CN117455312A - Intelligent power grid supply chain quality detection method and system based on block chain technology - Google Patents
Intelligent power grid supply chain quality detection method and system based on block chain technology Download PDFInfo
- Publication number
- CN117455312A CN117455312A CN202311696226.5A CN202311696226A CN117455312A CN 117455312 A CN117455312 A CN 117455312A CN 202311696226 A CN202311696226 A CN 202311696226A CN 117455312 A CN117455312 A CN 117455312A
- Authority
- CN
- China
- Prior art keywords
- detection
- function
- data
- intelligent contract
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 224
- 238000005516 engineering process Methods 0.000 title claims abstract description 28
- 238000012937 correction Methods 0.000 claims abstract description 44
- 239000000463 material Substances 0.000 claims abstract description 42
- 230000007246 mechanism Effects 0.000 claims abstract description 21
- 238000000034 method Methods 0.000 claims abstract description 13
- 230000006870 function Effects 0.000 claims description 85
- 238000012360 testing method Methods 0.000 claims description 30
- 238000013507 mapping Methods 0.000 claims description 12
- 238000012549 training Methods 0.000 claims description 12
- 238000007477 logistic regression Methods 0.000 claims description 9
- 238000007726 management method Methods 0.000 claims description 5
- 230000008569 process Effects 0.000 claims description 5
- 238000004519 manufacturing process Methods 0.000 claims description 4
- 238000007781 pre-processing Methods 0.000 claims description 3
- 238000007637 random forest analysis Methods 0.000 claims description 3
- 238000011084 recovery Methods 0.000 claims description 3
- 238000012795 verification Methods 0.000 claims description 3
- 230000008713 feedback mechanism Effects 0.000 abstract description 3
- 238000004590 computer program Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 7
- 238000007689 inspection Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000004888 barrier function Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 239000000446 fuel Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0639—Performance analysis of employees; Performance analysis of enterprise or organisation operations
- G06Q10/06395—Quality analysis or management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/06—Energy or water supply
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Human Resources & Organizations (AREA)
- Economics (AREA)
- Theoretical Computer Science (AREA)
- Strategic Management (AREA)
- Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Entrepreneurship & Innovation (AREA)
- Educational Administration (AREA)
- Marketing (AREA)
- Computer Security & Cryptography (AREA)
- General Health & Medical Sciences (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Development Economics (AREA)
- Game Theory and Decision Science (AREA)
- Public Health (AREA)
- Water Supply & Treatment (AREA)
- Quality & Reliability (AREA)
- Primary Health Care (AREA)
- Operations Research (AREA)
- Bioethics (AREA)
- Computer Hardware Design (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention relates to a method and a system for detecting the quality of an intelligent supply chain of a power grid based on a block chain technology, which are used for constructing a supply chain quality detection block chain based on the block chain technology, constructing a data access system of a detection mechanism and integrating real-time material quality detection data with the block chain; the supply chain quality detection blockchain network builds a first smart contract, a second smart contract, and a third smart contract using a smart contract programming language; the first intelligent contract is used for realizing a prediction model, the second intelligent contract is used for realizing an identification model, and the third intelligent contract is used for realizing a matching correction model; and the authorities acquire detection results through the user side supply chain quality detection blockchain network. The invention realizes the authenticity and credibility of the supply chain data, and an automatic quality management and feedback mechanism, and improves the quality and efficiency of the power grid supply chain.
Description
Technical Field
The invention relates to the field of data management, in particular to a power grid intelligent supply chain quality detection method based on a block chain technology.
Background
With the increasing demand of materials in the power industry, the requirement on the timeliness of the quality detection of the materials and the accuracy of the results is urgent. The blockchain technology is very much concerned by large institutions and mainstream companies at home and abroad because of the characteristics of transparent disclosure, non-falsification, traceability and the like, has huge market growth space when being combined with business, and does not have technical, trade barriers and policy limitations. The novel technology with high safety and high reliability is applied and explored in the actual business scene of the detection mechanism, and has practical guiding significance for establishing the sound detection mechanism in the good psychological recognition sense and public confidence of the social people. Therefore, the safe and reliable quality inspection business application is developed, and the problems of weak information fidelity capability, low mutual credibility, difficult complaint and dispute treatment and the like of the detection report and the like in the traditional mode of part of quality inspection business links can be effectively solved by uploading and storing the information such as quality inspection process data, quality inspection results, quality inspection reports and the like.
Disclosure of Invention
In order to solve the problems, the invention aims to provide a method and a system for detecting the quality of an intelligent supply chain of a power grid based on a block chain technology, which realize the authenticity and reliability of supply chain data, and an automatic quality management and feedback mechanism and improve the quality and efficiency of the supply chain of the power grid.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
a block chain technology-based intelligent power grid supply chain quality detection method comprises the following steps:
step S1, constructing a supply chain quality detection block chain based on a block chain technology, constructing a data access system of a detection mechanism, and integrating real-time material quality detection data with the block chain;
s2, constructing a first intelligent contract, a second intelligent contract and a third intelligent contract by utilizing an intelligent contract programming language; the first intelligent contract is used for realizing a prediction model, receives the detection items, the detection parameters and the actual test values as input, calls the prediction model for prediction, and returns a prediction result to a caller; the second intelligent contract is used for realizing an identification model, receiving the detection single number as input, calling the identification model for identification, and obtaining forecast of the batch; the third intelligent contract is used for realizing a matching correction model, receiving a formal detection result and a forecast as input, and calling the matching correction model to carry out matching correction;
step S3: according to the data access system, accessing real-time material quality detection data into a supply chain quality detection block chain, and calling a first intelligent contract to generate a pre-report;
step S4, feeding back the detection result and the available information of the material class, which are judged to be qualified by the detection result in the pre-report, to a main department, wherein the main department can carry out related material warehouse-in and available work in advance by means of the forecast;
step S5, when the detection mechanism completes the formal detection, a formal detection result is generated, the formal detection result is accessed into a blockchain, and a second intelligent contract is called to identify the forecast of the batch according to the detection single number;
and S6, calling a third intelligent contract, perfecting and correcting forecast data according to the formal detection result, if the material class judged to be qualified in the pre-report is corrected, feeding the correction data back to the authorities for correction, and finishing all material warehousing and leading works of the batch according to the formal detection result.
Further, the step S1 specifically includes:
defining a data structure of material quality detection data, wherein the data structure comprises a material name, a batch number, a production date, a detection result and a detection time field;
defining an intelligent contract on a blockchain for storing and managing material quality detection data;
the detection mechanism constructs a data access system for uploading real-time material quality detection data into the blockchain network, and the data access system uses a digital signature technology to verify and encrypt the data:
firstly, calculating a hash value of input data, then calling a sign hash function to sign the hash value by using a private key of a sender, and storing a signature result in a signature map;
based on the verifyignature function, the address, data and signature of the signer are accepted as parameters, and the public key of the signer is used for verifying the validity of the signature;
then, a hash value is used as a parameter by calling a sign hash function, a private key of a sender is used for signing the hash value, and a signature result is returned in a byte array mode; invoking the verifyHash function to accept a hash value, the signature and the address of the signer as parameters, and verifying the validity of the signature by using the public key of the signer; calling ecdsaSign function to sign the hash value and the signer, and returning r, s and v values of the signature; wherein the r value is a part of the signature, the s value is another part of the signature, and the v value represents the recovery ID of the public key of the signer;
the hash value and the signature are verified based on the ecdsaVerify function, and the validity of the signature is returned;
the detection mechanism uploads real-time material quality detection data to an intelligent contract on a blockchain through a data access system;
the Smart merge date stores the data uploaded each time onto the blockchain in the form of a transaction and ensures the non-tamper-resistance and transparency of the data.
Further, the first smart contract is specifically as follows:
based on the Solidity, an intelligent contract named qualitypredictionContract is declared, in which a structure TestResult is defined for storing the detection parameters and the prediction results, the structure comprising two fields: detecting parameters and prediction results;
a mapping TestResult is used for storing the history test data, the mapped key is the name of the item, and the value is a TestResult structure array for storing the history test data of the item;
the addTestData function is used for adding historical test data into testResults, accepting the project names, the detection parameters and the prediction results as parameters, and storing the parameters under the corresponding project names;
the predictQuality function is used for calling an intelligent contract of the prediction model to predict, receiving the project name and the detection parameter as parameters, and returning a prediction result.
Further, the call prediction model predicts as follows:
firstly, defining an intelligent contract named Logistic regressionmodel, wherein the intelligent contract comprises a logistic regression model, model parameters comprise intercept, coefficient coef1 of parameter 1 and coefficient coef2 of parameter 2, a prediction function prediction receives parameter 1 and parameter 2 as inputs, and returns a prediction result true or false, and in the prediction function, a sigmoid function and an exponential function are used for calculating the prediction result;
then, modifying the QualityprepactionContract intelligent contract, adding a constructor for receiving the address of the Logistic RegressionnMODEL intelligent contract, and initializing the Logistic RegressionnMODEL in the constructor; a structure testResults is also defined for storing the detection parameters and prediction results, and a mapping testResults is used to store historical test data;
in the qualityprepactionContract intelligent contract, an addestData function is added for adding historical test data, the function is modified, a actualvue parameter is added for storing actual test values, a predictQuality function is also added for calling a logistic regressionmodel for prediction, and a prediction result is stored in a testResults.
Further, the logistic regression model is specifically:
setting n detection parameters x1, x2, & gt, xn, and a corresponding quality grade label y, y=1 indicating pass and y=0 indicating fail;
the logistic regression model is:
hθ(x) = g(θ^T * x)
where θ is the parameter vector of the model, and x is the input feature vector;
g (z) is a logical function, the formula of which is:
g(z) = 1 / (1 + e^(-z))
wherein z is an input parameter;
the prediction result of the model is:
if hθ (x) > = 0.5, then predict y=1; if hθ (x) < 0.5, then y=0 is predicted.
Further, the second intelligent contract accepts the detection single number as input, calls the recognition model to recognize, and calls the forecast notice of the corresponding single number in the block chain according to the recognition result, specifically as follows:
defining a contract named ReportStorage, wherein a report map is included for storing forecast reports corresponding to the detection unit numbers, defining a function named setReport for setting the forecast reports corresponding to the detection unit numbers, and simultaneously defining a function named getReport for acquiring the forecast reports corresponding to the detection unit numbers;
defining a contract named DetectionModel, which contains a ReportStorage address variable for storing the address of the ReportStorage contract, and defining a function named detectAndGenerator report for single number identification and pre-reporting back;
in the detectAndGenerator report function, firstly, a single number identification model is called for identification, then, a getReport function is called for obtaining a pre-report corresponding to the single number, a getReport function of a reportStorage contract is called according to a reportStorage contract address stored in a reportStorage address, the pre-report corresponding to the single number is obtained, and finally, the pre-report is returned.
Further, the third intelligent contract comprises a contract named MatchingModel, a mapping named matchdaddress is defined in the contract and used for storing a matching correction result, and the contract comprises a public function named match and used for matching a specific key and an address and storing the specific key and the address into the mapping; a matchstorage is also defined for invoking the matching correction model; in addition, there is a common view function named getMatchedAddress for obtaining the matching revision address corresponding to the specific key.
Further, the matching correction model is specifically as follows:
acquiring historical related information of a batch of products, including detection items, detection parameters and actual test values, and preprocessing to construct a training data set;
constructing a matching correction model based on a random forest model, training based on a training data set, and taking all detection items and detection parameters of a product as characteristics and taking an actual test value as a label in the training process;
and optimizing the trained model through cross verification to obtain a final matching correction model.
A block chain technology-based intelligent power grid supply chain quality detection system comprises a detection mechanism, a data access system, a supply chain quality detection block chain network and a user side; the detection mechanism integrates real-time material quality detection data with the blockchain through a data access system; the supply chain quality detection blockchain network builds a first smart contract, a second smart contract, and a third smart contract using a smart contract programming language; the first intelligent contract is used for realizing a prediction model, receives the detection items, the detection parameters and the actual test values as input, calls the prediction model for prediction, and returns a prediction result to a caller; the second intelligent contract is used for realizing an identification model, receiving the detection single number as input, calling the identification model for identification, and obtaining forecast of the batch; the third intelligent contract is used for realizing a matching correction model, receiving a formal detection result and a forecast as input, and calling the matching correction model to carry out matching correction; and the main department accesses the supply chain quality detection blockchain network through the user terminal to acquire a detection result.
Furthermore, the user side is further provided with a detection cost management module, a detection cost reference value is adjusted and set according to detection items, detection institutions, material classes and detection grade condition dimension parameters, meanwhile, detection cost amount is automatically calculated by associating detection plans and detection item contents, meanwhile, detection cost of unqualified products is summarized, detection cost payment notification functions are generated according to detection cost information and detection cost amount information, the detection cost payment notification functions are sent to an electronic mailbox provided by a provider, detection cost payment information is pushed to backlog of the provider, the detection cost payment is sent to a contact person of the provider in a short message mode, an early warning function is set for information that detection cost is not paid for an exceeding period, and notification information can be periodically and repeatedly sent to the provider without submitting detection cost payment credentials.
The invention has the following beneficial effects:
1. the invention realizes the authenticity and credibility of the supply chain data, and an automatic quality management and feedback mechanism, and improves the quality and efficiency of the power grid supply chain;
2. the invention stores the data such as the pre-report, the detection result and the like on the blockchain, realizes the data security and the non-falsification, can conveniently access the data through the intelligent contract, and performs operations such as matching correction and the like;
3. the invention packages the low-complexity prediction model directly through the intelligent contract, uses the high-complexity identification model and the high-complexity matching correction model through calling, and the more complex the code in the intelligent contract is, the higher the fuel cost required for execution is, packages the low-complexity prediction model directly in the intelligent contract, thereby reducing the complexity of the intelligent contract, reducing the execution cost, improving the execution efficiency of the intelligent contract, taking the high-complexity identification model and the high-complexity matching correction model as callable external service, realizing the decoupling of the intelligent contract and the external model, and realizing the flexible updating and replacing of the identification model and the matching correction model without modifying the code of the intelligent contract, thereby improving the expandability and flexibility.
Drawings
FIG. 1 is a flow chart of the method of the present invention;
FIG. 2 is a diagram illustrating a system architecture according to an embodiment of the invention.
Detailed Description
The invention is described in further detail below with reference to the attached drawings and specific examples:
referring to fig. 1, in the present embodiment, a method for detecting quality of intelligent supply chain of a power grid based on a blockchain technology is provided, including the following steps:
step S1, constructing a supply chain quality detection block chain based on a block chain technology, constructing a data access system of a detection mechanism, and integrating real-time material quality detection data with the block chain;
s2, constructing a first intelligent contract, a second intelligent contract and a third intelligent contract by utilizing an intelligent contract programming language; the first intelligent contract is used for realizing a prediction model, receives the detection items, the detection parameters and the actual test values as input, calls the prediction model for prediction, and returns a prediction result to a caller; the second intelligent contract is used for realizing an identification model, receiving the detection single number as input, calling the identification model for identification, and obtaining forecast of the batch; the third intelligent contract is used for realizing a matching correction model, receiving a formal detection result and a forecast as input, and calling the matching correction model to carry out matching correction;
step S3: according to the data access system, accessing real-time material quality detection data into a supply chain quality detection block chain, and calling a first intelligent contract to generate a pre-report;
step S4, feeding back the detection result and the available information of the material class, which are judged to be qualified by the detection result in the pre-report, to a main department, wherein the main department can carry out related material warehouse-in and available work in advance by means of the forecast;
step S5, when the detection mechanism completes the formal detection, a formal detection result is generated, the formal detection result is accessed into a blockchain, and a second intelligent contract is called to identify the forecast of the batch according to the detection single number;
and S6, calling a third intelligent contract, perfecting and correcting forecast data according to the formal detection result, if the material class judged to be qualified in the pre-report is corrected, feeding the correction data back to the authorities for correction, and finishing all material warehousing and leading works of the batch according to the formal detection result.
In this embodiment, step S1 specifically includes:
defining a data structure of material quality detection data, wherein the data structure comprises a material name, a batch number, a production date, a detection result and a detection time field;
defining an intelligent contract on a blockchain for storing and managing material quality detection data;
the detection mechanism constructs a data access system for uploading real-time material quality detection data into the blockchain network, and the data access system uses a digital signature technology to verify and encrypt the data:
firstly, calculating a hash value of input data, then calling a sign hash function to sign the hash value by using a private key of a sender, and storing a signature result in a signature map;
based on the verifyignature function, the address, data and signature of the signer are accepted as parameters, and the public key of the signer is used for verifying the validity of the signature;
then, a hash value is used as a parameter by calling a sign hash function, a private key of a sender is used for signing the hash value, and a signature result is returned in a byte array mode; invoking the verifyHash function to accept a hash value, the signature and the address of the signer as parameters, and verifying the validity of the signature by using the public key of the signer; calling ecdsaSign function to sign the hash value and the signer, and returning r, s and v values of the signature; wherein the r value is a part of the signature, the s value is another part of the signature, and the v value represents the recovery ID of the public key of the signer;
the hash value and the signature are verified based on the ecdsaVerify function, and the validity of the signature is returned;
the detection mechanism uploads real-time material quality detection data to an intelligent contract on a blockchain through a data access system;
the Smart merge date stores the data uploaded each time onto the blockchain in the form of a transaction and ensures the non-tamper-resistance and transparency of the data.
Further, the first smart contract is specifically as follows:
based on the Solidity, an intelligent contract named qualitypredictionContract is declared, in which a structure TestResult is defined for storing the detection parameters and the prediction results, the structure comprising two fields: detecting parameters and prediction results;
a mapping TestResult is used for storing the history test data, the mapped key is the name of the item, and the value is a TestResult structure array for storing the history test data of the item;
the addTestData function is used for adding historical test data into testResults, accepting the project names, the detection parameters and the prediction results as parameters, and storing the parameters under the corresponding project names;
the predictQuality function is used for calling an intelligent contract of the prediction model to predict, receiving the project name and the detection parameter as parameters, and returning a prediction result.
In this embodiment, a prediction model is called to predict, specifically as follows:
firstly, defining an intelligent contract named Logistic regressionmodel, wherein the intelligent contract comprises a logistic regression model, model parameters comprise intercept, coefficient coef1 of parameter 1 and coefficient coef2 of parameter 2, a prediction function prediction receives parameter 1 and parameter 2 as inputs, and returns a prediction result true or false, and in the prediction function, a sigmoid function and an exponential function are used for calculating the prediction result;
then, modifying the QualityprepactionContract intelligent contract, adding a constructor for receiving the address of the Logistic RegressionnMODEL intelligent contract, and initializing the Logistic RegressionnMODEL in the constructor; a structure testResults is also defined for storing the detection parameters and prediction results, and a mapping testResults is used to store historical test data;
in the qualityprepactionContract intelligent contract, an addestData function is added for adding historical test data, the function is modified, a actualvue parameter is added for storing actual test values, a predictQuality function is also added for calling a logistic regressionmodel for prediction, and a prediction result is stored in a testResults.
In this embodiment, the logistic regression model is specifically:
setting n detection parameters x1, x2, & gt, xn, and a corresponding quality grade label y, y=1 indicating pass and y=0 indicating fail;
the logistic regression model is:
hθ(x) = g(θ^T * x)
where θ is the parameter vector of the model, and x is the input feature vector;
g (z) is a logical function, the formula of which is:
g(z) = 1 / (1 + e^(-z))
wherein z is an input parameter;
the prediction result of the model is:
if hθ (x) > = 0.5, then predict y=1; if hθ (x) < 0.5, then y=0 is predicted.
Further, the second intelligent contract accepts the detection single number as input, calls the recognition model to recognize, and calls the forecast notice of the corresponding single number in the block chain according to the recognition result, specifically as follows:
defining a contract named ReportStorage, wherein a report map is included for storing forecast reports corresponding to the detection unit numbers, defining a function named setReport for setting the forecast reports corresponding to the detection unit numbers, and simultaneously defining a function named getReport for acquiring the forecast reports corresponding to the detection unit numbers;
defining a contract named DetectionModel, which contains a ReportStorage address variable for storing the address of the ReportStorage contract, and defining a function named detectAndGenerator report for single number identification and pre-reporting back;
in the detectAndGenerator report function, firstly, a single number identification model is called for identification, then, a getReport function is called for obtaining a pre-report corresponding to the single number, a getReport function of a reportStorage contract is called according to a reportStorage contract address stored in a reportStorage address, the pre-report corresponding to the single number is obtained, and finally, the pre-report is returned.
Further, the third intelligent contract comprises a contract named MatchingModel, a mapping named matchdaddress is defined in the contract and used for storing a matching correction result, and the contract comprises a public function named match and used for matching a specific key and an address and storing the specific key and the address into the mapping; a matchstorage is also defined for invoking the matching correction model; in addition, there is a common view function named getMatchedAddress for obtaining the matching revision address corresponding to the specific key.
Further, the matching correction model is specifically as follows:
acquiring historical related information of a batch of products, including detection items, detection parameters and actual test values, and preprocessing to construct a training data set;
constructing a matching correction model based on a random forest model, training based on a training data set, and taking all detection items and detection parameters of a product as characteristics and taking an actual test value as a label in the training process;
and optimizing the trained model through cross verification to obtain a final matching correction model.
Referring to fig. 2, in this embodiment, there is further provided a system for detecting quality of an intelligent supply chain of a power grid based on a blockchain technology, including a detection mechanism, a data access system, a supply chain quality detection blockchain network, and a client; the detection mechanism integrates real-time material quality detection data with the blockchain through a data access system; the supply chain quality detection blockchain network builds a first smart contract, a second smart contract, and a third smart contract using a smart contract programming language; the first intelligent contract is used for realizing a prediction model, receives the detection items, the detection parameters and the actual test values as input, calls the prediction model for prediction, and returns a prediction result to a caller; the second intelligent contract is used for realizing an identification model, receiving the detection single number as input, calling the identification model for identification, and obtaining forecast of the batch; the third intelligent contract is used for realizing a matching correction model, receiving a formal detection result and a forecast as input, and calling the matching correction model to carry out matching correction; and the main department accesses the supply chain quality detection blockchain network through the user terminal to acquire a detection result.
In this embodiment, the user side is further provided with a detection cost management module, a detection cost reference value is adjusted and set according to detection items, detection institutions, material classes and detection grade condition dimension parameters, meanwhile, detection cost amount is automatically calculated by associating detection plans and detection item contents, meanwhile, detection cost of unqualified products is summarized, detection cost information and detection cost amount information are summarized, a detection cost payment notification function is generated and sent to an email box provided by a provider, detection cost payment information is pushed to backlog of the provider, detection cost payment is sent to a contact person of the provider in a short message mode, an early warning function is set for information that detection cost is not paid for an exceeding period, and notification information can be periodically and repeatedly sent to the provider not submitting detection cost payment credentials.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the invention in any way, and any person skilled in the art may make modifications or alterations to the disclosed technical content to the equivalent embodiments. However, any simple modification, equivalent variation and variation of the above embodiments according to the technical substance of the present invention still fall within the protection scope of the technical solution of the present invention.
Claims (10)
1. A block chain technology-based intelligent power grid supply chain quality detection method is characterized by comprising the following steps:
step S1, constructing a supply chain quality detection block chain based on a block chain technology, constructing a data access system of a detection mechanism, and integrating real-time material quality detection data with the block chain;
s2, constructing a first intelligent contract, a second intelligent contract and a third intelligent contract by utilizing an intelligent contract programming language; the first intelligent contract is used for realizing a prediction model, receives the detection items, the detection parameters and the actual test values as input, calls the prediction model for prediction, and returns a prediction result to a caller; the second intelligent contract is used for realizing an identification model, receiving the detection single number as input, calling the identification model for identification, and obtaining forecast of the batch; the third intelligent contract is used for realizing a matching correction model, receiving a formal detection result and a forecast as input, and calling the matching correction model to carry out matching correction;
step S3: according to the data access system, accessing real-time material quality detection data into a supply chain quality detection block chain, and calling a first intelligent contract to generate a pre-report;
step S4, feeding back the detection result and the available information of the material class, which are judged to be qualified by the detection result in the pre-report, to a main department, wherein the main department can carry out related material warehouse-in and available work in advance by means of the forecast;
step S5, when the detection mechanism completes the formal detection, a formal detection result is generated, the formal detection result is accessed into a blockchain, and a second intelligent contract is called to identify the forecast of the batch according to the detection single number;
and S6, calling a third intelligent contract, perfecting and correcting forecast data according to the formal detection result, if the material class judged to be qualified in the pre-report is corrected, feeding the correction data back to the authorities for correction, and finishing all material warehousing and leading works of the batch according to the formal detection result.
2. The method for detecting the quality of the intelligent supply chain of the power grid based on the blockchain technology according to claim 1, wherein the step S1 is specifically:
defining a data structure of material quality detection data, wherein the data structure comprises a material name, a batch number, a production date, a detection result and a detection time field;
defining an intelligent contract on a blockchain for storing and managing material quality detection data;
the detection mechanism constructs a data access system for uploading real-time material quality detection data into the blockchain network, and the data access system uses a digital signature technology to verify and encrypt the data:
firstly, calculating a hash value of input data, then calling a sign hash function to sign the hash value by using a private key of a sender, and storing a signature result in a signature map;
based on the verifyignature function, the address, data and signature of the signer are accepted as parameters, and the public key of the signer is used for verifying the validity of the signature;
then, a hash value is used as a parameter by calling a sign hash function, a private key of a sender is used for signing the hash value, and a signature result is returned in a byte array mode; invoking the verifyHash function to accept a hash value, the signature and the address of the signer as parameters, and verifying the validity of the signature by using the public key of the signer; invoking ecdsaSign function to sign hash value and signer, and returning r, s and v values of the signature, wherein r value is one part of the signature, s value is the other part of the signature, and v value represents recovery ID of public key of the signer;
the hash value and the signature are verified based on the ecdsaVerify function, and the validity of the signature is returned;
the detection mechanism uploads real-time material quality detection data to an intelligent contract on a blockchain through a data access system;
the Smart merge date stores the data uploaded each time onto the blockchain in the form of a transaction and ensures the non-tamper-resistance and transparency of the data.
3. The blockchain technology-based power grid intelligent supply chain quality detection method of claim 1, wherein the first intelligent contract is specifically as follows:
based on the Solidity, an intelligent contract named qualitypredictionContract is declared, in which a structure TestResult is defined for storing the detection parameters and the prediction results, the structure comprising two fields: detecting parameters and prediction results;
a mapping TestResult is used for storing the history test data, the mapped key is the name of the item, and the value is a TestResult structure array for storing the history test data of the item;
the addTestData function is used for adding historical test data into testResults, accepting the project names, the detection parameters and the prediction results as parameters, and storing the parameters under the corresponding project names;
the predictQuality function is used for calling an intelligent contract of the prediction model to predict, receiving the project name and the detection parameter as parameters, and returning a prediction result.
4. The intelligent supply chain quality detection method for a power grid based on the blockchain technology according to claim 3, wherein the prediction model is invoked for prediction, specifically as follows:
firstly, defining an intelligent contract named Logistic regressionmodel, wherein the intelligent contract comprises a logistic regression model, model parameters comprise intercept, coefficient coef1 of parameter 1 and coefficient coef2 of parameter 2, a prediction function prediction receives parameter 1 and parameter 2 as inputs, and returns a prediction result true or false, and in the prediction function, a sigmoid function and an exponential function are used for calculating the prediction result;
then, modifying the QualityprepactionContract intelligent contract, adding a constructor for receiving the address of the Logistic RegressionnMODEL intelligent contract, and initializing the Logistic RegressionnMODEL in the constructor; a structure testResults is also defined for storing the detection parameters and prediction results, and a mapping testResults is used to store historical test data;
in the qualityprepactionContract intelligent contract, an addestData function is added for adding historical test data, the function is modified, a actualvue parameter is added for storing actual test values, a predictQuality function is also added for calling a logistic regressionmodel for prediction, and a prediction result is stored in a testResults.
5. The method for detecting the quality of the intelligent supply chain of the power grid based on the blockchain technology according to claim 4, wherein the logistic regression model is specifically:
setting n detection parameters x1, x2, & gt, xn, and a corresponding quality grade label y, y=1 indicating pass and y=0 indicating fail;
the logistic regression model is:
hθ(x) = g(θ^T * x)
where θ is the parameter vector of the model, and x is the input feature vector;
g (z) is a logical function, the formula of which is:
g(z) = 1 / (1 + e^(-z))
wherein z is an input parameter;
the prediction result of the model is:
if hθ (x) > = 0.5, then predict y=1; if hθ (x) < 0.5, then y=0 is predicted.
6. The intelligent supply chain quality detection method for the power grid based on the blockchain technology according to claim 1, wherein the second intelligent contract accepts the detection single number as input, calls the recognition model for recognition, and calls the forecast of the corresponding single number in the blockchain according to the recognition result, specifically as follows:
defining a contract named ReportStorage, wherein a report map is included for storing forecast reports corresponding to the detection unit numbers, defining a function named setReport for setting the forecast reports corresponding to the detection unit numbers, and simultaneously defining a function named getReport for acquiring the forecast reports corresponding to the detection unit numbers;
defining a contract named DetectionModel, which contains a ReportStorage address variable for storing the address of the ReportStorage contract, and defining a function named detectAndGenerator report for single number identification and pre-reporting back;
in the detectAndGenerator report function, firstly, a single number identification model is called for identification, then, a getReport function is called for obtaining a pre-report corresponding to the single number, a getReport function of a reportStorage contract is called according to a reportStorage contract address stored in a reportStorage address, the pre-report corresponding to the single number is obtained, and finally, the pre-report is returned.
7. The blockchain technology-based power grid intelligent supply chain quality detection method according to claim 1, wherein the third intelligent contract comprises a contract named matchdaddress, a mapping named matchdaddress is defined in the contract, the matching correction result is stored, and the contract comprises a public function named match, and the public function is used for matching specific keys and addresses and storing the specific keys and addresses in the mapping; a matchstorage is also defined for invoking the matching correction model; in addition, there is a common view function named getMatchedAddress for obtaining the matching revision address corresponding to the specific key.
8. The blockchain technology-based power grid intelligent supply chain quality detection method of claim 7, wherein the matching correction model is specifically as follows:
acquiring historical related information of a batch of products, including detection items, detection parameters and actual test values, and preprocessing to construct a training data set;
constructing a matching correction model based on a random forest model, training based on a training data set, and taking all detection items and detection parameters of a product as characteristics and taking an actual test value as a label in the training process;
and optimizing the trained model through cross verification to obtain a final matching correction model.
9. The intelligent power grid supply chain quality detection system based on the block chain technology is characterized by comprising a detection mechanism, a data access system, a supply chain quality detection block chain network and a user side; the detection mechanism integrates real-time material quality detection data with the blockchain through a data access system; the supply chain quality detection blockchain network builds a first smart contract, a second smart contract, and a third smart contract using a smart contract programming language; the first intelligent contract is used for realizing a prediction model, receives the detection items, the detection parameters and the actual test values as input, calls the prediction model for prediction, and returns a prediction result to a caller; the second intelligent contract is used for realizing an identification model, receiving the detection single number as input, calling the identification model for identification, and obtaining forecast of the batch; the third intelligent contract is used for realizing a matching correction model, receiving a formal detection result and a forecast as input, and calling the matching correction model to carry out matching correction; and the main department accesses the supply chain quality detection blockchain network through the user terminal to acquire a detection result.
10. The intelligent power grid supply chain quality detection system based on the blockchain technology according to claim 9, wherein the user side is further provided with a detection cost management module, detection cost reference values are adjusted and set according to detection items, detection institutions, material classes and detection grade condition dimension parameters, detection cost amounts are automatically calculated through correlation of detection plans and detection item contents, detection cost of unqualified products is collected, detection cost payment notification functions are generated according to detection cost and detection cost information, the detection cost payment notification functions are sent to an electronic mailbox provided by a provider, detection cost payment information is pushed to a to-be-done item of the provider, detection cost payment is sent to a contact person of the provider in a short message mode, an early warning function is set for information of an overdue unpaid detection cost, and notification information can be periodically and repeatedly sent to the provider who does not submit detection cost payment certificates.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311696226.5A CN117455312B (en) | 2023-12-12 | 2023-12-12 | Intelligent power grid supply chain quality detection method and system based on block chain technology |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311696226.5A CN117455312B (en) | 2023-12-12 | 2023-12-12 | Intelligent power grid supply chain quality detection method and system based on block chain technology |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117455312A true CN117455312A (en) | 2024-01-26 |
CN117455312B CN117455312B (en) | 2024-03-08 |
Family
ID=89593184
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311696226.5A Active CN117455312B (en) | 2023-12-12 | 2023-12-12 | Intelligent power grid supply chain quality detection method and system based on block chain technology |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117455312B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2639015C1 (en) * | 2017-01-26 | 2017-12-19 | Игорь Сан-Сенович Дю | Authenticity and quality control procedure of production in the process of manufacture and implementation |
KR20190133573A (en) * | 2018-05-23 | 2019-12-03 | 권형석 | Block Chain Trading System with Smart Contract And That way |
CN111861285A (en) * | 2020-08-07 | 2020-10-30 | 浙江华电器材检测研究所有限公司 | Power distribution network material quality data high-reliability real-time management and control method and system based on block chain technology |
CN113222360A (en) * | 2021-04-23 | 2021-08-06 | 南京航空航天大学 | Recording method and device for power material quality detection critical weight information |
CN113760916A (en) * | 2021-09-08 | 2021-12-07 | 国网上海市电力公司 | Material quality tracing method and system based on industrial internet identification and block chain |
CN115409409A (en) * | 2022-09-21 | 2022-11-29 | 国网黑龙江省电力有限公司电力科学研究院 | Power technology supervision and management system based on block chain intelligent contract |
CN115619289A (en) * | 2022-11-16 | 2023-01-17 | 国网山西省电力公司信息通信分公司 | Block chain-based distribution transformer quality detection result distinguishing method and device |
CN116594989A (en) * | 2023-04-20 | 2023-08-15 | 南方电网数字平台科技(广东)有限公司 | Power exchange sharing data quality assessment method, medium and system based on blockchain intelligent contract |
CN116993215A (en) * | 2023-08-04 | 2023-11-03 | 贵州财经大学 | Intelligent evaluation and early warning method and system for manufacturing quality of electric power equipment |
CN117172668A (en) * | 2023-09-11 | 2023-12-05 | 国网江苏省电力有限公司 | Warehouse management system |
-
2023
- 2023-12-12 CN CN202311696226.5A patent/CN117455312B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2639015C1 (en) * | 2017-01-26 | 2017-12-19 | Игорь Сан-Сенович Дю | Authenticity and quality control procedure of production in the process of manufacture and implementation |
KR20190133573A (en) * | 2018-05-23 | 2019-12-03 | 권형석 | Block Chain Trading System with Smart Contract And That way |
CN111861285A (en) * | 2020-08-07 | 2020-10-30 | 浙江华电器材检测研究所有限公司 | Power distribution network material quality data high-reliability real-time management and control method and system based on block chain technology |
CN113222360A (en) * | 2021-04-23 | 2021-08-06 | 南京航空航天大学 | Recording method and device for power material quality detection critical weight information |
CN113760916A (en) * | 2021-09-08 | 2021-12-07 | 国网上海市电力公司 | Material quality tracing method and system based on industrial internet identification and block chain |
CN115409409A (en) * | 2022-09-21 | 2022-11-29 | 国网黑龙江省电力有限公司电力科学研究院 | Power technology supervision and management system based on block chain intelligent contract |
CN115619289A (en) * | 2022-11-16 | 2023-01-17 | 国网山西省电力公司信息通信分公司 | Block chain-based distribution transformer quality detection result distinguishing method and device |
CN116594989A (en) * | 2023-04-20 | 2023-08-15 | 南方电网数字平台科技(广东)有限公司 | Power exchange sharing data quality assessment method, medium and system based on blockchain intelligent contract |
CN116993215A (en) * | 2023-08-04 | 2023-11-03 | 贵州财经大学 | Intelligent evaluation and early warning method and system for manufacturing quality of electric power equipment |
CN117172668A (en) * | 2023-09-11 | 2023-12-05 | 国网江苏省电力有限公司 | Warehouse management system |
Non-Patent Citations (4)
Title |
---|
冯翠香;: "区块链技术在电力物资供应管理中的应用", 经营与管理, no. 05, 8 May 2020 (2020-05-08) * |
刘宗妹;: ""区块链+射频识别技术"赋能食品溯源平台研究", 食品与机械, no. 09, 31 December 2020 (2020-12-31) * |
王胜寒;郭创新;冯斌;张浩;杜振东;: "区块链技术在电力系统中的应用:前景与思路", 电力系统自动化, no. 11, 31 December 2020 (2020-12-31) * |
陆歌皓;李析禹;谢丽红;杨丹妮;罗健钊;: "区块链技术及其在供应链管理中的应用", 网络安全技术与应用, no. 05, 15 May 2020 (2020-05-15) * |
Also Published As
Publication number | Publication date |
---|---|
CN117455312B (en) | 2024-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110263024B (en) | Data processing method, terminal device and computer storage medium | |
CN110121727B (en) | Method and system for providing authenticated, auditable and immutable input for intelligent contracts | |
US20220027992A1 (en) | Non-fungible cryptographic tokens for tracking trees | |
US10970274B2 (en) | System and method for electronic data capture and management for audit, monitoring, reporting and compliance | |
CN110383318B (en) | Method and system for recording point-to-point transaction processing | |
CN110503373B (en) | Logistics method and device based on block chain network | |
CN109741168A (en) | Online arbitration information exchange method and system | |
US11941353B2 (en) | Data reuse computing architecture | |
CN110729028A (en) | Health data processing method and device, electronic equipment and storage medium | |
CN109658126A (en) | Data processing method, device, equipment and storage medium based on product promotion | |
CN111010282B (en) | Block chain-based information processing method, related device and storage medium | |
CN111931245A (en) | Information processing method and device | |
CN113641976B (en) | Method and device for remote service handling, electronic equipment and storage medium | |
CN112200533A (en) | Block chain-based consumption voucher full-life-cycle management method and device | |
CN113190562A (en) | Report generation method and device and electronic equipment | |
CN113205193B (en) | Block chain-based waste treatment method, system, equipment and storage medium | |
CN117455312B (en) | Intelligent power grid supply chain quality detection method and system based on block chain technology | |
CN111652726A (en) | Information processing method and system based on block chain | |
CN114549053B (en) | Data analysis method, device, computer equipment and storage medium | |
CN114048330B (en) | Risk conduction probability knowledge graph generation method, apparatus, device and storage medium | |
CN112632634B (en) | Signature data processing method, device, computer equipment and storage medium | |
CN114240399A (en) | Government affair data processing method and system based on block chain platform | |
CN112258324A (en) | Contract approval method, contract approval server, equipment and medium | |
CN112085469A (en) | Data approval method, device, equipment and storage medium based on vector machine model | |
CN111932196A (en) | Case processing method, device and equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |