A photovoltaic product supply chain traceability method and system

By building supply chain network models, defining transmission and privacy protocols, using deep learning algorithms and KD tree index coding, the data security and rapid positioning of supply chain traceability in the existing technology are solved, and efficient and secure traceability query is achieved.

CN119204942BActive Publication Date: 2025-04-25CHINA NAT INST OF STANDARDIZATION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411261112.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-04-25
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

The existing supply chain traceability technology has hidden data security risks, making it difficult to quickly locate the source of the problem, and lacks research on the overall flow path and the application of algorithm models.

Method used

The graph algorithm is used to build a supply chain network model, define transmission protocols and privacy protocols, learn constraint rules through deep learning algorithms, build constraint models, constrain the data links, extract product serial numbers, time and location features, and perform multi-dimensional index coding based on the KD tree to achieve rapid traceability query.

Benefits of technology

It improves the transparency and security of the supply chain, enhances data integrity and exchange security, and achieves the effect of quickly locate the source of problems and improves traceability efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204942B_ABST
    Figure CN119204942B_ABST
Patent Text Reader

Abstract

The present invention discloses a photovoltaic product supply chain traceability method and system, including: using a graph algorithm to construct a supply chain network model, defining a transmission protocol and a privacy protocol for the edges in the supply chain network model, obtaining a data link, constructing constraint rules for the data link, using a deep learning algorithm to learn the constraint rules to obtain a constraint model, constraining the generation phase of the data link through the constraint model, extracting product serial number features, time features and location features through the constrained data link, performing multidimensional index encoding based on a KD tree, obtaining a traceability query index, obtaining a traceability request, traversing the KD tree based on the traceability query index, and obtaining a traceability path. This method can not only locate the source in a timely manner, but also detect abnormal environments, and has good interpretability, and can be directly applied to a photovoltaic product supply chain traceability system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of supply chain management, and in particular to a photovoltaic product supply chain traceability method and system. Background Art

[0002] Real-time supply chain information helps companies predict demand more accurately, optimize inventory levels, and reduce inventory backlogs and out-of-stock risks. Traceability can promptly identify potential risks in the supply chain, such as supply disruptions and quality issues. When risks occur, companies can take quick action to reduce losses.

[0003] Traditional supply chain traceability technology mainly relies on manual records, barcode scanning and simple database management. Traditional methods have hidden dangers in data security, are susceptible to tampering and forgery, and it is difficult to quickly locate the source of the problem.

[0004] Although there are some methods or systems for tracing the supply chain based on blockchain, these methods and systems lack research on the overall flow path, mostly rely on rule engines, and lack the application of algorithm models. In addition, the smart contract of blockchain represents data that is recorded on the blockchain and cannot be modified. In order to improve and optimize the supply chain process and increase the flexibility and responsiveness of the supply chain, it is necessary to establish a photovoltaic product supply chain traceability method and system to improve the efficiency and practicality of traceability. Summary of the invention

[0005] The purpose of the present invention is to provide a photovoltaic product supply chain traceability method and system.

[0006] To achieve the above object, the present invention is implemented according to the following technical solutions:

[0007] A first aspect of the present invention provides a photovoltaic product supply chain traceability method, comprising the following steps:

[0008] S1. Entities in the supply chain are taken as nodes, and flow data between entities are taken as edges, and a supply chain network model is constructed using a graph algorithm; the entities in the supply chain include suppliers, manufacturers, distributors, and retailers; and the flow data is transaction data;

[0009] S2. Define a transmission protocol and a privacy protocol for the edges in the supply chain network model to obtain a data link; the data link is a link in the supply chain network model for storing transmission data;

[0010] S3, constructing constraint rules for the data chain, using a deep learning algorithm to learn the constraint rules to obtain a constraint model, and constraining the generation phase of the data chain through the constraint model;

[0011] S4, extracting product serial number features, time features and location features through the constrained data chain, performing multi-dimensional index encoding based on the KD tree, and obtaining a traceability query index;

[0012] S5. Obtain a tracing request, traverse the KD tree based on the tracing query index, and obtain a tracing path.

[0013] Furthermore, the method of constructing a supply chain network model using a graph algorithm includes:

[0014] Select the bidirectional graph model to build the supply chain network model. Create a node for each entity in the graph, and use bidirectional edges to connect the nodes.

[0015] Collect data about entities in the supply chain, including entity type, product information, and inventory data. Use product information and inventory data as node definition attributes of supply chain entities, and obtain transaction data between entities as edge definition attributes in the graph.

[0016] Entities are classified according to their types, and each node is assigned a unique position code based on the classification results.

[0017] Furthermore, a transmission protocol and a privacy protocol are defined for the edges in the supply chain network model, wherein the transmission protocol is specifically:

[0018] When a transmission operation occurs between supply chain entities, the position codes of the start and end nodes corresponding to the transmission operation in the supply chain network model, the node definition attributes, and the edge definition attributes are obtained, and the node definition attributes and the edge definition attributes are converted to obtain JSON format data;

[0019] Assign the JSON format data of the node definition attributes to the corresponding node storage;

[0020] The JSON format data of the edge definition attributes is used as the middle content of the data segment, and the start node and end node codes are used as the two ends of the data segment. The order in the data segment is: start node code → transaction data → end node code;

[0021] The data segments generated by each transmission are combined in the transmission order to obtain a data chain, which is then transmitted between the nodes of the supply chain network model based on the MQTT communication protocol.

[0022] Furthermore, a transmission protocol and a privacy protocol are defined for the edges in the supply chain network model, wherein the privacy protocol is specifically:

[0023] Perform combined encryption on the data chain to obtain a public key and a private key. Assign the private key to each node and a public key to the supply chain network model. The method of combined encryption is as follows: Use the symmetric encryption algorithm AES for symmetric encryption, generate a hash value for the symmetric encryption result using the hash function SHA-256, and encrypt the hash value using the asymmetric encryption algorithm RSA. The expressions for the public key and the private key are respectively:

[0024] K public =(e,n)

[0025] K private =(d,n)=(ModInverse(e,φ(n)),p×q)

[0026] Among them, K public is the public key, K private is the private key, e is the public key exponent, where 1 < e < φ(n), gcd(e,φ(n)) = 1, gcd(e,φ(n)) is the greatest common divisor of e and φ(n), n is the product of p and q, φ(n) is the calculated value of the Euler function, d is the private key exponent, and d×e = 1 (modφ(n)), mod represents performing the modular inverse operation, and p and q are prime numbers selected for combined encryption;

[0027] The public key can only encrypt the data chain, and the private key can only be used to decrypt the data segment transmitted by the node;

[0028] For each transmission, after encrypting the data chain with the public key, it is transmitted to the termination node. Using the private key of the starting node, after decrypting the data segment of the starting node, the data segment of the termination node is concatenated and added to the decrypted data segment.

[0029] Furthermore, the method of constructing constraint rules for the data chain and using a deep learning algorithm to learn the constraint rules to obtain a constraint model includes:

[0030] Define the constraint rules in the data chain, including: The end entity of a data segment is the start entity of the next data segment; The change in the inventory data in the node-defined attributes matches the transaction data in the data chain; The timestamps of the data segments are arranged in the correct order, that is, the timestamp of the subsequent data segment should not be earlier than the previous data segment; The product information in the node-defined attributes is consistent with the transaction data;

[0031] Construct a constraint model based on the graph convolutional neural network. Among them, the expression for defining the graph convolutional network layer is:

[0032]

[0033] Among them, H (l+1)is the feature matrix of the l+1th layer, σ is the ReLU activation function, for The degree matrix of for The normalized form of is the adjacency matrix, H (l) is the feature matrix of the lth layer, W (l) is the weight matrix of the lth layer;

[0034] The K-means algorithm is used to cluster the data segments in the data chain to obtain abnormal data segments and normal data segments, which are combined as a data set. The data set is divided into a training set and a test set in a ratio of 7:3. The model is trained to obtain a constraint model, in which the constraint rules are embedded into the loss function as loss terms. The expression of the loss function is:

[0035]

