A medical device product information tracing method and system

Through the Huffman tree encryption method and chaotic mapping algorithm, the problem of source information being vulnerable to attacks in medical device information traceability is solved, achieving higher security and trustworthy information traceability.

CN118487874BActive Publication Date: 2024-09-17SHAANXI JILEPIN PHARM RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410940138.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-09-17
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

Existing encryption algorithms are easily attacked by statistical analysis during medical device information traceability, leading to leakage and tampering of source information, making it impossible for consumers to identify the authenticity of medical devices.

Method used

The Huffman tree encryption method is used to divide the source information into coding segments of the same length. The frequency mapping sequence is generated through the chaotic mapping algorithm, a Huffman tree is constructed, and the coding process is determined based on the degree of optimization to ensure the chaos and security of the coding results. sex.

Benefits of technology

It enhances the security of medical device source information, resists statistical analysis attacks, makes it more difficult for attackers to tamper and forge, and makes information traceability more credible.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118487874B
    Figure CN118487874B
Patent Text Reader

Abstract

The present invention relates to the field of data protection and traceability technology, and in particular to a method and system for tracing medical device product information. The method includes: an information tracing platform verifies the query information, and after the verification is passed, queries the source information of the product, and encrypts the source information: divides the source information into multiple coding segments of the same length, assigns frequencies to the coding objects according to the frequency mapping sequence, constructs a Huffman tree according to the frequencies, determines the preference of the Huffman tree according to the difference between the codeword of the coding object in the encoded coding segment and the codeword of the corresponding coding object in the Huffman tree, selects the Huffman tree to encode the coding segment according to the preference, and the encoding results of all coding segments constitute the ciphertext of the source information, so that the information query client provides the source information of the product to the consumer based on the ciphertext of the source information. The present invention increases the difficulty of tampering with and forging the source information of the product, making the information tracing more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data protection and traceability, and in particular to a method and system for tracing product information of medical devices. Background Art

[0002] Medical devices are various equipment, appliances, instruments, materials or systems widely used in the field of healthcare for the prevention, diagnosis, treatment, monitoring or alleviation of diseases. The quality of medical devices is related to the production and packaging, factory delivery, quality inspection, transportation, sales and other links of medical devices. In order to effectively monitor the safety of medical devices, it is necessary to trace the information of medical devices in each link.

[0003] In the process of medical device information tracing, attackers may tamper with or forge the source information of medical devices, making it impossible for consumers to identify the authenticity of medical devices. Therefore, it is often necessary to encrypt the product ID and the source information of medical devices to prevent attackers from stealing the product ID and the source information of medical devices and tampering with or forging the source information. For example, the patent document with the publication number "CN115456639A" and the name "A product information traceability system based on industrial Internet of Things" discloses: a trading platform, a producer terminal, a product information encryption module, a dealer terminal, a product circulation module, a consumer terminal and a data storage module. Each product information is encrypted using a randomly generated key, and the encrypted ciphertext is saved. At the same time, the product circulation module is used to record a unique consumer for each product.

[0004] The above patent documents use existing encryption algorithms to encrypt product information. Existing encryption algorithms, such as AES and DES, encrypt plaintext segments of the same length to obtain ciphertext of the same length. The obtained ciphertext may contain statistical rules and can be easily exploited for statistical analysis attacks, which may lead to the leakage of product ID and source information of medical devices. Attackers can use the leaked information to tamper with and forge the source information, making it impossible for consumers to identify the authenticity of medical devices. Summary of the invention

[0005] In order to solve the problem that ciphertext contains statistical rules and is easily attacked by statistical analysis, causing attackers to tamper with or forge the source information of medical devices, making it impossible for consumers to identify the authenticity of medical devices, the present invention provides a medical device product information tracing method and system.

[0006] In a first aspect, the present invention provides a method for tracing medical device product information, which adopts the following technical solution:

[0007] A method for tracing medical device product information, comprising the steps of:

