Health product testing data transmission method and system based on blockchain

By encrypting and sorting in the blockchain based on the hierarchical anomalies and containment priorities of health product testing data, the problem of low traceability efficiency caused by blockchain encryption is solved and more efficient traceability of health product testing data is achieved.

CN118468319BActive Publication Date: 2024-09-06国品优选(北京)品牌管理有限公司
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When the blockchain encrypts health product testing data, it leads to low data traceability efficiency or traceability failure. The main reason is that the encryption is too complicated, which causes the detection data to be stacked too deep in the blockchain, affecting the traceability efficiency.

Method used

By obtaining the detection index data of health products, we determine its hierarchical anomalies and containment priorities, and perform blockchain encryption on the data according to the containment priorities to ensure that high-priority data is placed at the front when encrypted, thereby improving traceability. efficiency.

Benefits of technology

It improves the traceability efficiency of health product testing data and avoids traceability failures. By optimizing the encryption sequence and location, it improves the efficiency of blockchain storage and query.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118468319B
    Figure CN118468319B
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to a method and system for transmitting health product detection data based on blockchain, the method comprising: obtaining detection data of at least one detection index of a target health product to be detected; determining the hierarchical abnormality of the target health product according to the detection data of the detection index, the hierarchical abnormality indicating the possibility of abnormality of the target health product; determining the containment priority of the target health product according to the hierarchical abnormality and the detection data of the target health product; encrypting the detection data by blockchain according to the containment priority to obtain encrypted data; wherein, the higher the containment priority, the closer the encrypted stack position of the block in which the detection data is located when blockchain encryption is performed; transmitting the encrypted data. In this way, the detection data is set to a front encrypted stack position when blockchain encryption is performed, thereby improving the traceability efficiency of the detection data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method and system for transmitting data of health product testing based on blockchain. Background Art

[0002] With the continuous progress of society, people pay more and more attention to health, and various health products have emerged. Health products generally refer to products used to maintain or improve health, such as nutritional supplements, functional foods, and personal care products. Usually, in order to ensure the quality of health products, chemical and physical tests are required. Chemical tests can be used to test the chemical components of the product, such as nutrients and active ingredients; physical tests can be used to evaluate the physical properties of the product, such as quality, density, and color, to obtain the corresponding component content index, microbial content index, safety index, and functional index test data. The test data of these test indicators affect the efficacy and use of health products.

[0003] In some scenarios, in order to ensure data security, the detection data of health products needs to be encrypted, such as using blockchain to encrypt and transmit. When problems occur during the use of health products or there is a need for repurchase, the detection data of health products needs to be traced and analyzed. However, during the encryption process of the blockchain, the detection data of health products is randomly input and encrypted in the blockchain. In order to ensure the encryption security of the blockchain, different blocks will be restrained. In this way, the random input and encryption of the detection data of health products will cause the encryption restraint to be too complicated. Because of the influence of this complexity, the efficiency of tracing the detection data will become low or directly lead to the problem of traceability failure. Summary of the invention

[0004] In order to solve the technical problems of low efficiency or easy failure of traceability of test data, the purpose of the present invention is to provide a method and system for transmitting health product test data based on blockchain. The technical solutions adopted are as follows:

[0005] In a first aspect, an embodiment of the present application provides a blockchain-based method for transmitting health product detection data, including: obtaining detection data of at least one detection indicator of a target health product to be detected; determining the hierarchical abnormality of the target health product based on the detection data of the detection indicator, the hierarchical abnormality indicating the possibility of an abnormality in the target health product, and the hierarchical abnormality is proportional to the possibility of an abnormality in the target health product; determining the containment priority of the target health product based on the hierarchical abnormality and the detection data of the target health product, the containment priority indicating the necessity of tracing the target health product, and the containment priority is proportional to the necessity of tracing the target health product; performing blockchain encryption on the detection data according to the containment priority to obtain encrypted data; wherein, the higher the containment priority, the closer the encryption stack position of the block in which the detection data is located when blockchain encryption is performed; and transmitting the encrypted data.

[0006] Optionally, determining the stratified abnormality of the target health product based on the detection data of the detection indicator includes: determining an abnormal value score of the detection indicator based on the detection data of the detection indicator, the abnormal value score indicating whether the detection data of the detection indicator is abnormal, and the abnormal value score is proportional to the abnormality of the detection data of the detection indicator; determining a first number of abnormal detection indicators for each detection indicator that is abnormal based on the abnormal value score of the detection indicator; and determining the stratified abnormality of the target health product based on the abnormal value score of the detection indicator, the first number, and the second number of the detection indicator.

[0007] Optionally, determining the anomaly score of the detection index based on the detection data includes: determining the normalization constant of the isolation forest based on the total number of target healthy products; determining the average number of segmentation times for the detection data corresponding to the detection index to become isolated points; and determining the anomaly score of the detection data corresponding to the detection index using the normalization constant and the average number of segmentation times.

[0008] Optionally, determining the stratified abnormality of the target health product based on the abnormal value scores of the detection indicators, the first number and the second number of the detection indicators includes: calculating the sum of the first number and a preset value; traversing all the detection indicators, superimposing the abnormal value scores of each detection indicator, and obtaining an abnormal value superposition value; calculating the abnormality ratio of the product of the sum and the abnormal value superposition value and the square of the second number of the detection indicators, the abnormality ratio indicating the stratified abnormality of the target health product.

