Garment fabric process tracing method and system based on block chain, medium and equipment
By adopting blockchain-based traceability methods in the clothing industry, using particle swarm optimization algorithm and multimodal feature construction, the problem of low traceability efficiency of clothing problems is solved, and fast and accurate traceability and responsibility identification are achieved.
Patent Information
- Application Number
- CN202510389432.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, the traceability efficiency of clothing problems is low and difficult to characterize. Usually, the suppliers and the dealers bear the responsibility and cannot solve the problem rootably.
The garment fabric process traceability method based on blockchain is used to calculate the optimal nodes through the particle swarm optimization algorithm, count the node information of each batch of clothing, perform feature extraction and multimodal feature construction, find out the influencing factors, and decrypt the relevant information from the blockchain for traceability.
It realizes rapid and accurate tracing of clothing fabric processes, can quickly find the real cause of clothing problems, and improves the transparency and responsibility identification of production processes.
Smart Images

Figure CN119904251A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain encryption technology, and in particular to a blockchain-based clothing material process tracing method, system, medium and equipment. Background Art
[0002] In the existing technology, there are many factors that affect the final sales of clothing, including clothing fabric selection, transportation, production, distribution, etc. If there is a problem with the sales of clothing, it is necessary to trace the process to find the key factors causing the problem. At present, the tracking and tracing of clothing problems is very vague. When customers report a problem, they usually verify the problem one node at a time, which is inefficient and difficult to quantify. In the end, the supplier usually bears the responsibility and cannot solve the problem fundamentally. Summary of the invention In view of the shortcomings of the prior art, the purpose of the present invention is to provide a clothing fabric process traceability method based on blockchain, aiming to solve the technical problem that the tracking and tracing of clothing problems in the prior art is very vague. When customers report problems, they are generally verified one node at a time, which is inefficient and difficult to quantify. In the end, the supplier is generally held responsible, and the problem cannot be fundamentally solved.
[0003] In order to achieve the above object, the present invention is implemented by the following technical solutions: A method for tracing the source of clothing fabrics based on blockchain, comprising the following steps: Based on the particle swarm optimization algorithm, the optimal nodes that each piece of clothing passes through are calculated according to the principle of minimum cost, and the resulting solution is stored in the first blockchain; Count the nodes that each batch of clothing passes through and save them in the second blockchain; Extract features from each batch of clothing, and construct multimodal features based on clothing problems to obtain a multimodal feature map; According to the clothing problem reported by the customer, finding the influencing factors associated with the clothing problem from the multimodal feature graph; Based on the impact factor, find the node corresponding to the batch of clothing from the second blockchain; From the first blockchain, find other batches of clothing that have passed through the same node as the batch of clothing, and verify whether the other batches of clothing have the same clothing problem.
[0004] According to one aspect of the above technical solution, the particle swarm optimization algorithm is used to calculate the optimal node that each piece of clothing passes through according to the principle of minimum cost, and the result solution is stored in the first blockchain, which specifically includes: The nodes that a batch of clothing passes through are represented as particles X ij, and the particle optimization speed is represented as V ij , where X ij Indicates the jth production process of the batch of clothing in the i-th node, V ij Indicates the optimized speed of the batch of clothing in the jth production process in the i-th node; Define a cost fitness function to calculate the fitness value of the particle under various conditions; ; Among them, θ i1 represents the current cost of the i-th node, θ i2 represents the maximum cost borne by the i-th node, α and β are weight functions, and θ e represents the floating cost affecting the node, θ adj Indicates the mutual constraints between different production processes in this node; Preset a fitness value threshold, abandon the situation where the fitness value is lower than the fitness value threshold, and update the local optimal solution and the global optimal solution of the particle to update the production process and optimization speed of the particle; ; Where t represents the number of iterations of the particle. represents the inertia weight, y1 and y2 represent learning factors, r1 and r2 represent random constants, p represents the local optimal solution of the particle, g represents the global optimal solution of the particle, and v ij (t) represents the optimization speed of the batch of clothing at node i production process j during the tth iteration, x ij (t) indicates that the batch of clothing is located in the production process of node i and j during the t-th iteration; The fitness value of the updated particle is recalculated until a preset number of iterations is reached or the fitness value converges, so as to obtain a result solution for the batch of clothing and save it in the first blockchain.
[0005] According to one aspect of the above technical solution, the counting of nodes passed by each batch of clothing and saving them in the second blockchain specifically includes: The type information of the batch of clothing is counted. When the batch of clothing passes through the first node, the type information and the node information of the node are saved in the second blockchain, uploaded to the cloud server at the same time, and a traceability label and a direct link are generated; Every time the batch of clothing passes through a node, the node information of the current node is updated in the second blockchain, and the traceability label and the direct link are updated synchronously; Every time the batch of clothing passes through a node, a public key and a private key are synchronously generated, and the public key is saved to the cloud service end, and the private key is saved to each node.
[0006] According to one aspect of the above technical solution, the feature extraction for each batch of clothing and the multimodal feature construction based on the clothing problem to obtain a multimodal feature map specifically include: Counting the various production processes and various clothing problems corresponding to each node of the batch of clothing; Based on the background big data, the coordinated change relationship between each of the production processes and each of the clothing problems is obtained; The production process and the clothing problem are defined as events, and a multimodal feature structure ED is constructed based on the synergistic variation relationship; ; Among them, Z i represents the position of the ith event, E i represents the mode of the i-th event, i∈(1,n); A position threshold is set, and if the position relationship between the two event modes is less than the position threshold, the conditional probability of the two events is calculated; ; Among them, E a and E b denote the modes of event a and event b respectively, event b is earlier than event a, and C denotes the number of events obtained from the statistics of the co-variation relationship; The conditional probabilities of the two events under various combinations are statistically analyzed to obtain a multimodal feature map of the batch of clothing.
[0007] According to one aspect of the above technical solution, the step of finding the influencing factors associated with the clothing problem from the multimodal feature graph based on the clothing problem reported by the customer specifically includes: Find out the clothing problems reported by customers from various sales platforms; A conditional probability threshold is set, and based on the clothing problem, associated events whose conditional probability is greater than the conditional probability threshold are found as influencing factors.
[0008] According to one aspect of the above technical solution, the step of finding the node corresponding to the batch of clothing from the second blockchain based on the impact factor specifically includes: Based on the event corresponding to the impact factor, the node where the event is located is obtained; The second blockchain is decrypted using the private key required by the node, and all production processes of the node and the production processes of all nodes before the node are viewed through the traceability label and direct link of the node; Again, based on the conditional probability threshold, the associated events corresponding to the production process of the node are checked to construct associated event clues.
[0009] According to one aspect of the above technical solution, finding other batches of clothing that have passed through the same node as the batch of clothing from the first blockchain, and verifying whether other batches of clothing have the same clothing problem, specifically includes: Decrypt the first blockchain using the private key required by the first blockchain to obtain the result plan for each batch of clothing; According to the result scheme and the clues of the associated events, check other batches of clothing that have the same associated events as this batch of clothing, and verify the yield of other batches of clothing in each associated event. If the yield of other batches of clothing in the associated events does not meet the preset requirements, trace the fabric process of this batch of clothing.
[0010] The present invention also provides a blockchain-based clothing fabric process traceability system, comprising: The first storage module is used to calculate the optimal nodes that each piece of clothing passes through based on the particle swarm optimization algorithm and the principle of minimum cost, and store the result solution in the first blockchain; The first storage module is specifically used to: represent the nodes passed by a batch of clothing as particles X ij , and the particle optimization speed is represented as V ij , where X ij Indicates the jth production process of the batch of clothing in the i-th node, V ij Indicates the optimized speed of the batch of clothing in the jth production process in the i-th node; Define a cost fitness function to calculate the fitness value of the particle under various conditions; ; Among them, θ i1 represents the current cost of the i-th node, θ i2 represents the maximum cost borne by the i-th node, α and β are weight functions, and θ e represents the floating cost affecting the node, θ adj Indicates the mutual constraints between different production processes in this node; Preset a fitness value threshold, abandon the situation where the fitness value is lower than the fitness value threshold, and update the local optimal solution and the global optimal solution of the particle to update the production process and optimization speed of the particle; ; Where t represents the number of iterations of the particle. represents the inertia weight, y1 and y2 represent learning factors, r1 and r2 represent random constants, p represents the local optimal solution of the particle, g represents the global optimal solution of the particle, and v ij (t) represents the optimization speed of the batch of clothing at node i production process j during the tth iteration, x ij (t) indicates that the batch of clothing is located in the production process of node i and j during the t-th iteration; Recalculate the fitness value of the updated particle until a preset number of iterations is reached or the fitness value converges, so as to obtain a result solution for the batch of clothing, and save it in the first blockchain; The second storage module is used to count the nodes that each batch of clothing passes through and save them in the second blockchain; The second storage module is specifically used to: count the type information of the batch of clothing, and when the batch of clothing passes through the first node, save the type information and the node information of the node in the second blockchain, upload it to the cloud server at the same time, and generate a traceability label and a direct link; Every time the batch of clothing passes through a node, the node information of the current node is updated in the second blockchain, and the traceability label and the direct link are updated synchronously; When the batch of clothing passes through each node, a public key and a private key are synchronously generated, and the public key is saved to the cloud service end, and the private key is saved to each node; Feature extraction module: used to extract features from each batch of clothing and construct multimodal features based on clothing problems to obtain multimodal feature maps; The feature extraction module is specifically used to: count the various production processes and various clothing problems corresponding to each node of the batch of clothing; Based on the background big data, the coordinated change relationship between each of the production processes and each of the clothing problems is obtained; The production process and the clothing problem are defined as events, and a multimodal feature structure ED is constructed based on the synergistic variation relationship; ; Among them, Z i represents the position of the ith event, E i represents the mode of the i-th event, i∈(1,n); A position threshold is set, and if the position relationship between the two event modes is less than the position threshold, the conditional probability of the two events is calculated; ; Among them, E a and E b denote the modes of event a and event b respectively, event b is earlier than event a, and C denotes the number of events obtained from the statistics of the co-variation relationship; The conditional probabilities of the two events under various combinations are statistically analyzed to obtain a multimodal feature map of the batch of clothing; A first search module: used for finding the influencing factors associated with the clothing problem from the multimodal feature graph according to the clothing problem reported by the customer; The first search module is specifically used to: obtain clothing problems reflected by customers from various sales platforms; A conditional probability threshold is set, and based on the clothing problem, related events whose conditional probability is greater than the conditional probability threshold are found as influencing factors; A second search module: used to find the node corresponding to the batch of clothing from the second blockchain based on the impact factor; The second search module is specifically used to: obtain the node where the event is located based on the event corresponding to the impact factor; The second blockchain is decrypted using the private key required by the node, and all production processes of the node and the production processes of all nodes before the node are viewed through the traceability label and direct link of the node; Again, according to the conditional probability threshold, check the associated events corresponding to the production process of the node, and then construct the associated event clues; Verification module: Find out other batches of clothing that have passed through the same node as the batch of clothing from the first blockchain, and verify whether other batches of clothing have the same clothing problem; The verification module is specifically used for: Decrypt the first blockchain using the private key required by the first blockchain to obtain the result plan for each batch of clothing; According to the result scheme and the clues of the associated events, check other batches of clothing that have the same associated events as this batch of clothing, and verify the yield of other batches of clothing in each associated event. If the yield of other batches of clothing in the associated events does not meet the preset requirements, trace the fabric process of this batch of clothing.
[0011] The present invention also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the blockchain-based clothing fabric process traceability method as described above is implemented.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the blockchain-based clothing fabric process traceability method as described above is implemented.
[0013] Compared with the prior art, the present invention has the following beneficial effects: Through the particle swarm optimization algorithm, clothing companies can choose the most optimal production plan, saving costs. At the same time, the production plan of each batch of clothing can be statistically summarized and stored in the first blockchain as a basis for traceability. Then, in the clothing production process, every time a batch of clothing passes through a node, all the production processes of the node are recorded and saved in the second blockchain. Then, the features of each batch of clothing are extracted to obtain a multimodal feature map. The multimodal feature map can reflect the synergistic relationship between each production process and clothing problem in a batch of clothing, and then it can be known that the production process (the process of purchasing clothing fabrics) to be traced corresponds to a clothing problem (such as shrinkage and deformation). In the sales process, according to the clothing problems reported by customers, the production process that causes the problem can be found, and then the influencing factors can be obtained, so that the second blockchain can be decrypted to view the nodes of this batch of clothing; then the first blockchain can be decrypted to view the production process shared by other batches of clothing and this batch of clothing (it should be noted that the production process includes not only the process itself but also the supplier who contracted the process), and verify whether other batches of clothing have the same problem in the production process. If the same problem occurs, the real cause of the batch of clothing can be determined to achieve rapid clothing fabric process traceability; The present invention can quickly trace the problems that occur in the clothing production process, and then correct the process with problems in the subsequent clothing production process. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is a flowchart of a method for tracing the origin of clothing fabrics based on blockchain in the first embodiment of the present invention; Figure 2 This is a structural block diagram of a clothing fabric process traceability system based on blockchain in the second embodiment of the present invention; Figure 3 is a structural block diagram of an electronic device in a third embodiment of the present invention; The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0015] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0016] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0018] See also Figure 1 , shown is a method for tracing the source of clothing fabrics based on blockchain in the first embodiment of the present invention, comprising the following steps: S10, based on the particle swarm optimization algorithm, calculate the optimal node that each piece of clothing passes through according to the principle of minimum cost, and store the result solution in the first blockchain; S20, counting the nodes that each batch of clothing passes through and saving them in the second blockchain; S30, extracting features from each batch of clothing, and constructing multimodal features based on the clothing problem to obtain a multimodal feature map; S40, according to the clothing problem reported by the customer, finding the influencing factor associated with the clothing problem from the multimodal feature graph; S50, based on the impact factor, finding the node corresponding to the batch of clothing from the second blockchain; S60: Find other batches of clothing that have passed through the same node as the batch of clothing from the first blockchain, and verify whether the other batches of clothing have the same clothing problem.
[0019] It can be understood that the present invention can allow clothing companies to choose the most optimal production plan through the particle swarm optimization algorithm, saving costs, and can also statistically summarize the production plan of each batch of clothing and store it in the first blockchain as a basis for traceability; then in the clothing production process, every time a batch of clothing passes through a node, all the production processes of the node are recorded and saved in the second blockchain; then, feature extraction is performed on each batch of clothing to obtain a multimodal feature map, which can reflect the synergistic relationship between each production process and clothing problem in a batch of clothing, and then it can be known that corresponding to a clothing problem (such as shrinkage deformation), the production process (clothing surface) to be traced Fabric selection during material selection, or waterproofing during manufacturing, etc.); during the sales process, according to the clothing problems reported by customers, the production process that causes the problem can be found, and then the influencing factors can be obtained, and the second blockchain can be decrypted to view the nodes of this batch of clothing; then the first blockchain is decrypted to view the production process shared by other batches of clothing and this batch of clothing (it should be noted that the production process includes not only the process itself but also the supplier who contracted the process), and verify whether other batches of clothing have the same problem in the production process. If the same problem occurs, the real cause of the batch of clothing can be determined to achieve rapid clothing fabric process traceability; The present invention can quickly trace the problems that occur in the clothing production process, and then correct the process with problems in the subsequent clothing production process.
[0020] Specifically, the step S10 specifically includes: The nodes that a batch of clothing passes through are represented as particles X ij , and the particle optimization speed is represented as V ij , where X ij Indicates the jth production process of the batch of clothing in the i-th node, V ij Indicates the optimized speed of the batch of clothing in the jth production process in the i-th node; Define a cost fitness function to calculate the fitness value of the particle under various conditions; ; Among them, θ i1 represents the current cost of the i-th node, θ i2 represents the maximum cost borne by the i-th node, α and β are weight functions, and θ e represents the floating cost affecting the node, θ adj Indicates the mutual constraints between different production processes in this node; Preset a fitness value threshold, abandon the situation where the fitness value is lower than the fitness value threshold, and update the local optimal solution and the global optimal solution of the particle to update the production process and optimization speed of the particle; ; Where t represents the number of iterations of the particle. represents the inertia weight, y1 and y2 represent learning factors, r1 and r2 represent random constants, p represents the local optimal solution of the particle, g represents the global optimal solution of the particle, and v ij (t) represents the optimization speed of the batch of clothing at node i production process j during the tth iteration, x ij (t) indicates that the batch of clothing is located in the production process of node i and j during the t-th iteration; The fitness value of the updated particle is recalculated until a preset number of iterations is reached or the fitness value converges, so as to obtain a result solution for the batch of clothing and save it in the first blockchain.
[0021] It can be understood that the system will automatically traverse each production process of the batch of clothing at the first node, each production process of the second node, ..., each production process of the nth node, V ij It is used to guide the system on how to search for a better production process in each node; then, through the cost fitness function, the fitness of the batch of clothing in each combination is calculated in turn. The fitness reflects the cost situation. By setting the fitness threshold, it can be used to screen the combination of processes between nodes that meet the budget; if it is less than the fitness threshold, the system automatically updates the nodes and production processes, the optimization speed, and the cost fitness of the particles until the preset number of iterations is reached or the fitness value converges, and then finds the optimal result solution for the batch of clothing and saves it to the first blockchain. The result solution reflects each production process that the batch of clothing needs to go through at each node. When tracing the source later, the production process of the batch of clothing can be clearly reflected by querying the result solution.
[0022] Furthermore, the step S20 specifically includes: The type information of the batch of clothing is counted. When the batch of clothing passes through the first node, the type information and the node information of the node are saved in the second blockchain, uploaded to the cloud server at the same time, and a traceability label and a direct link are generated; Every time the batch of clothing passes through a node, the node information of the current node is updated in the second blockchain, and the traceability label and the direct link are updated synchronously; Every time the batch of clothing passes through a node, a public key and a private key are synchronously generated, and the public key is saved to the cloud service end, and the private key is saved to each node.
[0023] It can be understood that by saving the type information (including the basic information of the batch of clothing) and node information (including the production process of the node and the supplier contracted for the production process) to the second blockchain at each node, and providing traceability labels and the direct links, users can query various information about the production process of the batch of clothing through the public key to prevent counterfeit products. Managers can use private keys to confirm the production process and suppliers of the batch of clothing, have an overall understanding, and provide support for subsequent traceability.
[0024] Furthermore, the step S30 specifically includes: Counting the various production processes and various clothing problems corresponding to each node of the batch of clothing; Based on the background big data, the coordinated change relationship between each of the production processes and each of the clothing problems is obtained; The production process and the clothing problem are defined as events, and a multimodal feature structure ED is constructed based on the synergistic variation relationship; ; Among them, Z i represents the position of the ith event, E i represents the mode of the i-th event, i∈(1,n); A position threshold is set, and if the position relationship between the two event modes is less than the position threshold, the conditional probability of the two events is calculated; ; Among them, E a and E b denote the modes of event a and event b respectively, event b is earlier than event a, and C denotes the number of events obtained from the statistics of the co-variation relationship; The conditional probabilities of the two events under various combinations are statistically analyzed to obtain a multimodal feature map of the batch of clothing.
[0025] Understandably, this step can be based on the big data of the background, and the production process indicated by each clothing problem in the batch of clothing can be statistically analyzed in the historical process. For example, if the clothing problem is cuff wrinkles, the causes of the problem include poor fabric properties, improper worker operation, improper machine tension adjustment, etc. The corresponding nodes are clothing fabric selection and production manufacturing, and the corresponding production processes are fabric selection during clothing design, clothing processing, and clothing acceptance. The coordinated change relationship between clothing problems and each production process in each node can be determined. Here, the multimodal feature structure ED can be used to construct all nodes and production processes between the batch of clothing, which are collectively referred to as events. , the conditional probability between event a and event b is determined by the number of occurrences of the modes of event a and event b (such as wrinkled cuffs and improper operation by workers), and then the degree of correlation between event a and event b can be known. The role of the position threshold is to exclude a situation where the body proportion problem is caused by the sleeve proportion problem (because the entire garment needs to meet the proportional relationship during production). There is no problem with the production of the body here, only the sleeve production problem. This method excludes the mutual influence between the various positions of the garment during the production process, and focuses on the correlation of a part in each node and each production process to improve the traceability speed and accuracy.
[0026] Furthermore, the step S40 specifically includes: Find out the clothing problems reported by customers from various sales platforms; A conditional probability threshold is set, and based on the clothing problem, associated events whose conditional probability is greater than the conditional probability threshold are found as influencing factors.
[0027] It can be understood that the relationship between events can be obtained from the above multimodal feature structure to find out the related events as influencing factors.
[0028] Furthermore, the step S50 specifically includes: Based on the event corresponding to the impact factor, the node where the event is located is obtained; The second blockchain is decrypted using the private key required by the node, and all production processes of the node and the production processes of all nodes before the node are viewed through the traceability label and direct link of the node; Again, based on the conditional probability threshold, the associated events corresponding to the production process of the node are checked to construct associated event clues.
[0029] It can be understood that by decrypting the second blockchain with a private key, one can view the production process pointed to by the associated event with the problem, as well as all the production processes between the production processes, and again view the correlation between the various production processes by verifying the conditional probability threshold. This is because in addition to the connection between clothing problems and production processes, there is also a connection between multiple production processes. For example, if the fabric is not suitable, designing clothing with reference to the renderings will inevitably lead to various problems in clothing processing. This method can verify the correlation between production processes.
[0030] Furthermore, the step S60 specifically includes: Decrypt the first blockchain using the private key required by the first blockchain to obtain the result plan for each batch of clothing; According to the result scheme and the clues of the associated events, check other batches of clothing that have the same associated events as this batch of clothing, and verify the yield of other batches of clothing in each associated event. If the yield of other batches of clothing in the associated events does not meet the preset requirements, trace the fabric process of this batch of clothing.
[0031] It is understandable that by obtaining the result solutions for each batch of clothing, other batches of clothing with the same production process as the batch of clothing can be found. It should be noted that the production process also carries the supplier of the production process. For example, this batch of clothing is batch A. Batch A and batch B share the same supplier's machine for tensioning production. At the same time, batch B also has the problem of cuff wrinkles and a low yield rate. In this case, the supplier's machine is likely to have problems. At the same time, since the correlation between multiple production processes is also taken into account in the above steps, the method can include a situation where batch A and batch B are tensioned at the same supplier, and the supplier's machine has no problem. There is a problem, but the clothing fabric factory used unqualified fabrics. Since the correlation between multiple production processes has been taken into consideration, it can still be traced back to the clothing fabric factory. If the correlation between multiple production processes is not considered, the correlation between the clothing fabric factory using unqualified fabrics and the cuff wrinkles may be smaller than the conditional probability threshold, and thus cannot be counted as an influencing factor. This is because there are many factors that affect cuff wrinkles, and it is not always a problem with clothing fabrics. If the conditional probability threshold is set too small, the sample size will be too large, thus affecting the judgment. If the correlation between multiple production processes is adopted, the sample size will be more appropriate and the traceability will be more accurate.
[0032] Finally, the problematic nodes and production processes are rectified to prevent the same problems from occurring in the future.
[0033] In summary, the blockchain-based clothing fabric process traceability method in the above embodiments of the present invention can quickly trace the problems that occur in the clothing production process, and then correct the problematic processes in the subsequent clothing production process.
[0034] See also Figure 2 The second embodiment of the present invention provides a blockchain-based clothing material process traceability system, including: The first storage module 11 is used to calculate the optimal node that each piece of clothing passes through based on the particle swarm optimization algorithm and the principle of minimum cost, and store the result solution in the first blockchain; The first storage module 11 is specifically used to represent the nodes that a batch of clothing passes through as particles X ij , and the particle optimization speed is represented as V ij , where X ij Indicates the jth production process of the batch of clothing in the i-th node, V ij Indicates the optimized speed of the batch of clothing in the jth production process in the i-th node; Define a cost fitness function to calculate the fitness value of the particle under various conditions; ; Among them, θ i1 represents the current cost of the i-th node, θ i2 represents the maximum cost borne by the i-th node, α and β are weight functions, and θ e represents the floating cost affecting the node, θ adj Indicates the mutual constraints between different production processes in this node; Preset a fitness value threshold, abandon the situation where the fitness value is lower than the fitness value threshold, and update the local optimal solution and the global optimal solution of the particle to update the production process and optimization speed of the particle; ; Where t represents the number of iterations of the particle. represents the inertia weight, y1 and y2 represent learning factors, r1 and r2 represent random constants, p represents the local optimal solution of the particle, g represents the global optimal solution of the particle, and v ij (t) represents the optimization speed of the batch of clothing at node i production process j during the tth iteration, x ij (t) indicates that the batch of clothing is located in the production process of node i and j during the t-th iteration; Recalculate the fitness value of the updated particle until a preset number of iterations is reached or the fitness value converges, so as to obtain a result solution for the batch of clothing, and save it in the first blockchain; The second storage module 12 is used to count the nodes that each batch of clothing passes through and save them in the second blockchain; The second storage module 12 is specifically used to: count the type information of the batch of clothing, and when the batch of clothing passes through the first node, save the type information and the node information of the node in the second blockchain, upload it to the cloud service end, and generate a traceability label and a direct link; Every time the batch of clothing passes through a node, the node information of the current node is updated in the second blockchain, and the traceability label and the direct link are updated synchronously; When the batch of clothing passes through each node, a public key and a private key are synchronously generated, and the public key is saved to the cloud service end, and the private key is saved to each node; Feature extraction module 13: used to extract features from each batch of clothing, and construct multimodal features based on clothing problems to obtain a multimodal feature map; The feature extraction module 13 is specifically used to: count the various production processes and various clothing problems corresponding to each node of the batch of clothing; Based on the background big data, the coordinated change relationship between each of the production processes and each of the clothing problems is obtained; The production process and the clothing problem are defined as events, and a multimodal feature structure ED is constructed based on the synergistic variation relationship; ; Among them, Z i represents the position of the ith event, E i represents the mode of the i-th event, i∈(1,n); A position threshold is set, and if the position relationship between the two event modes is less than the position threshold, the conditional probability of the two events is calculated; ; Among them, E a and E b denote the modes of event a and event b respectively, event b is earlier than event a, and C denotes the number of events obtained from the statistics of the co-variation relationship; The conditional probabilities of the two events under various combinations are statistically analyzed to obtain a multimodal feature map of the batch of clothing; A first search module 14 is used to find out the influencing factors associated with the clothing problem from the multimodal feature graph according to the clothing problem reported by the customer; The first search module 14 is specifically used to: obtain clothing problems reflected by customers from various sales platforms; A conditional probability threshold is set, and based on the clothing problem, related events whose conditional probability is greater than the conditional probability threshold are found as influencing factors; The second search module 15 is used to find the node corresponding to the batch of clothing from the second blockchain based on the impact factor; The second search module 15 is specifically used to: obtain the node where the event is located based on the event corresponding to the impact factor; The second blockchain is decrypted using the private key required by the node, and all production processes of the node and the production processes of all nodes before the node are viewed through the traceability label and direct link of the node; Again, according to the conditional probability threshold, check the associated events corresponding to the production process of the node, and then construct the associated event clues; Verification module 16: Find other batches of clothing that have passed through the same node as the batch of clothing from the first blockchain, and verify whether the other batches of clothing have the same clothing problem; The verification module 16 is specifically used for: Decrypt the first blockchain using the private key required by the first blockchain to obtain the result plan for each batch of clothing; According to the result scheme and the clues of the associated events, check other batches of clothing that have the same associated events as this batch of clothing, and verify the yield of other batches of clothing in each associated event. If the yield of other batches of clothing in the associated events does not meet the preset requirements, trace the fabric process of this batch of clothing.
[0035] The present invention also provides an electronic device, see Figure 3 , shown is an electronic device in the third embodiment of the present invention, including a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20. When the processor 20 executes the computer program 30, the above-mentioned blockchain-based clothing fabric process traceability method is implemented.
[0036] Among them, the memory 10 includes at least one type of storage medium, and the storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10 can be an internal storage unit of an electronic device, such as a hard disk of the electronic device. In other embodiments, the memory 10 can also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory 10 can also include both an internal storage unit of the electronic device and an external storage device. The memory 10 can not only be used to store application software and various types of data installed in the electronic device, but also can be used to temporarily store data that has been output or is to be output.
[0037] Among them, in some embodiments, the processor 20 can be an electronic control unit (Electronic Control Unit, abbreviated as ECU, also known as a vehicle computer), a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run the program code stored in the memory 10 or process data, such as executing access restriction programs, etc.
[0038] It should be pointed out that Figure 3 The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than those shown in the figure, or combine certain components, or arrange the components differently.
[0039] An embodiment of the present invention further provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the blockchain-based clothing fabric process traceability method as described above is implemented.
[0040] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0041] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0042] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0043] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0044] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A blockchain-based clothing fabric process traceability method, characterized in that: The steps include: Based on the particle swarm optimization algorithm, the optimal nodes that each piece of clothing passes through are calculated according to the principle of minimum cost, and the resulting solution is stored in the first blockchain; Count the nodes that each batch of clothing passes through and save them in the second blockchain; Extract features from each batch of clothing, and construct multimodal features based on clothing problems to obtain a multimodal feature map; According to the clothing problem reported by the customer, finding the influencing factors associated with the clothing problem from the multimodal feature graph; Based on the impact factor, finding the node corresponding to the batch of clothing from the second blockchain; From the first blockchain, find other batches of clothing that have passed through the same node as the batch of clothing, and verify whether the other batches of clothing have the same clothing problem.
2. The method for tracing the source of clothing fabrics based on blockchain according to claim 1 is characterized in that: The method of calculating the optimal node that each piece of clothing passes through based on the particle swarm optimization algorithm according to the principle of minimum cost and storing the result solution in the first blockchain specifically includes: The nodes that a batch of clothing passes through are represented as particles X ij , and the particle optimization speed is represented as V ij , where X ij Indicates the jth production process of the batch of clothing in the i-th node, V ij Indicates the optimized speed of the batch of clothing in the jth production process in the i-th node; Define a cost fitness function to calculate the fitness value of the particle under various conditions; ; Among them, θ i1 represents the current cost of the i-th node, θ i2 represents the maximum cost borne by the i-th node, α and β are weight functions, and θ e represents the floating cost affecting the node, θ adj Indicates the mutual constraints between different production processes in this node; Preset a fitness value threshold, abandon the situation where the fitness value is lower than the fitness value threshold, and update the local optimal solution and the global optimal solution of the particle to update the production process and optimization speed of the particle; ; Where t represents the number of iterations of the particle. represents the inertia weight, y1 and y2 represent learning factors, r1 and r2 represent random constants, p represents the local optimal solution of the particle, g represents the global optimal solution of the particle, and v ij (t) represents the optimization speed of the batch of clothing at node i production process j during the tth iteration, x ij (t) indicates that the batch of clothing is located in the production process of node i and j during the t-th iteration; The fitness value of the updated particle is recalculated until a preset number of iterations is reached or the fitness value converges, so as to obtain a result solution for the batch of clothing and save it in the first blockchain.
3. The method for tracing the source of clothing fabrics based on blockchain according to claim 2 is characterized in that: The counting of nodes that each batch of clothing passes through and saving them in the second blockchain specifically includes: The type information of the batch of clothing is counted. When the batch of clothing passes through the first node, the type information and the node information of the node are saved in the second blockchain, uploaded to the cloud server at the same time, and a traceability label and a direct link are generated; Every time the batch of clothing passes through a node, the node information of the current node is updated in the second blockchain, and the traceability label and the direct link are updated synchronously; Every time the batch of clothing passes through a node, a public key and a private key are synchronously generated, and the public key is saved to the cloud service end, and the private key is saved to each node.
4. The method for tracing the source of clothing fabrics based on blockchain according to claim 3 is characterized in that: The feature extraction for each batch of clothing and the construction of multimodal features based on the clothing problem to obtain a multimodal feature map specifically include: Counting the various production processes and various clothing problems corresponding to each node of the batch of clothing; Based on the background big data, the coordinated change relationship between each of the production processes and each of the clothing problems is obtained; The production process and the clothing problem are defined as events, and a multimodal feature structure ED is constructed based on the synergistic variation relationship; ; Among them, Z i represents the position of the ith event, E i represents the mode of the i-th event, i∈(1,n); A position threshold is set, and if the position relationship between the two event modes is less than the position threshold, the conditional probability of the two events is calculated; ; Among them, E a and E b denote the modes of event a and event b respectively, event b is earlier than event a, and C denotes the number of events obtained from the statistics of the co-variation relationship; The conditional probabilities of the two events under various combinations are statistically analyzed to obtain a multimodal feature map of the batch of clothing.
5. The method for tracing the source of clothing fabrics based on blockchain according to claim 1 is characterized in that: The step of finding the influencing factors associated with the clothing problem from the multimodal feature graph according to the clothing problem reflected by the customer specifically includes: Find out the clothing problems reported by customers from various sales platforms; A conditional probability threshold is set, and based on the clothing problem, associated events whose conditional probability is greater than the conditional probability threshold are found as influencing factors.
6. The blockchain-based clothing fabric process traceability method according to claim 5 is characterized in that: The step of finding the node corresponding to the batch of clothing from the second blockchain based on the impact factor specifically includes: Based on the event corresponding to the impact factor, the node where the event is located is obtained; The second blockchain is decrypted using the private key required by the node, and all production processes of the node and the production processes of all nodes before the node are viewed through the traceability label and direct link of the node; Again, based on the conditional probability threshold, the associated events corresponding to the production process of the node are checked to construct associated event clues.
7. The blockchain-based clothing fabric process traceability method according to claim 1 is characterized in that: The step of finding other batches of clothing that have passed through the same node as the batch of clothing from the first blockchain, and verifying whether the other batches of clothing have the same clothing problem, specifically includes: Decrypt the first blockchain using the private key required by the first blockchain to obtain the result plan for each batch of clothing; According to the result scheme and the clues of the associated events, check other batches of clothing that have the same associated events as this batch of clothing, and verify the yield of other batches of clothing in each associated event. If the yield of other batches of clothing in the associated events does not meet the preset requirements, trace the fabric process of this batch of clothing.
8. A blockchain-based clothing fabric process traceability system, characterized in that: include: The first storage module is used to calculate the optimal nodes that each piece of clothing passes through based on the particle swarm optimization algorithm and the principle of minimum cost, and store the result solution in the first blockchain; The second storage module is used to count the nodes that each batch of clothing passes through and save them in the second blockchain; Feature extraction module: used to extract features from each batch of clothing and construct multimodal features based on clothing problems to obtain multimodal feature maps; A first search module: used for finding the influencing factors associated with the clothing problem from the multimodal feature graph according to the clothing problem reported by the customer; A second search module: used to find the node corresponding to the batch of clothing from the second blockchain based on the impact factor; Verification module: Find out other batches of clothing that have passed through the same node as the batch of clothing from the first blockchain, and verify whether other batches of clothing have the same clothing problem.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, a blockchain-based clothing fabric process traceability method as described in any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the blockchain-based clothing fabric process traceability method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Cloud service budget optimization scheduling method and device, equipment and storage medium
CN113132471A
Public cloud system and method for realizing data transparency and traceability based on block chain
CN117955632A
Product tracing method and system based on consensus mechanism
CN118134508A
Emergency block chain tracing method and device
CN118233224A
Flexible circuit board defect tracing method and system based on time sequence knowledge graph
CN118966221A