An interactive information flashing method and electronic equipment
Patent Information
- Application Number
- CN202610855730.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-12
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2046-06-12
AI Technical Summary
[0004]本发明提供了一种交互信息刷写方法及电子设备,可以减少内存预分配和交互频次,提升交互效率,降低业务中断风险,解决大规格环境阻塞问题,提升系统稳定性和资源利用效率
[0007] The interactive information writing method provided by this invention is applied to a multi-controller centralized storage system. By constructing a status recording structure at the storage unit level, it records task counts and status identifiers, achieving centralized status management, reducing pre-allocated memory requirements, and minimizing memory resource idle waste. When a ownership change service is triggered, a pause command is issued to the storage units involved in the ownership change service at the storage unit level, and the task count and status identifier are updated. Precise service pause management is achieved through command control. The method collects completion markers reported by the corresponding storage units and updates their status identifiers. Based on address mapping rules, it obtains the list of storage units corresponding to the ownership change service and decrements the status of storage units with a stopped status. The business layer counter optimizes the functional mapping structure to efficiently handle state changes and improve interaction efficiency. After the business layer counter reaches zero, it issues ownership change information and performs an interaction information flushing operation to update the metadata bitmap, reducing process complexity and improving system maintainability. After flushing, it issues start commands to the storage units involved in the ownership change business at the storage unit granularity, decrements the task counter, and triggers background task startup when it reaches zero. By simplifying and controlling the interaction process, it reduces the risk of business interruption, ensures the stability of the functional interaction system, solves the blocking problem in large-scale environments, saves memory resources while improving task execution efficiency, improves memory resource utilization efficiency, and enhances system stability.
Smart Images