[0009] Optionally, determining the containment priority of the target health product based on the stratified abnormality and detection data of the target health product includes: normalizing the stratified abnormality of the target health product to obtain normalized stratified abnormality; determining the abnormal detection data of the abnormal detection indicators that are abnormal in each detection indicator, and a first quantity of the abnormal detection indicators; comparing the abnormal detection data of each abnormal detection indicator with the standard data to obtain a first difference result value; determining the difference between the abnormal detection data of the abnormal detection indicator of the current target health product and the detection data of the same detection indicator of other target health products, and superimposing the differences to obtain a second difference result value; determining the containment priority of the target health product based on the normalized stratified abnormality, the first quantity, the first difference result value and the second difference result value.

[0010] Optionally, determining the containment priority of the target health product based on the normalized stratified abnormality, the first quantity, the first difference result value and the second difference result value includes: superimposing the first difference result values ​​of each abnormal detection indicator to obtain a first superimposed value; calculating the ratio of the sum of the first superimposed value and the second difference result value to the first quantity; determining the product of the ratio and the normalized stratified abnormality, the product indicating the necessity of traceability of the detection indicators of the target health product, and the product is proportional to the necessity of traceability; superimposing the necessity of traceability of each detection indicator of the target health product to obtain a second superimposed value; calculating the ratio between the second superimposed value and the second quantity of the detection indicators; normalizing the ratio between the second superimposed value and the second quantity of the detection indicators to obtain a normalized value, the normalized value indicating the containment priority, and the normalized value is proportional to the containment priority.

[0011] Optionally, blockchain encryption of the detection data according to the containment priority includes: inputting the detection data of the detection indicators of the target health product into the blocks of the blockchain and encrypting them in order of the containment priority from low to high, wherein the higher the containment priority, the front of the encryption stack position of the block where the detection data is located in the blockchain.

[0012] Optionally, transmitting the encrypted data includes: transmitting the encrypted data using a hypertext transfer protocol.

[0013] In a second aspect, an embodiment of the present application provides a blockchain-based health product detection data transmission system, including: an acquisition module, used to acquire detection data of at least one detection indicator of a target health product to be detected; a determination module, used to determine the hierarchical abnormality of the target health product based on the detection data of the detection indicator, the hierarchical abnormality indicating the possibility of abnormality in the target health product, and the hierarchical abnormality is proportional to the possibility of abnormality in the target health product; the determination module is also used to determine the containment priority of the target health product based on the hierarchical abnormality and the detection data of the target health product, the containment priority indicating the necessity of tracing the target health product, and the containment priority is proportional to the necessity of tracing the target health product; an encryption module, used to perform blockchain encryption on the detection data according to the containment priority to obtain encrypted data; wherein, the higher the containment priority, the closer the encryption stack position of the block in which the detection data is located when blockchain encryption is performed; a transmission module, used to transmit encrypted data.

[0014] In the third aspect, an embodiment of the present application provides a blockchain-based health product testing data transmission system, which includes: a processor and a memory; wherein the memory is used to store computer programs that can be run on the processor; the processor is used to execute the program stored in the memory to implement the steps of the blockchain-based health product testing data transmission method mentioned in the first aspect above.

[0015] The present invention has the following beneficial effects: by obtaining the detection data of at least one detection index of the target health product to be detected, and then determining the hierarchical abnormality of the target health product according to the detection data of the detection index, the hierarchical abnormality indicates the possibility of abnormality of the target health product, and the hierarchical abnormality is proportional to the possibility of abnormality of the target health product; and then determining the containment priority of the target health product according to the hierarchical abnormality and the detection data of the target health product, the containment priority indicates the necessity of tracing the target health product, and the containment priority is proportional to the necessity of tracing the target health product, and finally encrypting the detection data on the blockchain according to the containment priority to obtain encrypted data, wherein the higher the containment priority, the more forward the encrypted stack position of the block where the detection data is located when the blockchain is encrypted, and finally the encrypted data is transmitted. In this way, before blockchain encryption, the hierarchical abnormality of the detection data of each detection index and the necessity of tracing the source are determined, and the detection data with high traceability necessity are set to a high containment priority, that is, the detection data is set to a forward encrypted stack position when the blockchain is encrypted, thereby improving the traceability efficiency of the detection data. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A flowchart of a blockchain-based health product testing data transmission method provided by an embodiment of the present invention;

[0018] Figure 2 A schematic diagram of the module composition of a blockchain-based health product testing data transmission system provided by an embodiment of the present invention;

[0019] Figure 3 A schematic diagram of the structure of a blockchain-based health product testing data transmission system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a blockchain-based health product detection data transmission method and system proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0021] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0022] In some scenarios, in order to ensure data security, it is necessary to encrypt the test data of health products, such as using blockchain to encrypt and transmit. When problems occur during the use of health products or there is a need for repurchase, the test data of health products needs to be traced and analyzed. However, during the encryption process of the blockchain, the test data of health products is randomly input and encrypted in the blockchain. In order to ensure the encryption security of the blockchain, different blocks will be restrained. In this way, the random input and encryption of the test data of health products will cause the encryption restraint to be too complicated. After analysis, due to the influence of this complexity, the test data that needs to be traced may be in a deeper stack storage area of ​​the blockchain. At this time, the efficiency of traceability will be low or directly lead to the problem of traceability failure.

