A data real-time synchronization method, device, equipment and storage medium

By employing a dual-insurance strategy and an exponential backoff rule to optimize data synchronization, the problems of data latency and concurrency conflicts were resolved, enabling real-time synchronization of medical data and system stability, thus meeting the real-time collaborative needs of smart healthcare.

CN121000735BActive Publication Date: 2026-02-06杭州恒升医学科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511493514.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-02-06
Estimated Expiration
2045-10-20

AI Technical Summary

Technical Problem

Existing data synchronization solutions in the medical and government sectors suffer from problems such as data latency, concurrency conflicts, poor real-time performance, and insufficient reliability, making it difficult to meet real-time decision-making needs and affecting system stability.

Method used

A dual-insurance strategy (optimistic locking mechanism and incremental change log) is adopted to ensure data integrity. Illegal requests are filtered through a multi-layered verification mechanism, independent lock resources are generated to prevent concurrent conflicts, and the failure retry strategy is optimized by combining exponential backoff rules to achieve full lifecycle traceability of data and fine-grained task distribution.

Benefits of technology

It improves the security and consistency of data transmission, ensures the atomicity of data operations, optimizes system processing efficiency, and meets the real-time collaborative needs of smart healthcare.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121000735B_ABST
    Figure CN121000735B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data management, and more particularly to a data real-time synchronization method, device, equipment and storage medium; according to the preset double insurance strategy and the preset message transmission protocol, the inpatient information is processed to obtain a transmission compression package; when the preset business interface receives the transmission compression package, the transmission compression package is analyzed according to the preset permission and verification rule and the preset synchronization operation execution condition to obtain a synchronization data type; the synchronization data type is analyzed according to the preset security supplement mechanism to obtain an independent lock resource; the synchronization distribution task is generated according to the synchronization data type and the independent lock resource; the present application guarantees the transmission compliance and safety by standardizing HTTP request, double insurance traceback, etc.; multi-layer verification prevents illegal requests; version update and retry strategy are strictly controlled, layered storage ensures data availability and log traceability, improves medical data consistency and system stability, and meets the compliance requirements.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data management, and in particular to a data real-time synchronization method, device, equipment and storage medium. BACKGROUND

[0002] In the field of medical treatment, government affairs and the like with high requirements on data timeliness, the rationality of a data synchronization mechanism directly affects business efficiency and data quality. The current mainstream data synchronization scheme generally adopts a fixed periodic pull mode, which has significant technical bottlenecks: firstly, data delay cannot break through the interval limitation of a timing task, and a long synchronization period causes the information obtained by a downstream system to lag, which is difficult to support real-time decision-making requirements; secondly, in a multi-node deployment scenario, concurrent execution of timing tasks is prone to cause serious conflicts, including repeated updating of data and intensified competition for distributed locks, which further causes a sharp increase in database pressure and affects system stability; thirdly, the problem of poor real-time performance is prominent, and after data changes, the data needs to wait for the next scheduling trigger to be perceived, which cannot meet the response requirements of a quasi-real-time business scenario; in addition, the problem of insufficient reliability is significant, and when a task node is down or encounters network partitioning, a data synchronization empty window period is likely to occur, causing loss or inconsistency of critical information. These problems seriously restrict the efficiency and reliability of data synchronization, and need to be optimized and upgraded. SUMMARY

[0003] In order to overcome the deficiencies of the prior art, the purpose of the present application is to provide a data real-time synchronization method, device, equipment and storage medium.

[0004] A data real-time synchronization method comprises the following steps: acquiring synchronization inpatient information, and generating an HTTP request according to a preset interface calling rule and the synchronization inpatient information; processing the synchronization inpatient information according to a preset double insurance strategy and a preset message transmission protocol to obtain a transmission compression package; performing transmission processing on the transmission compression package in an HTTP request sending state; when the transmission compression package is received by a preset business interface, analyzing the transmission compression package according to a preset permission and verification rule and a preset synchronization operation execution condition to obtain a synchronization data type; analyzing the synchronization data type according to a preset security supplement mechanism to obtain an independent lock resource; generating a synchronization distribution task according to the synchronization data type and the independent lock resource; storing the synchronization distribution task into a preset storage resource according to a preset version update condition and a preset exponential backoff rule to obtain an updated storage resource.

[0005] Further, the processing of the synchronized inpatient information according to the preset double insurance strategy and the preset message transmission protocol to obtain a transmission compressed package comprises: configuring the synchronized inpatient information according to the double insurance strategy to obtain configured inpatient information; obtaining channel resources according to a preset frequency interval; and generating the transmission compressed package according to the channel resources, the message transmission protocol and the configured inpatient information.

[0006] Further, the configuring of the synchronized inpatient information according to the double insurance strategy to obtain configured inpatient information comprises: the double insurance strategy comprises an optimistic lock mechanism and an incremental change log; obtaining a patient information data table from the synchronized inpatient information; generating a new version number field and a conflict judgment rule according to the optimistic lock mechanism; configuring the patient information data table according to the new version number field and the conflict judgment rule to obtain a primary information data table; generating a log application scenario, an incremental change log table and a log recording rule according to the incremental change log; configuring the primary information data table according to the log application scenario, the incremental change log table and the log recording rule to obtain configured information data table; and updating the synchronized inpatient information according to the configured information data table to obtain the configured inpatient information.