[0036] Where N is the total number of training samples, y i is the true label of sample i, is the probability that the model predicts that sample i is abnormal, λ is the coefficient that controls the strength of L2 regularization, M is the total number of model parameters, ω j is the model parameter, μ is the coefficient for additionally controlling the strength of the regularization term, and α k h is used to adjust the weight of the hidden layer activation value in the loss function, k is the activation value of the kth hidden layer, β k is used to adjust the weight of the hidden layer gradient value in the loss function, e k is the gradient value of the kth layer, γ, δ, ζ and η are the hyperparameters corresponding to the four association rule loss terms, L entity is the entity continuity loss term, L inventory is the inventory consistency loss term, L timestamp is the timestamp sequential loss term, L serial_batch This is the consistency loss item of product serial number and batch number.

[0037] Furthermore, the method of constraining the generation phase of the data link by the constraint model includes:

[0038] Get the private key of the starting node of the data segment to decrypt the data segment. The expression is:

[0039] P=Unpad(Decrypt Kprivate (C,Hash -1 (Hash Kpublic (K private ))))

[0040] Among them, Unpad represents the inverse operation of Pad filling, Decrypt Kprivate Represented as using the private key K private The decryption function, C is the encrypted data segment, Hash -1 is the inverse function of the hash function, Hash Kpublic Represented as using the public key K public The function to perform the hashing;

[0041] After decryption, if the data segment meets the constraint rules, it is allowed to enter the data chain. If not, the content in the data segment is verified based on the association rules to obtain the content that needs to be corrected, and the data segment is modified. After modification, it is re-encrypted using the public key.

[0042] Furthermore, the method of performing multidimensional index encoding based on KD tree to obtain traceability query index includes: taking the product serial number feature as the primary key, constructing a KD tree, and each leaf node stores the time feature and location feature related to the product serial number.

[0043] The second aspect of the present invention also provides a photovoltaic product supply chain traceability system comprising:

[0044] Supply chain network module, which builds a supply chain network model based on graph algorithms. Nodes represent entities in the supply chain, and edges represent flow data between entities.

[0045] The transmission and privacy protocol module defines the transmission protocol and privacy protocol in the directed supply chain and transmits them in the form of data chain;

[0046] A constraint rule module constructs constraint rules for the data chain, learns the constraint rules through a deep learning algorithm to obtain a constraint model, and constrains the data chain during the generation phase through the constraint model;

[0047] The traceability index module extracts product serial number sequence features, time series features and location sequence features through the constrained data chain, performs multi-dimensional index encoding based on the KD tree, and obtains the traceability query index;

[0048] The traceability path module obtains the traceability request, traverses the KD tree based on the traceability query index, and obtains the traceability path.

[0049] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0050] A processor; and a memory arranged to store computer executable instructions, which when executed cause the processor to perform the method steps described in the first aspect.

[0051] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple applications, the electronic device executes the method steps described in the first aspect.

[0052] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:

[0053] (1) The present invention can ensure the transparency and security of the supply chain by assigning a private key to each node and a public key to the supply chain network model, enhance data integrity and data exchange security, and effectively improve the security and traceability of the supply chain network model;

[0054] (2) The present invention combines association rules with deep learning algorithms to help the model more accurately identify abnormal behaviors and obtain abnormal nodes, so that the data chain can be corrected more specifically and the abnormal situation can be monitored and responded to in real time;

[0055] (3) The present invention creates a traceability index based on the KD tree for product serial number features, time features and location features, and can perform range queries, nearest neighbor queries, etc., and can quickly obtain data segments with specific time and location features, thereby accelerating traceability queries. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 The present invention is a flowchart of the steps of a photovoltaic product supply chain traceability method.

[0057] Figure 2 It is a schematic diagram of the structure of an electronic device in an embodiment of this specification. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0059] Reference Figure 1 As shown, the first aspect of the present invention provides a photovoltaic product supply chain traceability method, comprising:

[0060] S1. Entities in the supply chain are taken as nodes, and flow data between entities are taken as edges, and a supply chain network model is constructed using a graph algorithm; the entities in the supply chain include suppliers, manufacturers, distributors, and retailers; and the flow data is transaction data;