[0023] The specific scheme of a blockchain-based health product detection data transmission method and system provided by the present invention is described in detail below with reference to the accompanying drawings.

[0024] Embodiment 1:

[0025] See also Figure 1 , which shows a flowchart of a blockchain-based health product detection data transmission method provided by an embodiment of the present invention, including:

[0026] Step S101, obtaining detection data of at least one detection index of the target health product to be detected.

[0027] Specifically, the number of target health products can be multiple, and the types of each target health product can be the same type, including but not limited to functional products, personal care products, and nutritional supplements. The detection indicators include but are not limited to ingredient content indicators (such as milligrams of vitamin C), microbial content indicators (such as bacterial counts), safety indicators (such as heavy metal content), and functional indicators (such as effect evaluation data in clinical trials). The detection data of each of the above indicators can be numerical data, and there are several target health products under different detection indicators. For example, under the biological content indicator, each target health product has a different content value. In this application, the detection data of each detection indicator of the target health product is subsequently encrypted on the blockchain and transmitted.

[0028] Step S103, determining the stratified abnormality of the target health product according to the detection data of the detection index.

[0029] Among them, the stratified abnormality indicates the possibility of abnormality of the target health product, and the stratified abnormality is proportional to the possibility of abnormality of the target health product.

[0030] Specifically, for the target health product, the more abnormal the test data under each test index is, the higher the possibility of tracing the source in subsequent processing. Therefore, the embodiment of the present application uses layered abnormality to indicate the possibility of abnormality in the test data of the target health product. The higher the layered abnormality, the higher the possibility of abnormality in the target health product.

[0031] In a possible implementation, determining the stratified abnormality of the target health product according to the detection data of the detection index includes:

[0032] The abnormality score of the detection indicator is determined according to the detection data of the detection indicator, the abnormality score indicates whether the detection data of the detection indicator is abnormal, and the abnormality score is proportional to the abnormality of the detection data of the detection indicator. Based on the abnormality score of the detection indicator, the first number of abnormal detection indicators of each detection indicator belonging to abnormality is determined, and the hierarchical abnormality of the target health product is determined according to the abnormality score of the detection indicator, the first number and the second number of the detection indicator.

[0033] Specifically, the abnormal value score refers to whether the test data of the test index is abnormal. The higher the abnormal value score, the higher the possibility of abnormality in the test data of the test index. In this application, the threshold can be set to compare the threshold with the abnormal value score. If the abnormal value score exceeds the threshold, it means that the test data of the test index is abnormal, and the more the abnormal value score exceeds the threshold, the greater the possibility of abnormality in the test data of the test index. The test index whose abnormal value score exceeds the threshold is regarded as an abnormal test index belonging to abnormality, and the total number of abnormal test indicators is counted, and the total number of all test indicators is counted. If the test indicators include but are not limited to ingredient content indicators (such as milligrams of vitamin C), microbial content indicators (such as bacterial counts), safety indicators (such as heavy metal content) and functional indicators (such as effect evaluation data in clinical trials), etc., the total number of test indicators is 4.

[0034] When determining the outlier score, the following method can be used: determine the normalization constant of the isolation forest based on the total number of target healthy products; determine the average number of segmentation times for the detection data corresponding to the detection index to become an isolated point; and use the normalization constant and the average number of segmentation times to determine the outlier score of the detection data corresponding to the detection index.

[0035] Specifically, the isolation forest algorithm can be used to calculate the abnormal value score of the detection data of each detection indicator of the target health product. The basic principle of the isolation forest algorithm can be referred to the known technology, and the embodiment of this application will not be repeated here. Among them, the isolation forest algorithm is used to calculate the abnormal value score as follows:

[0036]

[0037] in, Indicates Target health products The abnormal value scores corresponding to the detection data of the detection indicators are: Indicates the total number of target health products involved in the calculation. represents the normalization constant, In the above formula, the higher the isolation score of the test data of the test index, the higher the isolation, and the more likely the test data of the test index corresponding to the target health product is to be abnormal.

[0038] In one possible implementation, the stratified abnormality of the target health product can be calculated in the following manner: calculate the sum of a first quantity and a preset value; traverse all detection indicators, superimpose the abnormal value scores of each detection indicator, and obtain an abnormal value superposition value; calculate the abnormality ratio of the product of the sum and the abnormal value superposition value and the square of the second quantity of the detection indicator, and the abnormality ratio indicates the stratified abnormality of the target health product.

[0039] Specifically, the preset value may be 1, and the following formula may be used to calculate the stratified abnormality of the target health product:

[0040]

[0041] In the above formula, Indicates The hierarchical abnormality corresponding to each target health product; Indicates that the target health product has The detection data of dimensions (i.e. (Second number) detection data of detection indicators), for example, the detection data of the detection indicators can be milligrams of vitamin C, etc. It indicates that the total number (first quantity) of anomaly detection indicators whose anomaly value scores calculated by isolation forest belong to anomalies. It is worth noting that the detection data of healthy products involved in calculating the anomaly value scores are different detection data of different target healthy products under the same detection indicator.