[0008] The information tracing platform verifies the query information. After the verification is passed, the source information of the medical device is queried and the source information is encrypted so that the information query client can provide the source information of the medical device to the consumer based on the ciphertext of the source information; the encryption includes: dividing the source information into multiple coding segments of the same length; constructing a frequency mapping sequence, wherein the frequency mapping sequence includes multiple decimals in the range of (0,1); encrypting the coding segments in sequence, including: regarding the same elements in the source information as a coding object, assigning a frequency to each coding object according to the frequency mapping sequence, constructing a Huffman tree according to the frequency of the coding object, and determining the preference of the Huffman tree according to the difference between the codewords of the coding objects in all the coded coding segments and the codewords of the corresponding coding objects in the Huffman tree, wherein the preference is positively correlated with the difference; in response to the preference being greater than a preset preference threshold, encoding the coding segment using the Huffman tree, otherwise, reassigning a frequency to each coding object according to the frequency mapping sequence; and constituting the ciphertext of the source information with the encoding results of all the coding segments.

[0009] The present invention utilizes different Huffman trees to encrypt each coding segment in the source information of the medical device, so that the same coding object in the source information has different encryption results and different lengths, so that the ciphertext does not contain statistical rules, can resist statistical analysis attacks, enhance the security of the source information of the medical device, and increase the difficulty for attackers to tamper with and forge the source information of the medical device; the present invention determines whether the Huffman tree can encode the coding segment through the optimization degree of the Huffman tree, so that the codeword of the coding object in the Huffman tree that finally encodes the coding segment is as different as possible from the codeword of the coding object in the previously encoded coding segment, further increases the confusion of the ciphertext, and makes the security of the source information of the medical device stronger.

[0010] In one embodiment, the constructing of the frequency mapping sequence includes: setting the key to ( ),in, Represents the bifurcation parameter, the value range is ; Represents the initial value parameter, the value range is ; It represents the number of iterations, and its value range is , and L is an integer; a chaotic sequence is generated according to the key using a chaotic mapping algorithm as a frequency mapping sequence.

[0011] The present invention utilizes a chaotic mapping method to obtain a frequency mapping sequence. The generated frequency mapping sequence is chaotic and disordered, so that a subsequent Huffman tree structure constructed based on elements in the frequency mapping sequence is irregular. It is difficult for an attacker to guess the frequency mapping sequence, and it is also impossible to crack the ciphertext of the source information, thereby further enhancing the security and confidentiality of the source information.

[0012] In one embodiment, dividing the source information into a plurality of coding segments of the same length includes: dividing the source information into a plurality of coding segments of a length, wherein a is a preset length.

[0013] In one embodiment, the source information is divided into multiple coding segments of the same length, including: for a target element in the source information, obtaining the element with the smallest distance to the target element among all elements that are identical to the target element after the target element as the interval element of the target element, and using the distance between the target element and the interval element as the span of the target element; if there is no element that is identical to the target element after the target element, using the distance from the target element to the last element in the source information as the span of the target element; using the average of the spans of all elements in the source information as the segmentation length; dividing the source information into multiple coding segments, and the length of each coding segment is equal to the segmentation length.

[0014] The present invention uses a Huffman tree to encode a coding segment. Since the span of elements in the source information reflects the interval between the same elements in the source information, and the segmentation length obtained according to the mean of the span reflects the average interval between the same elements in the source information, the number of the same elements contained in each coding segment divided according to the segmentation length is very small, so that when a coding segment is encoded using the Huffman tree, the number of the same codewords in the coding result is as small as possible, thereby reducing the regularity in the ciphertext and further enhancing the security of the source information.

[0015] In one embodiment, allocating frequency to each coding object according to the frequency mapping sequence includes: selecting N elements in the frequency mapping sequence to form a frequency mapping subsequence, linearly normalizing the frequency mapping subsequence, and allocating each element in the normalized frequency mapping subsequence to each coding object in turn as the frequency of each coding object, wherein N represents the number of types of coding objects.

[0016] In one embodiment, the method of re-allocating the frequency for each coding object according to the frequency mapping sequence includes: selecting N elements in the frequency mapping sequence to form a new frequency mapping subsequence, where the new frequency mapping subsequence cannot be the same as the previous frequency mapping subsequence; linearly normalizing the new frequency mapping subsequence, and allocating each element in the normalized new frequency mapping subsequence to each coding object in turn as the frequency of each coding object, wherein N represents the number of types of coding objects.