[0061] In the actual evaluation, a bidirectional directed graph model is selected to build a supply chain network model. A node is created for each entity in the graph, and a unique code is assigned to each entity: supplier code: SUP001~SUP012, manufacturer code: MAN002~MAN007, distributor code: DIS001~DIS005, retailer code: RET004~RET010;

[0062] S2. Define a transmission protocol and a privacy protocol for the edges in the supply chain network model to obtain a data link; the data link is a link in the supply chain network model for storing transmission data;

[0063] In the actual evaluation, the node data and edge data are converted into JSON format: Supplier: {type: "Supplier", productID: "SPV100", description: "Solar photovoltaic panels", price: 150, productionDate: "2024-01-01", location: "31.2304, 121.4737", contact: "supplier@example.com"}; Manufacturer: {type: "Manufacturer", productionCapacity: 2000, qualityControl: "ISO9001", location: "34.0522, -118.2437", contact: "manufacturer@example.com"}; Distributor: {type: "Distributor", orderProcessingTime: 5, inventoryLevel: 500, location: "40.7128, -74.0060", contact: "dist ributor@example.com"}; Retailer: {type:"Retailer",salesVolume:100,customerRating:4.5,location:"37.7749,-122.4194",contact:"retailer@example.com"}; Transaction data: {transactionAmount:300000,transactionDate:"2024-03-01",paymentTerms:"Net 30"} Edge attributes: {transportMode:"Truck",estimatedTimeOfArrival:"2024-03-15",shippingCost:5000,delayHistory:["2024-02-01:Delayed by 2days"]};

[0064] In the actual evaluation, whenever a transmission operation occurs between supply chain entities, the system automatically captures the start node code S, the end node code E, the node definition attribute A and the edge definition attribute B of the operation, converts A and B into JSON format data, takes the JSON format data of the edge definition attribute as the intermediate content, and the start node and end node codes as the two ends to form a data segment with the following structure: ["S", {"edge attribute": {...}},"E"], combines the data segments generated by all transmission operations in the transmission order to form a complete data chain, connects each entity in the supply chain to an MQTT proxy server, the start node publishes the data segment as a message to a specific topic, the end node subscribes to the same topic, receives the transmitted data segment, and transmits the data chain between the nodes of the supply chain network model;

[0065] Specifically, the JSON data segments generated by each transmission are combined in the transmission order to form a complete data chain, in which one data segment: SUP001: {...}::MAN002: {...}::DIS003: {...}::RET004: {}, using Neo4j to build a supply chain network model, and import the supply chain data into the Neo4j database;

[0066] In the actual evaluation, a strong random key k is selected to obtain the ciphertext C. The SHA-256 hash function is used to generate a hash value H for the encrypted ciphertext C. The hash value H is encrypted using an asymmetric encryption algorithm to obtain a public key and a private key. A private key PrivKey is assigned to each node in the supply chain network, and a public key PubKey is assigned to the entire network. The node can use the private key PrivKey to decrypt the data segment in the data chain during the transmission process to verify the data integrity and source.

[0067] S3, constructing constraint rules for the data chain, using a deep learning algorithm to learn the constraint rules to obtain a constraint model, and constraining the generation phase of the data chain through the constraint model;

[0068] In the actual assessment, abnormal transactions were detected: timestamp: 2023-4-15 03:00, starting node: SUP001, ending node: MAN005, transaction data: a batch of photovoltaic components with a specific serial number. The data was decrypted using the private key of supplier SUP001. After verifying the decrypted data, it was found that the transaction data did not match the record: the serial number and batch number did not match. According to the association rules, the erroneous information in the data segment was corrected, and the corrected data segment was re-encrypted using the public key of the supply chain network, and further updated to the distributed ledger to ensure that all entities have the latest transaction records.

[0069] S4, extracting product serial number features, time features and location features through the constrained data chain, performing multi-dimensional index encoding based on the KD tree, and obtaining a traceability query index;

[0070] In the actual evaluation, each data segment in the data chain is obtained, the timestamp data and product serial number data are extracted from the intermediate content, the node codes are obtained from both ends of the data segment, the timestamp data is combined to form the time series feature, the node codes are combined to obtain the position series feature, the product serial number data is used as the product serial number feature, and the traceability index is created based on the KD tree;

[0071] S5. Obtain a tracing request, traverse the KD tree based on the tracing query index, and obtain a tracing path.

[0072] In the actual evaluation, one segment of the data chain contains the following sequence of timestamps and positions:

[0073] Timestamps: 2024-03-01 08:00, 2024-03-01 09:00, 2024-03-01 10:00;

[0074] Position sequence: SUP001, MAN002, DIS003;

[0075] In the actual evaluation, the timestamp is converted into a numerical feature vector. For example, 2024-03-01 08:00 is converted into [2023, 3, 1, 8, 0]. A matrix is ​​further constructed, in which the rows represent the timestamp feature vectors and the columns represent the node codes. The matrix is ​​used as input to construct a KD tree, and the median of each dimension is selected as the split point. The created KD tree can be used for traceability query.

[0076] In this embodiment, the method of constructing a supply chain network model using a graph algorithm includes:

[0077] Select the bidirectional graph model to build the supply chain network model. Create a node for each entity in the graph, and use bidirectional edges to connect the nodes.

[0078] Collect data about entities in the supply chain, including entity type, product information, and inventory data. Use product information and inventory data as node definition attributes of supply chain entities, and obtain transaction data between entities as edge definition attributes in the graph.

[0079] Entities are classified according to their types, and each node is assigned a unique position code based on the classification results.

[0080] In this embodiment, a transmission protocol and a privacy protocol are defined for the edges in the supply chain network model, wherein the transmission protocol is specifically:

[0081] When a transmission operation occurs between supply chain entities, obtain the location codes, node definition attributes, and edge definition attributes of the start node and end node corresponding to the transmission operation in the supply chain network model, perform data conversion on the node definition attributes and edge definition attributes to obtain JSON format data;

[0082] Allocate the JSON format data of the node definition attributes to the corresponding nodes for storage;

[0083] Use the JSON format data of the edge definition attributes as the middle content of the data segment, use the start node and end node codes as the two ends of the data segment, and the order in the data segment is: start node code → transaction data → end node code;

[0084] Combine the data segments generated by each transmission according to the transmission order to obtain a data chain, and transmit the data chain between the nodes of the supply chain network model based on the MQTT communication protocol.

[0085] In this embodiment, for the edge definition transmission protocol and privacy protocol in the supply chain network model, the privacy protocol is specifically:

[0086] Perform combined encryption on the data chain to obtain a public key and a private key, allocate a private key to each node, and allocate a public key to the supply chain network model. The method of combined encryption is: use the symmetric encryption algorithm AES for symmetric encryption, use the hash function SHA-256 to generate a hash value for the symmetric encryption result, and use the asymmetric encryption algorithm RSA to encrypt the hash value. The expressions of the public key and private key are respectively:

[0087] K public =(e,n)

[0088] K private =(d,n)=(ModInverse(e,φ(n)),p×q)

[0089] Where K public is the public key, K private is the private key, e is the public key exponent, where 1 < e < φ(n), gcd(e,φ(n)) = 1, gcd(e,φ(n)) is the greatest common divisor of e and φ(n), n is the product of p and q, φ(n) is the calculated value of the Euler function, d is the private key exponent, and d×e = 1 (modφ(n)), mod represents performing the modular inverse operation, and p and q are prime numbers selected for combined encryption;

[0090] The public key can only encrypt the data chain, and the private key can only be used to decrypt the data segment transmitted by the node;

[0091] For each transmission segment, the data chain is encrypted by the public key and transmitted to the terminating node. The data segment of the starting node is decrypted using the private key of the starting node, and the data segment of the terminating node is added in series to the decrypted data segment.

[0092] In this embodiment, the method of constructing constraint rules for the data link and using a deep learning algorithm to learn the constraint rules to obtain a constraint model includes:

