Quality tracing method and system based on block chain technology
Through symmetric encryption and pi law screening technology, blockchain technology is traced through product quality, solving the problem of excessive transparency exposing business-sensitive information, realizing secure storage and reasonable access to data, and improving corporate development.
Patent Information
- Application Number
- CN202411389939.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2024-11-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, excessive transparency of blockchain technology in the process of product quality traceability may expose the business sensitive information of the enterprise, which is not conducive to the development of the enterprise.
The product life cycle data is encrypted using symmetric encryption algorithms, and transmitted and stored on the blockchain network platform. The pi law is used to screen data related to product quality, and the data is divided into public and public There are two types of privacy, and dynamically display the data access scope by identifying traceability visitors.
It effectively protects data privacy and integrity, improves data utilization efficiency, ensures secure access and traceability of data, avoids the disclosure of hidden commercial information, and enhances the development capabilities of enterprises.
Smart Images

Figure CN118916900A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular, to a quality tracing method and system based on blockchain technology. Background Art
[0002] With the continuous development of the economy, the commodity economy is facing the challenge of counterfeit and shoddy goods while growing steadily. These illegal products not only harm the interests of consumers, but also disrupt the normal market order and affect the reputation and interests of legitimate enterprises. In order to deal with this problem, a variety of anti-counterfeiting technologies have emerged in the market, aiming to protect the brand image of legitimate enterprises, maintain market order and safeguard the legitimate rights and interests of consumers. Blockchain technology, as an innovative solution, is gradually becoming an important tool to combat counterfeit and shoddy goods. Blockchain is a distributed ledger technology that connects data in the form of blocks in chronological order to form an unalterable and unforgeable chain structure. This technology ensures the authenticity and security of data through cryptographic means, making each transaction transparent and traceable, thereby effectively preventing the counterfeiting and tampering of data.
[0003] In general, the application of blockchain technology in anti-counterfeiting and supply chain management provides a new solution for protecting the brand image of legitimate enterprises, maintaining market order, and safeguarding the legitimate rights and interests of consumers. The key to product quality traceability lies in transparency and trust. Consumers can query detailed information about products through the blockchain platform. However, in the process of product quality traceability, not all product quality can be made public, and some commercial privacy information does not need to be made public. Therefore, in some cases, excessive transparency may expose the company's commercial sensitive information, which is not conducive to the development of the company.
[0004] Currently, no effective solution has been proposed for the problems in the related technologies. Summary of the invention
[0005] In view of this, in response to the problems in the related technologies, the present invention provides a quality traceability method and system based on blockchain technology to solve the above-mentioned problem that excessive transparency may expose the company's commercial sensitive information and be detrimental to the company's development.
[0006] In order to solve the above problems, the specific technical solutions adopted by the present invention are as follows: According to one aspect of the present invention, a quality tracing method based on blockchain technology is provided, and the quality tracing method based on blockchain technology comprises the following steps: S1. Collect product life cycle data and encrypt it using a symmetric encryption algorithm, and transmit the encrypted life cycle data to the blockchain network platform; S2. Decrypt the encrypted life cycle data using the blockchain network platform, and use the law of pi to filter the life cycle data related to product quality to obtain product quality data; S3. Based on the naive Bayes method, the product quality data is divided into publicly traceable product quality data and private product quality data, and the divided product quality data is stored in partitions; S4. Identify the traceability access personnel and dynamically display the product quality data access scope based on the traceability access personnel identification results; Preferably, the encrypted life cycle data is decrypted using a blockchain network platform, and the life cycle data related to product quality is screened using the law of pi to obtain product quality data, including the following steps: S21. Perform a decryption operation after the encrypted lifecycle data is transmitted to the blockchain network platform; S22. Use the pi law and correlation analysis method to determine the correlation between product life cycle data and product quality; S23. Based on the correlation analysis result, select the life cycle data that meets the preset threshold from the decrypted life cycle data as the product quality data.
[0007] Preferably, collecting product life cycle data and encrypting it using a symmetric encryption algorithm, and transmitting the encrypted life cycle data to the blockchain network platform includes the following steps: S11. Obtain product life cycle data and perform preprocessing, including data cleaning and organization; S12, analyzing each stage of the product life cycle and determining the role groups related to the product life cycle data, and constructing a role key tree; S13, creating a role key for each role group in the role key tree, and using a symmetric encryption algorithm and the generated role key to encrypt the pre-processed product life cycle data; S14. Transmit the encrypted product life cycle data to the blockchain network platform through a secure communication protocol.
[0008] Preferably, determining the correlation between product life cycle data and product quality using the pi law and correlation analysis method includes the following steps: S221. Collect historical product life cycle data and build a product quality indicator system; S222. Standardize the secondary indicator data in the product quality indicator system by using the membership function method; S223. Calculate the product quality status value based on the standardized secondary indicator data using the pi law; S224. Analyze the correlation between product quality status value and product life cycle data using correlation analysis method.
[0009] Preferably, for the secondary indicator data in the product quality indicator system, the calculation formula for standardizing it by the membership function method is: ; In the formula, K X Indicates the secondary indicators in the product quality indicator system X Normalized values; X min It indicates the minimum value of the secondary indicators in the product quality indicator system; X max Indicates the maximum value of the secondary indicators in the product quality indicator system.
[0010] Preferably, based on the standardized secondary indicator data, calculating the product quality status value using the pi law includes the following steps: S2231. Determine the total number of secondary indicators based on the secondary indicator data after standardization; S2232, establishing a unit circle and dividing it into equal parts according to the number of secondary indicators; S2233, according to the standardized value of each secondary indicator, draw an indicator line with the center of the circle as the starting point; S2234, connecting all indicator lines in sequence to form a closed figure, the closed figure includes a sector and a triangle; S2235. Calculate the sum of the areas of all sectors and triangles in the closed figure, and calculate the product quality status value using the product quality status value calculation formula.
[0011] Preferably, the product quality status value calculation formula is: ; In the formula, G Indicates the product quality status value; m It indicates the number of secondary indicators whose value is 1 after standardization; n Indicates the number of secondary indicators; i Indicates the index of the secondary indicator; L 1 and L 2 respectively represent the adjacent index values of the triangular part; θ Represents the angle formed by adjacent secondary indicators.
[0012] Preferably, dividing the product quality data into publicly traceable product quality data and private product quality data based on the naive Bayes method, and partitioning and storing the divided product quality data includes the following steps: S31. Collect and organize product quality sample data, and train a naive Bayes classifier to obtain a product quality data classification model; S32. Input the product quality data into the product quality data classification model for classification, and obtain publicly traceable product quality data and private product quality data respectively; S33. Based on the division results, publicly traceable product quality data is stored in a public area, and private product quality data is stored in a protected area.
[0013] Preferably, collecting and organizing product quality sample data, and training a naive Bayes classifier to obtain a product quality data classification model comprises the following steps: S311. Preprocess product quality sample data using word segmentation technology and obtain a vocabulary set; S312, performing sensitivity analysis on each word in the vocabulary according to a preset sensitive word standard; S313, marking each word based on the sensitivity analysis result of each word; S314: Use the marked words and the corresponding product quality sample data as training data to train a naive Bayes classifier to obtain a product quality data classification model.
[0014] Preferably, identifying the traceability access personnel and dynamically displaying the product quality data access scope according to the traceability access personnel identification result includes the following steps: S41. Determine the identity of the visitor accessing the blockchain network platform using a pre-set identity authentication mechanism; S42, retrieving the role and authority information of the visitor on the blockchain network platform according to the visitor's identity; S43, based on the role and permission information, determine and generate the product quality data range that the visitor can access; S44. Dynamically display product quality data accessible to visitors through the blockchain network platform and generate access log records.
[0015] According to another aspect of the present invention, a quality traceability system based on blockchain technology is provided, the quality traceability system based on blockchain technology comprising: a data encryption transmission unit, a quality data screening unit, a quality data division unit and a quality data display unit, and the data encryption transmission unit, the quality data screening unit, the quality data division unit and the quality data display unit are connected in sequence; A data encryption transmission unit, which is used to collect product life cycle data and encrypt it using a symmetric encryption algorithm, and transmit the encrypted life cycle data to the blockchain network platform; A quality data screening unit is used to decrypt the encrypted life cycle data using the blockchain network platform, and screen the life cycle data related to product quality using the law of pi to obtain product quality data; A quality data partitioning unit, used to partition the product quality data into publicly traceable product quality data and private product quality data based on the naive Bayes method, and store the partitioned product quality data; The quality data display unit is used to identify the traceability access personnel and dynamically display the product quality data access scope according to the traceability access personnel identification results.
[0016] Compared with the prior art, the present invention provides a quality tracing method and system based on blockchain technology, which has the following beneficial effects: (1) The present invention uses a symmetric encryption algorithm to encrypt product life cycle data and transmits and stores it on a blockchain network platform, effectively protecting the privacy and integrity of the data and preventing data from being tampered with or leaked. The encrypted life cycle data is screened based on the pi law to select data related to product quality, avoiding unnecessary data storage and processing and improving data utilization efficiency. The naive Bayes method is used to divide product quality data into two categories: publicly traceable and private, making data classification clearer and more specific, which is conducive to the management and control of different categories of data. By identifying traceability access personnel and dynamically displaying the access scope of product quality data, the secure access and traceability of data are guaranteed, so that legitimate users can obtain the required data in a timely manner, thereby improving the use value of data, avoiding the disclosure of the company's commercial secrets, and improving the development of the company.
[0017] (2) The present invention collects historical product life cycle data and constructs a product quality indicator system, standardizes the secondary indicator data, and uses the pi law to calculate the product quality status value. It can objectively evaluate the correlation between different indicators and determine their impact on product quality. The secondary indicator data is standardized using the membership function method. Through a simple calculation formula, the indicator data is mapped to the unit circle, which is convenient for subsequent analysis and processing. At the same time, the original information of the data is maintained. By calculating the sum of the areas of all sectors and triangles in the closed figure, the product quality status value is obtained. The overall quality level of the product can be accurately evaluated, providing a scientific basis for quality management and improvement.
[0018] (3) The present invention can obtain a classification model for product quality data by collecting and organizing product quality sample data and training a naive Bayes classifier. The naive Bayes method performs well in fields such as text classification and can effectively divide data into different categories. The identified privacy product quality data is stored in a protected area, which helps to protect the user's privacy information from being leaked. This partitioned storage method effectively prevents the leakage and abuse of sensitive information, improves the security and credibility of the data, and stores publicly traceable product quality data in a public area, making it convenient for users or stakeholders to review and trace product quality information. This method can improve the transparency and traceability of product quality and enhance consumers' trust in the product. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. 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 creative work. In the drawings: Figure 1 is a flowchart of a quality tracing method based on blockchain technology according to an embodiment of the present invention; Figure 2 It is a principle block diagram of a quality traceability system based on blockchain technology according to an embodiment of the present invention.
[0020] In the figure: 1. Data encryption transmission unit; 2. Quality data screening unit; 3. Quality data classification unit; 4. Quality data display unit. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0022] According to an embodiment of the present invention, a quality tracing method and system based on blockchain technology are provided.
[0023] The present invention is further described with reference to the accompanying drawings and specific embodiments. Figure 1 As shown, according to one embodiment of the present invention, a quality tracing method based on blockchain technology is provided, and the quality tracing method based on blockchain technology includes the following steps: S1. Collect product life cycle data and encrypt it using a symmetric encryption algorithm, and transmit the encrypted life cycle data to the blockchain network platform; As a preferred implementation, collecting product life cycle data and encrypting it using a symmetric encryption algorithm, and transmitting the encrypted life cycle data to the blockchain network platform includes the following steps: S11. Obtain product life cycle data and perform preprocessing, including data cleaning and organization; It should be noted that data cleaning includes removing incomplete data, processing inaccurate data, removing duplicate data, and processing irrelevant data.
[0024] Removing incomplete data means checking the missing values in the data and choosing to delete or fill them (such as using the mean, median, mode, or interpolation) as appropriate.
[0025] Dealing with inaccurate data means identifying and correcting errors or outliers in the data, which may be caused by entry errors, equipment failures, or data corruption, among other reasons.
[0026] Deduplication means deleting duplicate records to ensure the uniqueness of each record in the data set.
[0027] Processing irrelevant data means deleting data fields or records that are not relevant to the product life cycle analysis.
[0028] S12, analyzing each stage of the product life cycle and determining the role groups related to the product life cycle data, and constructing a role key tree; Specifically, analyzing each stage of the product life cycle and determining the role groups related to the product life cycle data, and constructing the role key tree includes the following steps: Gain a detailed understanding of each stage of the product life cycle, including product design, raw material procurement, production, quality control, warehousing, distribution, sales, after-sales service, and product recycling or scrapping; analyze the type, volume, and importance of data generated at each stage; Identify data-related role groups based on different stages of the product life cycle; A hierarchical key tree structure is established, in which each node represents a role group, and the parent-child relationship between nodes reflects the permission inheritance relationship between role groups. At the root node of the key tree, a master key is set, which is used to encrypt the entire product life cycle data or to generate other subkeys.
[0029] For each role group, a subkey is assigned to it in the key tree according to its permission level and data access requirements. This subkey can be generated directly from the master key or from the subkey of its parent node.
[0030] Ensure that each role group can only access data within its permission scope and can only decrypt and access this data using the subkeys it owns.
[0031] S13, creating a role key for each role group in the role key tree, and using a symmetric encryption algorithm and the generated role key to encrypt the pre-processed product life cycle data; Specifically, establishing a role key for each role group in the role key tree, and using a symmetric encryption algorithm and the generated role key to encrypt the pre-processed product life cycle data includes the following steps: For each role group in the role key tree, a unique symmetric key is generated using a secure key generation algorithm (such as a pseudo-random number generator); this key will serve as the identity of the role group for subsequent encryption and decryption operations.
[0032] The preprocessed product lifecycle data is divided into blocks of appropriate size, and each data block is encrypted using the key of the corresponding role group and the symmetric encryption algorithm.
[0033] S14. Transmit the encrypted product life cycle data to the blockchain network platform through a secure communication protocol.
[0034] It should be noted that common secure communication protocols include HTTPS (HTTP Secure), TLS (Transport Layer Security) or DTLS (Datagram Transport Layer Security). These protocols all provide functions such as encrypted transmission, identity authentication and data integrity check. During the transmission process, secure communication protocols will ensure the confidentiality, integrity and identity authentication of data to prevent data from being stolen, tampered with or forged.
[0035] S2. Decrypt the encrypted life cycle data using the blockchain network platform, and use the law of pi to filter the life cycle data related to product quality to obtain product quality data; As a preferred implementation, the encrypted life cycle data is decrypted using a blockchain network platform, and the life cycle data related to product quality is screened using the law of pi. Obtaining product quality data includes the following steps: S21. Perform a decryption operation after the encrypted lifecycle data is transmitted to the blockchain network platform; It should be noted that the decryption operation is the reverse process of encryption, which depends on the encryption algorithm and key used during encryption. The encryption algorithm is a rule or method for converting plaintext into ciphertext, while the key is the parameter or information required to execute the encryption algorithm. Only with the correct key and algorithm knowledge can the ciphertext be decrypted to restore the plaintext.
[0036] S22. Use the pi law and correlation analysis method to determine the correlation between product life cycle data and product quality; As a preferred implementation, determining the correlation between product life cycle data and product quality using the pi law and correlation analysis method includes the following steps: S221. Collect historical product life cycle data and build a product quality indicator system; It should be noted that the collection of historical product life cycle data includes production data, inspection data, maintenance data, etc. By analyzing the relationship between the collection of historical product life cycle data and product quality goals, determine which data are key indicators, and build a hierarchical product quality indicator system based on the analysis results. This system includes primary indicators and secondary indicators. Primary indicators reflect the core aspects of product quality, and secondary indicators provide more detailed quality dimensions.
[0037] S222. Standardize the secondary indicator data in the product quality indicator system by using the membership function method; It should be noted that the membership function method is mainly used to convert various types of raw data into standardized numerical values, usually between 0 and 1.
[0038] Specifically, for the secondary indicator data in the product quality indicator system, the calculation formula for standardizing it through the membership function method is: ; In the formula, K X Indicates the secondary indicators in the product quality indicator system X Normalized values; X min It indicates the minimum value of the secondary indicators in the product quality indicator system; X max Indicates the maximum value of the secondary indicators in the product quality indicator system.
[0039] S223. Calculate the product quality status value based on the standardized secondary indicator data using the pi law; As a preferred implementation, based on the standardized secondary indicator data, calculating the product quality status value using the pi law includes the following steps: S2231. Determine the total number of secondary indicators based on the secondary indicator data after standardization; S2232, establishing a unit circle and dividing it into equal parts according to the number of secondary indicators; It should be noted that a unit circle is established based on the total number of secondary indicators. The unit circle is a circle with a radius of 1, which is used as the basis for evaluation. The circle is divided equally according to the number of secondary indicators, and each indicator occupies a sector. The purpose of equal division is to assign a position on the circle to each indicator in order to draw the indicator line.
[0040] S2233, according to the standardized value of each secondary indicator, draw an indicator line with the center of the circle as the starting point; It should be noted that the indicator line is drawn from the center of the circle according to the standardized value of each secondary indicator. If the standardized value of an indicator is 1, it means that the indicator performs best within its range, and the indicator line will extend directly to the edge of the unit circle. If the standardized value is less than 1, the indicator line will stop at a certain ratio from the center of the circle, and the ratio is the standardized value of the indicator.
[0041] S2234, connecting all indicator lines in sequence to form a closed figure, the closed figure includes a sector and a triangle; It should be noted that, in the order of drawing, the end points of each indicator line are connected to form a closed polygon, which may be composed of several sectors and triangles, each sector or triangle corresponds to an indicator. The shape and size of the polygon reflect the comprehensive status of product quality.
[0042] S2235. Calculate the sum of the areas of all sectors and triangles in the closed figure, and calculate the product quality status value using the product quality status value calculation formula.
[0043] Specifically, the product quality status value calculation formula is: ; In the formula, G Indicates the product quality status value; m It indicates the number of secondary indicators whose value is 1 after standardization; n Indicates the number of secondary indicators; i Indicates the index of the secondary indicator; L 1 and L 2 respectively represent the adjacent index values of the triangular part; θ Represents the angle formed by adjacent secondary indicators.
[0044] S224. Analyze the correlation between product quality status value and product life cycle data using correlation analysis method.
[0045] Specifically, the correlation analysis method is used to analyze the correlation between product quality status values and product life cycle data, including the following steps: Select the life cycle data that will serve as the independent variable (explanatory variable) and the product quality status value as the dependent variable; Use statistical software or tools to calculate the correlation coefficient between two sets of data. The commonly used correlation coefficient is the Pearson correlation coefficient; The correlation coefficient calculated by analysis is: Coefficient values close to +1 or -1 indicate a strong correlation, and values close to 0 indicate no correlation.
[0046] If the sign of the coefficient is positive, it indicates a positive correlation, that is, when one variable increases, the other also increases; if it is negative, it indicates a negative correlation, that is, when one variable increases, the other decreases; According to the size and direction of the correlation coefficient, the relationship between these indicators and the product quality status is explained. For example, if a production parameter is highly positively correlated with the product quality status value, it indicates that the optimization of this parameter may directly improve product quality.
[0047] To better understand how to use the Pi law and correlation analysis to determine the correlation between product life cycle data and product quality, for example: Collect the historical product life cycle data of the product in the past five years, including production data, inspection data, maintenance data, etc.; these data include: Production data includes production date, batch number, quality of raw materials used, operating status of the production line, etc. Inspection data includes test results of each batch of products, such as screen response time, battery life, camera pixel stability, etc. Maintenance data includes customer service records, return rates, customer feedback, etc.; Construction of product quality indicator system: Based on the above data, establish a system including primary indicators (such as battery performance, screen quality) and secondary indicators (such as battery charging speed, screen brightness uniformity).
[0048] For each secondary indicator such as battery charging speed ( X min = 30 minutes, X max =60 minutes) for standardization. If a mobile phone charges in 45 minutes, its standardized value is 0.5.
[0049] Assuming there are 10 secondary indicators, create a unit circle and divide it into 10 equal sectors.
[0050] Each sub-indicator plots an indicator line on the unit circle according to its normalized value.
[0051] Connect the end points of all indicator lines to form a closed polygon.
[0052] Calculate the area of the polygon and assume that the area obtained is 0.8, which means that the product quality is good.
[0053] Production parameters (such as raw material quality and production line status) were selected as independent variables, and product quality status value (0.8) was selected as the dependent variable.
[0054] The correlation coefficient was calculated and it was assumed that the Pearson correlation coefficient showed that the correlation coefficient between the raw material quality and the product quality status value was 0.9, indicating a strong positive correlation.
[0055] S23. Based on the correlation analysis result, select the life cycle data that meets the preset threshold from the decrypted life cycle data as the product quality data.
[0056] S3. Based on the naive Bayes method, the product quality data is divided into publicly traceable product quality data and private product quality data, and the divided product quality data is stored in partitions; As a preferred implementation, the product quality data is divided into publicly traceable product quality data and private product quality data based on the naive Bayes method, and the partitioned storage of the divided product quality data includes the following steps: S31. Collect and organize product quality sample data, and train a naive Bayes classifier to obtain a product quality data classification model; As a preferred implementation, collecting and organizing product quality sample data, and training a naive Bayes classifier to obtain a product quality data classification model includes the following steps: S311. Preprocess product quality sample data using word segmentation technology and obtain a vocabulary set; It should be noted that word segmentation technology, especially word segmentation technology for Chinese text, is a key technology in the field of natural language processing. Since Chinese text is different from English and other texts that are separated by spaces, there are no obvious separators between words in Chinese text. Word segmentation technology can be used to split the text descriptions contained in the product quality sample data into individual words.
[0057] S312, performing sensitivity analysis on each word in the vocabulary according to a preset sensitive word standard; It should be noted that the sensitive vocabulary criteria can be determined based on domain knowledge, expert opinions or historical data, and according to the defined sensitive vocabulary criteria, a list containing sensitive vocabulary is collected or created. This list can be a simple vocabulary list or a more complex structure containing vocabulary and its associated weights.
[0058] Each word in the vocabulary is matched against the sensitive vocabulary list. This can be achieved through string comparison, regular expression matching, or more complex semantic similarity calculations. For each matched word, its sensitivity is evaluated based on its similarity or matching degree with the words in the sensitive vocabulary list; the sensitivity evaluation is binary (i.e., sensitive / non-sensitive).
[0059] S313, marking each word based on the sensitivity analysis result of each word; S314: Use the marked words and the corresponding product quality sample data as training data to train a naive Bayes classifier to obtain a product quality data classification model.
[0060] S32. Input the product quality data into the product quality data classification model for classification, and obtain publicly traceable product quality data and private product quality data respectively; S33. Based on the division results, publicly traceable product quality data is stored in a public area, and private product quality data is stored in a protected area.
[0061] It should be noted that for publicly traceable product quality data, select a public storage area that is easy to access and query; for private product quality data, select a protected storage area with strict access control and encryption measures.
[0062] S4. By identifying the traceability access personnel, the product quality data access scope is dynamically displayed according to the traceability access personnel identification results; As a preferred implementation, by identifying the traceability access personnel and dynamically displaying the product quality data access scope according to the traceability access personnel identification result, the following steps are included: S41. Determine the identity of the visitor accessing the blockchain network platform using a pre-set identity authentication mechanism; It should be noted that when a visitor attempts to access the blockchain network platform, the identity authentication process will be triggered and the visitor will need to submit his or her identity authentication credentials, such as username and password, digital certificate, biometric information (such as fingerprint, facial recognition) or other authentication methods (such as email verification link, mobile phone verification code, etc.).
[0063] S42, retrieving the role and authority information of the visitor on the blockchain network platform according to the visitor's identity; It should be noted that once the identity authentication is successful, the unique identifier of the visitor (such as user ID, username or digital signature) is obtained, and this identifier will be used to retrieve the role and permission information associated with the visitor; Based on the visitor's identity identifier, the role and permission information associated with the visitor is retrieved from a corresponding storage location (such as a smart contract, a database, or a distributed ledger) on the blockchain network platform.
[0064] Roles define the general responsibilities and classification of visitors, such as administrator, ordinary user, data entry clerk, etc. Each role may have different permission levels and access scopes.
[0065] Permissions define the specific actions a role can perform and the scope of data it can access. This may include the ability to read, write, delete, or execute specific functions.
[0066] S43, based on the role and permission information, determine and generate the product quality data range that the visitor can access; It should be noted that an access control policy is formulated based on role and permission information. This policy will determine the specific operations that visitors can perform and the scope of data that they can access. According to the access control policy, the product quality data that visitors can access is retrieved from the blockchain network platform, involving operations such as querying the database, calling smart contracts, or accessing distributed ledgers.
[0067] S44. Dynamically display product quality data accessible to visitors through the blockchain network platform and generate access log records.
[0068] It should be noted that the retrieved data will be encapsulated into an appropriate format (such as JSON, XML or data table) and displayed to the visitor through the user interface or API of the blockchain network platform. Throughout the process, the visitor's identity, the scope of data accessed, the operations performed, and any related errors or warnings will be recorded. These log records are essential for subsequent security audits and troubleshooting.
[0069] like Figure 2 As shown, according to another embodiment of the present invention, a quality traceability system based on blockchain technology is provided, which is used to implement the quality traceability method based on blockchain technology according to any one of claims 1 to 9, characterized in that the quality traceability system based on blockchain technology comprises: a data encryption transmission unit 1, a quality data screening unit 2, a quality data division unit 3 and a quality data display unit 4, and the data encryption transmission unit 1, the quality data screening unit 2, the quality data division unit 3 and the quality data display unit 4 are connected in sequence; The data encryption transmission unit 1 is used to collect product life cycle data and perform encryption processing on it using a symmetric encryption algorithm, and transmit the encrypted life cycle data to the blockchain network platform; The quality data screening unit 2 is used to decrypt the encrypted life cycle data using the blockchain network platform, and screen the life cycle data related to product quality using the law of pi to obtain product quality data; The quality data partitioning unit 3 is used to partition the product quality data into publicly traceable product quality data and private product quality data based on the naive Bayes method, and store the divided product quality data in partitions; The quality data display unit 4 is used to identify the traceability access personnel and dynamically display the product quality data access scope according to the traceability access personnel identification result.
[0070] In summary, with the help of the above technical scheme of the present invention, the present invention uses a symmetric encryption algorithm to encrypt the product life cycle data, and transmits and stores it on the blockchain network platform, which effectively protects the privacy and integrity of the data and prevents the data from being tampered with or leaked. The encrypted life cycle data is screened based on the pi law, and data related to product quality is selected, which avoids unnecessary data storage and processing, and improves the utilization efficiency of data. The naive Bayes method is used to divide the product quality data into two categories: publicly traceable and private, so that the data classification is clearer and more definite, which is conducive to the management and control of different categories of data. By identifying the traceability access personnel and dynamically displaying the access scope of the product quality data, the secure access and traceability of the data are guaranteed, so that the legitimate users can obtain the required data in time, which improves the use value of the data, can avoid the disclosure of the company's commercial secrets, and improve the development of the company; the present invention collects historical product life cycle data and constructs a product quality indicator system, standardizes the secondary indicator data, and uses the pi law to calculate the product quality status value, so as to objectively evaluate the correlation between different indicators and determine The degree of its influence on product quality is standardized by using the membership function method. The indicator data is mapped to the unit circle through a simple calculation formula, which is convenient for subsequent analysis and processing, while maintaining the original information of the data. The product quality status value is obtained by calculating the sum of the areas of all sectors and triangles in the closed figure, which can accurately evaluate the overall quality level of the product and provide a scientific basis for quality management and improvement. The present invention collects and organizes product quality sample data and trains a naive Bayes classifier to obtain a classification model for product quality data. The naive Bayes method performs well in fields such as text classification and can effectively divide data of different categories. The identified privacy product quality data is stored in a protected area, which helps to protect the user's privacy information from being leaked. This partitioned storage method effectively prevents the leakage and abuse of sensitive information, improves the security and credibility of the data, and stores publicly traceable product quality data in a public area, which is convenient for users or stakeholders to consult and trace product quality information. This method can improve the transparency and traceability of product quality and enhance consumers' trust in the product.
[0071] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program code.
[0072] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A quality traceability method based on blockchain technology, characterized in that: The quality traceability method based on blockchain technology includes the following steps: S1. Collect product life cycle data and encrypt it using a symmetric encryption algorithm, and transmit the encrypted life cycle data to the blockchain network platform; S2. Decrypt the encrypted life cycle data using the blockchain network platform, and use the law of pi to filter the life cycle data related to product quality to obtain product quality data; S3. Based on the naive Bayes method, the product quality data is divided into publicly traceable product quality data and private product quality data, and the divided product quality data is stored in partitions; S4. Identify the traceability access personnel and dynamically display the product quality data access scope based on the traceability access personnel identification results; The method of decrypting the encrypted life cycle data using the blockchain network platform and screening the life cycle data related to product quality using the law of pi to obtain product quality data includes the following steps: S21. Perform a decryption operation after the encrypted lifecycle data is transmitted to the blockchain network platform; S22. Use the pi law and correlation analysis method to determine the correlation between product life cycle data and product quality; S23. Based on the correlation analysis result, select the life cycle data that meets the preset threshold from the decrypted life cycle data as the product quality data.
2. According to claim 1, a quality tracing method based on blockchain technology is characterized in that: The collecting of product life cycle data and encrypting it using a symmetric encryption algorithm, and transmitting the encrypted life cycle data to the blockchain network platform comprises the following steps: S11, obtaining product life cycle data and performing preprocessing, wherein the preprocessing includes data cleaning and sorting; S12, analyzing each stage of the product life cycle and determining the role groups related to the product life cycle data, and constructing a role key tree; S13, creating a role key for each role group in the role key tree, and using a symmetric encryption algorithm and the generated role key to encrypt the pre-processed product life cycle data; S14. Transmit the encrypted product life cycle data to the blockchain network platform through a secure communication protocol.
3. According to claim 1, a quality tracing method based on blockchain technology is characterized in that: The method of determining the correlation between product life cycle data and product quality by using the pi law and correlation analysis method comprises the following steps: S221. Collect historical product life cycle data and build a product quality indicator system; S222. Standardize the secondary indicator data in the product quality indicator system by using the membership function method; S223. Calculate the product quality status value based on the standardized secondary indicator data using the pi law; S224. Analyze the correlation between product quality status value and product life cycle data using correlation analysis method.
4. A quality tracing method based on blockchain technology according to claim 3, characterized in that: The calculation formula for standardizing the secondary indicator data in the product quality indicator system through the membership function method is: ; In the formula, K X Indicates the secondary indicators in the product quality indicator system X Normalized values; X min It indicates the minimum value of the secondary indicators in the product quality indicator system; X max Indicates the maximum value of the secondary indicators in the product quality indicator system.
5. A quality tracing method based on blockchain technology according to claim 3, characterized in that: The method of calculating the product quality status value based on the standardized secondary indicator data using the pi law includes the following steps: S2231. Determine the total number of secondary indicators based on the secondary indicator data after standardization; S2232, establishing a unit circle and dividing it into equal parts according to the number of secondary indicators; S2233, according to the standardized value of each secondary indicator, draw an indicator line with the center of the circle as the starting point; S2234, connecting all indicator lines in sequence to form a closed figure, wherein the closed figure includes a sector and a triangle; S2235. Calculate the sum of the areas of all sectors and triangles in the closed figure, and calculate the product quality status value using the product quality status value calculation formula.
6. A quality tracing method based on blockchain technology according to claim 5, characterized in that: The product quality status value calculation formula is: ; In the formula, G Indicates the product quality status value; m It indicates the number of secondary indicators whose value is 1 after standardization; n Indicates the number of secondary indicators; i Indicates the index of the secondary indicator; L 1 and L 2 respectively represent the adjacent index values of the triangular part; θ Represents the angle formed by adjacent secondary indicators.
7. A quality tracing method based on blockchain technology according to claim 1, characterized in that: The method of dividing the product quality data into publicly traceable product quality data and private product quality data based on the naive Bayes method, and partitioning and storing the divided product quality data includes the following steps: S31. Collect and organize product quality sample data, and train a naive Bayes classifier to obtain a product quality data classification model; S32. Input the product quality data into the product quality data classification model for classification, and obtain publicly traceable product quality data and private product quality data respectively; S33. Based on the division results, publicly traceable product quality data is stored in a public area, and private product quality data is stored in a protected area.
8. A quality tracing method based on blockchain technology according to claim 7, characterized in that: The collecting and collating of product quality sample data, and training of a naive Bayes classifier to obtain a product quality data classification model comprises the following steps: S311. Preprocess product quality sample data using word segmentation technology and obtain a vocabulary set; S312, performing sensitivity analysis on each word in the vocabulary according to a preset sensitive word standard; S313, marking each word based on the sensitivity analysis result of each word; S314: Use the marked words and the corresponding product quality sample data as training data to train a naive Bayes classifier to obtain a product quality data classification model.
9. The quality tracing method based on blockchain technology according to claim 1 is characterized in that: The method of identifying the traceability access personnel and dynamically displaying the product quality data access scope according to the traceability access personnel identification result includes the following steps: S41. Determine the identity of the visitor accessing the blockchain network platform using a pre-set identity authentication mechanism; S42, retrieving the role and authority information of the visitor on the blockchain network platform according to the visitor's identity; S43, based on the role and permission information, determine and generate the product quality data range that the visitor can access; S44. Dynamically display product quality data accessible to visitors through the blockchain network platform and generate access log records.
10. A quality tracing system based on blockchain technology, used to implement the quality tracing method based on blockchain technology as described in any one of claims 1 to 9, characterized in that: The quality traceability system based on blockchain technology includes: a data encryption transmission unit, a quality data screening unit, a quality data division unit and a quality data display unit, and the data encryption transmission unit, the quality data screening unit, the quality data division unit and the quality data display unit are connected in sequence; The data encryption transmission unit is used to collect product life cycle data and perform encryption processing on it using a symmetric encryption algorithm, and transmit the encrypted life cycle data to the blockchain network platform; The quality data screening unit is used to decrypt the encrypted life cycle data using the blockchain network platform, and screen the life cycle data related to product quality using the law of pi to obtain product quality data; The quality data partitioning unit is used to partition the product quality data into publicly traceable product quality data and private product quality data based on the naive Bayes method, and store the partitioned product quality data; The quality data display unit is used to identify the traceability access personnel and dynamically display the product quality data access scope according to the traceability access personnel identification result.
Citation Information
Patent Citations
Comprehensive electric energy quality estimation method based on improved radar graph
CN102682408A
Method and system for authority management based on blockchain
CN108229962A
Industrial dust explosion risk evaluation method
CN111985819A
Naive Bayes-based text classification method, apparatus and device, and medium
CN115292487A
Block chain multi-chain-based fruit and vegetable whole-course holographic information management model construction method
CN117875975A