[0017] In one embodiment, the preference satisfies the expression:

[0018] ; In the formula, Represents the optimization degree of the Huffman tree; Indicates the number of all coded segments that have been coded; Indicates the sequence number of the encoded code segment; Indicates the encoded The first The length of the codeword of the encoding object; Indicates the encoded The first The length of the codeword corresponding to the encoding object in the Huffman tree; Indicates the encoded The first The number of bits that differ between a codeword of a coding object and the corresponding codeword of the coding object in the Huffman tree; Indicates the encoded The number of types of coding objects contained in the coding segment; represents the hyperbolic tangent function; Represents the minimum function.

[0019] The optimization degree in the present invention takes into account the length difference between the codeword of the coding object in the encoded coding segment and the codeword of the corresponding coding object in the Huffman tree, as well as the degree of non-repetition between the codewords. When the length difference between the codewords is larger, the degree of non-repetition is larger, and the codewords are less similar, it is difficult for an attacker to analyze the rules of the coding object based on the codewords in the ciphertext of the source information, so that the ciphertext can resist statistical analysis attacks and has higher security.

[0020] In one embodiment, the preference satisfies the expression:

[0021] ; In the formula, Represents the optimization degree of the Huffman tree; Indicates the number of all coded segments that have been coded; Indicates the sequence number of the encoded code segment; Indicates the encoded The first The length of the codeword of the encoding object; Indicates the encoded The first The length of the codeword corresponding to the encoding object in the Huffman tree; Indicates the encoded The first The number of bits that differ between a codeword of a coding object and the corresponding codeword of the coding object in the Huffman tree; Indicates the encoded The number of types of coding objects contained in the coding segment; represents the hyperbolic tangent function; Represents the minimum function.

[0022] The serial number of the encoded coding segment can reflect the distance between the encoded coding segment and the current coding segment to be encoded. The preferred degree in the present invention takes into account the distance between the encoded coding segment and the current coding segment to be encoded. When the distance is smaller, if the code words corresponding to the same coding object are the same or similar, the local regularity in the ciphertext is stronger. When the distance is larger, if the code words corresponding to the same coding object are the same or similar, the same or similar code words in the ciphertext are separated by multiple coding segments, and the regularity is dispersed. The dispersed regularity is more difficult to mine than the local regularity of the data. Therefore, the present invention sets the weight of the encoded coding segment according to the serial number of the encoded coding segment, thereby obtaining the preferred degree. The local regularity in the final ciphertext is weaker, which enhances the security of the source information.

[0023] In a second aspect, the present invention provides a medical device product information tracing system, which adopts the following technical solution:

[0024] A medical device product information tracing system comprises: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned medical device product information tracing method is implemented.

[0025] By adopting the above technical solution, the above-mentioned medical device product information tracing method is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.

[0026] The present invention has the following technical effects: the present invention can encrypt the same coding object into codewords with different contents and lengths, so that the ciphertext does not contain statistical rules, can resist statistical analysis attacks, enhance the security of the source information of medical devices, increase the difficulty for attackers to tamper with and forge the source information of medical devices, and make information tracing more credible. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.

[0028] Figure 1 The present invention is a flowchart of a method for tracing medical device product information according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0030] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.

[0031] The embodiment of the present invention discloses a method for tracing medical device product information, comprising:

[0032] For each medical device, a unique product ID is assigned to it, that is, the product IDs of all medical devices are different. The specific format and content of the product ID are set by the implementer, such as including uppercase and lowercase letters and numbers.

[0033] A barcode, such as a barcode or a QR code, is generated according to the product ID of each medical device, and the generated barcode is printed on the outside of the packaging box of the medical device. It should be noted that since the product ID of each medical device is unique, the generated barcode is also unique.

[0034] A key is randomly assigned to each medical device and printed on the medical device.

[0035] During each link of medical device production and packaging, factory delivery, quality inspection, transportation, and sales, staff will use special equipment to scan the barcode on the outside of the medical device packaging box, obtain the product ID, and record the time, location, personnel and other source information of each link of medical device production and packaging, factory delivery, quality inspection, transportation, and sales, associate the recorded source information with the product ID, and store the source information on the information traceability platform.

[0036] The product IDs and corresponding keys of all medical devices are stored on the information traceability platform, and the hash value of each key is obtained, and the hash value of each key is also stored on the information traceability platform.

[0037] After the consumer purchases the medical device, he uses the information query client to scan the barcode on the outside of the medical device packaging box to obtain the product ID and enter the key on the medical device. The information query client encrypts the product ID with the key, obtains the ciphertext of the product ID, and obtains the hash value of the key. The ciphertext of the product ID and the key hash value are used as query information.

[0038] The information traceability platform queries the corresponding key in the information traceability platform according to the key hash value in the query information, decrypts the ciphertext in the query information according to the key, obtains the product ID, and determines whether the decrypted product ID is the same as the product ID corresponding to the key stored in the information traceability platform. If they are the same, it means that the identity of the medical device source information query is credible at this time, and the source information of the medical device is queried according to the product ID, and the source information of the medical device is encrypted by the key to obtain the ciphertext of the source information; if they are not the same, it means that the identity of the medical device source information query is not credible at this time, and the medical device source information is not queried.

[0039] The information query client decrypts the ciphertext of the source information according to the key, obtains the source information of the medical device, and displays the source information of the medical device to the consumer.

[0040] It should be noted that the encryption method used in the present invention to encrypt the product ID is the same as the encryption method used to encrypt the source information of the medical device. Therefore, the encryption method is described by taking the source information of the medical device as an example.

[0041] For specific encryption methods, refer to Figure 1 , comprising steps S1 to S4:

[0042] S1: Divide the source information into multiple coding segments of the same length.

[0043] It should be noted that the object of encryption in the present invention is the source information of the medical device. The source information may include multiple data types such as Chinese characters, English characters, numbers, etc. The implementers can also convert the source information into the same data type and then encrypt it as the encryption object, thereby reducing the difficulty of encryption.

[0044] In one embodiment, dividing the source information into a plurality of coding segments of the same length includes:

[0045] Divide the source information into multiple pieces of length The length of the last coding segment may not be ,in It is a preset length, which can be set by the implementer according to the actual implementation situation. ,For example ,in Indicates the length of the source information. Indicates the round-up symbol.

[0046] In another embodiment, dividing the source information into a plurality of coding segments of the same length includes:

[0047] Take any element in the source information as the target element, and take the element with the smallest distance to the target element among all the elements that are the same as the target element after the target element as the interval element of the target element. Take the distance between the target element and the interval element as the span of the target element. When there is no element that is the same as the target element after the target element, take the distance between the target element and the last element in the source information as the span of the target element. Take the average span of all elements in the source information as the segmentation length.

[0048] The source information is divided into multiple coding segments according to the segmentation length, the length of each coding segment is equal to the segmentation length, and the length of the last coding segment may not be equal to the segmentation length.

[0049] It should be noted that the purpose of the present invention is to use multiple Huffman trees to encode each coding segment separately. If the attacker does not master the Huffman tree, he cannot crack the source information based on the coding result, thereby realizing the encryption of the source information. Since the span of the elements in the source information reflects the interval between the same elements in the source information, the segmentation length obtained according to the mean of the span reflects the average interval between the same elements in the source information, and the number of the same elements contained in each coding segment divided according to the segmentation length is very small, so that when a coding segment is subsequently encoded using the Huffman tree, the same codewords in the coding result are as few as possible, thereby reducing the regularity in the ciphertext.

[0050] So far, multiple encoding segments have been obtained.

[0051] S2: Construct frequency mapping sequence.

[0052] In one embodiment, a key is set , in the key Represents the bifurcation parameter, the value range is ; Represents the initial value parameter, the value range is (0,1); It represents the number of iterations, and its value range is , and L is an integer. Key The bifurcation parameter, initial value parameter and iteration number parameter are parameters in the Logistic chaotic mapping algorithm. Their value ranges are determined by the Logistic chaotic mapping algorithm, and the specific principles will not be described here.

[0053] The same elements in the source information are regarded as a coding object, and the number of coding objects in the source information is counted, denoted as . According to the key Use the Logistic chaotic mapping algorithm to generate a length of A chaotic sequence of is the number of coding segments, It is the preset supplementary number to prevent the frequency mapping sequence length from being insufficient during subsequent encryption. The implementer can set it according to the actual implementation situation, for example . The elements to the last element constitute a frequency mapping sequence.

