CN116976919B - Block chain-based anti-counterfeiting traceability method and system for oral liquid - Google Patents

Block chain-based anti-counterfeiting traceability method and system for oral liquid Download PDF

Info

Publication number
CN116976919B
CN116976919B CN202311234694.0A CN202311234694A CN116976919B CN 116976919 B CN116976919 B CN 116976919B CN 202311234694 A CN202311234694 A CN 202311234694A CN 116976919 B CN116976919 B CN 116976919B
Authority
CN
China
Prior art keywords
production
circulation
data
oral liquid
matrix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311234694.0A
Other languages
Chinese (zh)
Other versions
CN116976919A (en
Inventor
张阳
李晓宁
鲁会林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guopin Optimality Beijing Brand Management Co ltd
Original Assignee
Guopin Optimality Beijing Brand Management Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guopin Optimality Beijing Brand Management Co ltd filed Critical Guopin Optimality Beijing Brand Management Co ltd
Priority to CN202311234694.0A priority Critical patent/CN116976919B/en
Publication of CN116976919A publication Critical patent/CN116976919A/en
Application granted granted Critical
Publication of CN116976919B publication Critical patent/CN116976919B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/018Certifying business or products
    • G06Q30/0185Product, service or business identity fraud
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Economics (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application belongs to the technical field of data processing, and provides an oral liquid anti-counterfeiting tracing method and system based on blockchain, wherein unique identifiers are generated on each bottle of oral liquid; extracting and structuring key information in each link of the oral liquid to obtain a production data matrix and a circulation data matrix; obtaining production controllability indexes for the production data matrix; obtaining a circulation adjustment related index for the circulation data matrix; constructing a key generation function based on the production controllability index and the circulation adjustment related index to generate a key; the user decrypts the encrypted data in the blockchain through the identification code of the oral liquid, so that the anti-counterfeiting tracing of the user on the oral liquid is realized. The privacy protection, tamper resistance and validity verification of the production data and the circulation data are realized by analyzing the data writing in different stages to construct a key generation function.

Description

Block chain-based anti-counterfeiting traceability method and system for oral liquid
Technical Field
The application relates to the technical field of data processing, in particular to an oral liquid anti-counterfeiting tracing method and system based on a blockchain.
Background
The block chain is used for anti-counterfeiting tracing, which is an innovative technical application, and ensures the authenticity and traceability of commodity information by utilizing the characteristics of non-tampering and decentralization of the block chain. By recording information such as production, processing, transportation, sales and the like of the commodity on the blockchain, consumers can view the information at any time, know the source and circulation process of the commodity, and avoid purchasing counterfeit and inferior commodities. On the blockchain, each record is encrypted and verified, thus preventing data tampering and fraud. The method not only protects the rights of consumers, but also improves the commodity quality and the consumer trust, and has positive effects on striking counterfeit commodities and promoting market development. Meanwhile, the blockchain anti-counterfeiting traceability can also promote the collaborative development of an industrial chain, enhance the supervision and management of each link and improve the efficiency and safety of a supply chain. Through the application of the block chain technology, the mutual trust cooperation of consumers and enterprises can be promoted, and the sustainable development of economy is promoted.
Along with the continuous improvement of health consciousness, the safety and quality requirements of people on medicines and health care products are higher and higher. However, there are many fake products in the market at present, especially in the oral liquid field, its anti-fake and traceability problem is especially outstanding. The block chain technology-based anti-counterfeiting and traceability problem of the oral liquid product is solved, and the block chain technology-based anti-counterfeiting and traceability problem is a potential solution. However, in encrypting the oral liquid production and transportation information, security distribution of the secret key to each party may face challenges when the anti-counterfeiting tracing of the multiparty participation. Transmission of the key over the secure channel may result in a key leakage such that encryption becomes invalid. Therefore, there is a need for an improvement in the problem of key distribution.
Disclosure of Invention
In order to solve the technical problems, the application provides an oral liquid anti-counterfeiting tracing method and system based on a blockchain.
According to a first aspect of embodiments of the present application, there is provided an oral liquid anti-counterfeiting tracing method based on blockchain, including:
generating a unique identifier on each bottle of oral liquid, and connecting the identifier serving as a digital identity of the oral liquid to a blockchain network;
extracting key information of the oral liquid in production, circulation and sales links, and carrying out structural treatment on the key information to obtain a production data matrix and a circulation data matrix;
evaluating the controllability of the production process of the single oral liquid by analyzing the change condition of adjacent parameters for the production data matrix to obtain a production controllability index;
evaluating consistency of the circulation process by analyzing the correlation of different issuing link parameters to obtain circulation adjustment correlation indexes;
constructing a key generation function based on the production controllability index and the circulation adjustment related index to generate a key;
and decrypting the encrypted data in the blockchain by the user through the identification code of the oral liquid, so that the anti-counterfeiting traceability of the oral liquid by the user is realized.
In some embodiments of the present invention, extracting key information of the oral liquid in production and circulation links, and performing structural processing on the key information to obtain a production data matrix and a circulation data matrix, where the method includes:
extracting key information of the oral liquid in production, circulation and sales links;
converting the key information into a plurality of binary features through an One-Hot Encoding algorithm;
defining a format structure of data by using JSON structured data, and distributing field names and data types of each piece of information;
and converting the key information into structured data according to predefined fields to obtain a production data matrix and a circulation data matrix.
In some embodiments of the invention, after obtaining the production data matrix and the flow-through data matrix, the method further comprises:
using a merck tree for the production data matrix and the circulation data matrix, taking the generated structured data as input, taking SHA-256 as a key generation function, calculating hash values of the oral liquid, and then combining a plurality of hash values into a larger root hash value;
and recording the root hash value and the structured data into a corresponding block.
In some embodiments of the invention, the production controllability index calculation formula is:
wherein,the serial number of the oral liquid is +.>Production controllability index of oral liquid of (2),. About.>And->Respectively +.>Oral liquid->Normalized production-related parameters +.>Normalized production-related parameters,/->For the mean value of all normalized production-related parameter data, +.>For the number of production related parameters.
In some embodiments of the present invention, obtaining a circulation adjustment correlation index by evaluating a consistency of a circulation process by analyzing a correlation of different issuing link parameters for a circulation data matrix includes:
extraction of the firstSecondary and->The circulation related data in the data issued for the second time is constructed to obtain two circulation related matrixesAnd->
Comparing the flow-through correlation matrixAnd->Preserving the parameter category contained in both matrixes, discarding the parameter category contained in only one matrix to obtain the optimizationCirculation correlation matrix->And->
Computing an optimized flow-through correlation matrixAnd->Covariance matrix>And->
By the covariance matrixAnd->Obtaining a correlation coefficient matrix;
based on the difference between the correlation coefficient matrix and the identity matrix, and combining and optimizing the circulation correlation matrixAnd->And (5) the pearson correlation coefficient between the two to obtain a circulation adjustment correlation index.
In some embodiments of the present invention, the correlation coefficient matrix is: the covariance matrixAnd the covariance matrix->Is a ratio of (2).
In some embodiments of the present invention, the circulation adjustment related index calculating method includes:
wherein,circulation regulation related index for representing secondary product issue, < >>Representing a correlation coefficient matrix between two covariance matrices corresponding to secondary product delivery, ++>Is a unitary matrix->For the number of parameter classes in the two optimized flow-through correlation matrices, < >>Representing a correlation coefficient matrix->And/or identity matrix>Mean value of differences,/>Is->The +.>Relative to the->The +.>Pearson correlation coefficient for each parameter.
In some embodiments of the invention, constructing a key generation function based on the production controllability index and the circulation adjustment related index, generating a key includes:
normalizing the numerical values of the production controllability index and the circulation adjustment related index to obtain a normalized production controllability index and a normalized circulation adjustment related index;
and adopting an advanced encryption standard encryption algorithm, and using the normalized production controllability index and the normalized circulation adjustment related index as input parameters to define a key generation function, wherein the generated key is as follows:
wherein,representing the generated key->Representing a hash function +_>And->Respectively representing a normalized production controllability index and a normalized circulation adjustment related index, < >>Representing a join operator.
According to a second aspect of the embodiments of the present application, there is provided an oral liquid anti-counterfeiting traceability system based on a blockchain, the system including a memory module and a processor module, wherein:
the memory module is used for storing program codes;
the processor module is configured to read the program code stored in the memory module and perform the method according to the first aspect of the embodiments of the present application.
In some embodiments of the present invention, the processor module includes an oral liquid identifier generating sub-module, a key information extracting and processing sub-module, a production controllability index obtaining sub-module, a circulation adjustment related index obtaining sub-module, a key generating sub-module, and an anti-counterfeiting tracing sub-module.
As can be seen from the above embodiments, the anti-counterfeiting traceability method and system for the oral liquid based on the blockchain provided by the embodiments of the present application have the following beneficial effects:
the invention establishes a traceability and anti-counterfeiting solution for the production and sales process of the oral liquid. Each oral liquid product is assigned a unique identification code that is connected to a blockchain network. The production process information and the circulation data are stored encrypted on the blockchain. The production and circulation information is stored in encrypted form on the blockchain, and the data record generates blocks according to the time stamps. The change of the difference value of adjacent parameters on an oral liquid product is analyzed to reflect the parameter change trend in the production process, and a production controllability index is constructed, so that the production data is more stable and predictable by analyzing the change trend among different parameters. Through the analysis, the quality of the product can be monitored, the data privacy of the production process can be protected, and the parameter information is ensured not to be maliciously acquired or tampered. By comparing the data of different issuing links, the parameter change of the encrypted product in the circulation process is facilitated by constructing circulation adjustment related indexes, abnormal change can be identified and measures can be taken, and the integrity of the circulation data of the product is facilitated to be protected. The construction and the derivation of the key generation function use the entropy of the index value to ensure that the key of each block is unique and based on the data characteristics. The encryption mode enhances the confidentiality of data and prevents unauthorized access and decryption. The user can obtain the blockchain information through the product identification code, decrypt the production information by using RSA, and analyze the consistency of the circulation data. According to the invention, the privacy protection, tamper resistance and validity verification of production data and circulation data are realized by analyzing the data writing in different stages to construct the key generation function.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings that are needed in the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a basic flow diagram of an anti-counterfeiting traceability method for an oral liquid based on a blockchain according to an embodiment of the present application;
fig. 2 is a basic flow diagram of a key information structuring processing method provided in an embodiment of the present application;
fig. 3 is a basic flow chart of a method for obtaining a circulation adjustment related index according to an embodiment of the present application;
fig. 4 is a basic composition schematic diagram of an oral liquid anti-counterfeiting traceability system based on blockchain according to an embodiment of the present application.
Detailed Description
In order to make the technical solution of the present invention better understood by those skilled in the art, the technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The following describes in detail an anti-counterfeiting traceability method and system for oral liquid based on blockchain provided in this embodiment with reference to the accompanying drawings.
Fig. 1 is a basic flow diagram of an anti-counterfeiting traceability method for an oral liquid based on a blockchain, which is provided in an embodiment of the present application, and as shown in fig. 1, the method specifically includes the following steps:
s100: unique identifiers are generated on each bottle of oral liquid, and the identifiers are used as the digital identities of the oral liquid to be connected to a blockchain network.
Each oral liquid product is distributed with a unique identification code in the production process, which can be a two-dimensional code, a bar code or an RFID chip. The identification code is used as the digital identity of the product to be connected to the blockchain network, and the blockchain platform is built so as to ensure the expandability of data and the privacy of the data. The detailed information of the oral liquid products is registered on the blockchain, including the date of production, the batch of production, the ingredient information, the manufacturer, etc., and each product generates a unique digital signature according to the date of production. Corresponding blockchain records, such as warehouse-in and warehouse-out time, place, operators and the like, need to be updated in different links of production, circulation and sales of the products. It is worth mentioning that the implementer can select the existing public chain or build the private chain blockchain platform according to the actual situation.
S200: and extracting key information of the oral liquid in production, circulation and sales links, and carrying out structural processing on the key information to obtain a production data matrix and a circulation data matrix.
Fig. 2 is a basic flow chart of a key information structuring processing method provided in an embodiment of the present application, and as shown in fig. 2, the key information structuring processing method specifically includes the following steps:
s201: extracting key information of the oral liquid in the links of production, circulation and sales.
In the process of producing and selling the oral liquid, a plurality of selling links such as producing and packaging, boxing and warehousing, issuing agency, issuing distributor, issuing retail terminal and the like exist, wherein in the issuing links of the oral liquid commodity, a series of operations such as transportation, warehousing time registration, ex-warehouse time registration and the like exist, the operating steps generate new data, the new data are stored in a new block of the blockchain according to the time stamp of the blockchain, and the production, circulation and selling key information extraction of the oral liquid are completed.
S202: the key information is converted into a plurality of binary features by the One-Hot Encoding algorithm.
In the links of production, circulation, sales, etc. of the oral liquid, various key information is generated or recorded, including but not limited to production date, production batch, time of entering and exiting warehouse, place, etc. The data to be recorded is converted into a plurality of binary features through One-Hot Encoding algorithm, and each possible value is mapped into a separate binary feature.
S203: the format structure of the data is defined using JSON structured data, and the field name and the data type of each information are assigned.
The format structure of the data is defined using JSON structured data, and the field name and the data type of each information are assigned.
S204: and converting the key information into structured data according to the predefined fields to obtain a production data matrix and a circulation data matrix.
According to the predefined fields, the extracted original information is converted into structured data, such as a Commodity field in JSON, and the product codes are extracted and filled into the Commodity field, so as to obtain a production data matrix and a circulation data matrix.
Additionally, in some embodiments of the present invention, after obtaining the production data matrix and the flow-through data matrix, the method further comprises:
s205: the Merck tree is used for the production data matrix and the circulation data matrix, the generated structured data is used as input, SHA-256 is used as a key generation function, hash values of the oral liquid are calculated, and then a plurality of hash values are combined into larger root hash values.
S206: and recording the root hash value and the structured data into the corresponding block.
The data structure of the link of the oral liquid goods delivery distributor is as follows:
in the link of delivering the oral liquid goods to the distributor, there areKey information, i.e. there is->The number of fields include, but are not limited to, product code (Commodity), production lot (batch_no), time In warehouse (In_time), time Out warehouse (Out_time), distributor name (Distributor), distributor address (geo_tag), etc. And marks each key information, such as product code (Commodity) as A, production lot (batch_no) as B, its internal data->The nth key data value for the mth product. Hash is a root Hash value obtained through the merck tree, and the root Hash value and the structured data are stored into one block of the blockchain. It should be noted that in an actual blockchain implementation, each key is not necessarily labeled, where the reason for labeling each key is to more intuitively analyze the data.
The structured data is classified into two types of data according to the key information types in the structured data, wherein the first type is production related data, and the interior of the structured data contains data recorded during the production of the oral liquid, including but not limited to production date, production batch, manufacturer, production line, production place, validity period, operator, factory price and the like. The second category is circulation related data, and the data in the second category is data information generated by the oral liquid being delivered from one link to the next link after the production is completed, such as information generated by the oral liquid being delivered from the manufacturer to the agent, including, but not limited to, the name of the distributor, the address of the distributor, the date of delivery, the mode of transportation, the time of transportation, the carrier, the place of storage, the wholesale price, the retail price, the sales representative, the date of sale, etc. It should be noted that, in the data written into the blockchain after the production of the oral liquid commodity, no circulation related data is existed, at this time, the structured data is used as input to generate a pseudo-random number, the pseudo-random number is used to generate a data key pair by using an RSA key generation algorithm, and the production related information is encrypted and written into the blockchain. Circulation related data is generated after the first product release from the manufacturer.
It is assumed here that the oral liquid is delivered to the agent by the manufacturer after the completion of the package, and this delivery is considered as the first commodity delivery. After the agent finishes the warehouse entry, the circulation related key information and the production information generated in the transportation process are encrypted and then written into a new block of the block chain. It should be noted that after each product delivery, only the production information and the circulation related data generated by the product delivery are encrypted and written into the blockchain. Such as: if the second issuing is that the agent issues the product to the dealer, the information written by the dealer only includes the production related information and the circulation related information. Because the key information generated by the first commodity distribution is written into the blockchain in the first distribution process, the circulation related data generated for the first time is not contained in the input information of the second product distribution, and similarly, the circulation related data and the production related data only are contained in the input information of the third distribution, and the circulation related data generated by the first and second distribution are not contained in the input information of the third distribution.
S300: and evaluating the controllability of the single oral liquid production process by analyzing the change condition of adjacent parameters for the production data matrix to obtain a production controllability index.
Taking the data stored during the second delivery as an example for analysis. Firstly, normalizing the structured data which needs to be written in during issuing, and eliminating the influence of dimension. For the important information related to production, the important information related to production is self-evident because the relevant information related to production is written into the blockchain together with the circulation relevant information generated by the distribution when the product is distributed each time, and the relevant information related to production written into the same oral liquid product each time is the same. For a production data matrix, the controllability of the production process of a single oral liquid is evaluated by analyzing the change condition of adjacent parameters, and the production controllability index of the oral liquid is constructedThe production controllability index calculation formula is:
wherein,the serial number of the oral liquid is +.>The production controllability index of the oral liquid; />And->Respectively +.>Oral liquid->Normalized production-related parameters +.>Normalized production-related parameters, such as operators, production lot, factory time, etc., which are specific values for describing various factors in the production process of the oral liquid; />The average value of all normalized production related parameter data is obtained; />For the number of production related parameters.
Representing the summation of the difference values of all two adjacent parameters, the mode shows the parameter change trend of a single oral liquid through the difference value between the adjacent parameters, and the larger the difference value is, the more severe the parameter change is. Since each of the different oral liquids has its own set of production related parameters, they are +.>The values are influenced by the variation between the parameters in the respective parameter sets, so that the production controllability index calculated by each oral liquid product is +.>The repetition rate is very low. Production controllability index->Reflecting the degree of variation among all production parameters of a product, the weaker the degree of variation among the parameters is, the more consistent the variation of the difference value is, +.>The smaller the value, the stronger the stability, regularity and traceability of the production process parameters of the oral liquid are indicated. And because the production related parameter sets among the oral liquids are different, the production controllability index of the oral liquids is +.>The same possibility is very low, with a certain uniqueness.
S400: and evaluating consistency of the circulation process by analyzing the correlation of different issuing link parameters to obtain circulation adjustment correlation indexes.
Fig. 3 is a basic flow chart of a method for acquiring a circulation adjustment related index according to an embodiment of the present application, where, as shown in fig. 3, the method for acquiring a circulation adjustment related index specifically includes the following steps:
s401: extraction of the firstSecondary and->The circulation related data in the data issued for the second time is constructed to obtain two circulation related matrixes +.>And->
For circulation related data information generated during the delivery of the oral liquid product, the data obtained by the delivery of the product can be written into a new block by the description of the steps, and the circulation related data written by the delivery and the circulation related data written by the last delivery are compared and analyzed. Since the present invention takes the data written by the second issuing as an example, the comparison analysis is performed between the data written by the second issuing and the data written by the first issuing. In order to compare the data issued by the two products, the circulation related data in the data issued by the first time and the second time are extracted to construct two circulation related matrixesAnd->
S402: comparing the flow-through correlation matrixAnd->Preserving the parameter category contained in both matrices, discarding the parameter category contained in only one matrix to obtain an optimized flow-through correlation matrix +.>And->
Comparing the flow-through correlation matrixAnd->Only the parameter types contained in two matrixes are reserved, only the parameter type contained in one matrix is abandoned, and the mostObtaining two processed circulation correlation matrixes which are marked as optimized circulation correlation matrixes>And optimizing the flow-through correlation matrix->。/>And->Line number of->The number of oral liquid is the number of columns +.>Is the number of parameters of the flow-through related data.
S403: computing an optimized flow-through correlation matrixAnd->Covariance matrix>And
computing an optimized flow-through correlation matrixAnd optimizing the flow-through correlation matrix->Covariance matrix>Andcovariance matrix->And->For comparing the circulation related data of the two product releases.
S404: by covariance matrixAnd->And obtaining a correlation coefficient matrix.
By covariance matrixAnd->Obtaining a correlation coefficient matrix->The method comprises the following steps: covariance matrixAnd covariance matrix->Ratio of (2), namely:
wherein,is covariance matrix->And->A matrix of correlation coefficients between the two,and->For two optimized flow-through correlation matrices->And->Is a covariance matrix of (a).
S405: based on the difference between the correlation coefficient matrix and the identity matrix, and the optimized flow-through correlation matrixAnd->And (5) the pearson correlation coefficient between the two to obtain a circulation adjustment correlation index.
Correlation matrix for two optimized flowsAnd->Calculating the pearson correlation coefficient of each parameter in each matrix for all parameters in the other matrix>,/>Is->The ith parameter in the matrix is relative to the +.>Pearson correlation coefficient for the j-th parameter in each matrix. Then constructing a matrix U according to all the Pearson correlation coefficients, wherein diagonal elements in the U are two matricesSame parameters +.>Values. This matrix reflects the consistency of the variation of each parameter in the two sets of data. Each element in the matrix U represents the degree of correlation of the changes in the two sets of data over the corresponding parameters. Construction of->And (5) circulating and adjusting related indexes issued by the secondary products. Circulation regulation related index->The calculation method comprises the following steps:
wherein,representing circulation adjustment related indexes issued by secondary products; />Representing a correlation coefficient matrix between two covariance matrices corresponding to secondary product delivery; />Is a unit matrix; />The number of parameter categories in the two optimized flow correlation matrices; />Representing a correlation coefficient matrix->And/or identity matrix>Average of differences of (a), i.e. for a matrix of correlation coefficientsEach element in (2) is calculated to be associated with the identity matrix +.>The difference value of the element at the corresponding position in the table is obtained, and then the average value of all the difference values is taken; />Is->The +.>Relative to the->The +.>Pearson correlation coefficient for each parameter.
By analyzing the covariance matrix of the two matrices to reflect the overall degree of change between the two matrices, for +.>The sum of the squares of (2) may reflect the correlation contribution of the two matrices on each parameter. />Reflecting that the degree of variation of the parameters between the two matrices is analyzed taking into account the internal correlation of the two matrices. />The smaller the parameter variation representing the two matrices, the more consistent the flow-through correlation is. />Is in the meaning ofThe parameter correlation inside the two matrixes and the parameter corresponding relation between the two matrixes are comprehensively considered to evaluate the circulation correlation between the two data sets. It should be noted that, there is no circulation related data in the previous block of the first data to be stored in the product, and the default value of 0 is used.
S500: and constructing a key generation function based on the production controllability index and the circulation adjustment related index to generate a key.
And carrying out normalization processing on the numerical values of the production controllability index and the circulation adjustment related index to ensure that the numerical values are in the same range, thereby obtaining the normalization production controllability index and the normalization circulation adjustment related index. Will normalizeAnd->The values of (2) are respectively expressed as +.>And->
Production of a controllability index using normalization with advanced encryption standard (Advanced Encryption Standard, AES) encryption algorithmAnd normalized flow-through adjustment related indicators->Defining a key generation function as an input parameter, and generating a key as follows:
wherein,representing the generated key->Representing a hash function +_>And->Respectively representing a normalized production controllability index and a normalized circulation adjustment related index, < >>Representing a join operator.
According to the method, the production controllability indexes of all the issued data are calculatedIndex related to flow adjustmentAnd generating a key for each block according to the key generation function rule. The key generated by this block is then combined with the final key in the previous block using the HMAC key derivation function to obtain a longer, more complex derivative key as the final key for this block.
S600: the user decrypts the encrypted data in the blockchain through the identification code of the oral liquid, so that the anti-counterfeiting tracing of the user on the oral liquid is realized.
After the oral liquid products flow into the market, the user can obtain the product identification and the blockchain address according to the unique identification code on each oral liquid product. If the block chain data is the first-time product issued block chain data, decrypting the production information by using the RSA private key to obtain important information such as production date, batch and the like. And analyzing the circulation data and comparing the circulation data with the previous circulation data for the subsequent product delivery. Calculating production controllability indexAnd circulation adjustment related index->Generate key->. Key to be generated using HMAC key derivation function +.>And combining the final key of the block with the final key of the last block to obtain the final key of the block. And decrypting the circulation data by using an AES encryption algorithm and a final key of the block to obtain information such as circulation paths, parameters and the like of the product. The user can check the decrypted data to verify the authenticity and validity of the product. Through the blockchain information, a user can confirm the source, circulation path, and parameters of the product. The anti-counterfeiting and tracing of the oral liquid are completed.
The invention establishes a traceability and anti-counterfeiting solution for the production and sales process of the oral liquid. Each oral liquid product is assigned a unique identification code that is connected to a blockchain network. The production process information and the circulation data are stored encrypted on the blockchain. The production and circulation information is stored in encrypted form on the blockchain, and the data record generates blocks according to the time stamps. For each oral liquid product, a production controllability index and a circulation adjustment related index are calculated. The production controllability index is obtained through accumulation of adjacent parameter difference values, and the circulation adjustment correlation index is obtained through circulation data correlation analysis and data difference degree issued by the product twice. Generating keys using normalized values of a production controllability index and a circulation adjustment correlation index. The final key of the current block is generated by combining the final key of the previous block with the HMAC key derivation function. The user can obtain the blockchain information through the product identification code, decrypt the production information by using RSA, and analyze the consistency of the circulation data. Finally, the scheme realizes the traceability and anti-counterfeiting of the oral liquid product by using the blockchain technology and index analysis, and ensures the quality and compliance of the product.
Based on the same inventive concept as the above method, the present embodiment further provides an oral liquid anti-counterfeiting tracing system based on a blockchain, and fig. 4 is a basic composition schematic diagram of the oral liquid anti-counterfeiting tracing system based on the blockchain provided in the embodiment of the present application, as shown in fig. 4:
the system includes a memory module 10 and a processor module 20, wherein:
a memory module 10 for storing program codes;
the processor module 20 is used for reading the program codes stored in the memory module 10, executing the generation of unique identifiers on each bottle of oral liquid, and connecting the identifiers as the digital identities of the oral liquid to the blockchain network; extracting key information of the oral liquid in production, circulation and sales links, and carrying out structural treatment on the key information to obtain a production data matrix and a circulation data matrix; for the production data matrix, evaluating the controllability of the production process of the single oral liquid by analyzing the change condition of adjacent parameters to obtain a production controllability index; evaluating consistency of the circulation process by analyzing the correlation of different issuing link parameters to obtain circulation adjustment correlation indexes; constructing a key generation function based on the production controllability index and the circulation adjustment related index to generate a key; the user decrypts the encrypted data in the blockchain through the identification code of the oral liquid, so that the anti-counterfeiting tracing of the user on the oral liquid is realized.
In some embodiments of the present invention, the processor module 20 includes an oral liquid identifier generating sub-module 21, a key information extracting and processing sub-module 22, a production controllability index obtaining sub-module 23, a circulation adjustment related index obtaining sub-module 24, a key generating sub-module 25, and an anti-counterfeiting tracing sub-module 26.
The oral liquid identifier generation sub-module 21 is used for generating unique identifiers on each bottle of oral liquid and connecting the identifiers serving as digital identities of the oral liquid to a blockchain network;
the key information extraction processing sub-module 22 is used for extracting key information of the oral liquid in the production, circulation and sales links, and carrying out structural processing on the key information to obtain a production data matrix and a circulation data matrix;
the production controllability index obtaining sub-module 23 is configured to evaluate the controllability of the production process of the single oral liquid by analyzing the change condition of the adjacent parameters for the production data matrix, so as to obtain a production controllability index;
the circulation adjustment related index obtaining sub-module 24 is configured to obtain a circulation adjustment related index by analyzing the correlation of different issuing link parameters to evaluate the consistency of the circulation process;
a key generation sub-module 25, configured to construct a key generation function based on the production controllability index and the circulation adjustment correlation index, and generate a key;
the anti-counterfeiting tracing sub-module 26 is used for decrypting encrypted data in the blockchain by a user through an identification code of the oral liquid, so that the anti-counterfeiting tracing of the oral liquid by the user is realized.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
It should be noted that unless otherwise specified and limited, terms such as "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a circuit structure, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such article or apparatus. Without further limitation, the statement "comprises one … …" does not exclude that an additional identical element is present in an article or device that comprises the element.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (7)

1. An oral liquid anti-counterfeiting tracing method based on a blockchain is characterized by comprising the following steps of:
generating a unique identification code on each bottle of oral liquid, and connecting the identification code as the digital identity of the oral liquid to a blockchain network;
extracting key information of the oral liquid in production, circulation and sales links, and carrying out structural treatment on the key information to obtain a production data matrix and a circulation data matrix;
using a merck tree for the production data matrix and the circulation data matrix, taking the generated structured data as input, taking SHA-256 as a key generation function, calculating hash values of the oral liquid, and then combining a plurality of hash values into a larger root hash value;
recording the root hash value and the structured data into a corresponding block;
evaluating the controllability of the production process of the single oral liquid by analyzing the change condition of adjacent parameters for the production data matrix to obtain a production controllability index; the production controllability index calculation formula is as follows:
wherein,the serial number of the oral liquid is +.>Production controllability index of oral liquid of (2),. About.>And->Respectively the firstOral liquid->Normalized production-related parameters +.>Normalized production-related parameters,/->For the mean value of all normalized production-related parameter data, +.>The number of production related parameters;
evaluating consistency of the circulation process by analyzing the correlation of different issuing link parameters to obtain circulation adjustment correlation indexes; wherein the tThe obtaining of the circulation adjustment related index of the secondary issuing link comprises the following steps:
extraction of the firstSecondary and->The circulation related data in the data issued for the second time is constructed to obtain two circulation related matrixes +.>And
comparing the flow-through correlation matrixAnd->Preserving the parameter category contained in both matrices, discarding the parameter category contained in only one matrix to obtain an optimized flow-through correlation matrix +.>And->
Computing an optimized flow-through correlation matrixAnd->Covariance matrix>And->
By the covariance matrixAnd->Obtaining a correlation coefficient matrix;
based on the difference between the correlation coefficient matrix and the identity matrix, and combining and optimizing the circulation correlation matrixAndthe pearson correlation coefficient between the two parameters is used for obtaining a circulation adjustment correlation index;
constructing a key generation function based on the production controllability index and the circulation adjustment related index to generate a key; combining the generated key with the final key in the previous block to obtain the final key of the block, encrypting the important information related to production by using the final key to obtain encrypted data, and recording the encrypted data in the block;
a user obtains a blockchain address through the identification code of the oral liquid; and according to the structural data recorded on the blockchain, acquiring production controllability indexes and circulation adjustment related indexes of each block to obtain a final key of each block, so as to decrypt the encrypted data in the blockchain and realize anti-counterfeiting tracing of the oral liquid by a user.
2. The blockchain-based oral liquid anti-counterfeiting tracing method according to claim 1, wherein extracting key information of the oral liquid in production and circulation links, and performing structural processing on the key information to obtain a production data matrix and a circulation data matrix comprises:
extracting key information of the oral liquid in production, circulation and sales links;
converting the key information into a plurality of binary features through an One-Hot Encoding algorithm;
defining a format structure of data by using JSON structured data, and distributing field names and data types of each piece of information;
and converting the key information into structured data according to predefined fields to obtain a production data matrix and a circulation data matrix.
3. The blockchain-based oral liquid anti-counterfeiting tracing method according to claim 1, wherein the correlation coefficient matrix is: the covariance matrixAnd the covariance matrix->Is a ratio of (2).
4. The blockchain-based oral liquid anti-counterfeiting tracing method according to claim 1, wherein the circulation adjustment related index calculation method is as follows:
wherein,circulation regulation related index for representing secondary product issue, < >>Representing a correlation coefficient matrix between two covariance matrices corresponding to secondary product delivery, ++>Is a unitary matrix->For the number of parameter classes in the two optimized flow-through correlation matrices, < >>Representing a correlation coefficient matrix->And/or identity matrix>Mean value of differences,/>Is->The +.>Relative to the->The +.>Pearson correlation coefficient for each parameter.
5. The blockchain-based oral anti-counterfeiting traceability method according to claim 1, wherein constructing a key generation function based on the production controllability index and the circulation adjustment related index to generate a key comprises:
normalizing the numerical values of the production controllability index and the circulation adjustment related index to obtain a normalized production controllability index and a normalized circulation adjustment related index;
and adopting an advanced encryption standard encryption algorithm, and using the normalized production controllability index and the normalized circulation adjustment related index as input parameters to define a key generation function, wherein the generated key is as follows:
wherein,representing the generated key->Representing a hash function +_>And->Respectively representing a normalized production controllability index and a normalized circulation adjustment related index, < >>Representing a join operator.
6. The block chain-based oral liquid anti-counterfeiting traceability system is characterized by comprising a memory module (10) and a processor module (20), wherein:
-said memory module (10) for storing program code;
the processor module (20) for reading the program code stored in the memory module (10) and performing the method of any of claims 1-5.
7. The blockchain-based oral anti-counterfeiting traceability system according to claim 6, wherein the processor module (20) comprises an oral identification generation sub-module (21), a key information extraction processing sub-module (22), a production controllability index acquisition sub-module (23), a circulation adjustment related index acquisition sub-module (24), a key generation sub-module (25) and an anti-counterfeiting traceability sub-module (26).
CN202311234694.0A 2023-09-25 2023-09-25 Block chain-based anti-counterfeiting traceability method and system for oral liquid Active CN116976919B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311234694.0A CN116976919B (en) 2023-09-25 2023-09-25 Block chain-based anti-counterfeiting traceability method and system for oral liquid

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311234694.0A CN116976919B (en) 2023-09-25 2023-09-25 Block chain-based anti-counterfeiting traceability method and system for oral liquid

Publications (2)

Publication Number Publication Date
CN116976919A CN116976919A (en) 2023-10-31
CN116976919B true CN116976919B (en) 2024-01-02

Family

ID=88473472

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311234694.0A Active CN116976919B (en) 2023-09-25 2023-09-25 Block chain-based anti-counterfeiting traceability method and system for oral liquid

Country Status (1)

Country Link
CN (1) CN116976919B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107657460A (en) * 2017-09-08 2018-02-02 众安信息技术服务有限公司 A kind of tobacco based on block chain is false proof and source tracing method and system
CN109146516A (en) * 2018-08-02 2019-01-04 佛山鑫达智汇科技有限公司 A kind of white wine traceability system based on block chain
CN109345264A (en) * 2018-08-21 2019-02-15 太原理工大学 A kind of alcohol product traceability anti-fake system and method based on block chain
CN112614001A (en) * 2020-12-26 2021-04-06 西安科锐盛创新科技有限公司 Agricultural product tracing method and system based on block chain
CN113052411A (en) * 2019-12-26 2021-06-29 北京邮电大学 Data product quality evaluation method and device
CN114493430A (en) * 2022-01-20 2022-05-13 吉林农业科技学院 Logistics distribution system and method based on big data
WO2022121290A1 (en) * 2020-12-09 2022-06-16 中国农业科学院农业资源与农业区划研究所 Trusted fruit tracing method and apparatus based on fruit pattern map and blockchain
CN116188041A (en) * 2023-03-29 2023-05-30 中国工商银行股份有限公司 Food information tracing method, device and system based on block chain

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107657460A (en) * 2017-09-08 2018-02-02 众安信息技术服务有限公司 A kind of tobacco based on block chain is false proof and source tracing method and system
CN109146516A (en) * 2018-08-02 2019-01-04 佛山鑫达智汇科技有限公司 A kind of white wine traceability system based on block chain
CN109345264A (en) * 2018-08-21 2019-02-15 太原理工大学 A kind of alcohol product traceability anti-fake system and method based on block chain
CN113052411A (en) * 2019-12-26 2021-06-29 北京邮电大学 Data product quality evaluation method and device
WO2022121290A1 (en) * 2020-12-09 2022-06-16 中国农业科学院农业资源与农业区划研究所 Trusted fruit tracing method and apparatus based on fruit pattern map and blockchain
CN112614001A (en) * 2020-12-26 2021-04-06 西安科锐盛创新科技有限公司 Agricultural product tracing method and system based on block chain
CN114493430A (en) * 2022-01-20 2022-05-13 吉林农业科技学院 Logistics distribution system and method based on big data
CN116188041A (en) * 2023-03-29 2023-05-30 中国工商银行股份有限公司 Food information tracing method, device and system based on block chain

Also Published As

Publication number Publication date
CN116976919A (en) 2023-10-31

Similar Documents

Publication Publication Date Title
US11379854B2 (en) Methods and systems for making, tracking and authentication of products
CN107341676A (en) False proof mark and the method for tracing to the source
CN107430755A (en) The encrypted authentication in source in supply chain
CN105469132A (en) Duplicate coding internet of things traceability security label and 2-dimensional bar code security traceability method
CN104854642A (en) Method and apparatus for marking manufactured items using physical characteristic
JP2022514784A (en) Methods and systems for preparing and performing object authentication
CN111414429B (en) Block chain-based commodity information management method, electronic equipment and storage medium
CN107423980A (en) Data trade reference platform and method in a kind of supply chain
JP6683603B2 (en) Product authentication system and product authentication method
CN101847225B (en) A kind of method based on CN39 code managing commodity circulation
US20100258641A1 (en) 3-in-1 barcode for identifying commodity
CN101520865A (en) Anti-drug counterfeiting method using radio frequency electronic tag and public key infrastructure
RU2216776C2 (en) Method and system for identifying and accounting marked objects
CN111427960A (en) Commodity traceability system based on block chain
CN110930167A (en) Block chain-based medicine information recording method, equipment and medium
WO2008056105A1 (en) Verification method
CN116976919B (en) Block chain-based anti-counterfeiting traceability method and system for oral liquid
CN107403077B (en) Copyright product management system with strong adaptability to rights splitting and combining
CN114140133B (en) Method for processing tracing data
CN115082087A (en) Food safety traceability system based on block chain and big data
Liu et al. Segmented Encryption: A Quality and Safety Supervisory Model for Herbal Medicine Based on Blockchain Technology
Ahmed et al. Detection of Counterfeit Medicine Using a Private and Permissioned Blockchain
US20100145867A1 (en) Verification method
CN117596086B (en) Commodity data encryption transmission method and system based on supply chain
CN114331481B (en) Product anti-counterfeiting traceability system based on Ether house beacon chain system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant