A blockchain-based digital management platform and method for morning health checkup sample retention
By introducing structured data generation, smart contract evidence storage, and multi-factor gating in food safety supervision, the reliability of morning temperature checks and food sample retention in food safety supervision has been solved, and efficient forgery identification and closed-loop evidence collection for sample destruction have been achieved.
Patent Information
- Application Number
- CN202610028206.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-09
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2046-01-09
AI Technical Summary
In the current food safety supervision of catering establishments, morning temperature checks and food sample retention rely on manual registration or centralized systems, which are prone to problems such as supplementary recording, proxy recording, tampering, and unreliable time sources. Blockchain evidence storage is vulnerable to forged data that can be verified and whose authenticity is difficult to determine. Sample destruction lacks strong correlation verification, making it difficult to form a closed-loop audit.
By generating structured data messages at the morning inspection and sample collection terminals, calculating data summaries and encrypting them to generate digital signatures, calling smart contracts to write evidence, and introducing sliding statistical time windows and credibility coefficients, combined with multi-factor gating for on-chain comprehensive judgment, alarm records and credibility adjustment are formed.
It improved the ability to identify counterfeit items, reduced the false alarm rate, enhanced the closed-loop evidence collection capability for sample retention and destruction, and improved the interpretability and auditability of supervision.
Smart Images

