QR Code Secure Transmission Method Based on Avro and BPE
By adopting the QR code secure transmission method based on Avro and BPE in medical data transmission, the problems of low identification accuracy, high transmission dedicated line cost and poor security in the prior art are solved, and efficient and secure patient data transmission is achieved, which is suitable for promotion and application in medical environments.
Patent Information
- Application Number
- CN202411723691.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2044-11-28
AI Technical Summary
The existing medical data transmission solutions have problems such as low identification accuracy, high transmission line cost and poor security, especially in terms of the privacy and security of patient out-of-hospital data transmission, which lack effective encryption transmission mechanisms and identity authentication methods.
A QR code secure transmission method based on Avro and BPE is adopted, and by obtaining patient identity information and medical record data, encrypting and compressing, a QR code is generated and feedback to the patient. After the patient scans the QR code, he or she performs identity verification and data decoding.
It improves the security and transmission efficiency of patient data, solves the problems of low identification accuracy, high transmission line cost and poor security. The solution is simple and easy to deploy, has low development and maintenance costs, and is suitable for promotion and application in medical environments.
Smart Images

Figure CN119743283B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data transmission, and particularly to a QR code secure transmission method based on Avro and BPE. Background Art
[0002] With the continuous development of medical technology, the demand for out-of-hospital rehabilitation management of patients is increasing day by day. Especially for patients suffering from diseases such as venous thromboembolism (VTE) that require home rehabilitation treatment, long-term anticoagulant therapy is needed after discharge to reduce the risk of thrombus recurrence, and doctors need to assist in out-of-hospital rehabilitation management based on the patient's medical record reports. However, there are many limitations in data transmission between in-hospital and out-of-hospital settings. For example, due to privacy protection and other considerations, the existing medical network environment usually cannot directly transmit the complete health data of patients to out-of-hospital devices or platforms. In addition, the data transmission process is vulnerable to unauthorized access, which may lead to the leakage of patient privacy, further increasing the security requirements for data transmission and storage.
[0003] The existing technical solutions mainly have two methods: (1) Print the report at the time of discharge, have the patient take a photo and upload it, and use OCR technology to identify the content to complete the file creation; (2) Establish a dedicated data transmission line inside and outside the hospital, and use the intranet device to transmit patient data. These solutions have solved the data transmission problem to a certain extent. For example, OCR technology converts text data into electronic records through image recognition, and the data line can accurately transmit patient data inside and outside the hospital network.
[0004] However, there are still deficiencies in the use of existing technical solutions. On the one hand, the recognition rate of OCR technology for complex medical texts is limited, and the patient is prone to affecting the recognition accuracy due to image quality or environmental factors during the process of taking a photo and uploading, usually requiring manual intervention and correction, which increases the workload of patients and doctors. On the other hand, the dedicated line transmission method is costly, and the data security depends on network isolation, with a long approval process and wiring cycle, affecting clinical promotion and application. At the same time, the existing data transmission solutions also have deficiencies in privacy and security protection, lacking effective encrypted transmission mechanisms and identity authentication means, resulting in the risk of leakage of patients' sensitive information during the transmission process. Therefore, there is an urgent need for a medical data transmission solution that can simultaneously achieve encrypted transmission and ensure user identity security to ensure the privacy, security, and efficiency of out-of-hospital patient data. Summary of the Invention
[0005] This application provides a QR code secure transmission method based on Avro and BPE, which can solve problems such as low recognition accuracy, high cost of dedicated transmission lines, and poor security in the prior art. The solution is simple and easy to deploy, has low development and maintenance costs, is suitable for popularization and application in a medical environment, and effectively improves the security and transmission efficiency of patient data. This application provides the following technical solutions:
[0006] In a first aspect, this application provides a QR code secure transmission method based on Avro and BPE, and the method includes:
[0007] Obtain the patient's identity information and their medical record data;
[0008] Encrypt the patient's identity information to generate a digital fingerprint of the patient;
[0009] Compress and encrypt the patient's medical record data to generate a compressed and encrypted data stream;
[0010] Generate a QR code based on the patient's digital fingerprint and the compressed and encrypted data stream and feedback it to the patient;
[0011] The patient scans the QR code, generates a digital fingerprint according to the login information and verifies the identity;
[0012] If there is only a single QR code, directly decode it. If there are multiple QR codes, merge the multiple QR codes and then decode.
[0013] In a specific feasible implementation, the encrypting the patient's identity information to generate a digital fingerprint of the patient includes:
[0014] Input the extracted patient's identity information into an encryption hash function, encrypt the information, and generate a unique hash value as the digital fingerprint of the patient.
[0015] In a specific feasible implementation, the compressing and encrypting the patient's medical record data to generate a compressed and encrypted data stream includes:
[0016] Use the BPE algorithm to perform word segmentation on the text data in the medical record data, convert the text into smaller units, and each word segmentation unit is vectorized;
[0017] Use Apache Avro to serialize the vectorized medical record data;
[0018] Perform Gzip compression on the binary medical record data stream serialized by Avro.
[0019] In a specific feasible implementation, the generating a digital fingerprint according to the login information and verifying the identity includes:
[0020] Perform an encryption hash function calculation on the identity information of the currently logged-in user to generate a hash value, which serves as the digital fingerprint of the logged-in user;
[0021] Compare the generated digital fingerprint of the logged-in user with the digital fingerprint of the patient in the two-dimensional code;
[0022] When the two are consistent, the authentication passes, proving that the patient identity verification is successful.
[0023] In a specific feasible implementation, the decoding of the two-dimensional code includes:
[0024] The two-dimensional code undergoes a Gzip decompression operation to be restored to the original binary data stream;
[0025] The decompressed binary data stream is deserialized using Apache Avro;
[0026] Use BPE to vectorize and restore the string represented in digital form in the medical record data to restore it to the original text content.
[0027] In a specific feasible implementation, the generation of the compressed and encrypted data stream by performing compression and encryption processing on the patient's medical record data further includes:
[0028] Construct a medical record data set for tokenizer training, and the data set is sourced from the historical patient electronic health records of the hospital;
[0029] Use the constructed data set to train a private BPE tokenizer;
[0030] Use the trained private BPE tokenizer to tokenize the target medical record data, converting the text content into a digital token sequence;
[0031] For the tokenized medical record data, encode it into a binary data stream using a pattern-driven Avro serialization method;
[0032] The private tokenizer and Avro serialization pattern are only shared by the server and client programs, and third parties cannot parse the content of the encoded binary data stream.
[0033] In a specific feasible implementation, the generation of the two-dimensional code based on the patient's digital fingerprint and the compressed and encrypted data stream and feedback to the patient includes:
[0034] Use the patient's digital fingerprint as the message header and the compressed and encrypted data stream as the message body, and combine the message header and message body to generate a two-dimensional code data packet;
[0035] According to the preset upper limit of the QR code size, the QR code data packet is divided into multiple data shards, and each data shard generates an independent QR code.
[0036] In a second aspect, the present application provides a QR code secure transmission system based on Avro and BPE, adopting the following technical solutions:
[0037] A QR code secure transmission system based on Avro and BPE includes:
[0038] A data acquisition module, configured to obtain the patient's identity information and their medical record data;
[0039] An identity encryption module, configured to perform encryption processing on the patient's identity information to generate the patient's digital fingerprint;
[0040] A data encryption and compression module, configured to perform compression and encryption processing on the patient's medical record data to generate a compressed and encrypted data stream;
[0041] A QR code generation module, configured to generate a QR code based on the patient's digital fingerprint and the compressed and encrypted data stream and feedback it to the patient;
[0042] An identity verification module, configured for the patient to scan the QR code, generate a digital fingerprint according to the login information and verify the identity;
[0043] A data decoding module, configured to directly decode if there is only a single QR code, and merge multiple QR codes and then decode if there are multiple QR codes.
[0044] In a third aspect, the present application provides an electronic device, which includes a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement a QR code secure transmission method based on Avro and BPE as described in the first aspect.
[0045] In a fourth aspect, the present application provides a computer-readable storage medium, in which a program is stored, and the program is used to implement a QR code secure transmission method based on Avro and BPE as described in the first aspect when executed by a processor.
[0046] In summary, the beneficial effects of the present application at least include:
[0047] 1) By combining the BPE, Avro, and Gzip algorithms, the present application achieves more efficient data compression than traditional compression methods. Through a customized joint compression strategy for the characteristics of medical text data, compared with traditional methods, the solution of the present application can significantly reduce the data volume. This improvement not only optimizes the utilization rate of storage space but also reduces the bandwidth requirement during data transmission, thereby improving the efficiency of data processing and transmission.
[0048] 2) This application converts medical text data into irreversible digital sequences by using a private tokenizer, thereby ensuring the privacy and security of the data. Since the tokenizer is trained based on a specific medical dataset, external third parties cannot restore the original text, thus effectively avoiding the risks of data leakage or illegal access. In addition, through the combination of encryption and data tokenization, this application provides a secure way to protect sensitive patient information.
[0049] Through multi-layer compression and encryption technologies, it effectively solves the problems of privacy leakage and insecure data transmission existing in the existing medical data transmission solutions. First, by encrypting the patient identity information and generating digital fingerprints, the secure verification of the patient identity is achieved, avoiding the risks of identity theft and information tampering. Then, through algorithms such as BPE, Avro, and Gzip, the patient medical record data is compressed and encrypted, ensuring the security, privacy, and efficiency of the data during transmission. In addition, through the splitting and transmission of QR codes, the data can be accurately split and transmitted, ensuring that even with a large amount of information, it can be efficiently transmitted and is convenient for patients to receive and view. Finally, after the patient scans the QR code and verifies their identity, the data is safely restored and displayed. This solution not only ensures the privacy and security of the data but also improves the efficiency of data transmission, solves the problems of low recognition accuracy, high cost of dedicated transmission lines, and poor security in the existing technologies. The solution is simple and easy to deploy, has low development and maintenance costs, is suitable for promotion and application in the medical environment, and effectively improves the security and transmission efficiency of patient data. In addition, through triple compression and encryption processing of the patient's medical record data using BPE, Avro, and Gzip, the data volume is significantly reduced.
[0050] The above description is only an overview of the technical solution of this application. In order to be able to more clearly understand the technical means of this application and implement it in accordance with the content of the specification, the following takes the preferred embodiments of this application and combines with the attached drawings to describe in detail as follows. Brief Description of the Drawings
[0051] Figure 1 It is a schematic flowchart of the QR code secure transmission method based on Avro and BPE in the embodiment of this application.
[0052] Figure 2 It is a use case schematic diagram of the encryption and compression process in the embodiment of this application.
[0053] Figure 3 It is a comparison chart of the compression efficiency between the traditional Gzip algorithm and the BPE+Avro+Gzip combined algorithm in the embodiment of this application.
[0054] Figure 4It is an analysis chart of the compression efficiency of Avro and Asn1 in different scenarios in the embodiments of the present application.
[0055] Figure 5 It is a structural block diagram of a two-dimensional code secure transmission system based on Avro and BPE in the embodiments of the present application.
[0056] Figure 6 It is a block diagram of an electronic device for two-dimensional code secure transmission based on Avro and BPE in the embodiments of the present application. Detailed implementation manners
[0057] The following will further describe the detailed implementation manners of the present application in combination with the accompanying drawings and embodiments. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.
[0058] Optionally, the present application takes the two-dimensional code secure transmission method based on Avro and BPE provided in each embodiment and used in an electronic device as an example for illustration. The electronic device is a terminal or a server. The terminal can be a mobile phone, a computer, a tablet computer, etc. The type of the electronic device is not limited in this embodiment.
[0059] Referring to Figure 1 , it is a flowchart of a two-dimensional code secure transmission method based on Avro and BPE provided in an embodiment of the present application. The method at least includes the following steps:
[0060] Step S101: Obtain the patient's identity information and his medical record data.
[0061] In step S101, before the patient is discharged from the hospital, the patient's identity information and his complete medical record data are automatically obtained from the hospital's electronic health record (EHR) system. The patient's identity information includes the patient's personal identifier, such as name, hospital number, ID number, etc. The medical record data is the content of the patient's health record, such as diagnosis records, laboratory test results, biochemical indicators, underlying diseases, bleeding risks and other data. The obtained medical record data is uniformly converted into the JSON format to provide a structured input for subsequent encoding, compression and encryption processing.
[0062] Step S102: Encrypt the patient's identity information to generate the patient's digital fingerprint.
[0063] In step S102, the extracted patient's identity information (such as name, hospital number or ID number) is input into an encryption hash function to encrypt the information and generate a unique hash value. This hash value will be used as the patient's digital fingerprint for identity verification to ensure the data security and privacy during subsequent data transmission and decoding processes.
[0064] Optionally, the BLAKE2b algorithm is used in this application to calculate the hash value. BLAKE2b has high speed and strong security, supports variable-length output, and compared with other common hash algorithms (such as SHA-256), its output length can be adjusted according to security requirements. By setting the hash value with a length of 2 bytes, not only can sufficient security be ensured, but the storage requirement can also be reduced to a certain extent.
[0065] In another feasible embodiment, the following method can also be used to generate the digital fingerprint of the patient. Specifically, the extracted patient identity information is encrypted through two different hash algorithms. First, the patient information is encrypted for the first time using the SHA-256 hash algorithm to obtain an intermediate hash result R1. Then, the result of the first encryption is encrypted for the second time using the MD5 hash algorithm to obtain a second hash result R2. To increase the complexity and unpredictability of the generated digital fingerprint, the following formula is used to transform R1 and R2 to obtain the digital fingerprint F:
[0066]
[0067] where, represents the bitwise exclusive OR operation, ⊙ represents the bitwise AND operation, rot(R2) represents the cyclic right shift operation on R2, that is, moving the last few bytes to the front. mod P represents a modulo operation, which means taking the remainder or modulus operation. P represents a random modulus. In encryption algorithms, mod P is often used to handle large numbers, and the modulo operation is used to ensure that the value remains within a certain range (such as the range of a prime number). This approach helps to enhance the security of the encryption algorithm because the modulo operation can help form complex mathematical structures, making it difficult for attackers to reverse-engineer the original input.
[0068] In the above formula, by using two different hashing algorithms, it is ensured that the digital fingerprints of each patient can obtain unique encryption results. Even if the identity information of two patients is similar, different hash values can be generated through two encryptions, avoiding the collisions that may be brought about by a single hashing algorithm. Operations such as exclusive OR and bitwise AND on the hash results, as well as the transformation of circular right shift, further enhance the complexity of the fingerprint, making the final digital fingerprints significantly different even if the identity information of the patients is very similar. During the design process of the formula, by combining two different operations (exclusive OR and bitwise AND) with rotation, the formula can affect the data at different levels. The exclusive OR operation usually increases the "scattering" effect of the data, while the bitwise AND operation controls certain specific bits, making the distribution of the entire data more uniform and reducing the possible pattern predictability. The final mod P operation ensures that no matter how the input data changes, the result always remains within a certain range. Because during the encryption process, it is usually necessary to ensure that the output data does not increase infinitely, especially when dealing with large numbers. The introduction of mod P can prevent digital overflow and ensure that the output always conforms to the expected range, which is crucial for encryption operations (such as generating keys or hashing).
[0069] Step S103: Perform compression and encryption processing on the medical record data of the patient to generate a compressed and encrypted data stream.
[0070] In step S103, the JSON - formatted medical record data of the patient is input into the encoding processing flow, and the BPE, Avro, and Gzip algorithms are sequentially used for compression and encryption, finally generating a compressed and encrypted data stream. Specifically, first, the BPE algorithm is used to perform word - segmentation processing on the text data in the medical record, converting the text into smaller units. Each word - segmentation unit is further vectorized to reduce redundancy and shrink the volume of the text data. Subsequently, Apache Avro is used to serialize the vectorized JSON object. Avro is a schema - driven serialization technology that can convert a JSON - formatted object into a compact binary format, thus further compressing the data volume. In addition, the binary format of Avro also increases the security of the data, avoiding directly exposing the original JSON structure. Finally, Gzip compression is performed on the binary data stream serialized by Avro. Gzip is a widely used compression algorithm that can significantly reduce the data volume, making the message body more compact for subsequent QR code transmission.
[0071] It should be noted that in order to enable compression algorithms (such as BPE and Avro) to achieve the best results when processing medical texts, the present application proposes a technical means of effectively decomposing target medical record data by training a tokenizer. Specifically, first, data is extracted from the historical patient electronic health records (EHRs) of a hospital to construct a medical record data set. This data set covers the medical record information of patients, including but not limited to text contents such as department names, surgery names, drug names, disease diagnoses, index names, and imaging examinations. The constructed medical record data set provides a high-quality medical corpus for tokenizer training, ensuring that the trained tokenizer can accurately decompose and process medical texts. Using the constructed medical record data set, the tokenizer of the byte pair encoding (BPE) algorithm is trained. During the training process, according to the characteristics of medical texts, a private tokenizer for Chinese medical texts is generated. The trained tokenizer can decompose the text into a more efficient token sequence, laying a foundation for subsequent compression processing. Using the trained private BPE tokenizer, the text content in the target medical record data is tokenized. The tokenization process converts the text content into a digital token sequence, and each token corresponds to a unique digital code, thereby realizing the format standardization and preliminary compression of medical record data. This conversion not only reduces data redundancy but also improves the processing efficiency for subsequent serialization operations. The tokenized medical record data is encoded based on the pattern-driven Apache Avro serialization method to generate a compact binary data stream. The Avro serialization method uses a predefined pattern to structure the token sequence, enabling the generated binary data stream to significantly reduce the data volume while maintaining the original information. In the present application, the trained private tokenizer and the used Avro serialization pattern are only shared between the server-side and client-side programs and are not disclosed to third parties. Due to the lack of the private tokenizer and serialization pattern, third parties cannot reverse-paralyze the encoded binary data stream, thereby further enhancing data security. In addition, the training process of the tokenizer is relatively fast, usually only taking dozens of seconds to a few minutes. Based on this, fields that need to be tokenized can be extracted from the JSON file, thereby improving the overall compression performance and further enhancing data security and transmission efficiency.
[0072] Next, an example is given to illustrate the encryption and compression process. Simulate a JSON sample of patient information, which contains four fields: admission date, length of hospital stay, inpatient department, and disease diagnosis, as Figure 2As shown, in implementation, the values of the two fields "Inpatient Department" and "Disease Diagnosis" are tokenized. For example, the text with the value "Type2 diabetes mellitus" in the "Disease Diagnosis" field is tokenized by a private tokenizer and transformed into "Type_2_diabetes_mellitus", and further transformed into the corresponding numerical list [10302, 6500, 2233]. It should be noted that due to different training corpora and hyperparameter configurations, using different tokenizers will generate different segmentation results and corresponding tokens, thus realizing the data encryption function. Since third parties lacking the private tokenizer cannot reverse-parse the data, the security of the data is guaranteed. Subsequently, the Apache Avro encoding technology is used to convert the JSON schema into a binary format to achieve data serialization. During this process, as Figure 2 shown, the bytes marked in blue represent the value of the admission date "2022-01-16", the bytes marked in red represent the length of stay '11' (using the variable-length zig-zag encoding method, 11 (integer) = 22 (zig-zag sequence number) = 0x16 (hexadecimal representation)), the bytes marked in green represent the inpatient department, and the bytes marked in orange represent the three disease names of the diagnosis. Finally, after BPE and Avro processing, the binary representation of the data is only 38 bytes. Compared with the original JSON file, the compression rate of the data is 4.87.
[0073] In this implementation scheme, the compression performance of the BPE + Avro + Gzip combined algorithm is verified. Figure 3 shows a comparison chart of the compression efficiency of the traditional Gzip algorithm and the BPE + Avro + Gzip combined algorithm. In the test data, the average size of the original JSON data is 5280 bytes. After being compressed by the traditional Gzip algorithm, the file size is reduced to 1609 bytes, and the compression rate is 3.17. In contrast, when using the BPE + Avro + Gzip combined algorithm developed in this application for compression, the file size is further reduced to 848 bytes, and the compression rate is increased to 6.07, showing the significant advantage of this algorithm in data compression. By comparison, the compression efficiency of this scheme is about 1.91 times that of the traditional Gzip algorithm. In addition, the distribution of the scatter plot indicates that as the volume of the original JSON file increases, the compression effect of the method used in this application becomes more significant, further proving the high efficiency of this algorithm in processing large-scale data.
[0074] In addition, in another feasible embodiment, the ASN.1 method can also be used to replace Avro, and the achieved technical effects are roughly the same, only the data compression rate is slightly inferior, as shown in the following table and Figure 4 as shown, presenting the compression efficiency analysis of Avro and Asn1 in different scenarios:
[0075]
[0076]
[0077] In the above table, in the JSON serialization technology, both ASN.1 (using PER encoding) and Avro can exhibit better compression performance. For the actually collected patient data, in terms of the compression rate of JSON serialization, the compression rate of Avro is 2.86, and the compression rate of ASN.1 is 2.88, with no significant difference. However, after combining with the BPE or Gzip compression method, Avro is significantly better than ASN.1. Specifically, the compression rate of Avro + Gzip reaches 4.27, and the compression rate of ASN.1 + Gzip is 3.90. Further, when the BPE method is introduced, the compression rate of Avro + BPE + Gzip is 6.28, and the compression rate of ASN.1 + BPE + Gzip is 5.52.
[0078] Step S104: Generate a two-dimensional code based on the patient's digital fingerprint and the compressed and encrypted data stream and feedback it to the patient.
[0079] In step S104, the patient's digital fingerprint is used as the message header, and the compressed and encrypted data stream is used as the message body to form a two-dimensional code data packet. At the same time, according to the preset upper limit of the two-dimensional code size, the data packet is divided into multiple parts, and each part generates an independent two-dimensional code. In this way, even if the amount of information is large, all medical record data can be completely transmitted in the form of multiple two-dimensional codes.
[0080] Optionally, the generated two-dimensional code can be printed out and submitted to the patient in the form of a home rehabilitation report, or directly displayed on the hospital computer screen for the patient to scan one by one through the APP.
[0081] It should be noted that in each two-dimensional code, the data content included is divided into two parts: the message header and the message body. The message header part consists of five fields, namely tag, Fingerprint, Transaction, count, and seq. When a medical record file needs to be divided into multiple two-dimensional codes for transmission, for the same transaction, the first four fields will remain unchanged, and only the seq field will increase sequentially in order. The specific definitions of each field are shown in the following table:
[0082]
[0083]
[0084] Step S105: The patient scans the QR code, generates a digital fingerprint based on the login information, and verifies the identity.
[0085] In step S105, the patient uses the exclusive APP on the mobile phone to scan each of the provided multiple QR codes one by one. The APP will automatically detect the QR code information and start the data reception process. After receiving the QR code data, the APP first performs an encrypted hash function calculation on the identity information (such as name, ID, etc.) of the currently logged-in user to generate a hash value, which serves as the digital fingerprint of the logged-in user. This digital fingerprint will be used for identity verification to ensure that only the corresponding patient can unlock their data. The APP compares the generated digital fingerprint of the logged-in user with the digital fingerprint of the patient in the QR code data packet. When the two are consistent and the authentication passes, it proves that the patient's identity verification is successful and enters the subsequent decoding process.
[0086] In implementation, the user scans and enters the QR codes one by one through the APP, and the program gives a friendly prompt according to the parsing result. The explanations of different result codes are as follows:
[0087] Result Code Meaning Description finished All QR codes scanned successfully, decoding completed waiting The current QR code scanned successfully, please continue to scan the [n, m, k...]th QR code duplicated The current QR code scanned repeatedly, please continue to scan the [n, m, k...]th QR code tag_error Tag error, not the QR code format supported by the program auth_failed Authentication failed, please confirm whether it has been authorized exception Other exceptions, please contact technical support for help
[0088] Step S106: If there is only a single QR code, directly perform decoding. If there are multiple QR codes, merge the multiple QR codes and then perform decoding.
[0089] In step S106, first, a Gzip decompression operation is performed to restore it to the original binary data stream. The Gzip algorithm decompresses the previously compressed data stream and restores it to the uncompressed binary format, preparing for the subsequent decoding steps. Subsequently, the decompressed binary data will be deserialized using Apache Avro. Avro converts the binary data into a JSON object, restoring the structure and content of the data. This step ensures that the data can be correctly restored to the original format for further processing and display. Finally, BPE is used to vectorize and restore the strings represented in digital form in the JSON object to restore them to the original text content. This step restores the text data that has been tokenized and vectorized through reverse operations, ensuring that the text information in the medical record can be restored to a readable and original text format.
[0090] In summary, through multi-layer compression and encryption technologies, the present application effectively solves the problems of privacy leakage and insecure data transmission in existing medical data transmission solutions. First, by encrypting the patient's identity information and generating a digital fingerprint, the secure verification of the patient's identity is achieved, avoiding the risks of identity theft and information tampering. Then, through algorithms such as BPE, Avro, and Gzip, the patient's medical record data is compressed and encrypted to ensure the security, privacy, and efficiency of the data during transmission. In addition, through the splitting and transmission of QR codes, the data can be accurately split and transmitted, ensuring efficient transmission and convenient reception and viewing by patients even when the amount of information is large. Finally, after the patient scans the QR code and verifies their identity, the data is safely restored and displayed. This solution not only ensures the privacy and security of the data but also improves the efficiency of data transmission, solves the problems of low recognition accuracy, high cost of dedicated transmission lines, and poor security in the prior art. The solution is simple and easy to deploy, with low development and maintenance costs, suitable for popularization and application in a medical environment, and effectively improves the security and transmission efficiency of patient data. In addition, through triple compression and encryption processing of the patient's medical record data using BPE, Avro, and Gzip, the data volume is significantly reduced.
[0091] Figure 5 FIG. 4 is a structural block diagram of a QR code secure transmission system based on Avro and BPE provided by an embodiment of the present application. The device at least includes the following several modules:
[0092] A data acquisition module, configured to obtain the patient's identity information and their medical record data;
[0093] An identity encryption module, configured to encrypt the patient's identity information to generate a digital fingerprint of the patient;
[0094] A data encryption and compression module, configured to compress and encrypt the patient's medical record data to generate a compressed and encrypted data stream;
[0095] A QR code generation module, configured to generate a QR code based on the patient's digital fingerprint and the compressed and encrypted data stream and feedback it to the patient;
[0096] An identity verification module, configured for the patient to scan the QR code, generate a digital fingerprint according to the login information and verify the identity;
[0097] A data decoding module, configured to directly decode if there is only a single QR code, and merge multiple QR codes and then decode if there are multiple QR codes.
[0098] For relevant details, refer to the above method embodiment.
[0099] Figure 6 FIG. 5 is a block diagram of an electronic device provided by an embodiment of the present application. The device at least includes a processor 401 and a memory 402.
[0100] The processor 401 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 401 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0101] The memory 402 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 401 to implement the QR code secure transmission method based on Avro and BPE provided in the method embodiments of the present application.
[0102] In some embodiments, the electronic device may also optionally include: a peripheral device interface and at least one peripheral device. The processor 401, the memory 402, and the peripheral device interface may be connected through a bus or signal lines. Each peripheral device may be connected to the peripheral device interface through a bus, signal lines, or a circuit board. Schematically, the peripheral devices include, but are not limited to: a radio frequency circuit, a touch display screen, an audio circuit, and a power supply, etc.
[0103] Of course, the electronic device may also include fewer or more components, and this embodiment does not limit this.
[0104] Optionally, the present application further provides a computer-readable storage medium storing a program, which is loaded and executed by a processor to implement the above-mentioned QR code secure transmission method based on Avro and BPE in the method embodiment.
[0105] Optionally, the present application further provides a computer product, which includes a computer-readable storage medium storing a program, which is loaded and executed by a processor to implement the above-mentioned QR code secure transmission method based on Avro and BPE in the method embodiment.
[0106] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0107] The above embodiments only represent several implementation manners of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several deformations and improvements can be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A QR code secure transmission method based on Avro and BPE, characterized in that: The method comprises: Access patient identification information and medical record data; Encrypting the patient's identity information to generate a digital fingerprint of the patient; The patient's medical record data is compressed and encrypted to generate a compressed and encrypted data stream; the compressed and encrypted data stream is compressed and encrypted to generate a compressed and encrypted data stream, including: using the BPE algorithm to perform word segmentation on the text data in the medical record data, converting the text into smaller units, and each word segmentation unit is vectorized; using Apache Avro to serialize the vectorized medical record data; Gzip compression is performed on the binary medical record data stream serialized by Avro; Generate a QR code based on the patient's digital fingerprint and the compressed and encrypted data stream and feed it back to the patient; The patient scans the QR code, generates a digital fingerprint based on the login information, and verifies the identity; If there is only a single QR code, decode it directly. If there are multiple QR codes, merge them and then decode them.
2. The two-dimensional code security transmission method based on Avro and BPE according to claim 1 is characterized in that: The step of encrypting the patient's identity information to generate the patient's digital fingerprint comprises: The extracted patient identity information is input into the encryption hash function, the information is encrypted, and a unique hash value is generated as the patient's digital fingerprint.
3. The method for secure transmission of a two-dimensional code based on Avro and BPE according to claim 1, characterized in that: Generating a digital fingerprint according to the login information and verifying the identity includes: Perform cryptographic hash function calculation on the identity information of the current logged-in user to generate a hash value as the digital fingerprint of the logged-in user; Compare the generated digital fingerprint of the logged-in user with the digital fingerprint of the patient in the QR code; When the two are consistent, the authentication is successful, proving that the patient's identity verification is successful.
4. The method for secure transmission of a two-dimensional code based on Avro and BPE according to claim 1, characterized in that: Decoding the two-dimensional code includes: The QR code is decompressed by Gzip and restored to the original binary data stream; The decompressed binary data stream is deserialized using Apache Avro; BPE is used to vectorize and restore the strings represented in digital form in the medical record data to their original text content.
5. The method for secure transmission of a two-dimensional code based on Avro and BPE according to claim 1, characterized in that: The compressing and encrypting the patient's medical record data to generate a compressed and encrypted data stream also includes: Construct a medical record dataset for labeler training, the dataset is derived from the hospital's historical patient electronic health records; Train a private BPE tagger using the constructed dataset; Use the trained private BPE tagger to tokenize the target medical record data and convert the text content into a digital tag sequence; The medical record data after tokenization is encoded into a binary data stream using the schema-driven Avro serialization method; The private marker and Avro serialization mode are shared only by the server and client programs, and third parties cannot parse the content of the encoded binary data stream.
6. The method for secure transmission of a two-dimensional code based on Avro and BPE according to claim 1, characterized in that: The generating of a two-dimensional code based on the digital fingerprint of the patient and the compressed and encrypted data stream and feeding back to the patient comprises: The patient's digital fingerprint is used as the message header, the compressed and encrypted data stream is used as the message body, and the message header and the message body are combined to generate a QR code data packet; According to the preset upper limit of the QR code size, the QR code data packet is divided into multiple data slices, and each data slice generates an independent QR code.
7. A two-dimensional code security transmission system based on Avro and BPE, characterized in that: include: Data collection module, used to obtain patient identity information and medical record data; An identity encryption module, used to encrypt the patient's identity information to generate a digital fingerprint of the patient; A data encryption and compression module is used to compress and encrypt the patient's medical record data to generate a compressed and encrypted data stream; The method of compressing and encrypting the patient's medical record data to generate a compressed and encrypted data stream includes: using the BPE algorithm to perform word segmentation on the text data in the medical record data, converting the text into smaller units, and each word segmentation unit is represented by vectorization; using Apache Avro to serialize the vectorized medical record data; and performing Gzip compression on the binary medical record data stream serialized by Avro; A QR code generation module, used to generate a QR code based on the patient's digital fingerprint and the compressed and encrypted data stream and feed it back to the patient; An identity verification module is used for the patient to scan the QR code, generate a digital fingerprint based on the login information, and verify the identity; The data decoding module is used to directly decode if there is only a single QR code, and to merge the multiple QR codes before decoding if there are multiple QR codes.
8. An electronic device, characterized in that: The device includes a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement a two-dimensional code secure transmission method based on Avro and BPE as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The storage medium stores a program, which, when executed by a processor, is used to implement a two-dimensional code secure transmission method based on Avro and BPE as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Web attack detection method based on NLP
CN114417345A
Fine-grained security data sharing method for patient health record privacy protection
CN116663047A