[0042] Furthermore, the specific test data corresponding to different test indicators of the target health products continuously fluctuates within a basic range, but it is guaranteed that the test data meets the basic standard requirements. The purpose of traceability of target health products is to query their specific production objects for repeat purchases or problems, so the layered abnormalities are analyzed in the embodiments of the present application to obtain more abnormal target health products, and the test data of all the corresponding test indicators are advanced in the stack part (encrypted stack position) of the blockchain, in order to improve the traceability efficiency. The higher the isolation score of the test data of the test indicator, the higher the isolation, and the more likely the test data of the test indicator corresponding to the target health product is to be abnormal. At this time, the layered abnormality The calculated mean of the outliers The higher it is, the higher the stratified abnormality. And, in order to accurately quantify the abnormal results corresponding to its detection indicators, the scoring criterion of the result isolation forest is used. When it exceeds the scoring threshold, it is considered that its isolation is high, that is, a certain detection indicator of the target health product satisfies the corresponding abnormal result. The more detection indicators that meet the abnormal results, the higher the corresponding abnormality of the target health product. Therefore, the number of abnormal detection indicators is directly proportional to the stratified abnormality. It is worth noting that the above calculation formula can be described by "calculating the abnormality ratio of the product of the sum and the superposition of the outliers and the square of the second number of the detection indicators, and the abnormality ratio indicates the stratified abnormality", or it can be described by "calculating the mean of the outliers". The product of the ratio between the sum and the second quantity is described as "a product indicating stratified abnormality".

[0043] Step S105, determining the containment priority of the target health product according to the hierarchical abnormality and the detection data of the target health product.

[0044] Among them, the containment priority indicates the necessity of tracing the target health product, and the containment priority is directly proportional to the necessity of tracing the target health product.

[0045] Specifically, the higher the layered abnormality of the target health product's test data, the greater the difference between the test data of its corresponding test indicators and the test data of other health products' test indicators, and the higher the outlier, then the higher the necessity of tracing the test data of the corresponding test indicators; further, the higher its containment priority, because the higher the necessity of traceability, the more forward the corresponding encryption stack position needs to be when the blockchain is encrypted, in order to improve the efficiency of traceability and increase the efficiency of blockchain storage. That is, when the blockchain is encrypted and stacked, the test data with low containment priority is stacked first, and the test data with high containment priority is stacked later, so as to ensure that the encryption stack position corresponding to the test data with high pre-priority is closer to the front. It is worth noting that the necessity of tracing the source of health products is possessed by a single target health product, and it should be noted that the target health products here can be of the same type.

[0046] In a possible implementation, the containment priority of the target health product may be determined in the following manner:

[0047] Normalize the stratified abnormality of the target health product to obtain the normalized stratified abnormality; determine the abnormal detection data of the abnormal detection indicators that are abnormal in each detection indicator, and the first number of the abnormal detection indicators; compare the abnormal detection data of each abnormal detection indicator with the standard data to obtain a first difference result value; determine the difference between the abnormal detection data of the abnormal detection indicator of the current target health product and the detection data of the same detection indicator of other target health products, and superimpose the differences to obtain a second difference result value; determine the containment priority of the target health product according to the normalized stratified abnormality, the first number, the first difference result value and the second difference result value.

[0048] Specifically, standard data refers to the standard ratio when the target health product is produced. Comparing the abnormal detection data of each abnormal detection indicator with the standard data can be to calculate the difference between the abnormal detection data of the abnormal detection indicator and the standard data.

[0049] Furthermore, determining the containment priority of the target health product based on the normalized stratified abnormality, the first quantity, the first difference result value and the second difference result value includes: superimposing the first difference result values ​​of each abnormal detection indicator to obtain a first superimposed value; calculating the ratio of the sum of the first superimposed value and the second difference result value to the first quantity; determining the product of the ratio and the normalized stratified abnormality, the product indicating the necessity of traceability of the detection indicators of the target health product, and the product is proportional to the necessity of traceability; superimposing the necessity of traceability of each detection indicator of the target health product to obtain a second superimposed value; calculating the ratio between the second superimposed value and the second quantity of the detection indicators; normalizing the ratio between the second superimposed value and the second quantity of the detection indicators to obtain a normalized value, the normalized value indicating the containment priority, and the normalized value is proportional to the containment priority.

[0050] The following formula can be used to calculate the necessity of traceability of the test indicators of the target health product:

[0051]

[0052] In the above formula, Indicates The first target health product The necessity of tracing the test data corresponding to each test indicator; represents the stratified abnormality after normalization; The first difference result value obtained by comparing the detection data (abnormal detection data) of the detection indicator (obtained by the isolation forest) indicating the presence of an abnormality with the standard data (the standard ratio when the target health product is produced); A first quantity representing an abnormality detection index satisfied by the target health product; It represents the sum of the differences between the abnormal detection data of the abnormal detection index and the detection data of the same detection index of other target health products (the second difference result value).

[0053] Furthermore, the normalized stratified abnormality of the former is proportional to the necessity of traceability. The larger its value is, the higher the necessity of traceability is, and the higher the possibility that the test data of the target health product's test index is abnormal is. The value after comparing the test data of the test index with the standard data during standard production is quantified. The larger the value, the higher the necessity of traceability of the corresponding test data, which means that the test data deviates more from the original standard data. The sum of the first difference result values ​​under different test indicators The larger it is, the more necessary it is to further determine its corresponding traceability, because the detection index that meets the isolated forest anomaly is indeed abnormal because of the difference between it and the standard data, so the above-mentioned hierarchical anomaly is more referenceable. For the summation coefficient, it is intended to quantify the difference results between the test data of different target health products under the same test indicator. Similarly, the greater the cumulative difference between different target health products under this test indicator, the more abnormal the distribution of the corresponding test data may be, and the more necessary it is to trace the test data of this test indicator.