[0054] It should be noted that each element in the chaotic sequence obtained by the Logistic chaotic mapping algorithm is a decimal in the range of (0,1), so each element in the obtained frequency mapping sequence is in the range of (0,1).

[0055] In other embodiments, the implementer may also use other methods to obtain the frequency mapping sequence, such as randomly generating a sequence whose element values ​​are all in the range of (0,1) as a key, and the key is the frequency mapping sequence. For example, other chaotic mapping algorithms are used to obtain the frequency mapping sequence, and the corresponding key needs to be set according to the chaotic mapping algorithm used.

[0056] At this point, the frequency mapping sequence is acquired.

[0057] S3: Encrypt the coding segments one by one, and the coding results of all coding segments constitute the ciphertext of the source information.

[0058] Specifically, for the current coding segment to be encoded, the same element in the source information is a coding object, a frequency is assigned to each coding object according to the frequency mapping sequence, and a Huffman tree is constructed according to the frequency of the coding object. The Huffman tree is judged, including: determining the preference of the Huffman tree according to the difference between the codewords of the coding objects in all the encoded coding segments and the codewords of the corresponding coding objects in the Huffman tree, and the preference is positively correlated with the difference; in response to the preference being greater than a preset preference threshold, the coding segment is encoded using the Huffman tree, otherwise, a frequency is reassigned to each coding object according to the frequency mapping sequence, a new Huffman tree is constructed according to the reassigned frequency, the new Huffman tree is judged, and the process is repeated until the coding of the current coding segment to be encoded is completed and the iteration is stopped.

[0059] The implementers may set the preferred threshold value according to the actual implementation situation, for example, the preferred threshold value is 0.9.

[0060] In one embodiment, allocating a frequency to each coding object according to a frequency mapping sequence includes:

[0061] The first N unused elements in the frequency mapping sequence constitute a frequency mapping subsequence, the frequency mapping subsequence is linearly normalized, and each element in the normalized frequency mapping subsequence is sequentially assigned to each coding object as the frequency of each coding object, where N represents the number of types of coding objects.

[0062] It should be noted that in Huffman coding, the sum of the frequencies of each coding object is required to be 1. However, the sum of all elements in the frequency mapping subsequence is not necessarily 1. Therefore, the present invention linearly normalizes the frequency mapping subsequence so that the sum of the elements in the normalized frequency mapping subsequence is 1, thereby making the sum of the frequencies of each coding object 1.

[0063] In other embodiments, implementers may also randomly select N elements in the frequency mapping sequence to form a frequency mapping subsequence, or select N elements in the frequency mapping sequence according to other rules to form a frequency mapping subsequence, but the positions of the selected elements or the selection rules need to be recorded.

[0064] It should be noted that when encoding each coding segment, it is necessary to assign a frequency to each coding object so as to construct a corresponding Huffman tree. The change of the frequency assigned to the coding object may not necessarily bring about a change in the Huffman tree. When the Huffman trees corresponding to different coding segments are the same or similar, the codewords of the same coding object in different coding segments may be the same, so that there are certain data regularities in the final ciphertext, which is not conducive to the confidentiality of the source information. Therefore, the present invention determines the preference of the Huffman tree based on the difference between the codewords of the coding objects in all the coded coding segments and the codewords of the coding objects corresponding to the current Huffman tree species. The preference can reflect the difference in the Huffman trees corresponding to different coding segments. When the difference is greater, the data regularity in the final ciphertext is weaker, and the confidentiality of the source information is stronger, making it difficult for attackers to forge the source information of the medical device.

[0065] In one embodiment, determining the preference of the Huffman tree according to the difference between the codewords of the coding objects in all the coded coding segments and the codewords of the corresponding coding objects in the Huffman tree includes:

[0066] ;