Figure CN122450389B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage technology, and in particular to an interactive information writing method and electronic device. Background Technology
[0002] With the continuous development of storage systems, multi-controller centralized storage systems have been widely used due to their high fault tolerance, high performance, and high stability. This system achieves parallel read / write control and fault-tolerant repair of multiple controllers through cyclic mirror synchronization. It adopts a lock-free design to partition and manage the disk array into zones, allocating storage space to each controller according to fixed rules to avoid read / write conflicts and reduce lock overhead.
[0003] Ownership change is a key mechanism for dynamic adjustment of storage space, involving highly coupled interaction between volume groups and storage unit modules. In traditional solutions, the upper layer needs to issue start / stop commands to each array one by one, collect completion status, synchronously update metadata bitmaps, and then resume the task. The process is complex and involves frequent interactions. Moreover, the command record table is usually built at the volume granularity, and the storage status information of memory is pre-allocated according to the maximum design specifications. When the actual resource usage is far lower than the design peak, it will cause serious memory resource idleness. At the same time, frequent interaction events between modules can easily block common channels, resulting in response delays, service interruption risks, and low interaction efficiency. Summary of the Invention
[0004] This invention provides an interactive information writing method and electronic device, which can reduce memory pre-allocation and interaction frequency, improve interaction efficiency, reduce business interruption risk, solve the problem of blocking in large-scale environments, and improve system stability and resource utilization efficiency.
[0005] This invention provides an interactive information writing method, applied to a multi-controller centralized storage system, comprising: Construct a state recording structure with storage units as the granularity; the state recording structure is used to record the task count and state identifier of the storage units. When the ownership change service is triggered, a pause command is issued to the storage units involved in the ownership change service at the storage unit granularity, the task count of the corresponding storage unit in the status record structure is updated, and the status identifier of the corresponding storage unit is set to the stopped state. Collect the completion flags reported by the storage units that have received the pause instruction, update the status flag of the corresponding storage unit to the stopped state, obtain the list of storage units corresponding to the ownership change service according to the address mapping rules, and decrement the service layer count for storage units whose status flag is stopped. After the business layer count reaches zero, the ownership change information is issued and the interactive information flushing operation is performed to update the metadata bitmap; After the flashing is completed, a start command is issued to the storage unit involved in the ownership change service according to the storage unit granularity, and the task count of the corresponding storage unit is decremented. When the task count reaches zero, the corresponding storage unit is triggered to start the background task.
[0006] The present invention also 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 any of the above-described interactive information writing methods.
[0007] The interactive information writing method provided by this invention is applied to a multi-controller centralized storage system. By constructing a status recording structure at the storage unit level, it records task counts and status identifiers, achieving centralized status management, reducing pre-allocated memory requirements, and minimizing memory resource idle waste. When a ownership change service is triggered, a pause command is issued to the storage units involved in the ownership change service at the storage unit level, and the task count and status identifier are updated. Precise service pause management is achieved through command control. The method collects completion markers reported by the corresponding storage units and updates their status identifiers. Based on address mapping rules, it obtains the list of storage units corresponding to the ownership change service and decrements the status of storage units with a stopped status. The business layer counter optimizes the functional mapping structure to efficiently handle state changes and improve interaction efficiency. After the business layer counter reaches zero, it issues ownership change information and performs an interaction information flushing operation to update the metadata bitmap, reducing process complexity and improving system maintainability. After flushing, it issues start commands to the storage units involved in the ownership change business at the storage unit granularity, decrements the task counter, and triggers background task startup when it reaches zero. By simplifying and controlling the interaction process, it reduces the risk of business interruption, ensures the stability of the functional interaction system, solves the blocking problem in large-scale environments, saves memory resources while improving task execution efficiency, improves memory resource utilization efficiency, and enhances system stability.
[0008] In addition, the present invention also provides a corresponding electronic device for the interactive information writing method, which has the same or corresponding technical features as the interactive information writing method mentioned above, and has the same effect. Attached Figure Description
[0009] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 A flowchart of the interactive information writing method provided in an embodiment of the present invention; Figure 2This is a schematic diagram of the service takeover mechanism of the circular mirroring system in the event of node failure, provided in an embodiment of the present invention. Figure 3 A schematic diagram illustrating the attribution division and task execution provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the next stage corresponding to the pause command provided in an embodiment of the present invention; Figure 5 This is a schematic diagram showing the state identifier of the corresponding storage unit being set to a stopped state, as provided in an embodiment of the present invention. Figure 6 This is a schematic diagram illustrating how the status flag of the corresponding storage unit is updated to a stopped state and a callback mechanism is triggered, as provided in an embodiment of the present invention. Figure 7 This is a schematic diagram showing the business layer count decrement and ownership change triggering conditions within the callback function provided in this embodiment of the invention. Figure 8 This is a schematic diagram illustrating the distribution of ownership change information via a unified synchronization interface after the service layer count is reduced to zero, as provided in this embodiment of the invention. Figure 9 This is a schematic diagram illustrating the issuance of a startup command and the triggering of background tasks to restore the corresponding function after the flashing process is completed, as provided in an embodiment of the present invention. Figure 10 This is a schematic diagram illustrating the reset of the state to the initial state after startup, as provided in an embodiment of the present invention. Figure 11 This is a schematic diagram of the interactive information writing device provided in an embodiment of the present invention. Detailed Implementation
[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0012] It should be noted that, in the description of this invention, 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., used in this invention are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0013] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0014] The specific application environment architecture or specific hardware architecture on which the execution of the interactive information writing method depends is described here.
[0015] The embodiments of the present invention provide an interactive information writing method, and the method is described in detail in conjunction with the execution flow of the interactive information writing method. Figure 1 A flowchart of the interactive information writing method provided in the embodiments of the present invention is shown below. Figure 1 As shown, this method is applied to a multi-controller centralized storage system, including: S101. When the ownership change service is triggered, a pause command is issued to the storage units involved in the ownership change service at the storage unit granularity. The task count of the corresponding storage unit in the pre-built status record structure at the storage unit granularity is updated, and the status flag of the corresponding storage unit is set to the stopped state. The status record structure is used to record the task count and status flag of the storage unit.
[0016] It should be understood that the storage unit of this invention can be one or any combination of an independent redundant array, disk group, storage node, or logical unit number at the bottom layer of the storage pool, or other storage components at the bottom layer of the storage pool, which are not limited here. The independent redundant array can be a Redundant Array of Independent Disks (RAID).
[0017] Multi-controller centralized storage systems achieve parallel read / write control and management of storage units by multiple controllers, as well as fault tolerance and repair, through cyclic mirroring synchronization. Low-cost backup and fault handling can be achieved in cyclic mirroring systems, while achieving lock-free design between controllers while realizing synchronous backup between controllers. Figure 2 This is a schematic diagram illustrating the service takeover mechanism of the circular mirroring system provided in an embodiment of the present invention during node failure. Figure 2 As shown, the circular mirroring system consists of nodes 0, 1, 2, and 3 forming a ring structure. Data is backed up synchronously in a fixed direction, with each node providing a data mirror to the next node in sequence. When node 1 fails, the ring link is broken, and the business data of node 0, originally backed up by node 1, is directly taken over by node 2, which has complete backup data. The system does not rely on the failed node; by skipping the failed node, subsequent nodes directly take over data backup and business services.
[0018] A multi-controller centralized storage system includes Volume Group (VG) modules and storage unit modules. The VG module manages the virtual pool resources, managing the resources of each storage unit within the pool and virtualizing them into contiguous memory space for the host to read and write operations. Taking RAID as an example, all the space in the RAID unit is provided to the VG module, which then maps and integrates it into a contiguous storage area. This storage area is further divided within the multi-controller system and assigned to specific controllers for management. To ensure wear leveling in storage area usage, the pool iteratively combines the various RAID arrays within the pool during the selection of contiguous storage areas. The resulting storage space is then further divided into assigned areas according to two rules: unassigned areas are evenly distributed to each controller in a cyclical manner, while assigned areas are allocated to specific controllers. Figure 3 This is a schematic diagram illustrating the attribution division and task execution provided in an embodiment of the present invention. For example... Figure 3 As shown, the underlying physical layer consists of multiple physical disks, which are organized into array-level managed disks (mdisks), such as managed disks 0 and 1. These logical disks are further divided into multiple partitions, such as partitions 0, 1, 2, and 3. The VG module further integrates these partitions into a unified storage area and, through a ownership management mechanism, assigns different storage partitions to nodes 0, 1, 2, and 3 for management.
[0019] For business scenarios requiring the allocation of a specific region to a particular controller, and for usage needs that adjust storage space based on the business pressure of each controller, a change of ownership region is necessary. Ownership change refers to the process of transferring management control of a storage region from one controller to another. Ownership change business refers to the specific business operation of redistributing management control of the storage region. After an ownership change business is initiated, corresponding processing tasks are generated. Tasks refer to expansion, start / stop, and state switching jobs derived during the ownership change process; they are the specific execution carriers of the ownership change business. The ownership change process occurs between the VG module and the storage unit module, requiring assurance of data integrity, security, and atomicity between the two modules. There is a highly coupled interaction process between the modules: during a change, for each ownership change, the upper layer issues a change task instruction to notify the storage unit to stop background tasks and respond with completion status. Subsequently, the VG module, in a secure environment, updates the metadata bitmap recording ownership information and issues a recovery instruction to notify the internal tasks of the storage unit module to recover. This ensures consistency of ownership information between the upper and lower layers, and that the execution areas of the storage unit's background tasks used for fault tolerance and recovery, and host I / O, remain consistent. Similarly, the execution of each background task of the storage unit also adapts to the controller's ownership division mechanism and the ownership change actions between controllers, and is executed on the ownership node according to the ownership information currently recorded in the storage unit.
[0020] Traditional ownership change processes construct instruction record tables at the volume level, pre-allocate memory according to the system's maximum supported specifications, and maintain record entries for each storage unit (such as RAID) containing start / stop status and instruction information. In the process, the VG module needs to send stop instructions to all storage units in the change area one by one. The storage unit records the instructions in the table and, after querying all the information as stop, sends a stop task instruction to the node service end. After the service end completes the task stop, it collects and reports the information through the control terminal, sets the status to stop, and sends a callback to the VG module. After receiving all task callbacks for a single volume, the VG module synchronously sends ownership change information to modify the bitmap. After the update is completed, it sends start instructions to each entry. After confirming that all entries are in the start state, the storage unit triggers task restart and reports completion. After the control terminal collects all node completion information, it resets the status and cleans up the entries. This process pre-allocates record table memory at the volume level, resulting in a significant waste of idle memory resources when actual business operations do not reach full specifications. Modules need to undergo multiple line-by-line interactions, and the frequent events can easily block the common interaction channel, leading to response delays, business fault recovery timeouts, and downtime risks. The high number of interactions and process complexity increase the execution time of expansion tasks, affect input / output waiting time and latency performance, and result in low scalability and difficulties in later operation and maintenance, causing a serious waste of communication resources.
[0021] This invention constructs a state recording structure at the storage unit level, replacing the traditional method of pre-allocating instruction records at the volume level. It dynamically correlates memory allocation with the actual number of tasks in the storage unit, avoiding memory waste caused by pre-allocating at the maximum capacity. Simultaneously, the state recording structure centrally manages the task counts and status identifiers of storage units, enabling the VG module to accurately issue pause commands at the storage unit level. This reduces the number of interactions between modules and the amount of data per interaction, lowering the risk of congestion on common interaction channels. Therefore, it solves the problems of wasted memory resources, frequent interactions leading to response delays, and high business interruption risks in traditional processes. Here, storage unit granularity refers to the smallest operational unit for resource scheduling and state control, managed independently by the storage unit.
[0022] S102. Collect the completion flags reported by the storage units that have received the pause instruction, update the status flag of the corresponding storage unit to the stopped state, obtain the list of storage units corresponding to the ownership change service according to the address mapping rules, and decrement the service layer count for storage units whose status flag is stopped.
[0023] In implementation, a completion marker refers to the completion status notification reported by a storage unit to the control terminal after completing the background task cessation operation. The business layer count refers to the number of storage units that have not yet been cessationd and are maintained within the volume (business layer) and are involved in the current ownership change business. Address mapping rules refer to the mapping mechanism that converts logical storage addresses into physical storage addresses, thereby locating the corresponding storage units.
[0024] This invention collects completion flags actively reported by storage units that have received pause instructions, and updates the status identifier of the corresponding storage unit to the stopped state. This replaces the traditional method of the control terminal polling the completion status of each node one by one, reducing the frequency of active queries between modules. At the same time, it obtains the list of storage units corresponding to the affiliation change service according to the address mapping rules, and only decrements the service layer count for storage units with the status identifier of stopped, realizing accurate perception of status changes and service layer count management, avoiding invalid counting operations, further simplifying the interaction process, and reducing the load on the common channel.
[0025] S103. After the business layer count reaches zero, issue the ownership change information and perform the interactive information flushing operation to update the metadata bitmap.
[0026] It's important to note that the metadata bitmap is a data bitmap that records the execution status of each stripe during background task execution. Background tasks refer to tasks such as formatting the entire array during storage unit management (e.g., RAID), reconstructing tasks for fault-tolerant recovery of failed areas due to disk failures, and copy-back tasks triggered to restore the idle state of a backup disk after disk replacement. A stripe is the smallest unit for fault-tolerant recovery calculation after uniformly dividing the storage area. Each bit in the bitmap uniquely corresponds to one stripe; 1 represents not executed, and 0 represents executed. This is used to accurately record the execution status of each stripe when the node affiliation information of the stripe unit changes in a multi-controller system managing the same storage unit. Affiliation information, in a multi-controller system managing the same storage unit, records the node responsible for the IO execution of the current stripe area, preventing interference between multiple controllers. This affiliation information is generally default or may change in real-time due to load balancing or other business scenarios.
[0027] This invention achieves secure triggering of ownership changes and atomic updates of metadata by issuing ownership change information and performing an interactive information flushing operation after the business layer count reaches zero. A zero business layer count indicates that all storage units involved in the volume have been safely stopped, satisfying the preconditions for ownership changes and avoiding the risk of data inconsistency caused by performing changes while background tasks are still running on the storage units. The interactive information flushing operation synchronously writes the changed ownership information to the metadata bitmap, ensuring consistency between the ownership information of the volume management module and the storage unit module.
[0028] S104. After the flashing is completed, a start command is issued to the storage units involved in the ownership change business according to the storage unit granularity, and the task count of the corresponding storage unit is decremented. When the task count reaches zero, the corresponding storage unit is triggered to start the background task.
[0029] In implementation, this invention restores the service after the change by issuing start commands to the storage units involved in the ownership change service at the storage unit granularity after the write operation is completed. Upon receiving the start command, the storage unit decrements its task count. When the task count reaches zero, a background task is triggered to start, ensuring that all volumes referencing that storage unit have been restored before the background task begins, thus avoiding conflicts between the background task and the foreground service. This method controls the start timing at the storage unit granularity, replacing the complex operation of traversing all entries and waiting for all states to synchronize in the traditional process, reducing the frequency of inter-module interactions and state synchronization overhead.
[0030] The interactive information writing method provided in this embodiment of the invention is applied to a multi-controller centralized storage system. By constructing a status recording structure with storage units as the granularity, it records task counts and status identifiers, achieving centralized status management, reducing pre-allocated memory requirements, and minimizing memory resource idle waste. When a ownership change service is triggered, a pause instruction is issued to the storage units involved in the ownership change service at the storage unit granularity, and the task counts and status identifiers are updated. Precise service pause management is achieved through instruction control. The completion markers reported by the corresponding storage units are collected and the status identifiers are updated. The list of storage units corresponding to the ownership change service is obtained according to the address mapping rules, and the storage units with the status identifier of "stopped" are processed. Decrementing the business layer count enables efficient handling of state changes through optimized functional mapping structure, improving interaction efficiency. Once the business layer count reaches zero, ownership change information is issued and an interaction information flushing operation is performed to update the metadata bitmap, reducing process complexity and improving system maintainability. After flushing, start instructions are issued to the storage units involved in the ownership change business at the storage unit granularity, decrementing the task count and triggering background task startup when it reaches zero. By simplifying and controlling the interaction process, the risk of business interruption is reduced, ensuring the stability of the functional interaction system, solving the blocking problem in large-scale environments, saving memory resources while improving task execution efficiency, improving memory resource utilization efficiency, and enhancing system stability.
[0031] Furthermore, in a specific implementation, in the interactive information writing method provided in the embodiments of the present invention, the cursor of the state record structure sequentially identifies the number of each storage unit, and the entries of the state record structure record the task count and state identifier of the corresponding storage unit; the state identifier may include the initial state (START), the stopped state (STOPPING), and the stopped state (STOPPED), with the default being the initial state; the parameter length of the entries of the state record structure is set, and the memory occupied by the state record structure is defined as the product of the parameter length of the entry and the maximum number of supported storage units.
[0032] In implementation, the status record structure can take various forms, such as forms, linked lists, arrays, or hash tables. Taking a status record form as the status record structure and RAID as the storage unit as an example, a status record table with RAID granularity is set up for the ownership change process.
[0033] Taking a specification supporting a maximum of 128 RAID arrays as an example, the cursor in the record table simultaneously identifies the RAID numbers sequentially. The entries in the status record form record the corresponding mdisk task count and status flag, with the status flag defaulting to the initial state. The parameter length of each entry in the status record form is set to the array record length `mdiskrecord_len`, and the memory usage of the status record form is `mdiskrecord_len`. 128. This status log form centrally manages task counts and status identifiers at the RAID granularity, replacing the traditional method of pre-allocating memory at the volume granularity according to the maximum specification. This avoids the waste of idle memory resources when the actual business does not reach the full specification, and improves the efficiency of memory resource utilization.
[0034] Furthermore, in a specific implementation, in the interactive information writing method provided in the embodiments of the present invention, when the attribution change service is triggered in step S101, a pause instruction is issued to the storage units involved in the attribution change service at the storage unit granularity, the task count of the corresponding storage unit in the status record structure is updated, and the status identifier of the corresponding storage unit is set to the stopped state. Specifically, this may include: after detecting that the attribution change service has been triggered, the service layer issues a pause instruction to the storage units involved in the attribution change service at the storage unit granularity according to the source of the change region; after the corresponding storage unit receives the pause instruction, the task count of the corresponding storage unit is increased in the status record structure, and the status identifier of the corresponding storage unit is set to the stopped state.
[0035] In implementation, this invention, upon detecting a change of ownership service being triggered, sends a pause command at the storage unit level, based on the change of ownership region, to the storage units involved in the change of ownership service, achieving precise control over command issuance. Upon receiving the pause command, the corresponding storage unit increments its task count in the status record structure and sets its status identifier to "stopped," indicating that the storage unit is currently in the process of service termination. For example, if a volume issues a pause command at the RAID level based on the change of ownership region, the RAID, upon receiving the command, increments the task count at the corresponding offset position. After the command table information changes, it looks up the corresponding mdisk entry with a non-zero count, sets its status to "stopped," and triggers a stop background task command. This method replaces the traditional volume-level command issuance with storage unit-level granularity, avoiding sending redundant commands to unrelated storage units, reducing the number of interactions between modules and the load on common channels, and lowering the risk of congestion in large-scale scenarios. Simultaneously, by dynamically tracking task counts and status identifiers through the status record structure, it avoids resource idleness caused by pre-allocating memory to the maximum specification, improving memory resource utilization efficiency and task execution efficiency.
[0036] In the above steps, the business layer issues pause commands to the storage units involved in the affiliation change business at the storage unit granularity according to the source of the changed region. Specifically, this can include: when an expansion operation occurs due to the affiliation change business, the business layer determines the corresponding list of storage units according to the source of the expansion region based on the address mapping rules, which can achieve precise location from the changed region to the storage unit; then, pause commands are issued to each storage unit in the determined list of storage units, avoiding sending redundant commands to unrelated storage units. In this way, starting from the expansion region, the list of storage units involved is located in reverse through the address mapping rules, replacing the traditional broadcast method of traversing all storage units at the volume granularity, reducing the scope of command issuance and the frequency of interaction.
[0037] In the above steps, the task count for the corresponding storage unit is added to the status record structure, and the status identifier of the corresponding storage unit is set to "stopped". Specifically, this can include: locating the corresponding entry in the status record structure using the storage unit number as an index, enabling fast and accurate access to the storage unit status; then reading the current task count of the located entry and performing an increment operation, writing the incremented task count back to the corresponding entry, dynamically tracking the number of pause commands received; and finally, changing the status identifier of the corresponding entry from the initial state to "stopped" to mark that the corresponding storage unit is currently in the process of service suspension. This reduces the computational overhead and interaction latency during status query and update processes.
[0038] In the above steps, the status identifier of the corresponding entry is changed from the initial state to the stopped state to mark that the corresponding storage unit is in the process of service suspension. Specifically, this can include: first, traversing the entries in the status record structure and filtering entries for corresponding storage units with non-zero task counts, which can achieve accurate identification of storage units that need to be stopped; then, changing the status identifier of the filtered entries from the initial state to the stopped state to mark that the corresponding storage unit is in the process of service suspension, and issuing a stop background task instruction to the corresponding storage unit to ensure that the status change and task stop are triggered synchronously. In this way, by filtering based on the non-zero task count condition, invalid status change and stop operations are avoided for storage units that are not participating in the current ownership change service, reducing redundant calculations and instruction issuance, reducing the frequency of inter-module interactions and the load on common channels, and further improving the execution efficiency of the ownership change process.
[0039] Figure 4 This is a schematic diagram illustrating the next stage of the pause command provided in an embodiment of the present invention. Figure 4 As shown in the diagram, the left side displays the volume structure, including Volume 0, Volume 1, Volume 2, etc. Each volume records the number of managed disks (mdisknum, e.g., mdisknum=2 for Volume 0 and Volume 1, and mdisknum=1 for Volume 2) and the physical address (addr). The first line indicates the number and address information of the corresponding storage units recorded according to the source of the expansion area. The second line is the status record form, which is 128 characters long. Each entry records the mdisk number, count, and state. The figure shows that mdisk0 has count=2 and state=START, and mdisk4 has count=3 and state=START, indicating that the task count is accumulated when multiple volumes issue pause commands to the same RAID.
[0040] Figure 5 This is a schematic diagram illustrating the state flag of the corresponding storage unit being set to a stopped state, as provided in an embodiment of the present invention. For example... Figure 5 As shown, the status log form displays mdisk0 with count=2 and state=STOPPING, mdisk4 with count=3 and state=STOPPING, and mdisk1, mdisk2, and mdisk3 with count=0 and state=START. For mdisks with a non-zero count, a background task is triggered to stop, the status is set to STOPPING, and the stop command is sent to each node. mdisk0 and mdisk4 trigger task stop to nodes 0 through 3 respectively. After each node stops, it reports a stopp flag, and the callback control terminal marks the node's task as stopped. This diagram illustrates the interactive mode of this invention, which issues stop commands to multiple nodes at the RAID granularity, with each node executing independently and then reporting uniformly. The status log form accurately filters storage units that need to be stopped based on a non-zero count, avoiding invalid operations on irrelevant RAID arrays and reducing redundant calculations and command issuance.
[0041] Furthermore, in a specific implementation, in the interactive information writing method provided in the embodiments of the present invention, step S102 collects the completion flags reported by the storage units that have received the pause command, and updates the status identifier of the corresponding storage unit to the stopped state. Specifically, it may include: collecting the stop background task completion flags reported by the storage units that have received the pause command, and including the collected stop background task completion flags into a first set; after the first set has collected all the stop completion flags of the corresponding storage units, locating the entry of the corresponding storage unit in the status record structure, and changing the status identifier of the entry from the stopped state to the stopped state.
[0042] In implementation, this invention collects the background task completion markers reported by storage units that have received pause instructions, and then aggregates these markers into a set, enabling centralized management of the storage unit stop status. Once the set contains all the stop completion markers for the corresponding storage units, the entry for the corresponding storage unit is located in the status record structure, and the entry's status is changed from "stopping" to "stopped," completing a safe state transition. For example, the control terminal collects reported completion information into a set; when the set is full, it changes the status of the corresponding mdisk in the table to "stopped." By aggregating the completion markers of all storage units in a set manner and then uniformly updating the status, the frequent interactions and inconsistencies caused by processing each item individually are avoided, ensuring that all storage units have been safely stopped before any ownership change.
[0043] Furthermore, in a specific implementation, in the interactive information writing method provided in the embodiments of the present invention, step S102 obtains the list of storage units corresponding to the ownership change service according to the address mapping rules, and decrements the service layer count for storage units whose status is marked as stopped. Specifically, this may include: the service layer subscribing to changes in the status of storage units; when the status of the corresponding storage unit is detected to change from stopped to stopped, a callback mechanism is triggered; in the callback, the list of storage units corresponding to the ownership change service is obtained according to the address mapping rules, the list of storage units is traversed and the status of each storage unit in the status record structure is queried; for storage units whose status is marked as stopped, the service layer count is decremented.
[0044] In implementation, this invention achieves reverse perception and event-driven processing of storage unit status changes by having the service layer subscribe to changes in the status identifier of storage units. When a change in the status identifier of a corresponding storage unit from "stopping" to "stopped," a callback mechanism is triggered. Within the callback, a list of storage units corresponding to the affiliation change service is obtained based on address mapping rules. This list is traversed, and the status identifier of each storage unit in the status record structure is queried. For storage units with the "stopped" status identifier, the service layer count is decremented, completing the conditional update of the service layer count. For example, a volume subscribes to the state of an mdisk. When the state of an mdisk changes, the volume triggers its own callback function NOTIFY. Based on the status record form, the status of the relevant mdisk is queried. If the corresponding mdisk is in the "stopped" state, the corresponding mdisknum count is decremented. This avoids the interaction overhead and resource waste caused by frequent queries of storage unit status by the service layer. By accurately triggering the decrement of the service layer count through status change events, the risk of public channel congestion is reduced, and the efficiency of status perception is improved.
[0045] In the above steps, the business layer subscribes to changes in the status identifier of the storage unit. When the status identifier of the corresponding storage unit changes from "stopping" to "stopped," a callback mechanism is triggered. Specifically, this can include: the business layer registering a status listening request, subscribing to changes in the status identifier of the storage unit, and establishing a reverse mapping relationship between the storage unit identifier and the callback entry point of the business layer, thus pre-constructing the status notification link; when the status identifier of the corresponding storage unit changes from "stopping" to "stopped," the business layer is located based on the reverse mapping relationship, and a status change event is dispatched to it. The callback mechanism is triggered after the associated business layer receives the status change event. This establishes a direct notification path from the storage unit to the business layer using a reverse mapping relationship, replacing the traditional broadcast or polling method at the volume granularity level, avoiding sending redundant events to unrelated business layers, and further reducing the frequency of inter-module interactions and the load on the common channel.
[0046] Furthermore, in a specific implementation, the interactive information writing method provided in the above embodiments of the present invention may further include, after triggering the callback mechanism, determining whether the business layer count is not zero in the callback; if the business layer count is not zero, obtaining the list of storage units corresponding to the ownership change business according to the address mapping rules.
[0047] In implementation, this invention achieves conditional control of callback triggering by checking whether the business layer count is not zero in the callback, avoiding invalid list retrieval operations when the business layer count is zero. If the business layer count is not zero, the storage unit list corresponding to the ownership change business is obtained according to the address mapping rules, accurately locating the data range involved in the current business. For example, a listening thread is set up to implement the volume callback function NOTIFY, which is called when the state of mdisk is modified. Each time the state changes, the callback function NOTIFY checks, and for volumes where mdisknum is not zero, obtains the list of mdisks involved in the current expansion area according to the address mapping rules of the expansion area, such as [volume 0: mdisk0, mdisk4]. In this way, using a non-zero business layer count as a prerequisite, combined with address mapping rules, the list of involved storage units is dynamically obtained, replacing the traditional fixed-range traversal method, reducing invalid calculations and memory access overhead, and improving the efficiency of callback processing and the accuracy of the ownership change process.
[0048] In the above steps, the list of storage units corresponding to the ownership change service is obtained according to the address mapping rules. The storage unit list is traversed, and the status identifier of each storage unit in the status record structure is queried. Specifically, this may include: First, parsing the address range of the change area for the ownership change service, querying the address mapping table, and converting the logical address of the change area into a physical address, achieving precise mapping from logical storage space to physical storage location; then, determining the relevant storage unit numbers based on the mapping relationship between physical addresses and storage units, generating the corresponding storage unit list, and completing the range locking from the change area to the storage unit; finally, traversing the storage unit list, using each storage unit number as an index, locating the corresponding entry in the status record structure, reading the status identifier of each entry, and obtaining the real-time business status of the storage unit. This accurately converts the upper-layer business change request into the operation object of the lower-layer storage unit, avoiding redundant queries and status access to unrelated storage units, reducing the traversal range of the status record structure and memory access overhead, and improving the efficiency of status acquisition and the accuracy of the ownership change process.
[0049] Figure 6 This is a schematic diagram illustrating how the status flag of the corresponding storage unit is updated to a stopped state and a callback mechanism is triggered, as provided in an embodiment of the present invention. Figure 6 As shown, the status log form displays mdisk0 with count=2 and state=STOPPED, mdisk4 with count=3 and state=STOPPED, and the remaining mdisks are in the START state. The callback function is invoked when the mdisk's state is written, indicating that the callback function is triggered by a change in state when the storage unit state in the status log form changes. After each node completes its shutdown, it reports a "stopp done" flag to the control end. The control end collects completion information into a set according to the node ID. Once the set is full, it changes the state of the corresponding mdisk to STOPPED and sets a listening thread to subscribe the volume to the mdisk's state. When the state changes, the volume triggers its own callback function NOTIFY. This diagram illustrates the invention's subscription mechanism that establishes a reverse mapping relationship between storage unit identifiers and business layer callback entry points. When the RAID state changes, the callback function of the associated volume is precisely triggered, and real-time perception of state changes is achieved using an event-driven model.
[0050] Figure 7 This is a schematic diagram illustrating the decrementing of the business layer count and the triggering conditions for ownership change within the callback function provided in this embodiment of the invention. Figure 7As shown, the initial values of mdisknum for each volume are 2, 2, and 1, respectively. After mapping calculation, volume 0 obtains [mdisk0, mdisk4], volume 1 obtains [mdisk0, mdisk4], and volume 2 obtains [mdisk4]. The status log shows that the state of mdisk0 and mdisk4 is STOPPED, and the rest are START. The callback function is called when the state of the mdisk is written. For volumes with mdisknum not equal to 0, the list of involved mdisks is obtained according to the expansion area address mapping rules. The status of the corresponding mdisk is queried in the status log. If it is STOPPED, the mdisknum count is decremented. When mdisknum is reduced to 0, the stop command is considered complete, and the volume starts to send ownership change information. Figure 7 The mdisknum values for both Volume 0 and Volume 1 decrease from 2 to 0, indicating that mdisk0 and mdisk4 involved in these volumes have reached the STOPPED state. This diagram illustrates that using mdisknum reaching zero is a safe trigger condition for issuing ownership change information, ensuring that all storage units involved in the volume are stopped before the change is executed.
[0051] Furthermore, in a specific implementation, in the interactive information writing method provided in the embodiments of the present invention, step S103, after the business layer count reaches zero, sends out ownership change information and performs interactive information writing operation to update the metadata bitmap, may specifically include: determining whether the business layer count has decreased to zero; if the business layer count has decreased to zero, sending ownership change information to the corresponding storage unit through a unified synchronization interface; after the corresponding storage unit receives the ownership change information, performing interactive information writing operation to write the changed ownership information into the metadata bitmap, thus completing the metadata update.
[0052] In implementation, this invention controls the secure triggering condition for the distribution of ownership change information by determining whether the business layer count has decreased to zero. If the business layer count decreases to zero, it indicates that all storage units involved in the volume have been safely stopped. At this time, ownership change information is distributed to the corresponding storage unit through a unified synchronization interface, ensuring that the change operation is performed in a silent business state. After the corresponding storage unit receives the ownership change information, it performs an interactive information flushing operation to write the changed ownership information into the metadata bitmap, completing the atomic update of the metadata. For example, when the mdisknum count is determined to be zero, each volume distributes ownership change information to mdisk through a unified synchronization interface. This method uses the business layer count reaching zero as a prerequisite, combined with a unified synchronization interface to achieve centralized distribution of ownership change information and atomic flushing of the metadata bitmap, avoiding the risk of data inconsistency caused by performing changes when storage units are not completely stopped.
[0053] Figure 8This is a schematic diagram illustrating the distribution of ownership change information via a unified synchronization interface after the service layer counter reaches zero, as provided in this embodiment of the invention. Figure 8 As shown, the mdisknum of each volume has decreased to 0, indicating that all the storage units involved have been stopped; each volume has been stopped via addr. The storage address information is sent to the mdisk via a unified interface function, distributing ownership change information to the service terminals at nodes 0 to 3 below. This diagram illustrates that the invention uses the service layer count reaching zero as a safety trigger condition, ensuring that all storage units involved in the volume have stopped before distributing ownership change information. This avoids the risk of data inconsistency caused by updating metadata while background tasks are not completely silent.
[0054] Furthermore, in a specific implementation, in the interactive information writing method provided in the embodiments of the present invention, after step S104 is completed, a start command is issued to the storage unit involved in the affiliation change service at the storage unit granularity, and the task count of the corresponding storage unit is decremented. When the task count reaches zero, the corresponding storage unit is triggered to start a background task. Specifically, this may include: after the writing is completed, the service layer issues a start command to the storage unit involved in the affiliation change service at the storage unit granularity; after the corresponding storage unit receives the start command, it locates the entry of the corresponding storage unit in the status record structure, reads the current task count and performs a decrement operation, and writes the updated task count back to the corresponding entry; it determines whether the updated task count reaches zero, and if it does, it triggers the corresponding storage unit to start a background task and resumes the operation of the background service.
[0055] In implementation, after the write operation is completed, the business layer issues start commands to the storage units involved in the ownership change business at the storage unit granularity, enabling precise recovery of the changed business. Upon receiving the start command, the corresponding storage unit locates its entry in the status record structure, reads the current task count and performs a decrement operation, writes the updated task count back to the corresponding entry, and dynamically tracks the number of start commands received. Then, it checks if the updated task count has reached zero. If it has, the corresponding storage unit is triggered to start a background task, restoring background business operation. For example, after synchronously writing the ownership information, the VG starts a task, also issuing start commands at the mdisk granularity: for each mdisk, the count is decremented once for each received START notification; when the task count reaches 0, the RAID module issues a start task command. This ensures that all volumes referencing the storage unit have been restored and started before restarting the background task, avoiding the risk of data inconsistency caused by conflicts between background tasks and foreground services. Simultaneously, controlling the start timing at the storage unit granularity replaces the complex operation of traversing all entries and waiting for all states to synchronize in the traditional process, further improving system recovery efficiency and business continuity.
[0056] Furthermore, in a specific implementation, the interactive information writing method provided in the embodiments of the present invention may further include: collecting the background task completion flags reported by the corresponding storage units, and including the collected background task completion flags into a second set; after the second set has collected all the background task completion flags of the corresponding storage units, locating the entry of the corresponding storage unit in the status record structure, and resetting the status identifier of the entry from the stopped state to the initial state.
[0057] In implementation, this invention collects the background task completion markers reported by the corresponding storage units and categorizes these markers into a set, achieving centralized aggregation management of the storage unit startup completion status. Once the set contains all the background task completion markers for the corresponding storage units, the entry for the corresponding storage unit is located in the status record structure, and the entry's status is reset from the stopped state to the initial state, completing the closed-loop recovery of the start / stop process. For example, when a node reports a "start done" marker, the control terminal collects these markers into a set. Once the set is full, the status of the corresponding mdisk is set to the initial state, and the start / stop task is complete. This ensures that the current ownership change cycle ends only after all storage units have been safely restored, avoiding process anomalies caused by premature status reset. Furthermore, marking the start / stop task completion with the initial state provides a starting point for the next ownership change service, further improving system maintainability.
[0058] Figure 9 This is a schematic diagram illustrating the issuance of a startup command and the triggering of background tasks to restore the corresponding process after the flashing process is completed, as provided in an embodiment of the present invention. Figure 9 As shown, each volume's `mdisknum` is restored to its initial value, and a `START` command is sent to the status log form. The status log form displays `count=2` and `state=STOPPED` for `mdisk0`, and `count=3` and `state=STOPPED` for `mdisk4`. Upon receiving the `START` command, the `count` is decremented. The status log form shows that the `count` for both `mdisk0` and `mdisk4` has decreased to 0, and the `state` has changed to `STARTING`. When the `count` reaches 0, a command is sent to start the task, triggering the task startup.
[0059] Figure 10 This is a schematic diagram illustrating the process of resetting the state to its initial state after startup, as provided in an embodiment of the present invention. Figure 10As shown, after the task is triggered, all business terminals from node 0 to node 3 complete the task startup, and each node calls back to the control terminal to mark its task startup. After all nodes have started, each node reports a "start done" flag. The control terminal collects these flags into a set. Once the set is full, the state of the corresponding mdisk is set to the initial state START. The status record form shows that the count for mdisk0 to mdisk4 is 0 and the state is START. This figure illustrates that the present invention aggregates the startup completion flags of all nodes in a set manner before uniformly resetting the status flags to the initial state, ensuring that the current ownership change cycle ends only after all nodes have been safely restored, thus avoiding process abnormalities caused by premature state reset.
[0060] It should be noted that the reverse mapping counting and monitoring control implementation method of this invention can also be applied to the allocation and maintenance of memory regions. For example, in the file system, high-frequency memory is reverse-mapped to low-frequency handles to achieve a good mapping relationship with low storage usage. Monitoring, copying and calculation can be implemented for two memory regions that need to be frequently interacted, thereby improving the execution efficiency of data storage and recovery.
[0061] From 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 software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0062] Embodiments of the present invention also provide an interactive information writing device. Figure 11 This is a schematic diagram of the interactive information writing device provided in an embodiment of the present invention. This embodiment is based on the perspective of functional modules, such as… Figure 11 As shown, this device is applied to a multi-controller centralized storage system and may include: The task count update module 11 is used to issue a pause command to the storage units involved in the ownership change business at the storage unit granularity when the ownership change business is triggered, update the task count of the corresponding storage unit in the pre-built status record structure at the storage unit granularity, and set the status flag of the corresponding storage unit to the stopped state; the status record structure is used to record the task count and status flag of the storage unit. The status identifier update module 12 is used to collect the completion flags reported by the storage units that have received the pause instruction, update the status identifier of the corresponding storage unit to the stopped state, obtain the list of storage units corresponding to the ownership change service according to the address mapping rules, and decrement the service layer count for storage units whose status identifier is stopped. The metadata bitmap update module 13 is used to send ownership change information and perform interactive information flushing operation after the business layer count is zero, so as to update the metadata bitmap. The background task restart module 14 is used to send start instructions to the storage units involved in the ownership change business according to the storage unit granularity after the write is completed, decrement the task count of the corresponding storage unit, and trigger the corresponding storage unit to start the background task when the task count reaches zero.
[0063] In the interactive information writing device provided in this embodiment of the invention, a state recording structure with storage units as the granularity can be constructed through the interaction of the above five modules. This records task counts and status identifiers, achieving centralized state management, reducing pre-allocated memory requirements, and minimizing memory resource idleness and waste. When a change of ownership service is triggered, a pause command is issued to the storage units involved in the change of ownership service at the storage unit granularity, and the task counts and status identifiers are updated. Precise service pause management is achieved through command control. The device collects completion markers reported by the corresponding storage units and updates the status identifiers. Based on address mapping rules, a list of storage units corresponding to the change of ownership service is obtained, and storage units with a status identifier of "stopped" are processed. Decrementing the business layer count enables efficient handling of state changes through optimized functional mapping structure, improving interaction efficiency. Once the business layer count reaches zero, ownership change information is issued and an interaction information flushing operation is performed to update the metadata bitmap, reducing process complexity and improving system maintainability. After flushing, start instructions are issued to the storage units involved in the ownership change business at the storage unit granularity, decrementing the task count and triggering background task startup when it reaches zero. By simplifying and controlling the interaction process, the risk of business interruption is reduced, ensuring the stability of the functional interaction system, solving the blocking problem in large-scale environments, saving memory resources while improving task execution efficiency, improving memory resource utilization efficiency, and enhancing system stability.
[0064] Since the embodiments of the interactive information writing device and the interactive information writing method correspond to each other, the description of the features in the embodiment corresponding to the interactive information writing device can be found in the relevant description of the embodiment corresponding to the interactive information writing method, and will not be repeated here. Furthermore, it has the same beneficial effects as the interactive information writing method mentioned above.
[0065] Furthermore, in a specific implementation, in the interactive information writing device provided in the embodiments of the present invention, the cursor of the state recording structure sequentially identifies the number of each storage unit, and the entries of the state recording structure record the task count and state identifier of the corresponding storage unit; the state identifier includes the initial state, the stopped state, and the stopped state, and the default is the initial state; the parameter length of the entries of the state recording structure is set, and the memory occupied by the state recording structure is defined as the product of the parameter length of the entry and the maximum number of supported storage units.
[0066] Furthermore, in a specific implementation, in the interactive information writing device provided in the embodiments of the present invention, the task count update module 11 can be specifically used to, after detecting that the ownership change service has been triggered, issue a pause command to the storage units involved in the ownership change service at the storage unit granularity according to the source of the change region; after the corresponding storage unit receives the pause command, it adds the task count of the corresponding storage unit to the status record structure and sets the status identifier of the corresponding storage unit to the stopped state. Specifically, when the ownership change service generates an expansion action, the service layer determines the corresponding storage unit list according to the source of the expansion region based on the address mapping rules; a pause command is issued to each storage unit in the determined storage unit list. Using the storage unit number as an index, the corresponding entry is located in the status record structure; the current task count of the located entry is read and incremented, and the incremented task count is written back to the corresponding entry; the status identifier of the corresponding entry is modified from the initial state to the stopped state to mark that the corresponding storage unit is in the process of service suspension. This invention can traverse the entries in the state record structure, filter the entries corresponding to the storage units with non-zero task counts, change the state identifier of the filtered entries from the initial state to the stopped state to mark that the corresponding storage unit is in the process of stopping business, and issue a stop background task to the corresponding storage unit.
[0067] Furthermore, in a specific implementation, in the interactive information writing device provided in the embodiments of the present invention, the status identifier update module 12 can be specifically used to collect the background task completion flags reported by the storage units that have received the pause command, and to include the collected background task completion flags into the first set; after the first set has collected all the corresponding storage unit's completion flags, the entry of the corresponding storage unit is located in the status record structure, and the status identifier of the entry is changed from the stopped state to the stopped state; the service layer subscribes to the status identifier changes of the storage units, and when it detects that the status identifier of the corresponding storage unit has changed from the stopped state to the stopped state, a callback mechanism is triggered; in the callback, the list of storage units corresponding to the affiliation change service is obtained according to the address mapping rules, the storage unit list is traversed and the status identifier of each storage unit in the status record structure is queried; for the storage units whose status identifier is the stopped state, the service layer count is decremented.
[0068] Furthermore, in a specific implementation, in the interactive information writing device provided in the embodiments of the present invention, the metadata bitmap update module 13 can be used to determine whether the business layer count has decreased to zero; if the business layer count has decreased to zero, the ownership change information is sent to the corresponding storage unit through the unified synchronization interface; after the corresponding storage unit receives the ownership change information, it performs the interactive information writing operation, writes the changed ownership information into the metadata bitmap, and completes the metadata update.
[0069] Furthermore, in a specific implementation, in the interactive information writing device provided in the embodiments of the present invention, the background task restart module 14 can be used to, after the writing is completed, issue a start command to the storage unit involved in the affiliation change business according to the storage unit granularity; after the corresponding storage unit receives the start command, it locates the entry of the corresponding storage unit in the status record structure, reads the current task count and performs a decrement operation, and writes the updated task count back to the corresponding entry; it determines whether the updated task count is zero, and if it is zero, it triggers the corresponding storage unit to start the background task and restore the background business operation; it collects the background task start completion flags reported by the corresponding storage unit and adds the collected background task start completion flags to the second set; after the second set has collected all the background task start completion flags of the corresponding storage units, it locates the entry of the corresponding storage unit in the status record structure and resets the status identifier of the entry from the stopped state to the initial state.
[0070] Embodiments of the present invention 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 embodiments of the interactive information writing method.
[0071] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described interactive information writing method embodiments when running.
[0072] 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 USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0073] Embodiments of the present invention 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 interactive information writing method embodiments.
[0074] Embodiments of the present invention also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described interactive information writing method embodiments.
[0075] 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 performed 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-chip (SoC), a complex programmable logic device (CPLD), a microcontroller unit (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 a combination 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.
[0076] 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 implementations should not be considered beyond the scope of this invention.
[0077] The interactive information writing method and electronic device provided by this invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only intended to help understand the method and core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of this invention.
Claims
1. A method for interactive information writing, characterized in that, Applications include multi-controller centralized storage systems, including: When the ownership change service is triggered, a pause command is issued to the storage units involved in the ownership change service at the storage unit granularity, the task count of the corresponding storage unit in the pre-constructed status record structure at the storage unit granularity is updated, and the status identifier of the corresponding storage unit is set to the stopped state; the status record structure is used to record the task count and status identifier of the storage unit. Collect the completion flags reported by the storage units that have received the pause instruction, update the status flag of the corresponding storage unit to the stopped state, obtain the list of storage units corresponding to the ownership change service according to the address mapping rules, and decrement the service layer count for storage units whose status flag is stopped. After the business layer count reaches zero, the ownership change information is issued and the interactive information flushing operation is performed to update the metadata bitmap; After the flashing is completed, a start command is issued to the storage unit involved in the ownership change service according to the storage unit granularity, and the task count of the corresponding storage unit is decremented. When the task count reaches zero, the corresponding storage unit is triggered to start the background task.
2. The interactive information writing method according to claim 1, characterized in that, When a change of ownership service is triggered, a pause command is issued to the storage units involved in the change of ownership service at the storage unit granularity, the task count of the corresponding storage unit in the status record structure is updated, and the status flag of the corresponding storage unit is set to the stopped state, including: Once a change of ownership service is detected, the service layer issues a pause command to the storage units involved in the change of ownership service at the storage unit granularity, according to the source of the change region. After receiving the pause instruction, the corresponding storage unit increments the task count of the corresponding storage unit in the status record structure and sets the status identifier of the corresponding storage unit to the stopped state.
3. The interactive information writing method according to claim 2, characterized in that, The business layer issues a pause command to the storage units involved in the affiliation change service at the storage unit granularity, according to the source of the changed region, including: When the ownership change service generates an expansion action, the service layer determines the corresponding list of storage units according to the source of the expansion area based on the address mapping rules. A pause command is issued to each memory cell in the defined list of memory cells.
4. The interactive information writing method according to claim 3, characterized in that, The task count for the corresponding storage unit is added to the state record structure, and the state flag of the corresponding storage unit is set to the stopped state, including: The corresponding entry is located in the status record structure using the storage unit number as an index. Read the current task count of the entry obtained from the location and perform an increment operation, then write the incremented task count back to the corresponding entry; Change the status flag of the corresponding entry from the initial state to the stopped state to indicate that the corresponding storage unit is in the process of service suspension.
5. The interactive information writing method according to claim 4, characterized in that, The status flag of the corresponding entry is changed from the initial state to the stopped state to indicate that the corresponding storage unit is in the process of service interruption, including: Traverse the entries in the state record structure and filter the entries in the corresponding storage units where the task count is non-zero; The status of the selected items is changed from the initial state to the stopped state to indicate that the corresponding storage unit is in the process of stopping the service, and a stop background task is issued to the corresponding storage unit.
6. The interactive information writing method according to claim 1, characterized in that, Collect completion flags reported by storage units that have received the pause command, and update the status flag of the corresponding storage unit to the stopped state, including: Collect the background task completion flags reported by the storage units that have received the pause command, and put the collected background task completion flags into the first set; After the first set has recorded all the stop completion markers of the corresponding storage units, the entry of the corresponding storage unit is located in the status record structure, and the status identifier of the entry is changed from the stopped state to the stopped state.
7. The interactive information writing method according to claim 1, characterized in that, Based on the address mapping rules, obtain the list of storage units corresponding to the ownership change service, and decrement the service layer count for storage units whose status is marked as stopped, including: The business layer subscribes to changes in the status flag of the storage unit. When the status flag of the corresponding storage unit changes from the stopped state to the stopped state, a callback mechanism is triggered. In the callback, the list of storage units corresponding to the attribution change service is obtained according to the address mapping rules. The list of storage units is traversed and the status identifier of each storage unit in the status record structure is queried. For storage units whose status is marked as stopped, decrement the service layer count.
8. The interactive information writing method according to claim 7, characterized in that, The business layer subscribes to changes in the status flag of storage units. When the status flag of the corresponding storage unit changes from "stopping" to "stopped," a callback mechanism is triggered, including: The business layer registers status listening requests, subscribes to changes in the status identifier of storage units, and establishes a reverse mapping relationship between storage unit identifiers and business layer callback entry points; When the status identifier of the corresponding storage unit is detected to change from the stopped state to the stopped state, the associated service layer is found according to the reverse mapping relationship, and a status change event is dispatched to the associated service layer. A callback mechanism is triggered after the associated business layer receives a state change event.
9. The interactive information writing method according to claim 8, characterized in that, After the callback mechanism is triggered, it also includes: In the callback, check if the business layer count is not zero; If the service layer count is not zero, then the list of storage units corresponding to the attribution change service is obtained according to the address mapping rules.
10. The interactive information writing method according to claim 9, characterized in that, Based on the address mapping rules, obtain the list of storage units corresponding to the attribution change service, traverse the list of storage units, and query the status identifier of each storage unit in the status record structure, including: The address range of the changed area for the attribution change service is analyzed, and the address mapping table is queried to convert the logical address of the changed area into a physical address; Based on the mapping relationship between the physical address and the storage unit, the relevant storage unit number is determined, and the corresponding storage unit list is generated; Traverse the list of storage units, using the storage unit number as an index, locate the corresponding entry in the status record structure, and read the status identifier of each entry.
11. The interactive information writing method according to claim 1, characterized in that, After the business layer count reaches zero, the ownership change information is issued and an interactive information flushing operation is performed to update the metadata bitmap, including: Determine if the business layer count has decreased to zero; If the business layer count decreases to zero, the ownership change information is sent to the corresponding storage unit through the unified synchronization interface; After receiving the ownership change information in the corresponding storage unit, an interactive information flushing operation is performed to write the changed ownership information into the metadata bitmap, thus completing the metadata update.
12. The interactive information writing method according to claim 1, characterized in that, After the write operation is complete, a start command is issued to the storage units involved in the ownership change service at the storage unit granularity, decrementing the task count of the corresponding storage unit. When the task count reaches zero, the corresponding storage unit is triggered to start a background task, including: After the write operation is completed, the business layer issues a start command to the storage units involved in the ownership change business at the storage unit granularity. After receiving the start instruction, the corresponding storage unit locates the entry of the corresponding storage unit in the status record structure, reads the current task count and performs a decrement operation, and writes the updated task count back to the corresponding entry. Determine if the updated task count is zero. If it is, trigger the corresponding storage unit to start a background task and restore background business operation.
13. The interactive information writing method according to claim 1, characterized in that, Also includes: Collect the background task completion flags reported by the corresponding storage units and put the collected background task completion flags into the second set; After the second set records the completion of the background task for all corresponding storage units, the entry for the corresponding storage unit is located in the status record structure, and the status identifier of the entry is reset from the stopped state to the initial state.
14. The interactive information writing method according to claim 1, characterized in that, Also includes: Set the parameter length of the entry in the state record structure, and define the memory occupied by the state record structure as the product of the parameter length of the entry and the maximum number of supported storage units; The cursor of the state record structure sequentially identifies the number of each storage unit, and the entries of the state record structure record the task count and state identifier of the corresponding storage unit; the state identifier includes the initial state, the stopped state, and the stopped state, with the default being the initial state.
15. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the interactive information writing method as described in any one of claims 1 to 14 when executing the computer program.
Citation Information
Patent Citations
Synchronously replicating datasets and other managed objects to cloud-based storage systems
CN110392876A
Data migration method and system of cross-control-free RAID stripe lock multi-control storage system
CN115525234A