[0054] Furthermore, the containment priority corresponding to the target health product is determined. The containment priority is the characteristic value corresponding to each target health product. That is, the higher the containment priority, the higher the encrypted stack position of all detection indicators when the target health product is encrypted and stored in the blockchain. The containment priority can be calculated using the following formula:

[0055]

[0056] In the above formula, Indicates The corresponding priority of each target health product, It represents normalization, wherein the larger the normalized value of the superposition value of the necessity of traceability of the test data of different test indicators of the target health product and the ratio of the second quantity is, the higher the containment priority of the target health product is.

[0057] Step S107, encrypting the detection data by blockchain according to the containment priority to obtain encrypted data.

[0058] Among them, the higher the containment priority, the closer the encryption stack position of the block where the data is located will be when blockchain encryption is performed.

[0059] Specifically, in the process of transmitting the test data of each test indicator of the target health product, due to its high privacy and necessary traceability, blockchain encryption transmission is required. However, due to the restraint of blockchain on data encryption, it will lead to efficiency problems in traceability. In order to solve the traceability efficiency problem caused by blockchain encryption, the root cause of its low efficiency is analyzed, that is, when the test data value of the test indicator is encrypted by blockchain, it is randomly input, and does not have the basic characteristics of the test data of the original test indicator. The test data that needs to be traced may be in a deeper stack storage area of ​​the blockchain, then the efficiency of traceability will be lower. Therefore, the test data of the test indicators of the target health product are feature analyzed, and the input order of it into the blockchain is optimized, rather than using the conventional random input to the blockchain.

[0060] Among them, blockchain encryption of detection data according to containment priority includes: inputting the detection data of the detection indicators of the target health product into the block of the blockchain and encrypting them in order of containment priority from low to high, wherein the higher the containment priority, the closer the encryption stack position of the block where the detection data is located in the blockchain.

[0061] Specifically, in order of the priority of containment from low to high, the detection data of the detection indicators of the target health products are input into the blocks of the blockchain in sequence, that is, the detection data of the corresponding detection indicators of the target health products with lower priority of containment are input into the blockchain first. When the blockchain is encrypted, the detection data of the corresponding detection indicators of the target health products with lower priority of containment are pushed into the stack first, and the detection data of the corresponding detection indicators of the target health products with higher priority of containment are pushed into the stack later. In this way, the closer the encrypted stack position of the detection data of the detection indicators pushed into the stack later is, the higher the necessity of its corresponding traceability is, in order to increase the efficiency of such detection data in traceability. For example, when the value of the containment priority is 1, the target health product is pushed into the stack and encrypted and stored at the end when it is encrypted in the blockchain, in order to advance its corresponding encrypted stack position and increase the corresponding traceability efficiency. In addition, storing such detection data in the encrypted stack area (stack storage area) of the front blockchain helps to accurately analyze and improve the corresponding encrypted storage efficiency. This is because the detection data with characteristics has a higher volatility than other detection data. The detection data with other types of relatively consistent detection data can be encrypted and stored through a high-efficiency storage method, thereby improving the encryption storage efficiency of the data.

[0062] Step S109, transmitting encrypted data.

[0063] Specifically, after obtaining the encrypted data, the encrypted health product testing data is encapsulated into a format acceptable to the blockchain, each block is hashed, and the new block is linked to the existing blockchain, aiming to ensure the integrity and immutability of the chain, thereby improving data security.

[0064] Furthermore, a secure data transmission protocol, such as HyperText Transfer Protocol Secure (HTTPS) or a custom protocol using Transport Layer Security (TLS), can be selected to protect the security of the test data of the target health product during transmission. Alternatively, a virtual private network (VPN) or other tunneling technology can be used to further protect the security of the test data during transmission.

[0065] Before the encrypted test data of the target health product reaches the destination, it is verified by the nodes on the blockchain network using a consensus algorithm to ensure the correctness and integrity of the test data. During the verification process, each node can use a consensus mechanism such as Proof of Authority (PoA) or Delegated Proof of Stake (DPoS) to improve efficiency and security. Furthermore, after the test data of the target health product's test indicators arrive at the destination, it is stored on the blockchain and a strict access control policy is applied to ensure that only authorized participants can access the test data. Multi-signatures or other technologies are used to ensure that key operations (such as modification or access to test data) require multi-party authentication.

[0066] Furthermore, a corresponding unique identifier can be provided for the test data and blockchain of each target health product's test indicator, so as to facilitate tracking and verification of data sources and data history when necessary, realize event recording and audit log functions, and facilitate viewing of the access history and processing history of test data at any time.

[0067] Through the technical solution disclosed in the embodiment of the present application, by obtaining the detection data of at least one detection index of the target health product to be detected, and then determining the layered abnormality of the target health product according to the detection data of the detection index, the layered abnormality indicates the possibility of abnormality of the target health product, and the layered abnormality is proportional to the possibility of abnormality of the target health product; and then determining the containment priority of the target health product according to the layered abnormality and the detection data of the target health product, the containment priority indicates the necessity of tracing the target health product, and the containment priority is proportional to the necessity of tracing the target health product, and finally encrypting the detection data on the blockchain according to the containment priority to obtain encrypted data, wherein the higher the containment priority, the more forward the encrypted stack position of the block where the detection data is located when the blockchain is encrypted, and finally transmit the encrypted data. In this way, before blockchain encryption, the layered abnormality of the detection data of each detection index and the necessity of tracing the source are determined, and the detection data with high traceability necessity are set to a high containment priority, that is, the detection data is set to a forward encrypted stack position when the blockchain is encrypted, so as to improve the traceability efficiency of the detection data.

[0068] Embodiment 2:

[0069] Corresponding to the blockchain-based health product detection data transmission method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides a blockchain-based health product detection data transmission system. Figure 2 A schematic diagram of the module composition of a health product detection data transmission system based on blockchain provided in an embodiment of the present application. The health product detection data transmission system based on blockchain is used to execute Figure 1 The described blockchain-based health product testing data transmission method, such as Figure 2 As shown, the blockchain-based health product detection data transmission system 200 includes: an acquisition module 201, which is used to obtain detection data of at least one detection indicator of the target health product to be detected; a determination module 202, which is used to determine the hierarchical abnormality of the target health product according to the detection data of the detection indicator, the hierarchical abnormality indicates the possibility of abnormality of the target health product, and the hierarchical abnormality is proportional to the possibility of abnormality of the target health product; the determination module 202 is also used to determine the containment priority of the target health product according to the hierarchical abnormality and the detection data of the target health product, the containment priority indicates the necessity of tracing the target health product, and the containment priority is proportional to the necessity of tracing the target health product; an encryption module 203, which is used to perform blockchain encryption on the detection data according to the containment priority to obtain encrypted data; wherein, the higher the containment priority, the closer the encryption stack position of the block in which the detection data is located when blockchain encryption is performed; a transmission module 204, which is used to transmit encrypted data.

[0070] Through the technical solution disclosed in the embodiment of the present application, by obtaining the detection data of at least one detection index of the target health product to be detected, and then determining the layered abnormality of the target health product according to the detection data of the detection index, the layered abnormality indicates the possibility of abnormality of the target health product, and the layered abnormality is proportional to the possibility of abnormality of the target health product; and then determining the containment priority of the target health product according to the layered abnormality and the detection data of the target health product, the containment priority indicates the necessity of tracing the target health product, and the containment priority is proportional to the necessity of tracing the target health product, and finally encrypting the detection data on the blockchain according to the containment priority to obtain encrypted data, wherein the higher the containment priority, the more forward the encrypted stack position of the block where the detection data is located when the blockchain is encrypted, and finally transmit the encrypted data. In this way, before blockchain encryption, the layered abnormality of the detection data of each detection index and the necessity of tracing the source are determined, and the detection data with high traceability necessity are set to a high containment priority, that is, the detection data is set to a forward encrypted stack position when the blockchain is encrypted, so as to improve the traceability efficiency of the detection data.

[0071] In a possible implementation, the determination module 202 is also used to determine an abnormality score of the detection indicator based on the detection data of the detection indicator, the abnormality score indicates whether the detection data of the detection indicator is abnormal, and the abnormality score is proportional to the abnormality of the detection data of the detection indicator; determine a first number of abnormal detection indicators that are abnormal for each detection indicator based on the abnormality score of the detection indicator; determine the stratified abnormality of the target health product based on the abnormality score of the detection indicator, the first number, and the second number of the detection indicator.

[0072] In one possible implementation, the determination module 202 is also used to determine the normalization constant of the isolation forest based on the total number of target health products; determine the average number of segmentation times when the detection data corresponding to the detection index becomes an isolated point; and use the normalization constant and the average number of segmentation times to determine the abnormal value score of the detection data corresponding to the detection index.

[0073] In a possible implementation, the determination module 202 is also used to calculate the sum of the first quantity and the preset value; traverse all the detection indicators, superimpose the abnormal value scores of each detection indicator, and obtain the abnormal value superposition value; calculate the abnormality ratio of the product of the sum and the abnormal value superposition value and the square of the second quantity of the detection indicator, and the abnormality ratio indicates the stratified abnormality of the target health product.

[0074] In a possible implementation, the determination module 202 is also used to normalize the stratified abnormality of the target health product to obtain the normalized stratified abnormality; determine the abnormal detection data of the abnormal detection indicators that are abnormal in each detection indicator, and the first number of the abnormal detection indicators; compare the abnormal detection data of each abnormal detection indicator with the standard data to obtain a first difference result value; determine the difference between the abnormal detection data of the abnormal detection indicator of the current target health product and the detection data of the same detection indicator of other target health products, and superimpose the differences to obtain a second difference result value; determine the containment priority of the target health product according to the normalized stratified abnormality, the first number, the first difference result value and the second difference result value.

[0075] In one possible implementation, the determination module 202 is also used to superimpose the first difference result values ​​of each abnormal detection indicator to obtain a first superimposed value; calculate the ratio of the sum of the first superimposed value and the second difference result value to the first quantity; determine the product of the ratio and the normalized hierarchical abnormality, the product indicates the necessity of traceability of the detection indicators of the target health product, and the product is proportional to the necessity of traceability; superimpose the necessity of traceability of each detection indicator of the target health product to obtain a second superimposed value; calculate the ratio between the second superimposed value and the second quantity of the detection indicators; normalize the ratio between the second superimposed value and the second quantity of the detection indicators to obtain a normalized value, the normalized value indicates the containment priority, and the normalized value is proportional to the containment priority.