[0007] Further, the analyzing of the transmission compressed package according to the preset permission and verification rule and the preset synchronization operation execution condition to obtain a synchronization data type comprises: verifying the transmission compressed package according to the permission and verification rule to obtain a verification result; when the verification result is verification success, decompressing the transmission compressed package to obtain a decompressed data set; obtaining a hospital ID to which a current operation belongs from the decompressed data set according to a preset security tool class; judging whether the hospital ID to which the current operation belongs satisfies the synchronization operation execution condition; if the hospital ID to which the current operation belongs satisfies the synchronization operation execution condition, obtaining a data synchronization identifier from the decompressed data set; and analyzing the data synchronization identifier to obtain the synchronization data type.

[0008] Further, the storing of the synchronized distribution task into the preset storage resource according to the preset version update condition and the preset exponential backoff rule to obtain an updated storage resource comprises: the storage resource comprises a target storage resource and a persistent storage resource; obtaining a current record version number from the synchronized distribution task; judging whether the current record version number satisfies the preset version update condition; if the current record version number satisfies the version update condition, storing the synchronized distribution task into the target storage resource to obtain the updated storage resource; otherwise, analyzing the synchronized distribution task according to the exponential backoff rule and a preset exponential growth upper limit condition to obtain a synchronization retry strategy; generating an error log according to the synchronization retry strategy and the synchronized distribution task; and storing the error log into the persistent storage resource to obtain the updated storage resource.

[0009] Further, the synchronization retry strategy is generated according to the synchronization retry strategy and the synchronization distribution task, and the method comprises the following steps: returning the current record version number obtained from the synchronization distribution task according to the synchronization retry strategy until the preset iteration stop condition is met; under the iteration stop condition, the real-time synchronization task execution state is obtained again to obtain a second synchronization task execution state; when the second synchronization task execution state is task execution failure, failure related information is generated; and the error log is generated according to the failure related information and the synchronization distribution task.

[0010] Further, the synchronization retry strategy is generated according to the synchronization retry strategy and the synchronization distribution task, and the method comprises the following steps: returning the current record version number obtained from the synchronization distribution task according to the synchronization retry strategy until the preset iteration stop condition is met; under the iteration stop condition, the real-time synchronization task execution state is obtained again to obtain a second synchronization task execution state; when the second synchronization task execution state is task execution failure, failure related information is generated; and the error log is generated according to the failure related information and the synchronization distribution task.

[0011] Further, a data real-time synchronization device comprises: a request generation module configured to obtain synchronization inpatient information and generate an HTTP request according to a preset interface calling rule and the synchronization inpatient information; an information processing module configured to process the synchronization inpatient information according to a preset double insurance strategy and a preset message transmission protocol to obtain a transmission compressed package; a transmission module configured to perform transmission processing on the transmission compressed package in an HTTP request sending state; an analysis module configured to analyze the transmission compressed package according to a preset permission and verification rule and a preset synchronization operation execution condition to obtain a synchronization data type when the preset business interface receives the transmission compressed package; a type analysis module configured to analyze the synchronization data type according to a preset security supplement mechanism to obtain an independent lock resource; a synchronization task generation module configured to generate a synchronization distribution task according to the synchronization data type and the independent lock resource; and a resource storage module configured to store the synchronization distribution task into a preset storage resource according to a preset version update condition and a preset exponential backoff rule to obtain an updated storage resource.

[0012] Further, a data real-time synchronization device comprises: a memory and at least one processor, the memory storing instructions; at least one processor calling the instructions in the memory to make the computer device execute the steps of any one of the above-mentioned data real-time synchronization methods.

[0013] Further, a computer readable storage medium having stored thereon instructions which, when executed by a processor, implement each step of the data real-time synchronization method of any of the above.

[0014] In the technical solution of the present application, a medical data full-link synchronization guarantee system is constructed, interface compatibility is ensured through standardized HTTP request generation, transmission failure caused by format problems is avoided, and a compliance foundation is laid for data transmission; data full life cycle traceability is realized through a double insurance strategy, data quality and transmission safety are guaranteed through generated transmission compression packages; a multi-layer verification mechanism filters illegal and unauthorized requests, a security supplement mechanism generates independent lock resources to prevent multi-node concurrent conflicts and ensure data operation atomicity; synchronization distribution tasks are finely split and distributed to improve system processing efficiency; version update conditions are strictly controlled to ensure data update accuracy, an exponential backoff rule optimizes the failure retry strategy, and the hierarchical design of storage resources not only guarantees the real-time availability of core data, but also realizes the traceability of abnormal logs, improves the consistency and stability of medical data, and meets the compliance requirements and intelligent medical collaboration needs. BRIEF DESCRIPTION OF DRAWINGS

[0015] The above and / or additional aspects and advantages of the present application will become apparent and more readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:

[0016] Figure 1 A first flowchart of a data real-time synchronization method provided for an embodiment of the present application;

[0017] Figure 2 A second flowchart of a data real-time synchronization method provided for an embodiment of the present application;

[0018] Figure 3 A third flowchart of a data real-time synchronization method provided for an embodiment of the present application;

[0019] Figure 4 A fourth flowchart of a data real-time synchronization method provided for an embodiment of the present application;

[0020] Figure 5 A fifth flowchart of a data real-time synchronization method provided for an embodiment of the present application;

[0021] Figure 6 A sixth flowchart of a data real-time synchronization method provided for an embodiment of the present application;

[0022] Figure 7 A seventh flowchart of a data real-time synchronization method provided for an embodiment of the present application;

[0023] Figure 8A structural schematic diagram of a data real-time synchronization device provided by an embodiment of the present application is shown in the figure.