[0093] Define the constraint rules in the data chain, including: the end entity of one data segment is the start entity of the next data segment; the changes in the inventory data in the node definition attributes match the transaction data in the data chain; the timestamps of the data segments are arranged in the correct order, that is, the timestamp of the subsequent data segment should not be earlier than the previous data segment; the product information in the node definition attributes is consistent with the transaction data;

[0094] A constraint model is constructed based on a graph convolutional neural network, where the expression defining the graph convolutional network layer is:

[0095]

[0096] Among them, H (l+1) is the feature matrix of the l+1th layer, σ is the ReLU activation function, for The degree matrix of for The normalized form of is the adjacency matrix, H (l) is the feature matrix of the lth layer, W (l) is the weight matrix of the lth layer;

[0097] The K-means algorithm is used to cluster the data segments in the data chain to obtain abnormal data segments and normal data segments, which are combined as a data set. The data set is divided into a training set and a test set in a ratio of 7:3. The model is trained to obtain a constraint model, in which the constraint rules are embedded into the loss function as loss terms. The expression of the loss function is:

[0098]

[0099] Where N is the total number of training samples, y i is the true label of sample i, is the probability that the model predicts that sample i is abnormal, λ is the coefficient that controls the strength of L2 regularization, M is the total number of model parameters, ω j is the model parameter, μ is the coefficient for additionally controlling the strength of the regularization term, and α k h is used to adjust the weight of the hidden layer activation value in the loss function, k is the activation value of the kth hidden layer, βk is used to adjust the weight of the hidden layer gradient value in the loss function, e k is the gradient value of the kth layer, γ, δ, ζ and η are the hyperparameters corresponding to the four association rule loss terms, L entity is the entity continuity loss term, L inventory is the inventory consistency loss term, L timestamp is the timestamp sequential loss term, L serial_batch This is the consistency loss item of product serial number and batch number.

[0100] In this embodiment, the method of constraining the generation phase of the data link by the constraint model includes:

[0101] Get the private key of the starting node of the data segment to decrypt the data segment. The expression is:

[0102] P=Unpad(Decrypt Kprivate (C,Hash -1 (Hash Kpublic (K private ))))

[0103] Among them, Unpad represents the inverse operation of Pad filling, Decrypt Kprivate Represented as using the private key K private The decryption function, C is the encrypted data segment, Hash -1 is the inverse function of the hash function, Hash Kpublic Represented as using the public key K public The function to perform the hashing;

[0104] After decryption, if the data segment meets the constraint rules, it is allowed to enter the data chain. If not, the content in the data segment is verified based on the association rules to obtain the content that needs to be corrected, and the data segment is modified. After modification, it is re-encrypted using the public key.

[0105] In this embodiment, the method of obtaining a traceability query index by performing multidimensional index encoding based on a KD tree includes: using the product serial number feature as the primary key, constructing a KD tree, and storing time features and location features related to the product serial number in each leaf node.

[0106] The second aspect of the present invention further provides a photovoltaic product supply chain traceability system, comprising:

[0107] Supply chain network module, which builds a supply chain network model based on graph algorithms. Nodes represent entities in the supply chain, and edges represent flow data between entities.

[0108] The transmission and privacy protocol module defines the transmission protocol and privacy protocol in the directed supply chain and transmits them in the form of data chain;

[0109] A constraint rule module constructs constraint rules for the data chain, learns the constraint rules through a deep learning algorithm to obtain a constraint model, and constrains the data chain during the generation phase through the constraint model;

[0110] The traceability index module extracts product serial number sequence features, time series features and location sequence features through the constrained data chain, performs multi-dimensional index encoding based on the KD tree, and obtains the traceability query index;

[0111] The traceability path module obtains the traceability request, traverses the KD tree based on the traceability query index, and obtains the traceability path.

[0112] Figure 2 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 2 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.

[0113] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 2 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0114] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0115] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a photovoltaic product supply chain traceability device at the logical level. The processor executes the program stored in the memory and is specifically used to execute any of the above photovoltaic product supply chain traceability methods.

[0116] The above application Figure 1 A photovoltaic product supply chain traceability method disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in a decoding processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0117] The electronic device may also perform Figure 1 A photovoltaic product supply chain traceability method is implemented Figure 1 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.