[0076] In one possible implementation, the encryption module 203 is also used to input and encrypt the detection data of the detection indicators of the target health products into the blocks of the blockchain in order of containment priority from low to high, wherein the higher the containment priority, the closer the encryption stack position of the block where the detection data is located in the blockchain.

[0077] In a possible implementation, the transmission module 204 is further configured to transmit encrypted data using the Hypertext Transfer Protocol.

[0078] It should be noted that the blockchain-based health product detection data transmission system provided in the embodiment of the present application and the blockchain-based health product detection data transmission method provided in the embodiment of the present application are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned blockchain-based health product detection data transmission method, and has the same or similar beneficial effects, and the repetitions will not be repeated.

[0079] Embodiment three:

[0080] Corresponding to the blockchain-based health product detection data transmission method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides a blockchain-based health product detection data transmission system, which is used to execute the blockchain-based health product detection data transmission method. Figure 3 A schematic diagram of a blockchain-based health product testing data transmission system for implementing each embodiment of the present application is shown below: Figure 3 The blockchain-based health product testing data transmission system may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and memory 302, the memory 302 is used to store computer programs that can be run on the processor, and the processor is used to execute the program stored in the memory to achieve the above Figure 1 The various steps in the method embodiment. Among them, the memory 302 can be a short-term storage or a persistent storage. The application stored in the memory 302 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the health product detection data transmission system based on blockchain.

[0081] Furthermore, the processor 301 can be configured to communicate with the memory 302 to execute a series of computer executable instructions in the memory 302 on the blockchain-based health product detection data transmission system. The blockchain-based health product detection data transmission system can also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input and output interfaces 305, and one or more keyboards 306.

[0082] Specifically in this embodiment, the blockchain-based health product detection data transmission system includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to achieve the above Figure 1 The various steps in the method embodiment are similar to those in the method embodiment, and have the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present application will not be described again here.

[0083] It should be noted that the blockchain-based health product detection data transmission system provided in the embodiment of the present application and the blockchain-based health product detection data transmission method provided in the embodiment of the present application are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned blockchain-based health product detection data transmission method, and has the same or similar beneficial effects, and the repetitions will not be repeated.

[0084] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0085] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A method for transmitting health product testing data based on blockchain, characterized in that: The blockchain-based health product testing data transmission method includes: Acquire detection data of at least one detection index of the target health product to be detected; Determine the stratified abnormality of the target health product according to the detection data of the detection index, the stratified abnormality indicates the possibility of the target health product being abnormal, and the stratified abnormality is proportional to the possibility of the target health product being abnormal; Determining the containment priority of the target health product according to the layered abnormality of the target health product and the detection data, wherein the containment priority indicates the necessity of tracing the target health product, and the containment priority is proportional to the necessity of tracing the target health product; Blockchain encryption is performed on the detection data according to the containment priority to obtain encrypted data; wherein the higher the containment priority, the closer the encryption stack position of the block in which the detection data is located is when blockchain encryption is performed; transmitting the encrypted data; The determining of the stratified abnormality of the target health product according to the detection data of the detection index includes: Determining an abnormality score of the detection indicator according to the detection data of the detection indicator, the abnormality score indicating whether the detection data of the detection indicator is abnormal, and the abnormality score is proportional to the abnormality of the detection data of the detection indicator; Determining a first number of abnormal detection indicators for which each of the detection indicators is abnormal based on the abnormal value scores of the detection indicators; Determining the hierarchical abnormality of the target health product according to the abnormal value score of the detection index, the first quantity, and the second quantity of the detection index; Determining the abnormal value score of the detection index according to the detection data includes: determining a normalization constant of the isolation forest according to the total number of target healthy products; Determine the average number of times the detection data corresponding to the detection index becomes an isolated point; Determine an abnormal value score of the detection data corresponding to the detection index by using the normalization constant and the average number of segmentation times; The step of determining the hierarchical abnormality of the target health product according to the abnormal value score of the detection index, the first quantity, and the second quantity of the detection index includes: Calculating a sum of the first number and a preset value; Traversing all detection indicators, superimposing the abnormal value scores of each detection indicator to obtain an abnormal value superposition value; Calculating an abnormality ratio of the product of the sum value and the abnormal value superposition value to the square of the second quantity of the detection index, the abnormality ratio indicating the hierarchical abnormality of the target health product; The determining of the containment priority of the target health product according to the layered abnormality of the target health product and the detection data comprises: Normalizing the stratified abnormality of the target health product to obtain normalized stratified abnormality; Determine abnormal detection data of abnormal detection indicators that are abnormal among the detection indicators, and a first number of the abnormal detection indicators; Comparing the abnormal detection data of each abnormal detection indicator with the standard data respectively to obtain a first difference result value; Respectively determine the difference between the abnormal detection data of the abnormal detection index of the current target health product and the detection data of the same detection index of other target health products, and superimpose the differences to obtain a second difference result value; determining the containment priority of the target health product according to the normalized hierarchical abnormality, the first quantity, the first difference result value, and the second difference result value; The determining of the containment priority of the target health product according to the normalized hierarchical abnormality, the first quantity, the first difference result value, and the second difference result value comprises: Superimposing the first difference result values ​​of each of the abnormality detection indicators to obtain a first superimposed value; Calculate the ratio of the sum of the first superposition value and the second difference result value to the first number; Determine a product of the ratio and the normalized hierarchical abnormality, the product indicating the necessity of traceability of the detection index of the target health product, and the product is proportional to the necessity of traceability; Superimposing the traceability necessity of each of the detection indicators of the target health product to obtain a second superposition value; Calculating a ratio between the second superposition value and a second quantity of the detection index; A ratio between the second superposition value and the second quantity of the detection index is normalized to obtain a normalized value, wherein the normalized value indicates the containment priority, and the normalized value is proportional to the containment priority.