[0024] Figure 9 A structural schematic diagram of a data real-time synchronization device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0025] The terms "first", "second", "third", "fourth" and the like in the description and claims of the present application and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of these terms herein is to be construed to cover the embodiments of the application, unless otherwise indicated herein or unless the context clearly dictates otherwise. Furthermore, use of the term "including" as well as "comprising" and variations thereof as used herein is intended to cover the inclusion and any variants of, for example, processes, methods, systems, products, or apparatuses that are covered by the expression "including", "comprising", and variations thereof, without the use of the term "consisting of" or "consisting only of", or the use of the term "consisting essentially of" or "consisting essentially of only", so long as the operations described in the expression are, without the use of the term "consisting of" or "consisting only of", or the use of the term "consisting essentially of" or "consisting essentially of only", included in the processes, methods, systems, products, or apparatuses covered by the expression "including", "comprising", and variations thereof.

[0026] For the convenience of understanding, the specific flow of the embodiment of the present application is described below, please refer to Figure 1 An embodiment of a data real-time synchronization method in the embodiment of the present application includes:

[0027] 101, acquire the synchronization of the inpatient information, and generate an HTTP request according to the preset interface calling rule and the synchronization of the inpatient information;

[0028] In this embodiment, the HTTP request is generated based on the interface calling rule (such as interface URL, request method, parameter format, header information, etc.), which ensures that the request format conforms to the business interface specification, lays the foundation for subsequent data transmission, and avoids transmission failure due to format incompatibility;

[0029] 102, according to the preset double insurance strategy and the preset message transmission protocol, the synchronization of the inpatient information is processed to obtain a transmission compression package;

[0030] In this embodiment, the patient information is processed based on the double insurance strategy (optimistic lock mechanism + incremental change log) and the message transmission protocol (such as HTTPS, DICOM) to generate a transmission compression package,

[0031] 103, in the HTTP request sending state, the transmission compression package is transmitted and processed;

[0032] 104, when the preset business interface receives the transmission compression package, the transmission compression package is analyzed according to the preset permission and verification rule and the preset synchronization operation execution condition to obtain the synchronization data type;

[0033] In the embodiment, during the HTTP request transmission process, after the target service interface receives the compressed package, multi-layer verification and analysis are performed, and unauthorized requests are filtered.

[0034] 105. Analyzing the synchronization data type according to the preset security supplement mechanism to obtain an independent lock resource;

[0035] 106. Generating a synchronization distribution task according to the synchronization data type and the independent lock resource;

[0036] In the embodiment, the independent lock resource (a unique lock identifier is allocated to each synchronization task) is generated through the security supplement mechanism (such as a distributed lock strategy), and the synchronization distribution task is generated in combination with the synchronization data type; the independent lock resource prevents multiple nodes from processing the same patient data at the same time (such as updating the allergy history of the same patient at the same time in the outpatient department and the emergency department), and avoids concurrent conflicts; the synchronization distribution task includes meta information such as data content, version number, lock identifier, target storage path, and the like, and realizes fine splitting and distribution of the task;

[0037] 107. Storing the synchronization distribution task into a preset storage resource according to a preset version update condition and a preset exponential backoff rule to obtain an updated storage resource;

[0038] In the embodiment, the synchronization distribution task is stored into the storage resource (target storage resource + persistent storage resource) according to the version update condition (the source end and the target end version number are consistent when updating, and the version number is incremented after updating) and the exponential backoff rule (the failure retry interval is 1s, 2s, 4s, and at most 3 times);

[0039] In the embodiment, a medical data full-link synchronization guarantee system is constructed, the interface compatibility is ensured through the standardized HTTP request generation, the transmission failure caused by format problems is avoided, and a compliance foundation is laid for data transmission; the data full-life cycle traceability is realized through the double insurance strategy, the data quality and transmission safety are guaranteed through the generated transmission compressed package; the multi-layer verification mechanism filters illegal and unauthorized requests, the independent lock resource generated by the security supplement mechanism prevents multiple node concurrent conflicts, and ensures the atomicity of data operation; the synchronization distribution task is fine split and distributed, and the system processing efficiency is improved; the version update condition strictly controls the data update accuracy, the exponential backoff rule optimizes the failure retry strategy, and cooperates with the hierarchical design of the storage resource, which not only guarantees the real-time availability of the core data, but also realizes the traceability of the abnormal log, improves the medical data consistency and system stability, and meets the compliance requirements and smart medical collaboration needs.

[0040] Please refer to Figure 2 , a second embodiment of a data real-time synchronization method in the embodiment of the application includes:

[0041] 201, configure the synchronous admission patient information according to the double insurance strategy to obtain configured admission patient information;

[0042] In this embodiment, the double insurance strategy includes an optimistic lock mechanism and an incremental change log. The synchronous admission patient information is configured according to the double insurance strategy, so that the configured admission patient information has both conflict detection capability and traceability of the whole life cycle change, laying a foundation of “high-quality data” for subsequent transmission.

[0043] 202, obtain channel resources according to a preset frequency interval;

[0044] In this embodiment, the frequency interval (such as a high-frequency channel in the hospital intranet, a low-frequency channel in the public network, or a transmission frequency band divided according to data priority) is dynamically screened and adapted to obtain channel resources. The frequency interval division basis includes data real-time requirement (such as high-frequency channel for emergency patient information), network load (avoiding congested channels during peak hours), and data sensitivity (classified information preferentially using a dedicated channel).

[0045] 203, generate a transmission compressed package according to the channel resources, the message transmission protocol, and the configured admission patient information;