Figure CN122066439B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchain storage and intelligent contract credibility identification, more specifically, the present application relates to a blockchain storage morning inspection sample digital management platform and method. BACKGROUND
[0002] In the supervision of catering food safety, the morning inspection body temperature and food sample are usually recorded manually or by a centralized system, which may cause problems such as supplement recording, proxy recording, tampering, and untrustworthy time source. The existing blockchain storage usually only makes an abstract chain + signature verification, and when the private key of the collection terminal is copied, leaked or used by multiple people, the forged data can still pass the signature verification and the on-chain and off-chain fields are self-consistent, forming a storage void with a form of credibility but a semantic distortion. Moreover, the abnormality often manifests as a gradual deviation across records, such as repeated abstracts or ciphers, batch delayed writing, abnormal morning inspection frequency of personnel or sample density of dishes, etc. It is difficult to distinguish between real accidental abnormalities and gradual forgeries by relying on single record verification or fixed threshold, resulting in traceability but difficulty in identification, and weakening the effectiveness of supervision and evidence collection. In addition, the data contains sensitive fields such as identity and image, which need to be encrypted and stored off-chain and the integrity needs to be verified; the sample destruction also lacks strong correlation verification with the sample record, making it difficult to form a retention- destruction closed-loop audit capability.
[0003] To solve the above problems, the present application provides a solution. SUMMARY
[0004] In order to overcome the above-mentioned defects of the prior art, the embodiments of the present application provide a blockchain storage morning inspection sample digital management platform and method to solve the problems raised in the background art.
[0005] To achieve the above-mentioned purpose, the present application provides the following technical solutions: In a preferred embodiment, it comprises: The morning inspection collection terminal and the sample collection terminal collect data and structurally generate morning inspection original data messages and sample original data messages; The morning inspection data abstract and the sample data abstract are calculated respectively, and the morning inspection encrypted data and the sample encrypted data are generated by encryption, and the morning inspection digital signature and the sample digital signature are generated; The storage record is written by calling the storage write function of the intelligent contract, and the collection terminal identifier is additionally written in the storage record; the intelligent contract maintains a sliding statistical time window and a collection terminal credibility coefficient; the intelligent contract performs a cryptography self-consistency gate, a time sequence relationship self-consistency gate and a cross-record mode self-consistency gate based on the cross-record relationship, and writes a prompt alarm record or a high-risk alarm record by using a joint trigger structure of multiple factor gates; the intelligent contract updates the collection terminal credibility coefficient according to the abnormality intensity cumulative amount, and adjusts the gate threshold value; Obtain the sample identifier associated with the sample storage record, verify the sample encryption data and write the destruction storage record, read the target storage record to perform forensic verification and output the verification result.
[0006] In a preferred embodiment, the morning inspection terminal performs identity verification on the morning inspection object and outputs a personnel identifier, calls the temperature sensor connected or integrated with the terminal to obtain the body temperature value, obtains the current time from a trusted time source as the morning inspection timestamp, and structurally combines the personnel identifier, body temperature value, and morning inspection timestamp in the predetermined field order to obtain the morning inspection raw data message.
[0007] In a preferred embodiment, the sample collection terminal obtains the current time from a trusted time source as the sample storage timestamp, outputs a random number from a random number generator and generates a sample identifier based on the sample storage timestamp and the random number, encodes the sample identifier into a two-dimensional barcode and pastes it on the surface of the corresponding sample container, collects sample associated information including at least the food name, sample amount, and sample responsible person identifier, and structurally combines the sample identifier, sample associated information, and sample storage timestamp in the predetermined field order to obtain the sample raw data message.
[0008] In a preferred embodiment, the morning inspection raw data message is called to perform digest calculation using a secure hash algorithm to obtain a morning inspection data digest, and the same secure hash algorithm is called to perform digest calculation on the sample raw data message to obtain a sample data digest; a symmetric key issued by a key management service or generated and registered by an authorized subject is obtained, and a symmetric encryption algorithm is used to encrypt the morning inspection raw data message and the sample raw data message respectively to obtain morning inspection encryption data and sample encryption data. The morning inspection collection terminal and the sample collection terminal are respectively configured with asymmetric key pairs, and the private key is stored in the terminal secure storage area and the public key is registered, then the morning inspection collection terminal calls its private key to perform a digital signature algorithm on the morning inspection data digest to generate a morning inspection digital signature, and the sample collection terminal calls its private key to perform a digital signature algorithm on the sample data digest to generate a sample digital signature.
[0009] In a preferred embodiment, the morning inspection data digest, morning inspection encryption data, morning inspection digital signature, sample data digest, sample encryption data, and sample digital signature are submitted to the blockchain network through the storage writing function of the smart contract, and the smart contract is triggered to perform rule verification and on-chain comprehensive discrimination in the same storage writing transaction. The encrypted data of the morning inspection is sent to the storage service for writing and the storage address of the morning inspection ciphertext is obtained. The secure hash algorithm is called to calculate the digest of the morning inspection ciphertext on the encrypted data of the morning inspection. Then, a morning inspection evidence record containing the business type, morning inspection data digest, morning inspection digital signature, morning inspection timestamp, morning inspection ciphertext storage address and morning inspection ciphertext digest is constructed. The blockchain node verifies the morning inspection digital signature based on the registered public key and writes it into the ledger according to the consensus algorithm. The sample encrypted data is sent to the storage service for writing and the ciphertext storage address is obtained. The secure hash algorithm is called to calculate the ciphertext digest of the sample encrypted data. Then, a sample storage record containing the business type, sample data digest, sample digital signature, sample timestamp, sample identifier, ciphertext storage address and ciphertext digest is constructed and submitted for writing. The blockchain node verifies the sample digital signature based on the registered public key and writes it into the ledger according to the consensus algorithm.
[0010] In a preferred embodiment, for evidence storage records that have passed verification and whose on-chain fields are consistent with off-chain ciphertext, anomaly detection is performed based on cross-record relationships; an acquisition terminal identifier is additionally written into each evidence storage record, and the smart contract maintains a sliding statistical time window and maintains the credibility coefficient and anomaly intensity accumulation corresponding to each acquisition terminal identifier in the same transaction in which the evidence storage writing function is called. Newly written records are comprehensively judged on-chain using hierarchical gating: First, cryptographic self-consistent gating is performed. After signature verification, the ciphertext digest and data digest are counted repeatedly within a window, and the repetition rate is stored in the contract state as a dynamic quantity. The gating threshold is taken from the quantile statistics within the window and dynamically adjusted according to the credibility coefficient of the collection terminal. Next, temporal relationship self-consistent gating is performed. The upload delay is calculated by reading the record timestamp and block time, and a dynamic baseline is constructed using the median and absolute median difference. At the same time, hysteretic threshold curves for entering and exiting anomaly thresholds are set and superimposed with the duration condition. Finally, cross-record pattern self-consistent gating is performed. For the morning inspection side, the frequency within the window is calculated based on the personnel identifier and timestamp and the deviation is standardized. For the sample retention side, the density within the window is calculated based on the food name and timestamp and the deviation is standardized.
[0011] In a preferred embodiment, a multi-factor gating joint triggering structure is adopted. When at least two types of anomalies are combined within the same window and continuously meet the preset duration, a high-risk alarm record is written. When only a single type of anomaly is detected, a prompt alarm record is written. The alarm record simultaneously writes the set of anomaly factors and the judgment conclusion for verification. The cumulative amount of anomaly intensity is accumulated in a graded manner based on the prompt alarm and high-risk alarm, and the credibility coefficient of the acquisition terminal is updated according to the state evolution formula with attenuation and recovery terms and used to adjust each gating threshold. Compliance verification outputs such as missing food list coverage and failure to destroy evidence of expired samples are included as anomaly factors in the same gating framework and written into the on-chain record.
[0012] In a preferred embodiment, the sample identifier is obtained by scanning the two-dimensional barcode on the surface of the sample container, the corresponding sample storage record on the chain is queried and the sample data digest, encrypted storage address and encrypted digest are retrieved, and then the encrypted sample data is read from the storage service and the encrypted digest comparison, decryption and data digest comparison are performed in sequence. Subsequently, a destruction original data message containing a retention identifier, destruction timestamp, and destruction responsibility identifier is generated. The destruction data digest is calculated, encrypted, and a destruction digital signature is generated. The destruction ciphertext is written to the storage service to obtain the ciphertext storage address and calculate the ciphertext digest. Then, the business type, retention identifier, destruction timestamp, destruction data digest, destruction digital signature, ciphertext storage address, and ciphertext digest are written to the destruction evidence record and submitted to the blockchain. During evidence collection and verification, the target evidence record is read and the data digest, digital signature, and ciphertext storage address are extracted. After reading the ciphertext from the storage service, ciphertext digest comparison, decryption, and data digest comparison are performed, and the digital signature is verified. The comparison result and verification result are output.
[0013] In a preferred embodiment, it includes: a morning inspection sample collection structured module, a digest encryption and signature processing module, an on-chain comprehensive discrimination and alarm module, a destruction verification and evidence collection verification module, and communication connections between the modules; The morning inspection sample collection structured module is used to collect data from the morning inspection collection terminal and the sample collection terminal, and to generate the original morning inspection data message and the original sample collection data message in a structured manner. The digest encryption signature processing module is used to calculate the morning inspection data digest and the sample retention data digest respectively, and encrypt them to generate the morning inspection encrypted data and the sample retention encrypted data, and generate the morning inspection digital signature and the sample retention digital signature. The on-chain integrated judgment and alarm module is used to write evidence records and additionally write the collection terminal identifier through the evidence writing function of the smart contract, maintain the sliding statistical time window and the collection terminal credibility coefficient; it performs cryptographic self-consistent gating, temporal self-consistent gating and cross-record pattern self-consistent gating based on cross-record relationship, writes prompt alarm records or high-risk alarm records using the joint triggering structure of multi-factor gating, updates the collection terminal credibility coefficient according to the cumulative amount of abnormality intensity, and is used to adjust the gating threshold; The destruction verification and evidence collection module is used to obtain the sample identifier associated with the sample preservation record, verify the encrypted sample data and write it into the destruction preservation record, read the target preservation record, perform evidence collection verification and output the verification result.
[0014] The technical effects and advantages of the blockchain-based digital management platform and method for morning health check samples are as follows: This invention introduces a comprehensive on-chain discrimination mechanism oriented towards semantic distortion within the framework of off-chain encrypted storage and on-chain indexing. It employs layered gating of cross-record features such as repetition rate, upload latency, and frequency or density, combined with dynamic quantile thresholds and hysteresis mechanisms. Anomaly factors and alarm levels are written on-chain for verification. Terminal trustworthiness is updated based on cumulative anomalies, making the discrimination sensitivity adaptable to data scale and terminal risk. This improves forgery detection, reduces false alarms, and forms a closed-loop evidence collection process of sample retention and destruction, even in cases of private key leakage or sharing. Furthermore, it incorporates compliance anomalies such as missing coverage and expired data, enhancing explainable auditing and regulatory capabilities. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of a blockchain-based digital management platform and method for morning inspection sample retention, according to the present invention.
[0016] Figure 2 This is a sequence diagram of a blockchain-based digital management platform and method for morning inspection sample retention, as described in this invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Example This invention discloses a blockchain-based digital management method for morning health checkup samples, such as... Figure 2 As shown, it includes: Step 1: Raw data collection and structure generation; First, morning check data collection is performed. The morning check data collection terminal verifies the identity of the person being checked and outputs a personnel identifier. The identity verification refers to the process of verifying the identity of the person being checked and obtaining a unique identity identifier. The identity verification is implemented using at least one of the following methods: facial recognition, employee badge or certificate reading, and account password login. Among them, facial recognition refers to collecting the facial image of the person being checked, extracting facial features, and comparing it with pre-stored facial features to output the identity verification result. The personnel identifier is taken from the unique identity identifier value generated or returned when the identity verification is passed. The personnel identifier is used to uniquely identify the person being checked.
[0019] Subsequently, the morning check-up terminal calls the temperature sensor connected to or integrated with it to obtain the body temperature value, which is taken from the measurement output of the temperature sensor.
[0020] After identity verification and temperature measurement are completed, the morning check data collection terminal obtains the current time from a trusted time source and records it as the morning check timestamp. The trusted time source refers to a trusted time source capable of providing standard time, and the trusted time source is at least one of network time service or satellite time service. The time value is retrieved from a trusted time source, rather than being manually entered. Then, the morning check data collection terminal collects the personnel identifier, body temperature value, and morning check timestamp according to a predetermined field order. By performing structured combination, the raw data messages of the morning inspection are obtained. .
[0021] in, This represents the morning check-in timestamp, with the data source being the time value returned by a trusted time source. This refers to the raw data message from the morning health check, which is a data set obtained by the morning health check data collection terminal through a structured combination of data according to a predetermined field order. This data set includes at least a personnel identifier, body temperature value, and a morning health check timestamp. Three types of fields.
[0022] Then, sample data collection is performed. The sample collection terminal obtains the current time from a trusted time source and records it as the sample timestamp. Simultaneously, the sample collection terminal outputs a random number, denoted as r, from a random number generator. The random number generator is used to output the random number r, which is taken from the output value of the random number generator. The sample collection terminal is based on... A sample retention identifier is generated with r, which is an identifier value that can uniquely identify a single retained sample. The sample collection terminal encodes the sample retention identifier into a two-dimensional barcode and outputs it, and affixes the two-dimensional barcode to the surface of the container corresponding to the physical retained sample; wherein, the two-dimensional barcode refers to a barcode graphic that encodes data in a matrix manner, used to read the encoded data content by scanning.
[0023] Subsequently, the sample collection terminal collects sample association information, which includes at least the food name, sample quantity, and the identifier of the person responsible for the sample collection. The food name originates from the selection input of the menu list or the recognition input of a barcode or 2D barcode at the sample collection terminal. The menu list refers to the list of names of foods to be processed or already processed that were entered or imported into the sample collection terminal by the management on the day the sample was collected. The sample quantity originates from the weighing output of an electronic scale or the quantitative input of a standard measuring container. The identifier of the person responsible for the sample collection originates from the identity verification result of the person responsible for the sample collection at the sample collection terminal. If a sample image is collected, the sample image originates from the output of the camera at the sample collection terminal. After collection, the sample collection terminal stores the sample identifier, sample association information, and sample timestamp in a predetermined field order. By performing structured combination, the original sample data message is obtained. .
[0024] in, represents the sample timestamp, with the data source being the time value returned by a trusted time source; r represents a random number, with the data source being the output value of a random number generator; This refers to the original sample retention data message, which is a data set obtained by the sample collection terminal through a structured combination of predetermined fields. The data set includes at least the sample retention identifier, food name, sample quantity, sample retention responsible person identifier, and sample retention timestamp. If a sample image is collected, the dataset also includes a sample image field.
[0025] Step 2: Digest calculation, encryption, and digital signature generation; First, the raw data messages from the morning check-up. Perform summary calculation. The morning inspection data collection terminal or its associated processing terminal... Calculate the morning inspection data digest using a secure hash algorithm. The preferred secure hash algorithm is SHA256. The digest calculation satisfies the following formula: ; in, This indicates the raw data message from the morning inspection, which originates from the structured data message generated by the morning inspection data collection terminal in step one. This represents a secure hash algorithm used to irreversibly map input data and output a fixed-length digest value, preferably SHA256; This represents a summary of morning health check data, and its value is a set of values. The output value obtained by executing the secure hash algorithm is processed by a data processing device that is communicatively connected to the morning inspection collection terminal and the sample retention collection terminal.
[0026] Then, the original data message of the retained sample. Perform summary calculation. The sample collection terminal or its associated processing terminal... The same secure hash algorithm is used to calculate the digest of the sampled data. The summary calculation satisfies the following formula: ; in, This indicates the original sample data message, which originates from the structured data message generated by the sample acquisition terminal in step one. This represents a summary of the retained sample data, and its value is a set of values. The output value obtained by executing the secure hash algorithm.
[0027] After obtaining the data summary, respectively... and Encryption processing is performed to generate encrypted data. The encryption process uses a symmetric encryption algorithm, preferably AES. Specifically, the processing terminal obtains the symmetric key and records it as follows: The symmetric key The source of the key is either a key generated and issued by the key management service, or a key generated and registered by an authorized entity in a controlled environment; subsequently, the processing terminal processes the keys... and Symmetric encryption is performed to obtain encrypted morning inspection data. Encrypted data with retained samples They respectively satisfy: ; ; in: This refers to a symmetric key, which originates from a key management service or an authorized entity that generates and registers the key. This represents a symmetric encryption algorithm used to encrypt input data under the control of a symmetric key, preferably AES; This indicates encrypted data from the morning health check, and its value is a pair. The output ciphertext obtained by performing symmetric encryption; This indicates that the sample is encrypted data, and its value is a pair. The output ciphertext obtained by performing symmetric encryption.
[0028] Subsequently, a digital signature is generated to characterize the data source and ensure non-repudiation. Specifically, asymmetric key pairs are configured for both the morning inspection data collection terminal and the sample retention data collection terminal. These asymmetric key pairs are generated by a key management service or by the terminal's local cryptographic module. Each asymmetric key pair includes a private key and a public key, where the private key is stored in the secure storage area of the corresponding terminal, and the public key is registered as a verifiable public key. When generating the digital signature, the morning inspection data collection terminal uses its private key to generate a digest of the morning inspection data. Execute the digital signature algorithm to obtain the morning inspection digital signature. The sample collection terminal calls its private key to digest the sample data. Execute the digital signature algorithm to obtain the sample digital signature. The preferred digital signature algorithm is either ECDSA or RSA. The digital signature generation satisfies the following formula: ; ; in: This indicates the private key of the morning inspection data collection terminal. Its source is either a private key generated and distributed to the morning inspection data collection terminal by the key management service, or a private key generated and registered locally by the morning inspection data collection terminal. The private key of the sample collection terminal is generated and distributed to the sample collection terminal by the key management service, or it is a private key generated and registered locally by the sample collection terminal. This refers to a digital signature algorithm used to generate a signature value from an input digest value under the control of a private key, preferably ECDSA or RSA; This represents a summary of morning health check data, sourced from... The digest value obtained by performing a secure hash algorithm; This represents a summary of the retained sample data, the source of which is... The digest value obtained by performing a secure hash algorithm; This represents the digital signature for the morning check-in, and its value is a pair. The signature output value obtained by executing the digital signature algorithm; This indicates a digital signature for the sample, and its value is a pair. The signature output value obtained by executing the digital signature algorithm.
[0029] Step 3: Blockchain notarization and smart contract rule verification; In step three, the morning inspection data summary obtained in step two is written using the smart contract's notarization function. Encrypted data from morning health checks Morning check-up digital signature and sample data summary Sample encrypted data Sample digital signature Submitted to the blockchain network; the smart contract executes rule verification and on-chain comprehensive judgment in the same evidence storage transaction, and writes the verification results and alarm records into the blockchain ledger.
[0030] Specifically, the first step is to store and write the encrypted morning inspection data. The morning inspection data collection terminal will then store the encrypted morning inspection data. The data is sent to a storage service and the write operation is completed. The storage service is a data storage service capable of receiving encrypted data and returning storage location information; the storage service is at least one of an object storage service or a distributed file storage service. After completing the write operation, the storage service returns the encrypted storage address for the morning check data, which is the location within the storage service where the encrypted data can be located and read. The address information, and its data source is the return result of the storage service. Subsequently, the morning inspection data collection terminal encrypts the morning inspection data. The secure hash algorithm described in step two is used to calculate the morning check ciphertext digest, the data source of which is the encrypted data of the morning check. The output value obtained by executing the secure hash algorithm.
[0031] Then, the morning inspection data collection terminal constructs a morning inspection evidence record and submits it to the blockchain network for writing. The morning inspection evidence record includes at least: a business type field, a morning inspection data digest field, a morning inspection digital signature field, a morning inspection timestamp field, a morning inspection encrypted storage address field, and a morning inspection encrypted digest field. The business type field indicates that the record is a morning inspection business, and its value is fixedly assigned by the morning inspection data collection terminal. The morning inspection data digest field is taken from the morning inspection data digest. The data source is the digest calculation output of step two; the morning inspection digital signature field is taken from the morning inspection digital signature. The data source is the digital signature generation output from step two; the morning inspection timestamp field is taken from the morning inspection timestamp. The data source is the trusted time source from step one; the morning check encrypted text storage address field is taken from the morning check encrypted text storage address returned by the storage service; the morning check encrypted text digest field is taken from the encrypted morning check data. The output value obtained by executing the secure hash algorithm.
[0032] After receiving the morning inspection and evidence storage record, the blockchain network verifies the digital signature field of the morning inspection by the blockchain nodes. The public key used for verification is the public key corresponding to the morning inspection collection terminal, and the data source of the public key is the public key registration information. When the verification is successful, the blockchain nodes reach an agreement on the morning inspection and evidence storage record according to the consensus algorithm and write it into the blockchain ledger. The consensus algorithm is an algorithm used to reach an agreement on the record to be written among the blockchain nodes.
[0033] Then, the encrypted sample data is stored and written for verification. The sample acquisition terminal will store the encrypted sample data. The data is sent to the storage service and written. The storage service returns the ciphertext storage address, which refers to the address where the encrypted sample data can be located and read from the storage service. The address information, and its data source is the return result of the storage service.
[0034] Subsequently, the sample collection terminal encrypted the sample data. The secure hash algorithm described in step two is used to calculate the ciphertext digest of the sample, where the data source of the ciphertext digest is the encrypted sample data. The output value is obtained by executing a secure hash algorithm. Then, the sample collection terminal constructs a sample preservation record and submits it to the blockchain network for writing. The sample preservation record includes at least the following fields: business type field, sample data digest field, sample digital signature field, sample timestamp field, sample identifier field, sample encrypted storage address field, and sample encrypted digest field. Among them, the business type field is used to indicate that the record is a sample business, and its value is fixedly assigned by the sample collection terminal; the sample data digest field is taken from the sample data digest. The data source is the digest calculation output of step two; the sample digital signature field is taken from the sample digital signature. The data source is the digital signature generation output from step two; the sample timestamp field is taken from the sample timestamp. The data source is the reliable time source from step one; the sample identifier field is taken from the sample identifier generated in step one, and its data source is the sample collection terminal based on the sample timestamp. The identifier value is generated by a random number r; the ciphertext storage address field is taken from the ciphertext storage address returned by the storage service; the ciphertext digest field is taken from the encrypted sample data. The output value obtained by executing the secure hash algorithm.
[0035] After receiving the sample preservation record, the blockchain network verifies the digital signature field of the sample by the blockchain node. The public key used for verification is the public key corresponding to the sample collection terminal, and the data source of the public key is the public key registration information. When the verification is successful, the blockchain node reaches an agreement on the sample preservation record according to the consensus algorithm and writes it into the blockchain ledger.
[0036] It should be noted that the original data message of the morning check has already been completed. With the original data message of the retained sample The data was collected and structured, and data summaries have been obtained. , Encrypted data , and digital signatures , Furthermore, after the evidence record containing the data digest field, digital signature field, timestamp field, ciphertext storage address field, and ciphertext digest field is written into the blockchain ledger and verified and consensus-written by the blockchain nodes, when the private key of the collection terminal is copied, leaked, or shared by multiple people, the newly added evidence record can simultaneously meet the formal verification conditions such as successful signature verification, recalculated and consistent digest, readable ciphertext and consistent ciphertext digest, and existence of the timestamp field. Moreover, the on-chain fields and off-chain ciphertext are cryptographically consistent. However, this consistency only indicates that the record is signed by the corresponding private key and the data is consistent on-chain and off-chain. It cannot further indicate that the morning check or sampling operation corresponding to the record actually occurred, thus creating a formally credible but semantically distorted evidence gap. Here, an evidence gap refers to a situation where the evidence record is cryptographically consistent and successful signature verification, but the corresponding morning check or sampling operation has not actually occurred.
[0037] It should be further clarified that the aforementioned distortions are not absolute anomalies in a single record field, but rather tend to manifest as gradual deviations across record relationships. For example, morning inspection records with the same personnel identifier may exhibit atypical dense or sparse distributions on adjacent timestamps; sample retention records related to the same food name or sample retention identifier may show atypical repetitive or delayed writing patterns within a sliding time window; or multiple data digests and encrypted digests may exhibit atypically similar or atypically discrete combination characteristics within a time window. In such cases, it is difficult to reliably distinguish between genuine but occasional anomalies and legitimate but progressive forgeries based solely on the verification results of a single record or a fixed threshold. This can easily lead to a state that is verifiable but inexplicable, traceable but indistinguishable, thus making it impossible for the records to provide sufficient basis for judgment in management and regulatory scenarios.
[0038] Therefore, in this embodiment, the on-chain comprehensive judgment and alarm writing operation is triggered by the smart contract during the execution of the evidence storage writing transaction. The smart contract is a contract program deployed on the blockchain ledger. The triggering condition is to call the evidence storage writing function of the smart contract to write the morning inspection evidence storage record or the sample evidence storage record. In order to enable the evidence storage record to form a verifiable judgment for cases where the signature passes but the semantics may be distorted, the morning inspection collection terminal and the sample collection terminal, when constructing their respective evidence storage records, in addition to the data digest field, digital signature field, timestamp field, encrypted storage address field, and encrypted digest field that have already been written, also write a collection terminal identifier field. The collection terminal identifier is an identifier value used to uniquely identify the collection terminal that initiated the evidence storage record. The collection terminal identifier is taken from the public key digest value obtained by performing a secure hash algorithm on the public key of the collection terminal or from the registered terminal identifier value. The data source of the public key digest value is the output value obtained by performing a secure hash algorithm on the public key of the collection terminal.
[0039] Next, the smart contract maintains on-chain a trust coefficient for each data collection terminal identifier, denoted as [the trust coefficient is then described in the original text]. The value range is [0,1], which is used to characterize the credibility of the collection terminal within the current statistical time window. The statistical time window refers to a sliding time window based on the blockchain ledger block time, and its window length is denoted as W. W is a pre-set time length parameter and is written into the blockchain ledger as a smart contract initialization parameter. For each newly written morning inspection evidence record or sample evidence record, the smart contract calculates multiple dynamic quantities and special quantities based on the cross-record relationship between the record and the historical records within the statistical time window. Without using a single threshold trigger, it performs hierarchical gating discrimination: first, it gates the cryptographic self-consistency, then the temporal relationship self-consistency, and finally the cross-record pattern self-consistency. When any gating layer is judged as abnormal, the smart contract writes the abnormal factor set and the discrimination conclusion into the blockchain ledger, so that the discrimination process has traceability and verifiability. Here, gating refers to the discrimination processing of judging a specified consistency condition and outputting a normal or abnormal result.
[0040] The cryptographic self-consistent gating does not use signature verification as the final reliable basis, but only uses the signature verification result as a necessary but not sufficient condition. After reading the digital signature field of the newly written record and completing the signature verification, the smart contract continues to read the ciphertext digest field and the ciphertext storage address field of the record, and performs a repeatability analysis on the ciphertext digest field and the ciphertext digest set of the same collection terminal identifier within the statistical time window to obtain the ciphertext digest repeatability rate. The data source of the ciphertext digest repeatability rate is the statistical result of the occurrence frequency of the ciphertext digest field within the statistical time window.
[0041] Furthermore, the smart contract reads the data digest field of the record and performs a repeatability analysis on the data digest field and the set of data digests of the same acquisition terminal identifier within the statistical time window to obtain a dynamic quantity called data digest repeatability rate. The data source for the data digest repeatability rate is the statistical result of the frequency of occurrence of the data digest field within the statistical time window. To cover the progressive characteristics of legitimate replay and perturbation replay, the smart contract does not handle it with a static rule of alarming upon the occurrence of a single repetition. Instead, it writes the ciphertext digest repeatability rate and the data digest repeatability rate as dynamic quantities that are updated with the window scrolling into the contract state, and based on the acquisition terminal credibility coefficient... Dynamically adjust the triggering conditions: when When the threshold is low, reduce the repetitive triggering threshold; when When the repetition rate is high, the repetition trigger threshold is increased to avoid distorted triggering caused by a fixed threshold under different data scales and record densities. The trigger threshold here is not a fixed constant, but is dynamically determined by the smart contract based on the historical distribution within a statistical time window. Specifically, the quantile value of the corresponding repetition rate sequence within the statistical time window is taken as the threshold. The quantile value is given by the smart contract initialization parameters and its changes can be updated and recorded on-chain. The quantile threshold is calculated from the sequence within the statistical time window according to the quantile parameter q, where q is the smart contract initialization parameter.
[0042] The self-consistent timing gate is used to capture legitimate new entries but with anomalous timing organization, resulting in forged or replay patterns. The smart contract reads the timestamp field of the newly written record and records it as 't', and simultaneously reads the block time of the block containing that record and records it as 't'. And calculate the upload latency. ,in The data source is the difference between the blockchain ledger block time and the record timestamp field. The smart contract writes Δt as a dynamic quantity into the contract state and constructs a dynamic baseline using the upload latency sequence of similar records within a statistical time window. This dynamic baseline is preferably constructed using the median and absolute median difference to reduce the impact of extreme values on the baseline. Specifically, the smart contract calculates the median of the upload latency sequence within the statistical time window and records it as... Calculate the median of the absolute deviation of the upload latency sequence from the median and denot it as . And calculate the timing consistency deviation. Satisfy the following formula: ; Wherein, Δt represents the upload latency, the meaning and source of which are as described above; This represents the median of the upload latency sequence within the statistical time window. The data source is the result of median statistics on the upload latency sequence within the window. It represents the absolute median difference of the upload delay sequence within the statistical time window. Its data source is the result of calculating the absolute deviation of the upload delay sequence within the window and taking the median. This represents a positive constant to prevent the denominator from being zero. Its value is a contract initialization parameter and is written into the blockchain ledger. This represents the deviation in timing consistency, and its data comes from the calculation results of the above formula.
[0043] At the same time, smart contracts do not directly compare using a fixed threshold. Instead, a hysteresis-based dynamic threshold is used for dynamic adjustment: two threshold curves are set for the same acquisition terminal identifier, one for entering an anomaly and one for exiting an anomaly. Both threshold curves are determined within a statistical time window. The quantile value sequence is dynamically generated, and the entry anomaly threshold is higher than the exit anomaly threshold to avoid frequent jittering of the judgment state during critical fluctuations; when When the threshold for entering an anomaly is exceeded, the smart contract marks the data collection terminal identifier as being in a timing anomaly state. Once the threshold for exiting an anomaly is reached and the preset duration is met, the anomaly state is lifted.
[0044] The cross-record mode self-consistency gating is used to capture progressive forgery where the signature verification is successful and the fields are self-consistent, but the cross-record relationships gradually deviate. For morning inspection evidence records, the smart contract calculates the dynamic value of the morning inspection frequency within a statistical time window based on the personnel identifier and timestamp fields. The data source for the dynamic value of the morning inspection frequency is the ratio of the number of morning inspection evidence records corresponding to the same personnel identifier within the statistical time window to the window length W, and further calculates the degree of deviation of the morning inspection frequency from the overall distribution of the window. Wherein, the degree of deviation is taken as the standardized deviation of the morning inspection frequency Zfam, Zfam=(Fam-MedFam) / (MadFam+εf); Fam represents the dynamic quantity of the morning inspection frequency; MedFam represents the median of the sequence of dynamic quantities of the morning inspection frequency corresponding to all personnel identifiers within the statistical time window; MadFam represents the median of the absolute deviation of the sequence from the median; εf represents a positive constant to prevent the denominator from being zero, and its value is taken as a contract initialization parameter and written into the blockchain ledger; For the sample retention records, the smart contract calculates the dynamic value of the sample density within a statistical time window based on the food name and timestamp fields. The data source for the dynamic value of the sample density is the ratio of the number of sample retention records corresponding to the same food name within the statistical time window to the window length W. Furthermore, it calculates the deviation of the sample density relative to the overall distribution of the window. This deviation is taken as the standardized deviation of the sample density Zspd, where Zspd = (Dsp - MedDsp) / (MadDsp + εs); Dsp represents the dynamic value of the sample density; MedDsp represents the median of the sequence of dynamic values of the sample density corresponding to all food names within the statistical time window; MadDsp represents the median of the absolute deviation of the sequence from the median; and εs represents a positive constant to prevent the denominator from being zero, and its value is a contract initialization parameter written into the blockchain ledger.
[0045] Furthermore, the smart contract employs a multi-factor gating joint triggering structure: a high-risk alarm record is generated only when at least two of the following anomalies—repetitive anomalies, timing anomalies, frequency deviation anomalies, and density deviation anomalies—are simultaneously satisfied within the same statistical time window, and this anomaly combination continues to exceed a preset duration parameter (Tdur, measured in blockchain ledger block time) from the moment it is first simultaneously satisfied; when only one type of anomaly is satisfied, only a suggestive alarm record is generated and written to the blockchain ledger. The high-risk alarm record includes at least a data acquisition terminal identifier field, an alarm generation timestamp field, an anomaly factor set field, and a judgment conclusion field. The alarm generation timestamp is taken from the blockchain ledger block time or the time value written to the blockchain ledger by a trusted time source; the anomaly factor set field records the anomaly type identifier that triggered the alarm, and its value is written by the smart contract based on the gating judgment result; the judgment conclusion field indicates whether the alarm is a suggestive alarm or a high-risk alarm, and its value is written by the smart contract according to the aforementioned joint triggering structure.
[0046] Based on the above multi-factor gating judgment, the smart contract assesses the reliability coefficient of the data collection terminal. The execution state is updated to dynamically adjust the judgment criteria based on the anomaly intensity and persistence. Specifically, the smart contract maintains a cumulative anomaly intensity for each data acquisition terminal identifier and records it as... The data source for the cumulative abnormal intensity is the result of accumulating various abnormal gating outputs within a statistical time window; when a warning alarm is generated, it is accumulated in a small increment. When a high-risk alarm is generated, it is accumulated in larger increments. Furthermore, the aforementioned incremental values are taken as contract initialization parameters and written into the blockchain ledger. Subsequently, the smart contract updates the credibility coefficient of the data collection terminal as follows: ; in, This represents the credibility coefficient of the data collection terminal before the update, and its data source is the current value corresponding to the identifier of the data collection terminal in the smart contract state. This represents the updated reliability coefficient of the data acquisition terminal, and its data source is the calculation result of the above formula; This represents the cumulative amount of abnormal intensity, and its meaning and source are as described above; This represents the decay coefficient, whose value is a contract initialization parameter and written into the blockchain ledger. This represents the recovery term, whose value is a contract initialization parameter written to the blockchain ledger. It is used to slowly restore the credibility coefficient when no anomaly is triggered or when the anomaly dissipates; eee represents the natural constant. The smart contract is being updated. Afterwards, The contract state is written, and the timestamp of this update is written to the blockchain ledger, making the change in the credibility coefficient of the data collection terminal traceable and verifiable; simultaneously, the smart contract will... The feedback to the aforementioned dynamic adjustment of the gate threshold makes the same acquisition terminal identifier enter a more sensitive discrimination state when the credibility decreases, and return to a more robust discrimination state when the credibility recovers. In addition, the smart contract retains on-chain verification of basic compliance items such as the daily menu and sample retention period, but no longer uses them as the sole basis for alarms. Instead, its output serves as one of the abnormal factors for the aforementioned multi-factor gating judgment: when it detects that there are food names in the daily menu that are not covered by the sample retention record, the smart contract generates a coverage missing anomaly and writes it into the anomaly factor set field; when it detects that the sample identifier has not been destroyed after the sample retention period has expired, the smart contract generates an overdue anomaly and writes it into the anomaly factor set field; the above-mentioned anomaly factors also participate in the judgment logic of the collection terminal credibility coefficient and alarm level, so that compliance anomalies and anomalies that pass the verification but may have semantic distortion can be uniformly recorded and reviewed under the same judgment framework.
[0047] Step 4: Verification of sample destruction, recording of destruction evidence, and verification of evidence collection; In step four, the physical samples to be destroyed are subject to sample destruction verification, and a destruction evidence record is generated and written into the blockchain ledger after the verification is passed. At the same time, when it is necessary to verify the morning inspection evidence record, sample preservation evidence record, or destruction evidence record, an evidence collection verification operation is performed to output the verification result.
[0048] Specifically, the first step is to verify the destruction of the retained samples. The person responsible for the retained samples places the physical samples to be destroyed within the reading range of a scanning device, which is a two-dimensional barcode scanner or a mobile terminal equipped with a camera. The scanning device scans and reads the two-dimensional barcode affixed to the surface of the physical sample container, and parses it to obtain the sample identifier. The data source of the sample identifier is the data content generated by the sample collection terminal in step one and encoded into the two-dimensional barcode.
[0049] Subsequently, the person responsible for or managing the sample retention will query the sample retention record associated with the sample retention identifier through the blockchain network. The data source of the sample retention record is the evidence record in the blockchain ledger. The sample retention data summary will then be read from the sample retention record. The system provides the encrypted storage address and digest of the sample. Then, the person responsible for or managing the sample retrieves the encrypted sample data from the storage service using the encrypted storage address. The The data source is the encrypted read result returned by the storage service. (Read) Afterwards, The secure hash algorithm described in step two is used to calculate the verification ciphertext digest, and the verification ciphertext digest is compared with the ciphertext digest of the retained sample in the retained evidence record. If the comparison is consistent, decryption is performed to obtain the decryption result of the original sample data message. The decryption process uses a symmetric decryption algorithm corresponding to the encryption process in step two, preferably the AES decryption algorithm; the symmetric key used in the decryption process is the symmetric key described in step two. The The data source is the key issued by the key management service or the key generated and registered by the authorized entity. The decryption process satisfies the following formula: ; in: This represents a symmetric key, whose data source is a key issued by a key management service or a key generated and registered by an authorized entity; This indicates that the encrypted sample data originates from the ciphertext data returned by the storage service. This represents a symmetric decryption algorithm used to decrypt ciphertext data under the control of a symmetric key, and corresponds to the symmetric encryption algorithm in step two, preferably the AES decryption algorithm; This indicates the decrypted data message, and its value is a pass / fail. The plaintext data output by executing the symmetric decryption algorithm.
[0050] get Afterwards, The verification data digest is calculated by calling the secure hash algorithm described in step two. and the verification data digest Summary of sample data in the sample retention record A consistency comparison is performed; the consistency comparison uses an equality comparison operation. The calculation of the verification data digest satisfies the following formula: ; in: This indicates a secure hash algorithm, which has the same meaning as in step two, and is preferably SHA256; This represents the decrypted sample data message, and its meaning is consistent with the above formula; This represents the verification data digest, and its value is a checksum. The output value obtained by executing the secure hash algorithm; This represents a summary of the retained sample data, the data source of which is the original retained sample data message from step two. The digest value obtained by performing a secure hash algorithm has been written to the blockchain ledger.
[0051] When the sample encrypted digest matches and and If the comparison is consistent, it is determined that the physical sample to be destroyed corresponds to the on-chain sample preservation record.
[0052] After the above verification is passed, the destruction and evidence writing will be performed. The person responsible for the sample retention will perform the destruction operation on the physical sample to be destroyed and generate the original destruction data message upon completion of the destruction. Destroy the original data message. It should include at least a sample retention identifier, a destruction timestamp, and a destruction responsibility identifier; wherein, the sample retention identifier is taken from the sample retention identifier obtained by the above scanning and reading; the destruction timestamp is taken from the current time returned by a trusted time source and recorded as . The meaning of the trusted time source is consistent with that in step one; the identifier of the person responsible for destruction is derived from the unique identity value obtained by the person responsible for destruction after completing identity verification on the sample collection terminal or a terminal with identity verification capabilities, and the meaning of the identity verification is consistent with that in step one. If a destruction image is collected, the destruction image originates from the camera's output and serves as the original destruction data message. One of the fields.
[0053] Subsequently, Calculate the data digest for destruction using a secure hash algorithm. and to Executing a symmetric encryption algorithm destroys the encrypted data. The secure hash algorithm and symmetric encryption algorithm are consistent with step two. The calculation of the destroyed data digest satisfies the following formula: ; in: This indicates the destruction of the original data message. The data source is the retention identifier and destruction timestamp recorded when the destruction operation is completed. The message is obtained by structurally combining the identifier of the person responsible for destruction and the optional destruction image; This represents the data digest to be destroyed, and its value is a set of values. The output value obtained by executing the secure hash algorithm.
[0054] Then, the digital signature algorithm described in step two is used to destroy the data digest. Generate and destroy digital signatures The private key used for signing is denoted as... The The data source is either a key management service that generates and distributes the data to the terminal that performs the destruction record generation, or a private key that is generated and registered locally on the terminal. The generation of the destruction digital signature satisfies the following formula: ; in: This indicates the destruction of the private key, whose data source is a private key generated and issued by the key management service or a private key generated and registered locally on the terminal; This refers to the digital signature algorithm, which has the same meaning as in step two, and is preferably ECDSA or RSA; This indicates the destruction of the data summary, and its meaning is consistent with the above formula; This indicates the destruction of the digital signature; its value is a pair. The signature output value obtained by executing the digital signature algorithm.
[0055] After completing the above processing, the encrypted data will be destroyed. Write to the storage service and obtain the encrypted storage address for destruction, wherein the data source for the encrypted storage address is the result returned by the storage service; and destroy the encrypted data. A secure hash algorithm is used to calculate the ciphertext digest for destruction. Subsequently, a destruction record is constructed and submitted to the blockchain network for writing into the blockchain ledger. This destruction record includes at least the following fields: business type field, sample identifier field, destruction timestamp field, destruction data digest field, destruction digital signature field, destruction ciphertext storage address field, and destruction ciphertext digest field. The business type field indicates that the record is a destruction business, and its value is fixed. The sample identifier field is taken from the sample identifier obtained through scanning. The destruction timestamp field is taken from... The data digest field for destruction is taken from... The destroyed digital signature field is taken from... The "Destroy Ciphertext Storage Address" field is taken from the ciphertext storage address returned by the storage service; the "Destroy Ciphertext Digest" field is taken from the... The output value obtained by executing the secure hash algorithm. Blockchain nodes perform signature verification on the destroyed digital signature field; the public key used for verification is... The corresponding public key, whose data source is public key registration information; when the signature verification is successful, the blockchain node writes the destruction of the evidence storage record into the blockchain ledger according to the consensus algorithm.
[0056] Then, evidence collection and verification are performed. When it is necessary to verify the morning inspection evidence record, the sample evidence record, or the destruction evidence record, the authorized verification entity reads the target evidence record through the blockchain network and extracts the data digest field, digital signature field, and encrypted storage address field from the target evidence record; whereby the authorized verification entity refers to an entity that has the right to read the blockchain ledger record and has the corresponding public key or private key acquisition right.
[0057] Subsequently, the authorized verification entity reads the corresponding encrypted data from the storage service via the encrypted storage address, calculates the ciphertext digest of the read encrypted data, and compares it with the ciphertext digest field in the evidence storage record. When the comparison matches, the authorized verification entity uses the symmetric key. The encrypted data is processed using a symmetric decryption algorithm to obtain a decrypted data message. A secure hash algorithm is then applied to the decrypted data message to obtain a verification data digest, which is then compared for consistency with the data digest field in the evidence storage record. Simultaneously, the authorized verification entity performs a signature verification operation on the digital signature field in the evidence storage record to obtain the verification result. The signature verification operation uses the same verification algorithm as the digital signature algorithm in step two, denoted as [example algorithm]. The This refers to an algorithm that verifies the consistency between a digital signature and a data digest based on a public key and outputs a Boolean result. The signature verification operation satisfies the following formula: ; Wherein: PK represents the public key, whose data source is the public key registration information, and corresponds to the private key used to generate the digital signature; H represents the data digest, whose value is the data digest field in the evidence storage record; when the business type is morning inspection business, H is the morning inspection data digest. When the business type is sample retention, H takes the value of the sample data summary. When the business type is destruction, H takes the value of the destruction data digest. S represents the digital signature, and its value is the digital signature field in the evidence storage record. V represents the signature verification algorithm, used to verify digital signatures and data digests based on public keys; V represents the signature verification result, where V is true and the signature verification is successful, and V is false and the signature verification is unsuccessful.
[0058] Finally, the authorized verification entity outputs the encrypted digest comparison result, the data digest comparison result, and the signature verification result as the evidence verification result.
[0059] This invention also proposes a blockchain-based digital management platform for morning health check samples, such as... Figure 1 As shown, it includes: a structured module for morning inspection sample collection, a digest encryption and signature processing module, an on-chain comprehensive judgment and alarm module, a destruction verification and evidence collection module, and communication connections between the modules; The morning inspection sample collection structured module is used to collect data from the morning inspection collection terminal and the sample collection terminal, and to generate the original morning inspection data message and the original sample collection data message in a structured manner. The digest encryption signature processing module is used to calculate the morning inspection data digest and the sample retention data digest respectively, and encrypt them to generate the morning inspection encrypted data and the sample retention encrypted data, and generate the morning inspection digital signature and the sample retention digital signature. The on-chain integrated judgment and alarm module is used to write evidence records and additionally write the collection terminal identifier through the evidence writing function of the smart contract, maintain the sliding statistical time window and the collection terminal credibility coefficient; it performs cryptographic self-consistent gating, temporal self-consistent gating and cross-record pattern self-consistent gating based on cross-record relationship, writes prompt alarm records or high-risk alarm records using the joint triggering structure of multi-factor gating, updates the collection terminal credibility coefficient according to the cumulative amount of abnormality intensity, and is used to adjust the gating threshold; The destruction verification and evidence collection module is used to obtain the sample identifier associated with the sample preservation record, verify the encrypted sample data and write it into the destruction preservation record, read the target preservation record, perform evidence collection verification and output the verification result.
[0060] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0061] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.
[0062] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and inventive constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0063] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0064] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0065] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for digital management of morning inspection samples using blockchain-based evidence storage, characterized in that, include: Data is collected by the morning inspection data collection terminal and the sample retention data collection terminal, and the original morning inspection data message and the original sample retention data message are generated in a structured manner. Calculate the morning inspection data digest and the sample retention data digest respectively, and encrypt them to generate encrypted morning inspection data and encrypted sample retention data, and generate digital signatures for morning inspection and sample retention. The system calls the smart contract's notarization writing function to write notarization records, and additionally writes the collection terminal identifier into the notarization records; the smart contract maintains the sliding statistical time window and the collection terminal credibility coefficient; the smart contract executes cryptographic self-consistent gating, temporal self-consistent gating, and cross-record pattern self-consistent gating based on cross-record relationships, and uses a multi-factor gating joint triggering structure to write suggestive alarm records or high-risk alarm records; the smart contract updates the collection terminal credibility coefficient according to the cumulative amount of anomaly strength, and uses it to adjust the gating threshold; among these, the newly written records are comprehensively judged on-chain according to hierarchical gating: first, cryptographic self-consistent gating is performed, and then after signature verification... The encrypted digest and data digest are statistically analyzed for repetition within the window, and the repetition rate is stored in the contract state as a dynamic quantity. The gating threshold is taken from the quantile statistics within the window and dynamically adjusted according to the credibility coefficient of the acquisition terminal. Then, a time-series self-consistent gating is performed. The upload delay is calculated by reading the record timestamp and block time, and a dynamic baseline is constructed using the median and absolute median difference. At the same time, hysteretic threshold curves for entering and exiting anomaly thresholds are set and the duration condition is superimposed. Then, a cross-record mode self-consistent gating is performed. For the morning inspection side, the frequency within the window is calculated based on the personnel identifier and timestamp and the deviation is standardized. For the sample retention side, the density within the window is calculated based on the food name and timestamp and the deviation is standardized. Obtain the sample identifier associated with the sample retention record, verify the encrypted sample data and write it to the destruction record, read the target record, perform evidence collection and verification, and output the verification result.
2. The method for digital management of morning inspection samples with blockchain-based evidence storage according to claim 1, characterized in that: The morning check data collection terminal verifies the identity of the person being checked and outputs the person's identifier. It calls the temperature sensor connected to or integrated with the terminal to obtain the body temperature value, obtains the current time from a trusted time source as the morning check timestamp, and combines the person's identifier, body temperature value and morning check timestamp in a structured combination according to a predetermined field order to obtain the original morning check data message.
3. The method for digital management of morning inspection samples with blockchain-based evidence storage according to claim 1, characterized in that: The sample collection terminal obtains the current time from a reliable time source as the sample retention timestamp. A random number generator outputs a random number and generates a sample retention identifier based on the sample retention timestamp and the random number. The sample retention identifier is encoded into a two-dimensional barcode and affixed to the surface of the corresponding sample container. Sample retention association information, including at least the food name, sample quantity, and the identifier of the person responsible for the sample retention, is collected. The sample retention identifier, sample retention association information, and sample retention timestamp are then combined in a structured manner according to a predetermined field order to obtain the original sample retention data message.
4. The method for digital management of morning inspection samples with blockchain-based evidence storage according to claim 1, characterized in that: The morning inspection raw data message is digested by using a secure hash algorithm to obtain the morning inspection data digest, and the same secure hash algorithm is used to digest the sample raw data message to obtain the sample data digest; the symmetric key issued by the key management service or generated and registered by an authorized entity is obtained, and the morning inspection raw data message and the sample raw data message are encrypted by using a symmetric encryption algorithm to obtain the morning inspection encrypted data and the sample encrypted data; Configure asymmetric key pairs for the morning inspection data collection terminal and the sample collection terminal respectively, and store the private key and register the public key in the secure storage area of the terminal. Then, the morning inspection data collection terminal calls its private key to execute the digital signature algorithm on the morning inspection data digest to generate the morning inspection digital signature, and the sample collection terminal calls its private key to execute the digital signature algorithm on the sample data digest to generate the sample digital signature.
5. The method for digital management of morning inspection samples with blockchain-based evidence storage according to claim 4, characterized in that: The smart contract's notarization writing function submits the morning inspection data summary, morning inspection encrypted data, morning inspection digital signature, as well as the sample data summary, sample encrypted data, and sample digital signature to the blockchain network, and triggers smart contract execution rule verification and on-chain comprehensive judgment in the same notarization writing transaction; The encrypted data of the morning inspection is sent to the storage service for writing and the storage address of the morning inspection ciphertext is obtained. The secure hash algorithm is called to calculate the digest of the morning inspection ciphertext on the encrypted data of the morning inspection. Then, a morning inspection evidence record containing the business type, morning inspection data digest, morning inspection digital signature, morning inspection timestamp, morning inspection ciphertext storage address and morning inspection ciphertext digest is constructed. The blockchain node verifies the morning inspection digital signature based on the registered public key and writes it into the ledger according to the consensus algorithm. The sample encrypted data is sent to the storage service for writing and the ciphertext storage address is obtained. The secure hash algorithm is called to calculate the ciphertext digest of the sample encrypted data. Then, a sample storage record containing the business type, sample data digest, sample digital signature, sample timestamp, sample identifier, ciphertext storage address and ciphertext digest is constructed and submitted for writing. The blockchain node verifies the sample digital signature based on the registered public key and writes it into the ledger according to the consensus algorithm.
6. The method for digital management of morning inspection samples with blockchain-based evidence storage according to claim 5, characterized in that: For evidence storage records that have passed verification and whose on-chain fields are consistent with off-chain encrypted text, anomaly detection is performed based on cross-record relationships. An additional collection terminal identifier is written into each evidence storage record, and the smart contract maintains a sliding statistical time window and maintains the credibility coefficient and anomaly intensity accumulation corresponding to each collection terminal identifier within the same transaction in which the evidence storage writing function is called.
7. The method for digital management of morning inspection samples with blockchain-based evidence storage according to claim 6, characterized in that: A multi-factor gating joint triggering structure is adopted. When at least two types of anomalies are combined within the same window and continuously meet the preset duration, a high-risk alarm record is written. When only a single type of anomaly is detected, a prompt alarm record is written. The alarm record also includes the set of anomaly factors and the judgment conclusion for verification. The cumulative amount of anomaly intensity is accumulated in a graded manner based on the prompt alarm and high-risk alarm, and the credibility coefficient of the acquisition terminal is updated according to the state evolution formula with attenuation and recovery terms, which is used to adjust the threshold of each gating. Missing items in the menu and failure to destroy evidence of expired samples are included as anomaly factors in the same gating framework and written into the on-chain record.
8. The method for digital management of morning inspection samples with blockchain-based evidence storage according to claim 1, characterized in that: Scan the two-dimensional barcode on the surface of the sample container to obtain the sample identifier, query the corresponding sample storage record on the chain and retrieve the sample data digest, encrypted storage address and encrypted digest, then read the encrypted sample data from the storage service and perform encrypted digest comparison, decryption and data digest comparison in sequence; Subsequently, a destruction original data message containing a retention identifier, destruction timestamp, and destruction responsibility identifier is generated. The destruction data digest is calculated, encrypted, and a destruction digital signature is generated. The destruction ciphertext is written to the storage service to obtain the ciphertext storage address and calculate the ciphertext digest. Then, the business type, retention identifier, destruction timestamp, destruction data digest, destruction digital signature, ciphertext storage address, and ciphertext digest are written to the destruction evidence record and submitted to the blockchain. During evidence collection and verification, the target evidence record is read and the data digest, digital signature, and ciphertext storage address are extracted. After reading the ciphertext from the storage service, ciphertext digest comparison, decryption, and data digest comparison are performed, and the digital signature is verified. The comparison result and verification result are output.
9. A blockchain-based digital management platform for morning inspection samples, used to implement the blockchain-based digital management method for morning inspection samples as described in any one of claims 1-8, characterized in that, include: The module includes a morning inspection sample collection structure module, a digest encryption and signature processing module, an on-chain comprehensive judgment and alarm module, a destruction verification and evidence collection verification module, and communication connections between the modules. The morning inspection sample collection structured module is used to collect data from the morning inspection collection terminal and the sample collection terminal, and to generate the original morning inspection data message and the original sample collection data message in a structured manner. The digest encryption signature processing module is used to calculate the morning inspection data digest and the sample retention data digest respectively, and encrypt them to generate the morning inspection encrypted data and the sample retention encrypted data, and generate the morning inspection digital signature and the sample retention digital signature. The on-chain comprehensive judgment and alarm module is used to call the smart contract's evidence writing function to write evidence records, and additionally write the collection terminal identifier into the evidence records; the smart contract maintains the sliding statistical time window and the collection terminal credibility coefficient; the smart contract executes cryptographic self-consistent gating, temporal self-consistent gating, and cross-record pattern self-consistent gating based on cross-record relationships, and uses a multi-factor gating joint triggering structure to write suggestive alarm records or high-risk alarm records; the smart contract updates the collection terminal credibility coefficient according to the cumulative amount of anomaly strength, and uses it to adjust the gating threshold; among them, on-chain comprehensive judgment is performed on newly written records according to hierarchical gating: first, cryptographic self-consistent gating is performed. After verification, the encrypted digest and data digest are statistically analyzed for repetition within a window, and the repetition rate is stored in the contract status as a dynamic quantity. The gating threshold is calculated based on the quantile statistics within the window and dynamically adjusted according to the credibility coefficient of the acquisition terminal. Then, a time-series self-consistent gating is performed. The upload delay is calculated by reading the record timestamp and block time, and a dynamic baseline is constructed using the median and absolute median difference. At the same time, hysteretic threshold curves for entering and exiting abnormal thresholds are set and superimposed with the duration condition. Then, a cross-record mode self-consistent gating is performed. For the morning inspection side, the frequency within the window is calculated based on the personnel identifier and timestamp and the deviation is standardized. For the sample retention side, the density within the window is calculated based on the food name and timestamp and the deviation is standardized. The destruction verification and evidence collection module is used to obtain the sample identifier associated with the sample preservation record, verify the encrypted sample data and write it into the destruction preservation record, read the target preservation record, perform evidence collection verification and output the verification result.
Citation Information
Patent Citations
Canteen dish reserved sample information acquisition and safety management system and device
CN114202162A
Intelligent contract automatic execution system and method based on block chain technology
CN120850355A