[0067] In the formula, Indicates the optimization degree of the current Huffman tree; Indicates the number of all coded segments that have been coded; Indicates the sequence number of the encoded code segment; Indicates the encoded The first The length of the codeword of the encoding object; Indicates the encoded The first The length of the codeword corresponding to the encoding object in the current Huffman tree; Indicates the encoded The first The number of bits that are different between the codeword of the encoding object and the corresponding codeword of the encoding object in the current Huffman tree. It should be noted that when counting the number of bits that are different between codewords, only the parts with the same length need to be compared, such as the encoded The first The code word corresponding to the encoding object is 00100, and the code word corresponding to the encoding object in the current Huffman tree is 1110. Then, 0010 and 1110 in 00100 are compared, and the number of different bits is 2; Indicates the encoded The number of types of coding objects contained in the coding segment; represents the hyperbolic tangent function; represents the minimum function; Represents the absolute value symbol.

[0068] In the formula, Indicates the encoded The first The difference between the length of the codeword of the coded object and the length of the corresponding codeword of the coded object in the current Huffman tree. The larger the length difference, the larger the length difference. The greater the difference in layer depth between the node corresponding to the coding object in the Huffman tree corresponding to the coding segment and the node corresponding to the coding object in the current Huffman tree; Indicates the encoded The first The degree of non-repetition between the codeword of the first encoding object and the corresponding codeword of the encoding object in the current Huffman tree. The greater the degree of non-repetition, the more The greater the difference between the path between the root node in the Huffman tree corresponding to the encoding segment and the node corresponding to the encoding object in the current Huffman tree, the Can reflect the encoded The first The difference between the codeword of the first encoding object and the corresponding codeword of the encoding object in the current Huffman tree can also reflect the encoded The structural difference between the node corresponding to the coding object in the Huffman tree corresponding to the coding segment and the node corresponding to the coding object in the current Huffman tree.

[0069] but Reflects the coded All coded objects contained in the coded segment are The structural difference between the Huffman tree corresponding to the first coded segment and the corresponding node in the current Huffman tree is due to the coded The coded objects not included in the coded segment do not use the coded The Huffman tree corresponding to the coded segment is encoded, so there is no need to pay attention to the coded The structural differences between the nodes corresponding to the coded objects not included in the coded segments in the two Huffman trees can be used. To reflect the encoded The overall structural difference between the Huffman tree corresponding to the coding segment and the current Huffman tree; when the overall structural difference is greater, the two Huffman trees are used to encode the same data, the greater the difference in the encoding results, the weaker the regularity in the ciphertext, and the more resistant to statistical analysis attacks; conversely, when the overall structural difference is smaller, the two Huffman trees are used to encode the same data, the smaller the difference in the encoding results, the stronger the regularity in the ciphertext, and the easier it is to be used for statistical analysis attacks. The overall structural differences corresponding to all encoded coding segments are averaged to obtain the optimization degree of the current Huffman tree.

[0070] In another embodiment, the determining of the preference of the Huffman tree according to the difference between the codewords of the coding objects in all the coded coding segments and the codewords of the corresponding coding objects in the Huffman tree comprises:

[0071] ;

[0072] In the formula, Indicates the optimization degree of the current Huffman tree; Indicates the number of all coded segments that have been coded; Indicates the sequence number of the encoded code segment; Indicates the encoded The first The length of the codeword of the encoding object; Indicates the encoded The first The length of the codeword corresponding to the encoding object in the current Huffman tree; Indicates the encoded The first The number of bits that differ between the codeword of the encoding object and the corresponding codeword of the encoding object in the current Huffman tree; Indicates the encoded The number of types of coding objects contained in the coding segment; represents the hyperbolic tangent function; represents the minimum function; Represents the absolute value symbol.

[0073] In the formula, Indicates the encoded The serial number coefficient of the coding segment is The larger the value, the more The closer the coded segment is to the current coded segment, the The overall structural difference between the Huffman tree corresponding to the coding segment and the current Huffman tree The smaller the number, the The code words corresponding to the same coding object in the current coding segment are the same or similar, which makes the local regularity in the ciphertext stronger; when The smaller the value, the more The farther the coded segment is from the current coded segment, the The overall structural difference between the Huffman tree corresponding to the coding segment and the current Huffman tree The smaller the number, the The first coding segment is the same or similar to the codeword corresponding to the same coding object in the current coding segment to be coded. These same or similar codewords are separated by multiple coding segments and have scattered regularities. Since the local regularity of data is easier to mine than the scattered regularity, the present invention will be the first coded segment. The sequence number coefficient of the coding segment As an overall structural difference The attention weight is The larger the value, the more attention is paid to the encoded The overall structural differences corresponding to the coding segments are The smaller the size, the less attention is paid to the encoded The overall structural differences corresponding to the coded segments are weighted and summed to obtain the optimality of the current Huffman tree.

[0074] In one embodiment, re-assigning frequencies to each encoding object according to a frequency mapping sequence includes:

[0075] The element corresponding to the first element in the frequency mapping subsequence in the frequency mapping sequence is marked as a used element, the first N unused elements in the frequency mapping sequence constitute a new frequency mapping subsequence, the new frequency mapping subsequence is linearly normalized, and each element in the normalized new frequency mapping subsequence is sequentially assigned to each coding object as the frequency of each coding object, where N represents the number of types of coding objects.

[0076] It should be noted that, after the coding segment to be coded is encoded using the current Huffman tree, the corresponding element of each element in the corresponding frequency mapping subsequence in the frequency mapping sequence is a used element. This ensures that when allocating frequencies to different coding segments according to the frequency mapping subsequence, the elements in the frequency mapping sequence will not be repeatedly allocated to different coding segments.

[0077] In other embodiments, the implementer may also randomly select N elements in the frequency mapping sequence to form a new frequency mapping subsequence, or select N elements in the frequency mapping sequence according to other rules to form a new frequency mapping subsequence, but it is necessary to record the positions of the selected elements or the selection rules, and the selected new frequency mapping subsequence cannot be the same as the previous frequency mapping subsequence.

[0078] S4: Decrypt the ciphertext of the source information to obtain the source information.

[0079] The frequency mapping sequence is constructed using the method in S2. The ciphertext of the source information is decrypted to obtain multiple coded segments in sequence, and all the decoded coded segments are concatenated together as the source information.

[0080] The process of decrypting a coding segment includes: assigning a frequency to each coding object according to the frequency mapping sequence, and constructing a Huffman tree according to the frequency of the coding object. The Huffman tree is judged, including: determining the preference of the Huffman tree according to the difference between the codewords of the coding objects in all decoded coding segments and the codewords of the corresponding coding objects in the Huffman tree, and in response to the preference being greater than a preset preference threshold, continuing to decode the ciphertext of the source information using the Huffman tree, and when the decoding obtains When the element elements as a coding segment, where is the length of each coding segment; otherwise, the frequency is reallocated to each coding object according to the frequency mapping sequence, a new Huffman tree is constructed according to the reallocated frequency, the new Huffman tree is judged, and the process is repeated until a coding segment is obtained after decoding and the iteration is stopped.

[0081] It should be noted that, when encrypting, the preference of the Huffman tree is determined according to the difference between the codeword of the coded object in all the coded segments and the codeword of the corresponding coded object in the Huffman tree, and when decrypting, the preference of the Huffman tree is determined according to the difference between the codeword of the coded object in all the decoded coded segments and the codeword of the corresponding coded object in the Huffman tree. The encryption and decryption processes are both performed sequentially, so when encrypting a coded segment, all the coded segments before the coded segment in the source information are all the coded segments that have been coded, and when decrypting the same coded segment, all the coded segments before the coded segment in the source information are all the coded segments that have been decoded. Therefore, when encrypting and decrypting, all the coded segments that have been coded are the same as all the coded segments that have been decoded, so that the preference obtained during encryption is the same as the preference obtained during decryption, thus ensuring that the Huffman trees used during encryption and decryption are the same, so that the coded segment can be decoded smoothly.

[0082] At this point, the ciphertext of the source information has been decrypted and the source information has been obtained.

[0083] The embodiment of the present invention further discloses a medical device product information tracing system, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a medical device product information tracing method according to the present invention is implemented.

[0084] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0085] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