[0118] An embodiment of the present application also proposes a computer-readable storage medium, which stores one or more programs, and the one or more programs include instructions. When the instructions are executed by an electronic device including multiple application programs, any one of the aforementioned photovoltaic product supply chain traceability methods is executed.

[0119] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0120] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.

[0121] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0123] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0124] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0125] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0126] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0127] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0128] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.

Claims

1. A photovoltaic product supply chain traceability method, characterized in that: The following steps are involved: The entities in the supply chain are taken as nodes, and the flow data between the entities are taken as edges, and a supply chain network model is constructed using a graph algorithm; the entities in the supply chain are composed of suppliers, manufacturers, distributors, and retailers; and the flow data is transaction data; Defining a transmission protocol and a privacy protocol for the edges in the supply chain network model to obtain a data link; the data link is a link in the supply chain network model for storing transmission data; Constructing constraint rules for the data chain, using a deep learning algorithm to learn the constraint rules to obtain a constraint model, and constraining the generation phase of the data chain through the constraint model; The product serial number features, time features and location features are extracted through the constrained data chain, and multi-dimensional index encoding is performed based on the KD tree to obtain the traceability query index; A traceability request is obtained, and the KD tree is traversed based on the traceability query index to obtain a traceability path.

2. A photovoltaic product supply chain traceability method according to claim 1, characterized in that: The method of constructing a supply chain network model using a graph algorithm includes: Select the bidirectional graph model to build the supply chain network model. Create a node for each entity in the graph, and use bidirectional edges to connect the nodes. Collect data on entities in the supply chain, which consists of entity type, product information, and inventory data. Use product information and inventory data as node definition attributes of supply chain entities, and obtain transaction data between entities as edge definition attributes in the graph. Entities are classified according to their types, and each node is assigned a unique position code based on the classification results.

3. A photovoltaic product supply chain traceability method according to claim 1, characterized in that: The transmission protocol and privacy protocol are defined for the edges in the supply chain network model, wherein the transmission protocol is specifically: When a transmission operation occurs between supply chain entities, the position codes of the start and end nodes corresponding to the transmission operation in the supply chain network model, the node definition attributes, and the edge definition attributes are obtained, and the node definition attributes and the edge definition attributes are converted to obtain JSON format data; Assign the JSON format data of the node definition attributes to the corresponding node storage; The JSON format data of the edge definition attributes is used as the middle content of the data segment, and the start node and end node codes are used as the two ends of the data segment. The order in the data segment is: start node code → transaction data → end node code; The data segments generated by each transmission are combined in the transmission order to obtain a data chain, which is then transmitted between the nodes of the supply chain network model based on the MQTT communication protocol.

4. A photovoltaic product supply chain traceability method according to claim 1, characterized in that: The transmission protocol and the privacy protocol are defined for the edges in the supply chain network model, wherein the privacy protocol is specifically: The data chain is encrypted in combination to obtain the public key and private key, a private key is assigned to each node, and a public key is assigned to the supply chain network model. The combined encryption method is: use the symmetric encryption algorithm AES for symmetric encryption, use the hash function SHA-256 to generate a hash value for the symmetric encryption result, and use the asymmetric encryption algorithm RSA to encrypt the hash value. The expressions of the public key and private key are: K public =(e,n) K private =(d,n)=(ModInverse(e,ϕ(n)),p×q) Among them, K public is the public key, K private is the private key, e is the public key exponent, where 1<e<φ(n), gcd(e, φ(n))=1, gcd(e, φ(n)) is the greatest common divisor of e and φ(n), n is the product of p and q, φ(n) is the calculated value of Euler function, is the private key exponent, and d×e=1(modφ(n)), mod represents the modular inverse operation, and p and q are the prime numbers selected for the combined encryption; The public key can only be used to encrypt the data chain, and the private key can only be used to decrypt the data segment transmitted by the node; For each transmission segment, the data chain is encrypted by the public key and transmitted to the terminating node. The data segment of the starting node is decrypted using the private key of the starting node, and the data segment of the terminating node is added in series to the decrypted data segment.

