An order medium medical image archiving method, system, terminal and storage medium based on visibility root and reachability recycling control
By introducing visibility roots and reachability reclamation controls on sequential media, the problems of logical visibility control and secure reclamation in medical image archiving are solved, achieving data consistency and recoverability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN JIETENG TECHNOLOGY CO LTD
- Filing Date
- 2026-05-11
- Publication Date
- 2026-06-05
AI Technical Summary
When archiving medical images on sequential media, existing technologies struggle to simultaneously address logical visibility control, crash recovery, and secure data reclamation, resulting in inconsistent data visibility, complex recovery processes, and a high risk of erroneous data reclamation.
The visibility root and reachability reclamation control method is adopted. By maintaining the visibility root in the control storage layer and maintaining the ancestor chain of published records on the sequential storage medium, and combining logical reachability to determine data visibility and reclamation conditions, data consistency and recoverability are ensured.
It achieves logical consistency, readability, recoverability, and controllable recycling of medical image data on sequential media, reducing system complexity and the risk of erroneous recycling.
Smart Images

Figure CN122158007A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical image archiving technology, and in particular to a sequential media medical image archiving method, system, terminal, and computer-readable storage medium based on visibility root and reachability recovery control. Background Technology
[0002] With the development of hospital information systems, imaging equipment, and telemedicine services, medical image archiving systems need to store large amounts of medical image objects that conform to medical digital imaging and communication standards for long periods, and support retrieval and reading by patient, research, sequence, and instance levels. To reduce archiving costs and meet long-term storage requirements, an increasing number of archiving systems are adopting high-performance sequential write storage media for medical image archiving, such as partitioned block devices, shingled magnetic recording devices, and magnetic tape storage devices.
[0003] However, sequential storage media typically require writes to be performed in a forward append manner, making them unsuitable for in-situ modifications to existing metadata structures. When existing solutions directly migrate general table-based commit models or general log structure models to sequential media, the following problems can easily arise: First, the physical write completion and logical visibility state changes are difficult to strictly decouple, making it difficult to determine which data should be visible to queries in abnormal interruption scenarios; second, the recovery process often requires additional external metadata databases or complete state mirrors, increasing system complexity and inconsistency risks; third, whether a write area can be reset or reused is usually determined based on the physical write completion status or ordinary garbage collection strategies, which cannot be consistent with the actual logical visibility state, resulting in the premature reclamation of still readable data or the prolonged inability to release invalid areas.
[0004] Therefore, existing technologies still need to be improved and developed. Summary of the Invention
[0005] The main objective of this invention is to provide a sequential media medical image archiving method, system, terminal, and computer-readable storage medium based on visibility root and reachability reclamation control, aiming to solve the technical problem in the prior art that medical image archiving in sequential media scenarios is difficult to simultaneously take into account logical visibility control, crash recovery, and secure reclamation.
[0006] To achieve the above objectives, the present invention provides a sequential media medical image archiving method based on visibility root and reachability retrieval control, the sequential media medical image archiving method based on visibility root and reachability retrieval control comprising the following steps: Multiple medical image objects are aggregated to form an immutable archive segment, and the immutable archive segment is stored in the target write area of the sequential storage medium in a sequential append writing manner. After the immutable archive segment is written to the target write area, a release record is appended to the release log maintained on the sequential storage medium. The release record encapsulates the segment identifier of the immutable archive segment, the region identifier of the target write area, and the predecessor identifier pointing to the previous release record. In the control storage layer, which is independent of the sequential storage medium, the visibility root is atomically updated to the publication record. The visibility root is the only access point for determining whether the data written in the target write area is logically readable. Using the visibility root as the entry point, along the ancestor chain formed by the predecessor identifiers in the publication records, all publication records reachable from the visibility root are determined, and the immutable archive segments identified in all reachable publication records are determined as externally readable archive segments to complete the archiving of the medical image object.
[0007] Optionally, in the sequential media medical image archiving method based on visibility root and reachability recovery control, the immutable archived segment includes a segment header, a load area, an object location index, and segment tail verification information. The segment header is used to store the metadata information of the immutable archive segment, the payload area is used to store the entity data of multiple medical image objects, the object location index is used to establish the mapping relationship between the medical image object identifier and the internal offset of the payload area, and the segment tail verification information is used to verify the integrity of the archive segment during reading, recovery or verification.
[0008] Optionally, the sequential media medical image archiving method based on visibility root and reachability recovery control, wherein the step of using the visibility root as an entry point, determining all reachable publication records from the visibility root along the ancestor chain formed by predecessor identifiers in the publication records, and determining the immutable archive segments identified in all reachable publication records as externally readable archive segments, specifically includes: Obtain the visibility root from the control storage layer, use the visibility root as an entry point, and extract the publication record identifier currently pointed to by the visibility root; The predecessor identifiers encapsulated in each publication record in the publication log are sequentially connected to form an ancestor chain. Starting from the publication record corresponding to the publication record identifier, a backtracking traversal is performed along the ancestor chain to obtain all publication records that can be reached from the visibility root along the ancestor chain. Wherein, the predecessor identifier is the publication record identifier of the previous publication record when there is a previous publication record, and is an empty root value when there is no previous publication record. When a publication record with the predecessor identifier being the empty root value is extracted, the backtracking traversal terminates. The immutable archive segment corresponding to the segment identifier encapsulated in each of the published records obtained by backtracking is determined to be an externally readable archive segment. All the externally readable archive segments are combined into an externally readable archive segment set. When a read request is received, the target medical image object pointed to by the read request is retrieved from the externally readable archive segment set. Among them, immutable archive segments that have been fully written to the target write area but are not included in the externally readable archive segment set maintain physical storage integrity on the sequential storage medium and are logically unreadable to the read request.
[0009] Optionally, the sequential media medical image archiving method based on visibility root and reachability reclamation control further includes, after determining the immutable archive segments identified in all reachable publication records as externally readable archive segments: When the system restarts, the checkpoint records associated with the visibility root are retrieved from the control storage layer. If the checkpoint record is obtained, the release records are read from the playback start position recorded in the checkpoint record according to the physical append order of the release log. The integrity of each release record is checked. From the release records that pass the integrity check, the release records that are reachable from the visibility root and through the ancestor chain are selected. The immutable archive segment corresponding to the segment identifier encapsulated in the selected release record is reconstructed into an externally readable archive segment. Immutable archive segments corresponding to segment identifiers encapsulated within publication records that fail integrity checks or cannot be reached from the visibility root via the ancestor chain are identified as physically preserved but logically unreadable isolated content. If the checkpoint record is not obtained, the visibility root in the control storage layer is obtained, the publication record pointed to by the visibility root is used as the basis for confirming the current state, and all publication records that can be reached from the visibility root are determined along the ancestor chain. The immutable archive segment corresponding to the segment identifier encapsulated in all reachable publication records is reconstructed into an externally readable archive segment. The immutable archive segment corresponding to the segment identifier encapsulated within the publication record originating from the visibility root and unreachable via the ancestor chain is identified as physically preserved but logically unreadable isolated content.
[0010] Optionally, the sequential media medical image archiving method based on visibility root and reachability recovery control further includes: Monitor the ancestor chain reachability relationship between all immutable archive segments already stored within the target write area and the currently valid visibility root in the control storage layer; When it is determined that there is at least one immutable archive segment in the target write area that can be reached by any currently valid visibility root via the ancestor chain, the target write area is set to a recycling blocking state. The recycling blocking state is used to prohibit the target write area from being reset or overwritten and reused by new data. When it is confirmed that all immutable archive segments within the target write region are unreachable relative to all currently valid visibility roots within the archive system via the ancestor chain, the recycling blocking state of the target write region is lifted.
[0011] Optionally, the sequential media medical image archiving method based on visibility root and reachability recovery control further includes: When recording the metadata status of the target write area, the attribute flag of the target write area is switched to open, sealed, reclaimed blocked, or resettable depending on whether the target write area is set to a reclaim blocked state or is unsealed from the reclaim blocked state.
[0012] Optionally, the sequential media medical image archiving method based on visibility root and reachability recovery control further includes: An immutable archive segment that has been written to the sequential storage medium is defined as the first immutable archive segment, which stores medical image objects that need to be rewritten. The newly written immutable archive segment is defined as the second immutable archive segment, and the second immutable archive segment is generated later than the first immutable archive segment; Define the publication record that the visibility root points to before the update as the first publication record, and define the newly appended publication record that points to the second immutable archive segment as the second publication record; At least one medical image object is determined from the first immutable archive segment, the entity data of the medical image object is repackaged and written into the second immutable archive segment, and the second immutable archive segment is stored in another target write area or a subsequent storage location of the same target write area in the sequential storage medium. After the second immutable archive segment is written, the second publication record is appended to the publication log, and the pointer of the visibility root is changed from the first publication record to the second publication record through an atomic update operation, so as to migrate the logical readable entry of the medical image object from the first immutable archive segment to the second immutable archive segment; After the visibility root pointer change is completed, and it is confirmed that the first immutable archive segment is unreachable relative to all existing visibility roots in the archive system via the ancestor chain, a reset or reuse operation is performed on the target write region where the first immutable archive segment is located.
[0013] Furthermore, to achieve the above objectives, the present invention also provides a sequential media medical image archiving system based on visibility root and reachability recovery control, wherein the sequential media medical image archiving system based on visibility root and reachability recovery control includes: The archive segment writing module is used to aggregate multiple medical image objects into an immutable archive segment, and store the immutable archive segment into the target write area in the sequential storage medium in a sequential append writing manner. The publish record appending module is used to append a publish record to the publish log maintained on the sequential storage medium after the immutable archive segment is written to the target write area. The publish record encapsulates the segment identifier of the immutable archive segment, the area identifier of the target write area, and the predecessor identifier pointing to the previous publish record. The visibility root update module is used to atomically update the pointer of the visibility root to the publication record in the control storage layer, which is independent of the sequential storage medium. The visibility root is the only access point for determining whether the data written in the target write area presents a logically readable state to the outside world. The readable segment determination module is used to take the visibility root as the entry point, determine all publishing records reachable from the visibility root along the ancestor chain formed by the predecessor identifiers in the publishing records, and determine the immutable archive segments identified in all reachable publishing records as externally readable archive segments, so as to complete the archiving of the medical image object. The recovery and reconstruction module is used to rebuild the set of externally readable archive segments based on checkpoint records, high watermarks of published logs, and visibility roots after the system restarts, and to identify content that fails integrity verification or is not reached by a valid visibility root as physically retained but logically unreadable content. The recycling control module is used to control the target write region to switch between open, archive, recycling blocking and resettable based on the reachability relationship between the immutable archive segment in the target write region relative to the current visibility root and the reserved visibility root, as well as the object validity status. The object validity determination module is used to determine the valid object version that the current read request should return when there are multiple write versions of the same medical image object, based on the object version number, object validity summary, and failure flag.
[0014] Furthermore, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a sequential media medical image archiving program based on visibility root and reachability reclamation control stored in the memory and executable on the processor, wherein when the sequential media medical image archiving program based on visibility root and reachability reclamation control is executed by the processor, it implements the steps of the sequential media medical image archiving method based on visibility root and reachability reclamation control as described above.
[0015] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a sequential media medical image archiving program based on visibility root and reachability reclamation control, wherein when the sequential media medical image archiving program based on visibility root and reachability reclamation control is executed by a processor, it implements the steps of the sequential media medical image archiving method based on visibility root and reachability reclamation control as described above.
[0016] In this invention, multiple medical image objects are aggregated into immutable archive segments, which are then stored in the target write area of a sequential storage medium using a sequential append-only write method. After the immutable archive segment is written to the target write area, a publication record is appended to the publication log maintained on the sequential storage medium. This publication record encapsulates the segment identifier of the immutable archive segment, the region identifier of the target write area, and a predecessor identifier pointing to the previous publication record. In a control storage layer independent of the sequential storage medium, the visibility root is atomically updated to the publication record. The visibility root is the unique access point for determining whether the data written in the target write area is logically readable. Using the visibility root as the entry point, the ancestor chain formed by the predecessor identifiers in the publication records is used to determine all publication records reachable from the visibility root. The immutable archive segments identified in all reachable publication records are then identified as externally readable archive segments, completing the archiving of the medical image objects. This invention decouples physical write completion from logical visibility publication and constrains the read visibility range and write area reclamation conditions through the visibility root, achieving consistent readability, recoverability, and controllable reclamation of medical image archives on a sequential medium. Attached Figure Description
[0017] Figure 1 This is a flowchart of a preferred embodiment of the sequential media medical image archiving method based on visibility root and reachability recovery control of the present invention; Figure 2This is a schematic diagram illustrating the relationship between the ancestral relationship and the visibility root pointing relationship in the sequential media medical image archiving method based on visibility root and reachability recovery control in this invention. Figure 3 This is a schematic diagram of the state reconstruction process after system restart in the sequential media medical image archiving method based on visibility root and reachability recycling control of the present invention; Figure 4 This is a schematic diagram of the state transition and retrieval blocking control of the writing region in the sequential media medical image archiving method based on visibility root and reachability retrieval control of the present invention. Figure 5 This is a schematic diagram of medical image object rewriting and readability transfer in the sequential media medical image archiving method based on visibility root and reachability recycling control of the present invention; Figure 6 This is a structural diagram of a preferred embodiment of the sequential media medical image archiving system based on visibility root and reachability recovery control of the present invention; Figure 7 This is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed Implementation
[0018] This application provides a method, system, and terminal for sequential media medical image archiving based on visibility root and reachability recovery control. To make the objectives, technical solutions, and effects of this application clearer and more explicit, the following detailed description is provided with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining this application and are not intended to limit this application.
[0019] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0020] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0021] Existing sequential media archiving schemes have three prominent problems in medical image archiving scenarios: First, when medical image objects are written to sequential media before the subsequent metadata state is stable, the system has difficulty in clearly defining which data should be externally visible; second, after abnormal power outages, control node switching, or media writing interruptions, the system often needs to rely on additional metadata databases or complete snapshot copies to rebuild the state, resulting in complex recovery paths and potential state deviations; third, whether a written area is reclaimable is usually determined based on the physical end of writing or ordinary garbage collection standards, rather than on the actual logically readable state, which poses a risk of erroneous reclamation.
[0022] This application establishes a consistency control scheme for medical image archiving on sequential media by maintaining a visibility root in the control storage layer, maintaining a publication record ancestor chain on the sequential storage medium, and using reachability from the visibility root as the common basis for reading visibility and reclamation control. In other words, this application does not simply determine readability based on "data has been written to the medium," but requires that the target immutable archive segment simultaneously satisfy both the conditions of "physically written" and "reachable from a valid visibility root" before it can enter the current readable archive state.
[0023] Furthermore, key terms appearing in this application are defined, wherein "visibility root" refers to a control state item stored in an independent control storage layer. This control state item is used to identify the currently valid publication record and serves as the unique entry point to the currently readable archive state. The visibility root can be represented as the identifier, address information, or other control information capable of uniquely locating the currently valid publication record, but preferably it is a lightweight control state that only records the identifier of the currently valid publication record.
[0024] "Reachability" refers to the relationship that allows one to reach a certain publication record or an immutable archive segment by traversing the predecessor relationships between publication records starting from the currently valid publication record pointed to by the visibility root. In other words, whether an immutable archive segment is reachable does not depend on whether it has been physically written to sequential storage media, but on whether there exists a logical path from the currently valid visibility root through the ancestor chain of valid publication records to reach that immutable archive segment.
[0025] "Logically readable" means that the immutable archive segment containing the target medical image object has been physically written to the sequential storage medium and is reachable from the current valid visibility root, thus allowing the queried path to be included in the returned results. In contrast, an immutable archive segment that has been physically written to but is not reachable from the current valid visibility root is in a physically reserved but logically unreadable state.
[0026] "Reclaim blocking" means that at least one immutable archive segment in the target write region is still reachable from any valid visibility root, thus placing the target write region in a state where resetting or reuse is prohibited. The target write region can only enter a resettable state when all immutable archive segments in the target write region are unreachable from all valid visibility roots.
[0027] Furthermore, the system can distinguish between current visibility roots and reserved visibility roots. Current visibility roots represent the latest logical state of the archiving system, which currently provides read services. Reserved visibility roots represent historical logical states that are still within snapshot retention, audit retention, or recovery protection periods. When reading currently archived data, the current visibility root is used as the sole entry point; when performing region reclamation judgment, both the current visibility root and all reserved visibility roots are checked simultaneously. Only when the immutable archived segments within the target write region do not contain currently valid or reserved valid objects for all of the aforementioned visibility roots will the system allow that region to enter a resettable state.
[0028] The preferred embodiment of the sequential media medical image archiving method based on visibility root and reachability recovery control described in this invention, such as... Figure 1 and Figure 2 As shown, the sequential media medical image archiving method based on visibility root and reachability recovery control includes the following steps: Step S10: Aggregate multiple medical image objects to form an immutable archive segment, and store the immutable archive segment into the target write area of the sequential storage medium in a sequential append writing manner.
[0029] In this embodiment, the medical image objects are preferably object instances that conform to medical digital imaging and communication standards, such as DICOM (Digital Imaging and Communications in Medicine) objects organized by patient, research, sequence, and instance hierarchy. Multiple medical image objects are aggregated and packaged before being written to form an immutable archive segment. The immutable archive segment refers to a data segment structure that is no longer modified in its original location once the writing is complete; its immutability ensures the stability and traceability of the content written on the sequential medium.
[0030] Furthermore, the immutable archive segment includes a segment header, a payload area, an object location index, and segment tail verification information; The segment header is used to store the metadata information of the immutable archive segment, the payload area is used to store the entity data of multiple medical image objects, the object location index is used to establish the mapping relationship between the medical image object identifier and the internal offset of the payload area, and the segment tail verification information is used to verify the integrity of the archive segment during reading, recovery or verification.
[0031] It should be noted that the object location index records at least the instance-level identifier, and may further record at least a portion of the sequence-level identifier, study-level identifier, and patient-related index fields, thereby supporting hierarchical queries by patient, study, sequence, and instance level.
[0032] Furthermore, the immutable archive segments are written sequentially to pre-defined target write regions within the sequential storage medium. The sequential storage medium can be a partitioned block device, a shingled magnetic recording device, or a magnetic tape storage device, or any other storage medium with sequential write constraints. Sequential append writing ensures that the physical constraints of the medium align with the archive write behavior, avoiding performance degradation and media lifespan issues caused by random rewriting. The target write region is the area within the sequential storage medium currently allowed for forward append writing. The system can maintain the region state (e.g., open, sealed, reclaimed, resettable) for each target write region to facilitate subsequent reclamation control steps.
[0033] Furthermore, in this embodiment, the sequential storage medium is divided into multiple sequentially writable target write regions. For partitioned block devices, the target write region may correspond to one or more sequential write partitions; for shingled magnetic recording devices, the target write region may correspond to consecutive sequential write tape areas; for magnetic tape storage devices, the target write region may correspond to consecutive archive segments or logical volume segments on the magnetic tape. The system uniformly maintains region identifier, write start position, current write position, region capacity, region status, and reset permission flag for each target write region. The region status includes at least open, sealed, reclaimed blocked, and resettable. The system only allows the target write region to be switched to a resettable state when all immutable archive segments in the target write region are no longer reachable by any currently valid visibility root or reserved visibility root.
[0034] Furthermore, the immutable archive segment includes a segment header, a payload area, an object location index, and segment tail verification information. The segment header includes at least a segment identifier, a region identifier, a segment start position, a segment length, a segment generation time, a segment sequence number, the number of objects, and a segment header checksum. The payload area is used to sequentially store entity data for multiple medical image objects. The object location index includes at least a medical image object identifier, a patient identifier, a Study Instance UID (examination instance unique identifier), a Series Instance UID (sequence instance unique identifier), a SOP Instance UID (service object to instance unique identifier), the object's start offset in the payload area, the object length, the object checksum, and the object version number. The segment tail verification information includes at least a segment integrity checksum, an object index checksum, and a segment end marker, used to confirm whether the immutable archive segment has been completely written during read, recovery, or consistency checks.
[0035] Furthermore, in medical image archiving scenarios, the system organizes medical image objects according to patient, examination, sequence, and instance levels. For objects conforming to the DICOM standard, the system prioritizes Study Instance UID, Series Instance UID, and SOP Instance UID as the core fields for object location indexing, and can combine patient identifier, examination time, image modality, and archiving strategy to generate archive segment aggregation rules. Medical image objects under the same examination or the same sequence are preferentially aggregated into the same immutable archive segment or adjacent immutable archive segments to reduce the overhead of cross-region playback and cross-media positioning during reading.
[0036] Step S20: After the immutable archive segment is written to the target write area, a publication record is appended to the publication log maintained on the sequential storage medium. The publication record encapsulates the segment identifier of the immutable archive segment, the area identifier of the target write area, and the predecessor identifier pointing to the previous publication record.
[0037] Specifically, this application only appends the corresponding publication record to the publication log after the immutable archive segment has completed the physical write to the target write area. The completion of the physical write is a prerequisite for appending the publication record, ensuring that the immutable archive segment referenced by the publication record has stably existed on the sequential storage medium.
[0038] The publication logs are also stored on sequential storage media and form a record sequence using the same sequential append method as the immutable archive segments. Storing publication logs and archived data on the same sequential media simplifies the system architecture, allowing recovery to be performed by scanning only a limited log area on the same physical media, without requiring cross-media coordination.
[0039] Each publication record encapsulates at least the following: publication record identifier, predecessor publication record identifier, segment identifier of the immutable archive segment, region identifier of the target write region, segment start position, segment length, segment checksum, object index digest, object validity digest, commit sequence number, and publication record checksum. The segment identifier of the immutable archive segment is used to uniquely locate the corresponding immutable archive segment; the region identifier of the target write region is used to associate the physical region where the archive segment is located, providing a basis for subsequent region reclamation control; the predecessor identifier points to the previous publication record. If the current publication record is the first record in the publication log, this field can be set to an empty root value, indicating the end point of the ancestor chain traversal. In addition to the above encapsulated content, the publication record may also include a publication record identifier, archive segment generation identifier, checksum information, and timestamp.
[0040] Furthermore, the object validity summary in the publication record is used to record whether the medical image object involved in this publication is a newly added object, a replaced object, an expired object, or a migrated object, thereby distinguishing the reachability of the publication record from the current validity of the object. The publication record checksum is used to verify whether the publication record itself has been completely written; the segment checksum is used to verify whether the immutable archive segment referenced by the publication record is consistent with the content when the writing was completed. Only when the publication record passes the checksum and the immutable archive segment it references passes the checksum is the publication record allowed to be referenced by the visibility root.
[0041] Furthermore, this application establishes a unidirectional, traceable ancestor chain among successively added publication records by using predecessor identifiers carried in each publication record. This ancestor chain expresses which earlier state the current readable archive state evolved from, providing a basis for backtracking the read path and reconstructing the state for crash recovery.
[0042] Understandably, adding a publication record does not immediately make the corresponding immutable archive segment logically readable. At this point, the immutable archive segment has physically resided in the medium, but its readability still depends on whether the visibility root points to the publication record or whether the publication record can be reached via the ancestor chain in subsequent steps.
[0043] Step S30: In the control storage layer independent of the sequential storage medium, the visibility root is atomically updated to the publication record. The visibility root is the only access point for determining whether the data written in the target write area presents a logically readable state.
[0044] It is understood that the control storage layer is set up independently of the sequential storage medium. Unlike the physical constraint that sequential storage media only supports sequential append writes, the control storage layer preferably uses solid-state drives, random access memory in conjunction with persistent log devices or other storage resources that support low-latency random read and write operations, enabling efficient atomic update operations on the visibility root.
[0045] The visibility root is a lightweight control status item stored in the control storage layer, used to identify the currently valid publication record. Preferably, it only records the identifier of the currently valid publication record, and not the complete enumeration information of all reachable immutable archive segments. The visibility root can be represented as a publication record identifier, address information, or other control information that can uniquely locate the currently valid publication record.
[0046] The visibility root is defined as the sole access point for determining whether data written to a target write region is logically readable. This means that an immutable archive segment written to sequential storage media is considered logically readable only if its corresponding publication record can be reached from the visibility root via the ancestor chain; conversely, even if the physical write is complete, the archive segment remains invisible to the outside world if no reachable association is established with the visibility root.
[0047] Step S40: Using the visibility root as the entry point, determine all publishing records reachable from the visibility root along the ancestor chain formed by the predecessor identifiers in the publishing records, and determine the immutable archive segments identified in all reachable publishing records as externally readable archive segments to complete the archiving of the medical image object.
[0048] Specifically, the visibility root is obtained from the control storage layer, and the publication record identifier currently pointed to by the visibility root is extracted using the visibility root as the entry point; The predecessor identifiers encapsulated in each publication record in the publication log are sequentially connected to form an ancestor chain. Starting from the publication record corresponding to the publication record identifier, a backtracking traversal is performed along the ancestor chain to obtain all publication records that can be reached from the visibility root along the ancestor chain. Wherein, the predecessor identifier is the publication record identifier of the previous publication record when there is a previous publication record, and is an empty root value when there is no previous publication record. When a publication record with the predecessor identifier being the empty root value is extracted, the backtracking traversal terminates. The immutable archive segment corresponding to the segment identifier encapsulated in each of the published records obtained by backtracking is determined to be an externally readable archive segment. All the externally readable archive segments are combined into an externally readable archive segment set. When a read request is received, the target medical image object pointed to by the read request is retrieved from the externally readable archive segment set. Among them, immutable archive segments that have been fully written to the target write area but are not included in the externally readable archive segment set maintain physical storage integrity on the sequential storage medium and are logically unreadable to the read request.
[0049] In this embodiment, the system obtains the visibility root from a control storage layer independent of the sequential storage medium. The visibility root preferably records only the identifier of the currently valid published record, and does not record the complete enumeration information of all reachable immutable archive segments. For example... Figure 2 As shown, the visibility root is represented by a box with an arrow pointing to the currently valid publication record PR3. After obtaining the visibility root, the system extracts the identifier of the currently valid publication record (i.e., the identifier of PR3) from the records therein. This identifier is the only entry point into the ancestor chain of the readable archive state.
[0050] Furthermore, the predecessor identifiers encapsulated within each release record in the release log are sequentially connected to form an ancestor chain, which is then traversed backtrackingly. Specifically, the system sequentially connects the predecessor identifiers encapsulated within each release record in the release log to form a unidirectional ancestor chain. Release record PR3 points to release record PR2 via a predecessor identifier arrow, and release record PR2 points to release record PR1 via a predecessor identifier arrow. The release records are sequentially linked together via predecessor identifier arrows, forming a chain structure tracing back from the latest release record to earlier release records. Starting from PR3, the system backtracks along this ancestor chain, recording the three release records PR3, PR2, and PR1 encountered one by one.
[0051] During the backtracking traversal, the traversal terminates when a publication record with its predecessor identifier set to an empty root value is encountered. The arrow pointing from the predecessor identifier of publication record PR1 to the empty root identifier (the empty root identifier is used to mark the traversal termination boundary of the ancestor chain), this position is the end point of the ancestor chain. An empty root value indicates that PR1 is the first publication record in the publication log, and there is no previous publication record.
[0052] The backtracking traversal yields three publication records: PR3, PR2, and PR1, representing all reachable publication records from the current valid visibility root. Each publication record is associated with its corresponding immutable archive segment via a pointing arrow: PR1 points to immutable archive segment SEG1, PR2 points to immutable archive segment SEG2, and PR3 points to immutable archive segment SEG3.
[0053] Upon receiving a read request, the system only reads the externally readable archive segment set (i.e. Figure 2 The search retrieves target medical image objects within the set consisting of SEG1, SEG2, and SEG3. It's important to note that the read path is no longer solely determined by whether data has been written to the medium; instead, logical visibility is determined by whether the data is reachable from the current valid visibility root. Hierarchical queries can be performed using object location indexes within each immutable archive segment, but the search scope remains limited to the aforementioned set of externally readable archive segments.
[0054] For immutable archive segments that have been fully written to the target write region but failed to be included in the set of externally readable archive segments because they have not established a reachable association with the visibility root, the system maintains their physical storage integrity on the sequential storage medium, but these archive segments are logically unreadable to read requests. Figure 2 If there are other immutable archive segments that have been written to but are not pointed to by any valid publication record, beyond the reachable path shown, then those archive segments are in a state of being physically reserved but logically unreadable.
[0055] Furthermore, the step of identifying the immutable archive segments identified in all accessible publication records as externally readable archive segments further includes: When the system restarts, the checkpoint records associated with the visibility root are retrieved from the control storage layer. If the checkpoint record is obtained, the release records are read from the playback start position recorded in the checkpoint record according to the physical append order of the release log. The integrity of each release record is checked. From the release records that pass the integrity check, the release records that are reachable from the visibility root and through the ancestor chain are selected. The immutable archive segment corresponding to the segment identifier encapsulated in the selected release record is reconstructed into an externally readable archive segment. Immutable archive segments corresponding to segment identifiers encapsulated within publication records that fail integrity checks or cannot be reached from the visibility root via the ancestor chain are identified as physically preserved but logically unreadable isolated content. If the checkpoint record is not obtained, the visibility root in the control storage layer is obtained, the publication record pointed to by the visibility root is used as the basis for confirming the current state, and all publication records that can be reached from the visibility root are determined along the ancestor chain. The immutable archive segment corresponding to the segment identifier encapsulated in all reachable publication records is reconstructed into an externally readable archive segment. The immutable archive segment corresponding to the segment identifier encapsulated within the publication record originating from the visibility root and unreachable via the ancestor chain is identified as physically preserved but logically unreadable isolated content.
[0056] like Figure 3 As shown, in this embodiment, after the system restarts following an abnormal power outage or node failure recovery, it first attempts to retrieve the checkpoint record associated with the visibility root from the control storage layer. The checkpoint record is recovery acceleration data periodically generated by the system during stable operation, and it contains at least the identifier of the most recent valid publication record pointed to by the stable visibility root and the corresponding replay start position information. If the checkpoint record exists, the system can quickly locate the recovery starting point; if the checkpoint record fails to be persisted due to an anomaly or is corrupted, the system then directly retrieves the visibility root in the control storage layer, using the publication record currently pointed to by the visibility root as the recovery starting point. The checkpoint record includes at least the checkpoint identifier, checkpoint generation time, the visibility root identifier corresponding to the checkpoint, the publication record identifier currently pointed to by the visibility root, the publication log replay start position, the publication log high watermark, the most recent confirmed commit sequence number, a readable object index digest, and a checkpoint verification value. When generating a checkpoint record, the system first persists the checkpoint content and completes verification, then updates the checkpoint reference in the control storage layer to the latest checkpoint. When the system recovers, incremental replay is performed using the replay start position and the high watermark of the published log in the checkpoint record first; if the checkpoint record does not exist or the verification fails, the current readable state is reconstructed along the ancestor chain of the published record with the visibility root in the control storage layer as the entry point.
[0057] Upon successfully acquiring the checkpoint record, the system starts from the replay start position recorded in the checkpoint record and sequentially reads each publication record appended after the checkpoint, according to the physical append order of the publication log. During the reading process, each publication record is first checked for integrity, using pre-encapsulated verification information to identify incomplete or corrupted publication records. For publication records that pass the integrity check, the system further determines whether they are reachable from the visibility root and via the ancestor chain. This determination is based on whether the publication record can be traversed when backtracking along the predecessor identifier starting from the visibility root. The immutable archive segment corresponding to the segment identifier encapsulated within the valid and reachable publication record is reconstructed into an externally readable archive segment and included in the current readable archive state.
[0058] For publication records that fail integrity checks, or those that pass checks but are unreachable from the visibility root via the ancestor chain, their corresponding immutable archive segments are identified as physically preserved but logically unreadable orphaned content. This orphaned content maintains physical integrity on sequential storage media and can be manually verified or recovered offline, but it is not included in the query scope of normal read request responses.
[0059] Furthermore, if no checkpoint record is obtained after a system restart, the publication record pointed to by the visibility root in the control storage layer is used as the basis for confirming the current state, and all publication records reachable from the visibility root are determined along the ancestor chain. The visibility root serves as the sole entry point to the current readable archive state, and preferably only records the identifiers of currently valid publication records. Immutable archive segments corresponding to publication records that cannot be reached from the visibility root via the ancestor chain are identified as physically retained but logically unreadable isolated content. Data that has been written but not yet officially published can be physically retained but logically unreadable.
[0060] Furthermore, during system interruption or restart recovery, if an immutable archive segment has been physically written but the corresponding publication record has not been fully written, the immutable archive segment is identified as physically reserved but logically unreadable content and is not included in the current read results. If a publication record has been fully written but the visibility root has not been updated to that publication record, the publication record and its corresponding immutable archive segment are also not included in the current readable archive segment set. If the publication record pointed to by the visibility root fails the integrity check, the system rolls back to the most recent checkpoint record that passed the check, or searches along the publication log for the last publication record that can be reached by a valid visibility root and has passed the integrity check. For half-written records or records that failed the check at the end of the publication log, the system ignores them or marks them as content to be manually verified during the recovery process, and they are not used as a basis for logical readable status.
[0061] As can be seen, the system in this application does not need to rely on an external metadata database or a complete state image after an abnormal interruption, thus avoiding the problem of uncertain read-visible state caused by abnormal interruption in sequential media scenarios and improving the consistency of crash recovery.
[0062] Furthermore, the sequential media medical image archiving method based on visibility root and reachability recovery control also includes: Monitor the ancestor chain reachability relationship between all immutable archive segments already stored within the target write area and the currently valid visibility root in the control storage layer; When it is determined that there is at least one immutable archive segment in the target write area that can be reached by any currently valid visibility root via the ancestor chain, the target write area is set to a recycling blocking state. The recycling blocking state is used to prohibit the target write area from being reset or overwritten and reused by new data. When it is confirmed that all immutable archive segments within the target write region are unreachable relative to all currently valid visibility roots within the archive system via the ancestor chain, the recycling blocking state of the target write region is lifted.
[0063] In this embodiment, the system monitors the ancestor chain reachability relationship between all immutable archive segments stored within the target write area and the currently valid visibility root in the control storage layer. The ancestor chain reachability relationship refers to the relationship that can reach a certain publication record or a certain immutable archive segment when traversing along the predecessor relationship between publication records starting from the currently valid publication record pointed to by the visibility root.
[0064] When it is determined that at least one immutable archive segment within the target write region is reachable via the ancestor chain from any currently valid visibility root, the target write region is set to a reclamation blocking state. This reclamation blocking state prohibits resetting or overwriting / reusing new data within the target write region. Reclamation blocking means that at least one immutable archive segment within the target write region is still reachable from any valid visibility root, thus placing the target write region in a state where resetting or reuse is prohibited.
[0065] like Figure 4 As shown, the target write region starts from the open state and enters the sealed state after the sealed conditions are met; if there are reachable immutable archive segments in the region, it enters the recycling blocking state; when all immutable archive segments in the region are unreachable to all valid visibility roots, it enters the resettable state; in the resettable state, a reset or reuse operation can be performed to make the region open again.
[0066] Specifically, when a region is in a sealed state and there are still reachable immutable archive segments within the region, the region state changes from sealed to reclaimable blocked. In the reclaimable blocked state, the system does not allow resetting or reusing the region to protect still readable logical data. The reclaimable blocked state of the target write region is lifted when it is confirmed that all immutable archive segments within the target write region are unreachable relative to all currently valid visibility roots in the archiving system via the ancestor chain. If there are still immutable archive segments reachable from any valid visibility root in the target write region, the write region is prevented from being reset or reused. Conversely, the region can only be reset or reused when all immutable archive segments are unreachable. When a region is in a reclaimable blocked state and all immutable archive segments within the region are unreachable from all valid visibility roots, the region state changes from reclaimable blocked to resettable. In the resettable state, resetting or reusing operations are allowed on the target write region, enabling safe reclamation of storage space.
[0067] Furthermore, the sequential media medical image archiving method based on visibility root and reachability recovery control also includes: When recording the metadata status of the target write area, the attribute flag of the target write area is switched to open, sealed, reclaimed blocked, or resettable depending on whether the target write area is set to a reclaim blocked state or is unsealed from the reclaim blocked state.
[0068] Understandably, the attribute markers of a target write region reflect its current lifecycle stage. When a target write region is set to a reclaim blocking state, its attribute marker switches to reclaim blocking accordingly; when the reclaim blocking state of a target write region is released, its attribute marker switches to resettable. Furthermore, during regular write operations that do not involve reclaim blocking checks, the region attribute markers can switch between open and sealed based on the write progress and sealing conditions. By linking the setting and releasing of the reclaim blocking state with the switching of region attribute markers, the aforementioned reclaim control steps are concretely implemented at the metadata management level, facilitating accurate identification by the system at runtime of whether each target write region is allowed to be reset or reused.
[0069] Furthermore, the system only allows the reclaiming blocking state of the target write region to be lifted when all medical image objects in the first immutable archive segment have been replaced, migrated, or invalidated by subsequent immutable archive segments, and all immutable archive segments within the target write region where the first immutable archive segment is located are unreachable or do not contain any currently valid objects relative to all currently valid visibility roots and reserved visibility roots. If other currently valid medical image objects still exist in the target write region, the system must not perform a complete reset or overwrite reuse operation on the target write region, even if the target objects in the first immutable archive segment have been migrated.
[0070] Furthermore, the sequential media medical image archiving method based on visibility root and reachability recovery control also includes: An immutable archive segment that has been written to the sequential storage medium is defined as the first immutable archive segment, which stores medical image objects that need to be rewritten. The newly written immutable archive segment is defined as the second immutable archive segment, and the second immutable archive segment is generated later than the first immutable archive segment; Define the publication record that the visibility root points to before the update as the first publication record, and define the newly appended publication record that points to the second immutable archive segment as the second publication record; At least one medical image object is determined from the first immutable archive segment, the entity data of the medical image object is repackaged and written into the second immutable archive segment, and the second immutable archive segment is stored in another target write area or a subsequent storage location of the same target write area in the sequential storage medium. After the second immutable archive segment is written, the second publication record is appended to the publication log, and the pointer of the visibility root is changed from the first publication record to the second publication record through an atomic update operation, so as to migrate the logical readable entry of the medical image object from the first immutable archive segment to the second immutable archive segment; After the visibility root pointer change is completed, and it is confirmed that the first immutable archive segment is unreachable relative to all existing visibility roots in the archive system via the ancestor chain, a reset or reuse operation is performed on the target write region where the first immutable archive segment is located.
[0071] like Figure 5 As shown, in this embodiment, the system defines the immutable archive segments participating in the rewriting. An immutable archive segment already written to sequential storage medium is defined as the first immutable archive segment SEG_early, which stores the medical image objects to be rewritten. A newly written immutable archive segment is defined as the second immutable archive segment SEG_late, and SEG_late is generated later than SEG_early. Simultaneously, the publication record pointed to before the visibility root update is defined as the first publication record PR_old; the newly appended publication record pointing to SEG_late is defined as the second publication record PR_new.
[0072] Furthermore, the system identifies at least one medical image object to be rewritten from SEG_early, repackages the entity data of this medical image object into SEG_late, and stores SEG_late in another target write area of the sequential storage medium, or in a subsequent storage location within the same target write area. The medical image object is migrated from SEG_early to SEG_late. During this process, SEG_early retains its original physical form and is not rewritten in-situ to ensure that the write constraints of the sequential storage medium are not violated.
[0073] After SEG_late is written, the system appends PR_new to the release log and changes the visibility root's pointer from PR_old to PR_new through an atomic update operation. The arrow of the visibility root changes from pointing to PR_old to pointing to PR_new. Since the visibility root is the only access point to determine whether written data is logically readable, the change in the visibility root's pointer migrates the logical readable entry point of the medical image object from SEG_early to SEG_late. Subsequently, when read requests trace back along the visibility root and ancestor chain, they may still reach PR_old and its corresponding SEG_early; the system further combines the object validity summary and object version number to determine the current valid position of the target medical image object as SEG_late corresponding to PR_new, and excludes the object version replaced in SEG_early from the current read results, thus achieving a seamless transfer of readability without rewriting earlier archive segments.
[0074] Furthermore, when the same medical image object is rewritten, the system does not simply determine the object's current validity based on whether the publication record is reachable from the ancestor chain. Instead, it combines the object validity summary and the object version number to determine the read result. Specifically, after the second immutable archive segment is written, the system appends a second publication record, which records the new object version number of the target medical image object and updates the current valid position of the medical image object to the object position in the second immutable archive segment. Although the first immutable archive segment may still be reachable through the ancestor chain, the replaced medical image object is marked as a non-current valid version. When a read request hits multiple versions, it only returns the object with the latest version number that is not overwritten by the invalidation mark.
[0075] Furthermore, the rewriting of medical image objects can be used for archiving media replacement, image object verification and repair, lifecycle migration, generation of de-identified copies, or reconstruction of archived copies. When performing a rewrite, the system retains the migration relationship between the original and new object versions and records the migration reason, migration time, source immutable archive segment identifier, target immutable archive segment identifier, and migration verification result. Read requests return the latest valid version based on the currently valid object index; audit requests or recovery requests can trace historical object versions based on the migration relationship.
[0076] The present invention has the following beneficial effects: (1) Avoid the problem of uncertain read visibility status caused by abnormal interruption in sequential media scenarios.
[0077] (2) Reduce the dependence of the recovery process on the external complete metadata database and improve the consistency of crash recovery.
[0078] (3) Avoid premature recycling of data that is still readable, and improve the security of recycling control.
[0079] (4) To make writing, visibility, recovery and recycling in the sequential media archiving system form a unified control closed loop.
[0080] Furthermore, such as Figure 6 As shown, based on the above-described sequential media medical image archiving method based on visibility root and reachability recovery control, the present invention also provides a sequential media medical image archiving system based on visibility root and reachability recovery control, wherein the sequential media medical image archiving system based on visibility root and reachability recovery control includes: Archive segment writing module 51 is used to aggregate multiple medical image objects into an immutable archive segment, and store the immutable archive segment into the target write area in the sequential storage medium in a sequential append writing manner. The publication record appending module 52 is used to append a publication record to the publication log maintained on the sequential storage medium after the immutable archive segment is written to the target write area. The publication record encapsulates the segment identifier of the immutable archive segment, the area identifier of the target write area, and the predecessor identifier pointing to the previous publication record. The visibility root update module 53 is used to atomically update the pointer of the visibility root to the publication record in the control storage layer independent of the sequential storage medium. The visibility root is the only access entry point for determining whether the data written in the target write area presents a logically readable state to the outside world. The readable segment determination module 54 is used to take the visibility root as the entry point, determine all publishing records reachable from the visibility root along the ancestor chain formed by the predecessor identifiers in the publishing records, and determine the immutable archive segments identified in all reachable publishing records as externally readable archive segments, so as to complete the archiving of the medical image object. The recovery and reconstruction module 55 is used to rebuild the set of externally readable archive segments based on checkpoint records, high watermarks of published logs and visibility roots after the system restarts, and to identify content that fails the integrity check or is not reached by a valid visibility root as physically retained but logically unreadable content. The recycling control module 56 is used to control the target write region to switch between open, archive, recycling blocking and resettable based on the reachability relationship between the immutable archive segment in the target write region relative to the current visibility root and the reserved visibility root, and the object validity status. The object validity determination module 57 is used to determine the valid object version that the current read request should return when there are multiple write versions of the same medical image object, based on the object version number, object validity summary and failure flag.
[0081] Furthermore, such as Figure 7 As shown, based on the above-mentioned sequential media medical image archiving method and system based on visibility root and reachability recovery control, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 7 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0082] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as program code installed on the terminal. The memory 20 may also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a sequential media medical image archiving program 40 based on visibility root and reachability reclamation control. This sequential media medical image archiving program 40 based on visibility root and reachability reclamation control can be executed by the processor 10, thereby implementing the sequential media medical image archiving method based on visibility root and reachability reclamation control in this application.
[0083] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the sequential media medical image archiving method based on visibility root and reachability recovery control.
[0084] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components of the terminal communicate with each other via a system bus.
[0085] In one embodiment, when processor 10 executes a sequential media medical image archiving program 40 based on visibility root and reachability reclamation control in memory 20, the following steps are performed: Multiple medical image objects are aggregated to form an immutable archive segment, and the immutable archive segment is stored in the target write area of the sequential storage medium in a sequential append writing manner. After the immutable archive segment is written to the target write area, a release record is appended to the release log maintained on the sequential storage medium. The release record encapsulates the segment identifier of the immutable archive segment, the region identifier of the target write area, and the predecessor identifier pointing to the previous release record. In the control storage layer, which is independent of the sequential storage medium, the visibility root is atomically updated to the publication record. The visibility root is the only access point for determining whether the data written in the target write area is logically readable. Using the visibility root as the entry point, along the ancestor chain formed by the predecessor identifiers in the publication records, all publication records reachable from the visibility root are determined, and the immutable archive segments identified in all reachable publication records are determined as externally readable archive segments to complete the archiving of the medical image object.
[0086] The immutable archive segment includes a segment header, a payload area, an object location index, and segment tail verification information; The segment header is used to store the metadata information of the immutable archive segment, the payload area is used to store the entity data of multiple medical image objects, the object location index is used to establish the mapping relationship between the medical image object identifier and the internal offset of the payload area, and the segment tail verification information is used to verify the integrity of the archive segment during reading, recovery or verification.
[0087] Specifically, the step of using the visibility root as an entry point, determining all reachable publication records from the visibility root along the ancestor chain formed by the predecessor identifiers in the publication records, and identifying the immutable archive segments identified in all reachable publication records as externally readable archive segments includes: Obtain the visibility root from the control storage layer, use the visibility root as an entry point, and extract the publication record identifier currently pointed to by the visibility root; The predecessor identifiers encapsulated in each publication record in the publication log are sequentially connected to form an ancestor chain. Starting from the publication record corresponding to the publication record identifier, a backtracking traversal is performed along the ancestor chain to obtain all publication records that can be reached from the visibility root along the ancestor chain. Wherein, the predecessor identifier is the publication record identifier of the previous publication record when there is a previous publication record, and is an empty root value when there is no previous publication record. When a publication record with the predecessor identifier being the empty root value is extracted, the backtracking traversal terminates. The immutable archive segment corresponding to the segment identifier encapsulated in each of the published records obtained by backtracking is determined to be an externally readable archive segment. All the externally readable archive segments are combined into an externally readable archive segment set. When a read request is received, the target medical image object pointed to by the read request is retrieved from the externally readable archive segment set. Among them, immutable archive segments that have been fully written to the target write area but are not included in the externally readable archive segment set maintain physical storage integrity on the sequential storage medium and are logically unreadable to the read request.
[0088] The step of identifying the immutable archive segments identified in all accessible publication records as externally readable archive segments further includes: When the system restarts, the checkpoint records associated with the visibility root are retrieved from the control storage layer. If the checkpoint record is obtained, the release records are read from the playback start position recorded in the checkpoint record according to the physical append order of the release log. The integrity of each release record is checked. From the release records that pass the integrity check, the release records that are reachable from the visibility root and through the ancestor chain are selected. The immutable archive segment corresponding to the segment identifier encapsulated in the selected release record is reconstructed into an externally readable archive segment. Immutable archive segments corresponding to segment identifiers encapsulated within publication records that fail integrity checks or cannot be reached from the visibility root via the ancestor chain are identified as physically preserved but logically unreadable isolated content. If the checkpoint record is not obtained, the visibility root in the control storage layer is obtained, the publication record pointed to by the visibility root is used as the basis for confirming the current state, and all publication records that can be reached from the visibility root are determined along the ancestor chain. The immutable archive segment corresponding to the segment identifier encapsulated in all reachable publication records is reconstructed into an externally readable archive segment. The immutable archive segment corresponding to the segment identifier encapsulated within the publication record originating from the visibility root and unreachable via the ancestor chain is identified as physically preserved but logically unreadable isolated content.
[0089] The sequential media medical image archiving method based on visibility root and reachability recovery control further includes: Monitor the ancestor chain reachability relationship between all immutable archive segments already stored within the target write area and the currently valid visibility root in the control storage layer; When it is determined that there is at least one immutable archive segment in the target write area that can be reached by any currently valid visibility root via the ancestor chain, the target write area is set to a recycling blocking state. The recycling blocking state is used to prohibit the target write area from being reset or overwritten and reused by new data. When it is confirmed that all immutable archive segments within the target write region are unreachable relative to all currently valid visibility roots within the archive system via the ancestor chain, the recycling blocking state of the target write region is lifted.
[0090] The sequential media medical image archiving method based on visibility root and reachability recovery control further includes: When recording the metadata status of the target write area, the attribute flag of the target write area is switched to open, sealed, reclaimed blocked, or resettable depending on whether the target write area is set to a reclaim blocked state or is unsealed from the reclaim blocked state.
[0091] The sequential media medical image archiving method based on visibility root and reachability recovery control further includes: An immutable archive segment that has been written to the sequential storage medium is defined as the first immutable archive segment, which stores medical image objects that need to be rewritten. The newly written immutable archive segment is defined as the second immutable archive segment, and the second immutable archive segment is generated later than the first immutable archive segment; Define the publication record that the visibility root points to before the update as the first publication record, and define the newly appended publication record that points to the second immutable archive segment as the second publication record; At least one medical image object is determined from the first immutable archive segment, the entity data of the medical image object is repackaged and written into the second immutable archive segment, and the second immutable archive segment is stored in another target write area or a subsequent storage location of the same target write area in the sequential storage medium. After the second immutable archive segment is written, the second publication record is appended to the publication log, and the pointer of the visibility root is changed from the first publication record to the second publication record through an atomic update operation, so as to migrate the logical readable entry of the medical image object from the first immutable archive segment to the second immutable archive segment; After the visibility root pointer change is completed, and it is confirmed that the first immutable archive segment is unreachable relative to all existing visibility roots in the archive system via the ancestor chain, a reset or reuse operation is performed on the target write region where the first immutable archive segment is located.
[0092] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a sequential media medical image archiving program based on visibility root and reachability reclamation control, wherein when the sequential media medical image archiving program based on visibility root and reachability reclamation control is executed by a processor, it implements the steps of the sequential media medical image archiving method based on visibility root and reachability reclamation control as described above.
[0093] In summary, this invention provides a sequential media medical image archiving method, system, terminal, and storage medium based on visibility root and reachability reclamation control. The method includes: aggregating multiple medical image objects into immutable archive segments, and storing the immutable archive segments into a target write area in a sequential storage medium using a sequential append-only write method; after the immutable archive segments are written to the target write area, appending a publication record to the publication log maintained on the sequential storage medium, the publication record encapsulating the segment identifier of the immutable archive segment, the area identifier of the target write area, and a predecessor identifier pointing to the previous publication record; in a control storage layer independent of the sequential storage medium, atomically updating the pointer of the visibility root to the publication record, the visibility root being the unique access entry for determining whether the data already written in the target write area presents a logically readable state; using the visibility root as the entry point, determining all publication records reachable from the visibility root along the ancestor chain formed by the predecessor identifiers in the publication records, and determining the immutable archive segments identified in all reachable publication records as externally readable archive segments, thus completing the archiving of medical image objects. This invention decouples physical write completion from logical visibility publication and uses visibility root constraints to limit the visible range and write area reclamation conditions to achieve consistent readability, recoverability and controllable reclamation of medical image archives on sequential media.
[0094] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.
[0095] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0096] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A sequential media medical image archiving method based on visibility root and reachability recovery control, characterized in that, The sequential media medical image archiving method based on visibility root and reachability recovery control includes: Multiple medical image objects are aggregated to form an immutable archive segment, and the immutable archive segment is stored in the target write area of the sequential storage medium in a sequential append writing manner. After the immutable archive segment is written to the target write area, a release record is appended to the release log maintained on the sequential storage medium. The release record encapsulates the segment identifier of the immutable archive segment, the region identifier of the target write area, and the predecessor identifier pointing to the previous release record. In the control storage layer, which is independent of the sequential storage medium, the visibility root is atomically updated to the publication record. The visibility root is the only access point for determining whether the data written in the target write area is logically readable. Using the visibility root as the entry point, along the ancestor chain formed by the predecessor identifiers in the publication records, all publication records reachable from the visibility root are determined, and the immutable archive segments identified in all reachable publication records are determined as externally readable archive segments to complete the archiving of the medical image object.
2. The sequential media medical image archiving method based on visibility root and reachability recovery control according to claim 1, characterized in that, The immutable archive segment includes a segment header, a payload area, an object location index, and segment tail verification information; The segment header is used to store the metadata information of the immutable archive segment, the payload area is used to store the entity data of multiple medical image objects, the object location index is used to establish the mapping relationship between the medical image object identifier and the internal offset of the payload area, and the segment tail verification information is used to verify the integrity of the archive segment during reading, recovery or verification.
3. The sequential media medical image archiving method based on visibility root and reachability recovery control according to claim 1, characterized in that, The step of using the visibility root as an entry point, determining all reachable publication records from the visibility root along the ancestor chain formed by the predecessor identifiers in the publication records, and identifying the immutable archive segments identified in all reachable publication records as externally readable archive segments specifically includes: Obtain the visibility root from the control storage layer, use the visibility root as an entry point, and extract the publication record identifier currently pointed to by the visibility root; The predecessor identifiers encapsulated in each publication record in the publication log are sequentially connected to form an ancestor chain. Starting from the publication record corresponding to the publication record identifier, a backtracking traversal is performed along the ancestor chain to obtain all publication records that can be reached from the visibility root along the ancestor chain. Wherein, the predecessor identifier is the publication record identifier of the previous publication record when there is a previous publication record, and is an empty root value when there is no previous publication record. When a publication record with the predecessor identifier being the empty root value is extracted, the backtracking traversal terminates. The immutable archive segment corresponding to the segment identifier encapsulated in each of the published records obtained by backtracking is determined to be an externally readable archive segment. All the externally readable archive segments are combined into an externally readable archive segment set. When a read request is received, the target medical image object pointed to by the read request is retrieved from the externally readable archive segment set. Among them, immutable archive segments that have been fully written to the target write area but are not included in the externally readable archive segment set maintain physical storage integrity on the sequential storage medium and are logically unreadable to the read request.
4. The sequential media medical image archiving method based on visibility root and reachability recovery control according to claim 1, characterized in that, The step of identifying immutable archive segments identified in all accessible publication records as externally readable archive segments further includes: When the system restarts, the checkpoint records associated with the visibility root are retrieved from the control storage layer. If the checkpoint record is obtained, the release records are read from the playback start position recorded in the checkpoint record according to the physical append order of the release log. The integrity of each release record is checked. From the release records that pass the integrity check, the release records that are reachable from the visibility root and through the ancestor chain are selected. The immutable archive segment corresponding to the segment identifier encapsulated in the selected release record is reconstructed into an externally readable archive segment. Immutable archive segments corresponding to segment identifiers encapsulated within publication records that fail integrity checks or cannot be reached from the visibility root via the ancestor chain are identified as physically preserved but logically unreadable isolated content. If the checkpoint record is not obtained, the visibility root in the control storage layer is obtained, the publication record pointed to by the visibility root is used as the basis for confirming the current state, and all publication records that can be reached from the visibility root are determined along the ancestor chain. The immutable archive segment corresponding to the segment identifier encapsulated in all reachable publication records is reconstructed into an externally readable archive segment. The immutable archive segment corresponding to the segment identifier encapsulated within the publication record originating from the visibility root and unreachable via the ancestor chain is identified as physically preserved but logically unreadable isolated content.
5. The sequential media medical image archiving method based on visibility root and reachability recovery control according to claim 1, characterized in that, The sequential media medical image archiving method based on visibility root and reachability recovery control further includes: Monitor the ancestor chain reachability relationship between all immutable archive segments already stored within the target write area and the currently valid visibility root in the control storage layer; When it is determined that there is at least one immutable archive segment in the target write area that can be reached by any currently valid visibility root via the ancestor chain, the target write area is set to a recycling blocking state. The recycling blocking state is used to prohibit the target write area from being reset or overwritten and reused by new data. When it is confirmed that all immutable archive segments within the target write region are unreachable relative to all currently valid visibility roots within the archive system via the ancestor chain, the recycling blocking state of the target write region is lifted.
6. The sequential media medical image archiving method based on visibility root and reachability recovery control according to claim 5, characterized in that, The sequential media medical image archiving method based on visibility root and reachability recovery control further includes: When recording the metadata status of the target write area, the attribute flag of the target write area is switched to open, sealed, reclaimed blocked, or resettable depending on whether the target write area is set to a reclaim blocked state or is unsealed from the reclaim blocked state.
7. The sequential media medical image archiving method based on visibility root and reachability recovery control according to claim 1, characterized in that, The sequential media medical image archiving method based on visibility root and reachability recovery control further includes: An immutable archive segment that has been written to the sequential storage medium is defined as the first immutable archive segment, which stores medical image objects that need to be rewritten. The newly written immutable archive segment is defined as the second immutable archive segment, and the second immutable archive segment is generated later than the first immutable archive segment; Define the publication record that the visibility root points to before the update as the first publication record, and define the newly appended publication record that points to the second immutable archive segment as the second publication record; At least one medical image object is determined from the first immutable archive segment, the entity data of the medical image object is repackaged and written into the second immutable archive segment, and the second immutable archive segment is stored in another target write area or a subsequent storage location of the same target write area in the sequential storage medium. After the second immutable archive segment is written, the second publication record is appended to the publication log, and the pointer of the visibility root is changed from the first publication record to the second publication record through an atomic update operation, so as to migrate the logical readable entry of the medical image object from the first immutable archive segment to the second immutable archive segment; After the visibility root pointer change is completed, and it is confirmed that the first immutable archive segment is unreachable relative to all existing visibility roots in the archive system via the ancestor chain, a reset or reuse operation is performed on the target write region where the first immutable archive segment is located.
8. A sequential media medical image archiving system based on visibility root and reachability recovery control, characterized in that, The sequential media medical image archiving system based on visibility root and reachability recovery control includes: The archive segment writing module is used to aggregate multiple medical image objects into an immutable archive segment, and store the immutable archive segment into the target write area in the sequential storage medium in a sequential append writing manner. The publish record appending module is used to append a publish record to the publish log maintained on the sequential storage medium after the immutable archive segment is written to the target write area. The publish record encapsulates the segment identifier of the immutable archive segment, the area identifier of the target write area, and the predecessor identifier pointing to the previous publish record. The visibility root update module is used to atomically update the pointer of the visibility root to the publication record in the control storage layer, which is independent of the sequential storage medium. The visibility root is the only access point for determining whether the data written in the target write area presents a logically readable state to the outside world. The readable segment determination module is used to take the visibility root as the entry point, determine all publishing records reachable from the visibility root along the ancestor chain formed by the predecessor identifiers in the publishing records, and determine the immutable archive segments identified in all reachable publishing records as externally readable archive segments, so as to complete the archiving of the medical image object. The recovery and reconstruction module is used to rebuild the set of externally readable archive segments based on checkpoint records, high watermarks of published logs, and visibility roots after the system restarts, and to identify content that fails integrity verification or is not reached by a valid visibility root as physically retained but logically unreadable content. The recycling control module is used to control the target write region to switch between open, archive, recycling blocking and resettable based on the reachability relationship between the immutable archive segment in the target write region relative to the current visibility root and the reserved visibility root, as well as the object validity status. The object validity determination module is used to determine the valid object version that the current read request should return when there are multiple write versions of the same medical image object, based on the object version number, object validity summary, and failure flag.
9. A terminal, characterized in that, The terminal includes: a memory, a processor, and a sequential media medical image archiving program based on visibility root and reachability recovery control stored in the memory and executable on the processor. When the sequential media medical image archiving program based on visibility root and reachability recovery control is executed by the processor, it implements the steps of the sequential media medical image archiving method based on visibility root and reachability recovery control as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a sequential media medical image archiving program based on visibility root and reachability reclamation control, which, when executed by a processor, implements the steps of the sequential media medical image archiving method based on visibility root and reachability reclamation control as described in any one of claims 1-7.