[0046] In this embodiment, the lossless compression algorithm (such as DEFLATE) is used to compress the configured admission patient information, so as to reduce the data package size. The compression rate is adjusted according to the bandwidth characteristics of the channel resources (the compression rate can be reduced to reduce the calculation time for high-frequency channels, and the compression rate can be increased to save bandwidth for low-frequency channels). The message transmission protocol (such as HTTPS and DICOM protocol conforming to medical data standards) is intelligently matched by monitoring the channel bandwidth, delay, and packet loss rate in real time, so as to avoid transmission delay or failure caused by channel congestion.

[0047] In this embodiment, in the double insurance strategy, the optimistic lock mechanism adds a version number field to intercept concurrent conflicts and avoid “old data overwriting new data”. The incremental change log completely records the whole life cycle change of the data, supports traceability and rollback, and lays a foundation of high-quality data. The frequency interval is divided according to the data real-time requirement, network load, and sensitivity, and the adaptive channel resources are dynamically obtained. The high-frequency channel preferentially guarantees the core business such as emergency, and the low-frequency channel carries non-urgent data, thereby improving the network resource utilization rate. The compression rate is adjusted according to the channel bandwidth characteristics, and the transmission is encrypted and packaged through HTTPS and DICOM protocols, thereby reducing the transmission delay and failure risk. This scheme not only meets the medical data compliance requirements, but also provides reliable support for the data flow of smart medical treatment.

[0048] Please refer to Figure 3 The third embodiment of the data real-time synchronization method in the embodiment of the application includes:

[0049] The double insurance strategy includes an optimistic lock mechanism and an incremental change log;

[0050] 301、obtain a patient information data table from the synchronized admission patient information;

[0051] 302、generate a new version number field and a conflict determination rule according to the optimistic lock mechanism;

[0052] 303、configure the patient information data table according to the new version number field and the conflict determination rule to obtain a primary information data table;