5. A photovoltaic product supply chain traceability method according to claim 1, characterized in that: The method of constructing constraint rules for the data link and using a deep learning algorithm to learn the constraint rules to obtain a constraint model includes: Define the constraint rules in the data chain, including: the end entity of one data segment is the start entity of the next data segment; the changes in the inventory data in the node definition attributes match the transaction data in the data chain; the timestamps of the data segments are arranged in the correct order, that is, the timestamp of the subsequent data segment should not be earlier than the previous data segment; the product information in the node definition attributes is consistent with the transaction data; A constraint model is constructed based on a graph convolutional neural network, where the expression defining the graph convolutional network layer is: Among them, H (l+1) is the feature matrix of the l+1th layer, σ is the ReLU activation function, for The degree matrix of for The normalized form of is the adjacency matrix, H (l) is the feature matrix of the lth layer, W (l) is the weight matrix of the lth layer; The K-means algorithm is used to cluster the data segments in the data chain to obtain abnormal data segments and normal data segments, which are combined as a data set. The data set is divided into a training set and a test set in a ratio of 7:

3. The model is trained to obtain a constraint model, in which the constraint rules are embedded into the loss function as loss terms. The expression of the loss function is: Where N is the total number of training samples, y i is the true label of sample i, is the probability that the model predicts that sample i is abnormal, λ is the coefficient that controls the strength of L2 regularization, M is the total number of model parameters, ω j is the model parameter, μ is the coefficient for additionally controlling the strength of the regularization term, and α k h is used to adjust the weight of the hidden layer activation value in the loss function, k is the activation value of the kth hidden layer, β k is used to adjust the weight of the hidden layer gradient value in the loss function, e k is the gradient value of the kth layer, γ, δ, ζ and η are the hyperparameters corresponding to the four association rule loss terms, L entity is the entity continuity loss term, L inventory is the inventory consistency loss term, L timestamp is the timestamp sequential loss term, L serial_batch This is the consistency loss item of product serial number and batch number.

6. A photovoltaic product supply chain traceability method according to claim 1, characterized in that: The method for constraining the generation phase of the data link by the constraint model comprises: Get the private key of the starting node of the data segment to decrypt the data segment. The expression is: Among them, Unpad represents the inverse operation of Pad filling. Represented as using the private key K private The decryption function, C is the encrypted data segment, Hash -1 is the inverse function of the hash function, Represented as using the public key K public The function to perform the hashing; After decryption, if the data segment meets the constraint rules, it is allowed to enter the data chain. If not, the content in the data segment is verified based on the association rules to obtain the content that needs to be corrected, and the data segment is modified. After modification, it is re-encrypted using the public key.

7. A photovoltaic product supply chain traceability method according to claim 1, characterized in that: The method for obtaining a traceability query index by performing multidimensional index encoding based on a KD tree includes: taking a product serial number feature as a primary key, constructing a KD tree, and storing time features and location features related to the product serial number in each leaf node.

8. A photovoltaic product supply chain traceability system, characterized in that: The system comprises: The supply chain network module builds a supply chain network model based on graph algorithms, where nodes represent entities in the supply chain and edges represent flow data between entities; The transmission and privacy protocol module defines the transmission protocol and privacy protocol for the edges in the supply chain network model and transmits them in the form of data links; A constraint rule module constructs constraint rules for the data chain, learns the constraint rules through a deep learning algorithm to obtain a constraint model, and constrains the data chain during the generation phase through the constraint model; The traceability index module extracts product serial number sequence features, time series features and location sequence features through the constrained data chain, performs multi-dimensional index encoding based on the KD tree, and obtains the traceability query index; The traceability path module obtains the traceability request, traverses the KD tree based on the traceability query index, and obtains the traceability path.

9. An electronic device, comprising: processor; as well as A memory arranged to store computer executable instructions, which when executed cause the processor to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, enables the electronic device to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Wharf logistics supply chain data protection method based on block chain

    CN112732830A

  • Indoor close contact person space-time trajectory tracing method and system based on visual perception

    CN118212260A