[0086] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for tracing medical device product information, wherein an information tracing platform verifies the query information, and after the verification is passed, queries the source information of the medical device, and encrypts the source information so that the information query client provides the source information of the medical device to the consumer based on the ciphertext of the source information, characterized in that: The encryption includes: Dividing the source information into multiple coding segments of the same length, including: for a target element in the source information, obtaining the element with the smallest distance to the target element from all elements that are the same as the target element after the target element as the interval element of the target element, taking the distance between the target element and the interval element as the span of the target element, if there is no element that is the same as the target element after the target element, taking the distance from the target element to the last element in the source information as the span of the target element; taking the average of the spans of all elements in the source information as the segmentation length; dividing the source information into multiple coding segments, the length of each coding segment is equal to the segmentation length; constructing a frequency mapping sequence, wherein the frequency mapping sequence includes multiple decimals in the range of (0,1); Encrypting the coding segments in sequence includes: treating the same elements in the source information as a coding object, assigning a frequency to each coding object according to a frequency mapping sequence, constructing a Huffman tree according to the frequency of the coding object, and determining the preference of the Huffman tree according to the difference between the codewords of the coding objects in all the coded coding segments and the codewords of the corresponding coding objects in the Huffman tree, wherein the preference satisfies the expression: ; In the formula, Represents the optimization degree of the Huffman tree; Indicates the number of all coded segments that have been coded; Indicates the sequence number of the encoded code segment; Indicates the encoded The first The length of the codeword of the encoding object; Indicates the encoded The first The length of the codeword corresponding to the encoding object in the Huffman tree; Indicates the encoded The first The number of bits that differ between a codeword of a coding object and the corresponding codeword of the coding object in the Huffman tree; Indicates the encoded The number of types of coding objects contained in the coding segment; represents the hyperbolic tangent function; represents the minimum function; Or the preference satisfies the expression: ; In the formula, Represents the optimization degree of the Huffman tree; Indicates the number of all coded segments that have been coded; Indicates the sequence number of the encoded code segment; Indicates the encoded The first The length of the codeword of the encoding object; Indicates the encoded The first The length of the codeword corresponding to the encoding object in the Huffman tree; Indicates the encoded The first The number of bits that differ between a codeword of a coding object and the corresponding codeword of the coding object in the Huffman tree; Indicates the encoded The number of types of coding objects contained in the coding segment; represents the hyperbolic tangent function; represents a minimum value function, and the preference is positively correlated with the difference; in response to the preference being greater than a preset preference threshold, the coding segment is encoded using the Huffman tree, otherwise, a frequency is reallocated to each coding object according to the frequency mapping sequence, a new Huffman tree is constructed according to the reallocated frequency, the new Huffman tree is judged, and the process is repeated until the coding of the current coding segment to be encoded is completed and the iteration is stopped; The encoding results of all encoding segments constitute the ciphertext of the source information.

2. A medical device product information tracing method according to claim 1, characterized in that: The constructing of the frequency mapping sequence comprises: Set the key to ( ),in, Represents the bifurcation parameter, the value range is ; Represents the initial value parameter, the value range is (0,1); Indicates the number of iterations parameter, the value range is (30, + ), and L is an integer; A chaotic sequence is generated using a chaotic mapping algorithm according to a key as a frequency mapping sequence.

3. A medical device product information tracing method according to claim 1, characterized in that: The step of dividing the source information into a plurality of coding segments of the same length includes: The source information is divided into multiple coding segments of length a, where a is a preset length.

4. A medical device product information tracing method according to claim 1, characterized in that: The allocating a frequency to each encoding object according to the frequency mapping sequence comprises: N elements are selected from the frequency mapping sequence to form a frequency mapping subsequence, the frequency mapping subsequence is linearly normalized, and each element in the normalized frequency mapping subsequence is sequentially assigned to each coding object as the frequency of each coding object, where N represents the number of types of coding objects.

5. A medical device product information tracing method according to claim 4, characterized in that: The re-allocating frequency for each encoding object according to the frequency mapping sequence comprises: Select N elements in the frequency mapping sequence to form a new frequency mapping subsequence, and the new frequency mapping subsequence cannot be the same as the previous frequency mapping subsequence; The new frequency mapping subsequence is linearly normalized, and each element in the normalized new frequency mapping subsequence is sequentially assigned to each coding object as the frequency of each coding object, where N represents the number of types of coding objects.

6. A medical device product information tracing system, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a medical device product information tracing method according to any one of claims 1 to 5 is implemented.