2. The method for transmitting health product detection data based on blockchain according to claim 1 is characterized in that: The blockchain encryption of the detection data according to the containment priority includes: In order of the containment priority from low to high, the detection data of the detection indicators of the target health product are input into the block of the blockchain and encrypted in sequence, wherein the higher the containment priority, the closer the encryption stack position of the block where the detection data is located in the blockchain.

3. The method for transmitting health product detection data based on blockchain according to claim 1 is characterized in that: The transmitting the encrypted data comprises: The encrypted data is transmitted using the Hypertext Transfer Protocol.

4. A health product testing data transmission system based on blockchain, characterized in that: The blockchain-based health product testing data transmission system includes: An acquisition module, used to acquire detection data of at least one detection index of a target health product to be detected; a determination module, configured to determine the stratified abnormality of the target health product according to the detection data of the detection index, wherein the stratified abnormality indicates the possibility that the target health product is abnormal, and the stratified abnormality is proportional to the possibility that the target health product is abnormal; The determination module is further used to determine the containment priority of the target health product according to the hierarchical abnormality of the target health product and the detection data, wherein the containment priority indicates the necessity of tracing the target health product, and the containment priority is proportional to the necessity of tracing the target health product; an encryption module, configured to perform blockchain encryption on the detection data according to the containment priority to obtain encrypted data; wherein the higher the containment priority, the closer the encryption stack position of the block in which the detection data is located is when blockchain encryption is performed; A transmission module, used for transmitting the encrypted data; The determining of the stratified abnormality of the target health product according to the detection data of the detection index includes: Determining an abnormality score of the detection indicator according to the detection data of the detection indicator, the abnormality score indicating whether the detection data of the detection indicator is abnormal, and the abnormality score is proportional to the abnormality of the detection data of the detection indicator; Determining a first number of abnormal detection indicators for which each of the detection indicators is abnormal based on the abnormal value scores of the detection indicators; Determining the hierarchical abnormality of the target health product according to the abnormal value score of the detection index, the first quantity, and the second quantity of the detection index; Determining the abnormal value score of the detection index according to the detection data includes: determining a normalization constant of the isolation forest according to the total number of target healthy products; Determine the average number of times the detection data corresponding to the detection index becomes an isolated point; Determine an abnormal value score of the detection data corresponding to the detection index by using the normalization constant and the average number of segmentation times; The step of determining the hierarchical abnormality of the target health product according to the abnormal value score of the detection index, the first quantity, and the second quantity of the detection index includes: Calculating a sum of the first number and a preset value; Traversing all detection indicators, superimposing the abnormal value scores of each detection indicator to obtain an abnormal value superposition value; Calculating an abnormality ratio of the product of the sum value and the abnormal value superposition value to the square of the second quantity of the detection index, the abnormality ratio indicating the hierarchical abnormality of the target health product; The determining of the containment priority of the target health product according to the layered abnormality of the target health product and the detection data comprises: Normalizing the stratified abnormality of the target health product to obtain normalized stratified abnormality; Determine abnormal detection data of abnormal detection indicators that are abnormal among the detection indicators, and a first number of the abnormal detection indicators; Comparing the abnormal detection data of each abnormal detection indicator with the standard data respectively to obtain a first difference result value; Respectively determine the difference between the abnormal detection data of the abnormal detection index of the current target health product and the detection data of the same detection index of other target health products, and superimpose the differences to obtain a second difference result value; determining the containment priority of the target health product according to the normalized hierarchical abnormality, the first quantity, the first difference result value, and the second difference result value; The determining of the containment priority of the target health product according to the normalized hierarchical abnormality, the first quantity, the first difference result value, and the second difference result value comprises: Superimposing the first difference result values ​​of each of the abnormality detection indicators to obtain a first superimposed value; Calculate the ratio of the sum of the first superposition value and the second difference result value to the first number; Determine a product of the ratio and the normalized hierarchical abnormality, the product indicating the necessity of traceability of the detection index of the target health product, and the product is proportional to the necessity of traceability; Superimposing the traceability necessity of each of the detection indicators of the target health product to obtain a second superposition value; Calculating a ratio between the second superposition value and a second quantity of the detection index; A ratio between the second superposition value and the second quantity of the detection index is normalized to obtain a normalized value, wherein the normalized value indicates the containment priority, and the normalized value is proportional to the containment priority.

5. A health product testing data transmission system based on blockchain, characterized in that: include: A processor and a memory; wherein the memory is used to store a computer program that can be run on the processor; A processor is used to execute the program stored in the memory to implement the steps of the blockchain-based health product testing data transmission method as described in any one of claims 1 to 3.