[0053] In this embodiment, the patient information data table (such as structured data containing fields such as name, age, admission time, diagnosis result, etc.) is the basic carrier of data processing, and clearly defines the core content of the synchronization object; the new version number field is the version field, which is added to the patient information data table of this type of business table, and the version number is checked during synchronization. Each time the data in the table is modified, the value of the version field will automatically increase; the conflict determination rule is that only when the data is not modified by other operations from reading to updating, the update will be successful. When updating data, check whether the current record version number is consistent with the version number in the database; if not, it is determined as a conflict, triggering a retry or conflict resolution process. The primary information data table has basic conflict detection capability and can identify and intercept conflict operations in a multi-node concurrent update scenario (such as modifying the same patient's allergy history in outpatient and emergency departments), avoiding "old data overwriting new data";

[0054] 304、generate a log application scenario, an incremental change log table, and a log recording rule according to the incremental change log;

[0055] In this embodiment, the log application scenario is used to define the use range of the log (such as data synchronization backtracking, error troubleshooting, and auditing); the incremental change log table is used to design the log storage structure (such as recording the change time, changed field, old value, new value, and operator); and the log recording rule is used to standardize the log triggering condition (such as automatically recording when data is added, modified, or deleted) and format standard;

[0056] 305、configure the primary information data table according to the log application scenario, the incremental change log table, and the log recording rule to obtain a configuration information data table;

[0057] In this embodiment, the configuration information data table not only has conflict detection capability, but also can record the data change track completely, supporting "data change traceability and error operation rollback";

[0058] 306、update the synchronized admission patient information according to the configuration information data table to obtain configured admission patient information;

[0059] In the embodiment, the configuration of the inpatient information not only has conflict detection capability, but also can record the data change track completely, and supports "data change traceability and error operation rollback";

[0060] In the embodiment, the "optimistic lock mechanism + incremental change log" double insurance strategy is used to provide protection for the inpatient information synchronization, and the effect is remarkable. The optimistic lock mechanism adds a version field, checks the version number during synchronization, automatically increments the version value each time the modification is made, and only allows the data to be updated successfully if it has not been modified by other operations. The conflict operation in the multi-node concurrent scene is effectively intercepted, the problem of "old data covering new data" is completely avoided, and the accuracy of medical data is guaranteed. The incremental change log clearly defines the application scene, storage structure and recording rules, completely records the change time, field, new and old values, and operator and the like, realizes the data full life cycle traceability and error rollback, and finally forms the configuration of the inpatient information which has conflict detection and change traceability capability, meets the medical data compliance requirements, improves the multi-department collaboration efficiency, reduces the operation and maintenance troubleshooting cost, and provides reliable technical support for the intelligent medical data flow.

[0061] Please refer to Figure 4 , a fourth embodiment of a data real-time synchronization method in the embodiment of the application comprises:

[0062] 401. Verify the transmission compressed package according to the permission and the verification rule to obtain a verification result;

[0063] In the embodiment, the transmission compressed package is verified in all dimensions based on the permission and the verification rule, and the core includes:

[0064] Identity legality verification: the identity of the sender (such as a hospital information system HIS, an electronic health record platform) is verified through an API key, a Token token or a digital certificate, to prevent illegal systems from accessing the transmission link;

[0065] Data integrity verification: the hash value (such as SHA-256) built in the compressed package is compared with the local calculation result, to ensure that the data has not been tampered with (such as malicious replacement of patient diagnosis information) in the transmission process;

[0066] Format compliance verification: whether the compressed package conforms to the protocol specification (such as data field integrity, encryption format) is checked, to filter invalid data packages with format errors;

[0067] 402. When the verification result is verification success, the transmission compressed package is decompressed to obtain a decompressed data set;

[0068] In the embodiment, the decompression process is allowed only when the verification result is success, to intercept malicious data or abnormal data packages from the source, and reduce the risk of system attack;

[0069] 403、According to the preset security tool class, the hospital ID to which the current operation belongs is obtained from the decompressed data set;

[0070] In this embodiment, the security tool class is, for example, SecurityUtils;

[0071] 404、It is judged whether the hospital ID to which the current operation belongs satisfies the synchronization operation execution condition;

[0072] In this embodiment, the synchronization operation execution condition is that if the hospital ID to which the current operation belongs is empty or less than or equal to 0, it is directly returned, and the subsequent synchronization operation is not executed;

[0073] 405、If the hospital ID to which the current operation belongs satisfies the synchronization operation execution condition, the data synchronization identifier is obtained from the decompressed data set;

[0074] 406、The data synchronization identifier is analyzed to obtain the synchronization data type;

[0075] In this embodiment, if the synchronization data type (dataType) is empty or "p", the inpatient data is synchronized, and the parameters are the department ID string and the current login user;

[0076] If the synchronization data type (dataType) is "d", the department ward data is synchronized, and the parameters are the department ID and the path " / sync / department / all";

[0077] If the synchronization data type (dataType) is "a", the medical advice data is synchronized, and the parameters are the department ID and the path " / sync / advice / al";

[0078] If the synchronization data type (dataType) is "n", the medical care data is synchronized, and the parameters are the department ID and the path " / sync / doctor / all";

[0079] If the synchronization data type (dataType) is "r", the inspection C report data is synchronized, and the parameters are the department ID and the path " / sync / report / all";

[0080] If the synchronization data type (dataType) is "s", the outpatient and emergency physical examination blood sugar data is synchronized, and the parameters are the department ID and the path " / sync / sugar / al";

[0081] If the synchronization data type (dataType) is "cd", the chronic disease screening data is synchronized, and the parameters are the department ID and the path " / sync / disease / chronic / all";

[0082] If the synchronization data type (dataType) is "gv", the large vessel disease data is synchronized, and the parameters are department ID and path " / sync / disease / vessel / al";

[0083] If the synchronization data type (dataType) is "op", the outpatient data is synchronized, and the parameters are department ID and path " / sync / outpatient / all";

[0084] In the embodiment, through multi-level verification and authority control, all-round security is provided for medical data transmission; in the full-dimensional verification mechanism, the identity legality verification intercepts illegal access through API key, Token, etc.; the data integrity verification prevents tampering through SHA-256 hash comparison; the format compliance verification filters invalid data packets to reduce attack risks from the source. Only the compressed package that passes the verification is allowed to be decompressed, the hospital ID is extracted by combining the security tool class, the authority is strictly controlled through the execution condition of "non-empty and greater than 0", and the overreach operation is prevented; for the data meeting the condition, the data type is determined through analysis of the synchronization identifier, and the downstream system is accurately processed; the scheme not only meets the medical data compliance requirements, but also improves the data security, and provides a reliable security barrier and efficiency support for cross-institutional medical data collaboration.

[0085] Please refer to Figure 5 , a fifth embodiment of a data real-time synchronization method in the embodiment of the application includes:

[0086] The storage resource includes a target storage resource and a persistent storage resource;

[0087] 501, obtaining a current record version number from the synchronization distributed task;

[0088] In the embodiment, in the data synchronization process, when data is obtained from the source end and is ready to be synchronized to the target end, the version number of the data is carried; when the data is updated at the target end, the current version number of the data at the target end is compared with the current record version number carried from the source end;

[0089] 502, judging whether the current record version number meets the preset version update condition;

[0090] In the embodiment, the version update condition is that only when the two version numbers are consistent, the update operation is allowed to be performed, and the version number of the data at the target end is incremented; if the version numbers are inconsistent, it indicates that the data has been modified by other operations during synchronization, and then the synchronization operation is rejected, avoiding error coverage caused by data conflict and ensuring data consistency;

[0091] 503、if the current record version number meets the version update condition, the synchronization distribution task is stored into the target storage resource to obtain an updated storage resource;

[0092] In the embodiment, for example, when the patient admission information is synchronized, if the source version number is 3 and the target current version number is also 3, the synchronization is allowed and the target version number is upgraded to 4; if the target version number has been updated to 4 by other operations, the synchronization is rejected, which avoids the problem of “old data covering new data” caused by multi-node concurrent modification and adapts to the optimistic lock logic to prevent conflicts;

[0093] 504, on the contrary, the synchronization distribution task is analyzed according to the exponential backoff rule and the preset exponential growth upper limit condition to obtain a synchronization retry strategy;

[0094] In the embodiment, the synchronization retry strategy is generated based on the exponential backoff rule (for example, retry intervals of 1s, 2s and 4s, and a maximum of 3 retries) and the exponential growth upper limit condition (limiting the maximum retry number and interval), which avoids high-frequency invalid requests from occupying system resources;

[0095] 505, error logs are generated according to the synchronization retry strategy and the synchronization distribution task;

[0096] 506, the error logs are stored into a persistent storage resource to obtain an updated storage resource;

[0097] In the embodiment, the structured error logs are generated by combining the task metadata (task, data type) and the failure details (version conflict reason, involved patient identity information) and are stored into the persistent storage resource, which provides complete basis for subsequent manual intervention or automatic repair;

[0098] In the embodiment, the hierarchical storage and version checking mechanism are used to provide efficient and reliable storage guarantee for medical data synchronization; the storage resource is divided into target storage and persistent storage to realize isolated management of normal data and abnormal logs; through comparison of the source version number and the target version number, only when the version numbers are consistent, the update is allowed and the version number is incremented, for example, the source version number 3 matches the target version number 3, and then the synchronization is upgraded to 4, if the version numbers are inconsistent, the synchronization is rejected, which avoids the problem of old data covering new data caused by multi-node concurrent modification, and when the version conflict occurs, the exponential backoff retry (1s, 2s, 4s, and a maximum of 3 times) is triggered to reduce the pressure of invalid requests on the system; the structured error logs integrate the task metadata and the failure details and are stored into the persistent storage, which facilitates quick problem troubleshooting, guarantees the stability of core business, and meets the medical data compliance traceability demand.

[0099] Please refer to Figure 6 The sixth embodiment of the data real-time synchronization method in the embodiment of the application includes the following steps:

[0100] 601、acquire real-time synchronization task execution state to obtain a first synchronization task execution state;

[0101] 602、when the first synchronization task execution state is task execution failure, analyze the synchronization distribution task according to an exponential backoff rule to obtain a backoff coefficient and a basic interval time;

[0102] In the embodiment, the exponential backoff rule is that the first retry interval is 1 second, the second retry interval is 2 seconds, and the third retry interval is 4 seconds (each interval is twice the previous interval), and the backoff coefficient is determined by the exponential backoff rule, such as the first retry coefficient is 1, the second is 2, and the third is 4, which embodies the characteristic that the interval increases exponentially with the number of retries;

[0103] 603、generate an actual interval time according to the basic interval time and a preset random value;

[0104] In the embodiment, the basic interval time is the reference interval (1s, 2s, 4s) corresponding to each retry number, which avoids the instantaneous pressure on the server caused by high-frequency retries in a short time (such as database connection pool depletion and network bandwidth fullness);

[0105] 604、generate a synchronization retry strategy according to the exponential growth upper limit condition, the actual interval time, and the backoff coefficient;

[0106] In the embodiment, to solve the problem of resource competition caused by simultaneous retries after multiple task failures, the scheme introduces random value optimization, superimposes a random value (such as ±0.2s) in a preset range on the basic interval time (such as 1s) to generate an actual interval time (such as 0.9s, 1.1s), which can disperse the retry time points of multiple failed tasks and avoid network congestion or server overload caused by concentrated requests, especially suitable for the complex environment of multi-department synchronization in medical scenarios; the exponential growth upper limit condition is that the maximum number of retries is 3 times and the maximum interval is 4s;

[0107] In the embodiment, the retry mechanism combining exponential backoff and dynamic adjustment significantly improves the fault tolerance capability and system stability of synchronization tasks; after task failure, the exponential interval of 1s, 2s, and 4s is retried, and the backoff coefficient is multiplied by the number of times, which avoids the sharp increase in server pressure caused by high-frequency retries in a short time, such as database connection pool depletion and bandwidth fullness; random value optimization is introduced to superimpose ±0.2s random fluctuation on the reference interval to generate differentiated actual intervals, which effectively disperses the time points of multiple concurrent retries, reduces network congestion and resource competition, and adapts to the medical multi-department synchronization scenario; the upper limit of 3 times maximum retry and 4s maximum interval prevents resource consumption caused by invalid retries; the scheme provides recovery opportunities for temporary fault tasks and guarantees system stability, providing reliable fault tolerance support for medical data cross-agency collaboration.

[0108] Please refer to Figure 7 The seventh embodiment of the data real-time synchronization method in the embodiments of the present application comprises:

[0109] 701. According to the synchronization retry strategy, the current record version number obtained from the synchronization distributed task is returned for execution until the preset iteration stop condition is met;

[0110] In this embodiment, the latest version number is obtained before each retry, and the optimistic lock mechanism is adapted (the version number is inconsistent, and the update is rejected), so as to avoid synchronization conflicts caused by old version data (such as data updated by other nodes during the retry process, and the synchronization needs to be reinitiated based on the latest version number); the iteration stop condition is, for example, “the number of retries reaches the upper limit (3 times)”, “the task is executed successfully”, or “the maximum retry time window is exceeded”, so as to prevent infinite loop from consuming system resources;

[0111] 702. Under the iteration stop condition, the real-time synchronization task execution state is obtained again to obtain a second synchronization task execution state;

[0112] In this embodiment, if the synchronization task execution state is “success”, the synchronization process is normally ended, and the data is consistent; if the synchronization task execution state is “failure”, a subsequent error handling mechanism is triggered to ensure that the failure condition is captured;

[0113] 703. When the second synchronization task execution state is task execution failure, failure related information is generated;

[0114] In this embodiment, the failure related information includes failure time, number of retries, last failure reason (such as network timeout, version conflict, insufficient permission), and key information such as patient ID and hospital ID;

[0115] 704. An error log is generated according to the failure related information and the synchronization distributed task;

[0116] In this embodiment, the error log is generated in association with the synchronization distributed task: the failure information and task metadata (such as task ID, data type, and target system) are integrated to form a structured log (such as containing fields such as task_id, patient_id, error_type, and retry_count);

[0117] In the embodiment, the reliability of the synchronization task and the problem tracing capability are enhanced through the iteration retry and the log recording mechanism; the latest version number is obtained before the retry to adapt the optimistic lock, the old data synchronization conflict is avoided, and the latest data state is ensured for each retry; the iteration stop conditions such as the upper limit of the retry number, the task success, and the timeout are used to prevent the infinite loop from consuming resources and to guarantee the system stability; after the task finally fails, the failure record containing the failure time, the reason, the patient ID, and the hospital ID and the like key information is generated, and the task metadata is integrated into the structured error log containing the fields such as task_id and error_type; the scheme not only improves the medical data synchronization consistency, but also quickly locates the problem through the complete log, reduces the troubleshooting time from the hour level to the minute level, meets the compliance tracing requirements, and provides a reliable guarantee for the medical data cooperation.

[0118] The above describes a data real-time synchronization method in the embodiment of the application, and the following describes a data real-time synchronization device in the embodiment of the application, please refer to Figure 8 An embodiment of the data real-time synchronization device in the embodiment of the application includes:

[0119] The request generation module 1 is configured to obtain the synchronization inpatient information, and generate an HTTP request according to the preset interface calling rule and the synchronization inpatient information;

[0120] The information processing module 2 is configured to process the synchronization inpatient information according to the preset double insurance strategy and the preset message transmission protocol to obtain a transmission compression package;

[0121] The transmission module 3 is configured to perform transmission processing on the transmission compression package in the HTTP request sending state;

[0122] The analysis module 4 is configured to analyze the transmission compression package according to the preset permission and verification rule and the preset synchronization operation execution condition after the preset business interface receives the transmission compression package to obtain a synchronization data type;

[0123] The type analysis module 5 is configured to analyze the synchronization data type according to the preset security supplement mechanism to obtain an independent lock resource;

[0124] The synchronization task generation module 6 is configured to generate a synchronization distribution task according to the synchronization data type and the independent lock resource;

[0125] The resource storage module 7 is configured to store the synchronization distribution task into a preset storage resource according to the preset version update condition and the preset exponential backoff rule to obtain an updated storage resource;

[0126] In the embodiment, a medical data full-link synchronization guarantee system is constructed, interface compatibility is ensured through standardized HTTP request generation, transmission failure caused by format problems is avoided, and a compliance foundation is laid for data transmission; data full life cycle traceability is realized through a double insurance strategy, data quality and transmission safety are guaranteed through generated transmission compression packages; a multi-layer verification mechanism filters illegal and unauthorized requests, a security supplement mechanism generates independent lock resources to prevent multi-node concurrent conflicts and ensure data operation atomicity; synchronization distribution tasks are finely split and distributed to improve system processing efficiency; version update conditions are strictly controlled to ensure data update accuracy, an exponential backoff rule optimizes the failure retry strategy, and the hierarchical design of storage resources guarantees real-time availability of core data and realizes traceability of abnormal logs, improves medical data consistency and system stability, and meets compliance requirements and smart medical collaboration needs.

[0127] Figure 9 A structure diagram of a data real-time synchronization device provided by the embodiment of the present application, the data real-time synchronization device 900 can have great differences due to different configurations or performances, and can include one or more central processing units (CPUs) 910 (for example, one or more processors) and a memory 920, and one or more storage media 930 (for example, one or more mass storage devices) storing application programs 933 or data 932. The memory 920 and the storage medium 930 can be temporary storage or persistent storage. The programs stored in the storage medium 930 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the data real-time synchronization device 900. Further, the processor 910 can be configured to communicate with the storage medium 930, execute a series of instruction operations in the storage medium 930 on the data real-time synchronization device 900, to realize the steps of the data real-time synchronization method provided by each method embodiment.

[0128] The data real-time synchronization device 900 can also include one or more power supplies 940, one or more wired or wireless network interfaces 950, one or more input and output interfaces 960, and / or one or more operating systems 931, such as Windows Server, MacOS X, Unix, Linux, FreeBSD, etc. Those skilled in the art can understand that Figure 9 The structure of the data real-time synchronization device shown does not constitute a limitation on the data real-time synchronization device, and can include more or fewer components than shown, or combine certain components, or different component arrangements.

[0129] The application further provides a computer readable storage medium, which can be a nonvolatile computer readable storage medium or a volatile computer readable storage medium, and the computer readable storage medium stores instructions, and the instructions make a computer execute steps of a data real-time synchronization method when the instructions are run on the computer.

[0130] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system or device, unit can refer to the corresponding processes in the foregoing method embodiments, and will not be described here.

[0131] The integrated unit, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for making a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in the various embodiments of the application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.

[0132] Finally, it should be noted that: the above only for the preferred examples of the application, and not for limiting the application, although the application has been described in detail with reference to the foregoing embodiments, for those skilled in the art, it still can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the application shall be included in the protection scope of the application.

Claims

1. A method for real-time data synchronization, characterized in that, include: Obtain information on patients admitted to the hospital simultaneously, and generate an HTTP request based on the preset interface call rules and the information on patients admitted to the hospital simultaneously; The information of patients admitted simultaneously is processed according to the preset dual insurance strategy and preset message transmission protocol to obtain a transmission compressed package; The compressed package is processed for transmission while the HTTP request is being sent. When the preset business interface receives the transmission compressed package, it analyzes the transmission compressed package according to the preset permission and verification rules and the preset synchronization operation execution conditions to obtain the synchronization data type; The synchronization data types are analyzed according to the preset security supplementation mechanism to obtain independent lock resources; Generate synchronization distribution tasks based on synchronization data types and independent lock resources; Based on the preset version update conditions and preset exponential backoff rules, the synchronous distribution tasks are stored in the preset storage resources to obtain the updated storage resources. The process of processing synchronously admitted patient information according to a preset dual-insurance strategy and a preset message transmission protocol to obtain a transmission compressed packet includes: The information of patients admitted simultaneously is configured according to the dual-insurance strategy to obtain the configured information of admitted patients; Channel resources are obtained based on a preset frequency range; Generate a transmission compressed package based on channel resources, message transmission protocol, and configured patient admission information; The configuration of synchronously admitted patient information according to the dual-insurance strategy to obtain configured admitted patient information includes: The dual-insurance strategy includes an optimistic locking mechanism and an incremental change log. The patient information data table is obtained from the synchronized admission patient information; A new version number field and conflict determination rules are generated based on the optimistic locking mechanism; Configure the patient information data table according to the new version number field and conflict determination rules to obtain the primary information data table; Generate log application scenarios, incremental change log tables, and log recording rules based on incremental change logs; Configure the primary information data table according to the log application scenario, incremental change log table, and log recording rules to obtain the configuration information data table; The information of synchronously admitted patients is updated based on the configuration information data table to obtain the configuration information of admitted patients.

2. The real-time data synchronization method as described in claim 1, characterized in that, The process of analyzing the transmitted compressed packet according to preset permission and verification rules and preset synchronization operation execution conditions to obtain the synchronization data type includes: The transmitted compressed package is verified according to the permissions and verification rules to obtain the verification result; If the verification result is successful, the transmitted compressed package is decompressed to obtain the decompressed dataset; The hospital ID to which the current operation belongs is obtained from the decompression dataset based on the preset security tool class; Determine if the hospital ID to which the current operation belongs meets the conditions for executing the synchronous operation; If the hospital ID to which the current operation belongs meets the conditions for executing the synchronization operation, then the data synchronization identifier is obtained from the decompressed dataset; Analyze the data synchronization identifier to obtain the data type of the synchronization.

3. The real-time data synchronization method as described in claim 1, characterized in that, The step of storing the synchronous distributed tasks into preset storage resources according to preset version update conditions and preset exponential backoff rules to obtain updated storage resources includes: The storage resources include target storage resources and persistent storage resources; Obtain the current record version number from the synchronous distributed task; Determine whether the current record version number meets the preset version update conditions; If the current record version number meets the version update conditions, the synchronous distribution task will be stored in the target storage resource to obtain the updated storage resource; Conversely, the synchronous distribution task is analyzed according to the exponential backoff rule and the preset exponential growth upper limit condition to obtain the synchronous retry strategy. Error logs are generated based on the synchronous retry strategy and synchronous distributed tasks; The error log is stored in persistent storage resources to obtain updated storage resources.

4. The real-time data synchronization method as described in claim 3, characterized in that, The analysis of the synchronous distribution task based on the exponential backoff rule and the preset exponential growth upper limit condition to obtain the synchronous retry strategy includes: Obtain the real-time execution status of the synchronization task to get the execution status of the first synchronization task; When the execution status of the first synchronous task is task execution failure, the synchronous distributed tasks are analyzed according to the exponential backoff rule to obtain the backoff coefficient and the basic interval time. The actual interval time is generated based on the base interval time and a preset random value; A synchronous retry strategy is generated based on the upper limit condition of exponential growth, the actual interval time, and the backoff coefficient.

5. The real-time data synchronization method as described in claim 4, characterized in that, The generation of error logs based on the synchronization retry strategy and the synchronization distributed tasks includes: According to the synchronous retry strategy, the current record version number is obtained from the synchronous distributed task until the preset iteration stop condition is met. Under the condition of stopping the iteration, the real-time execution status of the synchronization task is obtained again to obtain the second execution status of the synchronization task; When the execution status of the second synchronous task is "task execution failed", failure-related information is generated; Error logs are generated based on failure-related information and synchronous distributed tasks.

6. A real-time data synchronization device, characterized in that, include: The request generation module is used to obtain synchronously admitted patient information and generate HTTP requests based on preset interface call rules and synchronously admitted patient information. The information processing module is used to process the information of synchronously admitted patients according to a preset dual-insurance strategy and a preset message transmission protocol to obtain a transmission compressed package. The specific steps include: The information of patients admitted simultaneously is configured according to the dual-insurance strategy to obtain the configured admission information. The specific steps include: The dual-insurance strategy includes an optimistic locking mechanism and an incremental change log. The patient information data table is obtained from the synchronized admission patient information; A new version number field and conflict determination rules are generated based on the optimistic locking mechanism; Configure the patient information data table according to the new version number field and conflict determination rules to obtain the primary information data table; Generate log application scenarios, incremental change log tables, and log recording rules based on incremental change logs; Configure the primary information data table according to the log application scenario, incremental change log table, and log recording rules to obtain the configuration information data table; The information of synchronously admitted patients is updated according to the configuration information data table to obtain the configuration information of admitted patients; Channel resources are obtained based on a preset frequency range; Generate a transmission compressed package based on channel resources, message transmission protocol, and configured patient admission information; The transmission module is used to process the transmission of compressed packages in the state of HTTP request sending; The analysis module is used to analyze the transmitted compressed package according to the preset permission and verification rules and the preset synchronization operation execution conditions when the preset business interface receives the transmitted compressed package, so as to obtain the synchronization data type. The type analysis module is used to analyze the synchronous data type according to the preset security supplementation mechanism to obtain independent lock resources; The synchronization task generation module is used to generate synchronization distribution tasks based on the synchronization data type and independent lock resources; The resource storage module is used to store synchronous distributed tasks into preset storage resources according to preset version update conditions and preset exponential backoff rules, so as to obtain updated storage resources.

7. A real-time data synchronization device, characterized in that, The real-time data synchronization device includes: a memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause the real-time data synchronization device to perform the steps of the real-time data synchronization method as claimed in any one of claims 1-5.

8. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of the real-time data synchronization method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Application scheduling method and device, electronic equipment and computer readable medium

    CN116795478A

  • Two-stage lock-free parallel log playback method and device

    CN117009361A