Quantum anomaly tracing detection method based on quantum machine learning

By collecting and cleaning quantum cloud code data, optimizing the model using the quantum support vector machine algorithm, and combining anomaly level classification and traceability strategies, the accuracy and efficiency issues of the quantum model in anomaly detection were solved. This enabled accurate identification and traceability of illegal coding and cross-regional sales, meeting the regulatory needs of the food and pharmaceutical industries.

CN121365987AActive Publication Date: 2026-01-20FUJIAN ZHONGXIN NET SAFETY INFORMATION TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511947297.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-01-20
Estimated Expiration
2045-12-23

AI Technical Summary

Technical Problem

Existing sub-models suffer from low discriminative power of anomaly features, low training efficiency, insufficient generalization ability, and insufficient integration with business logic in anomaly detection. This results in low accuracy, high false positive and false negative rates, making them unsuitable for large-scale data processing scenarios and industry regulatory requirements.

Method used

Collect data from the entire quantum cloud code flow, construct standardized feature vectors through data cleaning and feature extraction, optimize quantum gate circuits using quantum support vector machine algorithm, generate anomaly detection model, identify anomalies in real time by combining quantum state inference acceleration algorithm, establish anomaly level classification standard, link regulatory platform and enterprise system, and generate collaborative management and control strategy.

Benefits of technology

It enables accurate identification and traceability of illegal coding and cross-regional sales, improves the accuracy and efficiency of anomaly detection, meets the traceability and supervision needs of the food and pharmaceutical industries, and solves the pain points of cross-regional sales fraud and regulatory lag.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121365987A_ABST
    Figure CN121365987A_ABST
Patent Text Reader

Abstract

The invention discloses a quantum machine learning-based quantum anomaly tracing detection method, which is applied to the technical field of data processing and comprises the following steps of: acquiring quantum cloud code full-link circulation data including key information such as a code assigning equipment number and a timestamp; a standardized feature vector is constructed through data cleaning and feature extraction, a quantum support vector machine algorithm is selected and a quantum gate circuit is optimized based on a quantum machine learning framework, and an anomaly detection model is trained. And the model accesses a data stream in real time, identifies abnormities such as illegal tagging and traces a source, and generates an early warning and traceability report. In combination with industry requirements, abnormal grades are divided, a graded early warning and tracing scheme is generated, a linkage platform generates a collaborative management and control strategy, finally, multiple types of information are comprehensively processed, and evaluation information containing indexes such as detection accuracy is output.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a quantum abnormality tracing detection method based on quantum machine learning. BACKGROUND

[0002] The existing model uses a traditional quantum coding method to process the flow data, and does not design adaptive mapping rules for the coding characteristics, space-time characteristics and other core business characteristics of quantum cloud codes, resulting in that the numerical differences in the original data cannot be accurately reflected in the quantum state, and the distinguishing degree of abnormal characteristics and normal characteristics is low. For example, the quantum mapping of key features such as "abnormal coding frequency" and "cross-regional channeling span" has information loss, making it difficult for the model to accurately identify abnormal scenarios such as illegal coding and cross-regional channeling, and the accuracy of abnormality detection is insufficient, and the false positive rate and the false negative rate are high.

[0003] The quantum gate circuit design is unreasonable, and the model training efficiency is low: the quantum gate circuit of the existing model lacks targeted optimization, the quantum bit allocation does not combine the importance ranking of features, and the quantum bits with high noise sensitivity of key business features are bound, resulting in serious interference of quantum state; at the same time, the logic gate combination does not consider the business association between features, the line depth is redundant, which further aggravates the quantum noise interference and reduces the stability and efficiency of model training. Compared with classical machine learning algorithms, the existing quantum detection model does not fully utilize the parallel advantage of quantum computing, and when facing massive full-link flow data, the training period is long and the computing power consumption is large, which is difficult to adapt to large-scale data processing scenarios.

[0004] The model hyperparameter optimization is blind and the generalization ability is insufficient: in the training process of the existing model, the hyperparameter adjustment depends on the experience value, and does not combine the business scenario requirements of quantum cloud code abnormality detection (such as the risk prevention and control focus of different industries and the differentiated characteristics of abnormal types) for targeted optimization. For example, the setting of key hyperparameters such as quantum kernel function bandwidth and regularization coefficient does not adapt to the identification needs of different abnormal scenarios such as illegal coding and cross-regional channeling, resulting in weak generalization ability of the model. When facing new types of abnormalities or flow data in different industries, the detection performance decreases significantly, and the model cannot be stably applied across scenarios and industries.

[0005] The model is not fully integrated with business logic, and the traceability and supervision adaptability is poor: the existing model only focuses on the identification of abnormal data, and does not deeply integrate with the traceability and supervision requirements of the food and pharmaceutical industries, and lacks adaptive design of business processes such as abnormal level division, traceability link tracing, and collaborative control. The model output result can only preliminarily determine the occurrence of abnormality, and cannot provide accurate node positioning and trajectory tracking support for traceability, and it is also difficult to link industry supervision platforms and enterprise management systems to form a collaborative control strategy, resulting in incomplete abnormal traceability, difficulty in defining the main responsibility, and lagging supervision and disposal, which cannot fundamentally solve the industry pain points such as "channeling and counterfeiting" and "supervision gap". SUMMARY

[0006] To solve the above technical problems, the present application provides the following technical solutions: A quantum anomaly tracing detection method based on quantum machine learning, comprising: collecting quantum cloud code full-link flow data and associated information, including code assignment device number, code assignment timestamp, code assignment geographic location, full-process verification record and flow node information; processing the quantum cloud code full-link flow data and associated information, constructing a standardized feature vector through data cleaning and feature extraction, selecting a quantum support vector machine algorithm based on a quantum machine learning framework, optimizing quantum gate circuit structure and parameter configuration, and training to generate an anomaly detection model; processing the trained anomaly detection model, introducing a model inference optimization mechanism, improving anomaly feature matching efficiency through a quantum state inference acceleration algorithm, optimizing model deployment adaptation logic, and real-time accessing quantum cloud code flow data stream, identifying illegal code assignment and cross-regional channeling of abnormal data through model inference, tracing the source and flow track of abnormal data based on the unique identification characteristics of quantum cloud code, and generating preliminary anomaly warning information and traceability report; processing the preliminary anomaly warning information and traceability report, establishing an anomaly level division standard based on the traceability supervision requirements of the food and pharmaceutical industries, applying detection accuracy threshold constraints and real-time response time requirements, and generating a graded warning notification and precise traceability scheme; processing the graded warning notification and precise traceability scheme, linking industry supervision platforms and enterprise management systems, and generating a collaborative control strategy that takes into account anomaly disposal efficiency and regulatory coverage; comprehensively processing the preliminary anomaly warning information, traceability report, graded warning notification, precise traceability scheme and collaborative control strategy, constructing a model full-process evaluation system, including model anomaly detection precision, inference speed and generalization ability in the evaluation dimension, and generating quantum cloud code anomaly tracing detection comprehensive evaluation information.

[0007] The present application provides a quantum anomaly tracing detection method based on quantum machine learning, focusing on the anomaly tracing problem in the large-scale flow of quantum cloud codes in the food and pharmaceutical industries, and constructing a full-process detection system. First, collect full-link flow data such as code assignment device number and timestamp, extract four types of core features after cleaning and standardization, and convert them into quantum states through angle encoding. Relying on the quantum machine learning framework, the quantum support vector machine algorithm is used to optimize the quantum gate circuit structure and train the anomaly detection model. The model real-time accesses the data stream, frame-by-frame analyzes and identifies illegal code assignment, cross-regional channeling and other abnormalities, traces the source and track based on the unique identification of cloud code, and generates warning and traceability report. Combined with industry demand, a three-level anomaly level standard is established to generate a graded warning and precise traceability scheme, link supervision and enterprise systems, and select the optimal control strategy through quantum particle swarm optimization algorithm. Finally, through the fusion calculation of three types of quantitative factors, comprehensive evaluation information is output, effectively solving the industry channeling and counterfeiting, and the lagging supervision pain points. BRIEF DESCRIPTION OF DRAWINGS

[0008] Figure 1 A flow chart of a quantum anomaly tracing detection method based on quantum machine learning provided for an embodiment of the present application; Figure 2 A module schematic diagram of a quantum anomaly tracing detection device based on quantum machine learning provided for an embodiment of the present application. DETAILED DESCRIPTION

[0009] The preferred embodiments of the present application will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to explain and illustrate the present application, and are not used to limit the present application. The following describes the quantum anomaly tracing detection method based on quantum machine learning according to the exemplary embodiments of the present application. Figure 1 The quantum anomaly tracing detection method based on quantum machine learning according to the exemplary embodiments of the present application is described below.

[0010] In an embodiment of the present application, a quantum anomaly tracing detection method based on quantum machine learning is as shown in the following figure: Figure 1 S101, collect quantum cloud code full-link flow data and associated information.

[0011] In an embodiment, through the data collection terminal and transmission network of the quantum cloud code flow process, the system collects the key data and associated information of the quantum cloud code from code generation to verification use, ensures the data coverage integrity and timeliness, and provides basic data support for subsequent anomaly detection and tracing. A unique identification coding rule is adopted, for example, “QM-DEV-20240512-0089”, wherein “QM” represents the prefix of the quantum cloud code special equipment, “20240512” is the equipment factory date, and “0089” is the equipment serial number, which can accurately locate the specific physical equipment generating the quantum cloud code and distinguish the operation records of different code terminals. UTC standard time format is adopted, for example, “2024-06-18T09:32:47.153Z”, which is accurate to millisecond level, records the specific time point of quantum cloud code generation, and provides a time reference for judging the code timing rationality and investigating cross-period abnormal code.

[0012] ​In combination with GPS and base station positioning technology, latitude and longitude coordinates + regional coding dual recording is adopted, for example, "North Latitude 39.9042°, East Longitude 116.4074° (regional code: 110105)", wherein the latitude and longitude ensure the positioning accuracy, and the regional code corresponds to the administrative division, which is used to identify whether the physical location of the code assignment meets the preset range. The key information of each verification is recorded in sequence according to the verification time sequence, for example, "Verification 1: Time 2024-06-18T10:15:22Z, verification terminal ID: VT-0123, verification result: pass, verification location: Shanghai Pudong New Area; Verification 2: Time 2024-06-18T14:08:59Z, verification terminal ID: VT-0456, verification result: pass, verification location: Suzhou Gusu District, Jiangsu Province", which completely presents the usage track of the quantum cloud code.

[0013] The transfer nodes of the quantum cloud code in the supply chain and the distribution chain are recorded, for example, "Node 1: production enterprise (A Pharmaceutical Co., Ltd., node type: code assignment source node, node ID: NODE-S-001); Node 2: regional distributor (B Pharmaceutical Distribution Company, node type: first-level transfer node, node ID: NODE-T-023); Node 3: terminal pharmacy (C Chain Pharmacy XX Branch, node type: terminal node, node ID: NODE-E-156)", which clearly defines the subjects and node attributes of each transfer link.

[0014] In one embodiment, the quantum cloud code full-link transfer data and associated information are processed, the standardized feature vectors are constructed through data cleaning and feature extraction, the quantum support vector machine algorithm is selected based on the quantum machine learning framework, the quantum gate line structure and parameter configuration are optimized, and the abnormal detection model is trained and generated.

[0015] In one embodiment, the quantum cloud code full-link transfer data and associated information are processed, the standardized feature vectors are constructed through data cleaning and feature extraction, the quantum support vector machine algorithm is selected based on the quantum machine learning framework, the quantum gate line structure and parameter configuration are optimized, and the abnormal detection model is trained and generated. In one embodiment, the quantum cloud code full-link transfer data and associated information are processed, the standardized feature vectors are constructed through data cleaning and feature extraction, the quantum support vector machine algorithm is selected based on the quantum machine learning framework, the quantum gate line structure and parameter configuration are optimized, and the abnormal detection model is trained and generated. Through the data duplication algorithm, duplicate code assignment records (such as the same quantum cloud code record generated by the same device at the same timestamp) and invalid verification data (such as data with missing verification request parameters) are identified and removed, for example, "3 duplicate quantum cloud code records generated by device number QM-DEV-20240512-0089 at 2024-06-18T09:32:47.153Z are removed".

[0016] Filter and remove data that does not meet the preset rules, such as non-UTC standard time strings, invalid latitude and longitude coordinates (such as latitude greater than 90°), and data with missing prefix identifiers, such as "remove non-standardized records with time format '2024 / 06 / 1809:32' and invalid geographic location data with latitude 95.2°."

[0017] The timestamp is unified in the UTC format "YYYY-MM-DDTHH:MM:SS.sssZ", for example, "2024-06-1817:32:47" is converted to "2024-06-18T09:32:47.000Z"; the geographic location code is unified as "latitude and longitude + 6-digit administrative division code", for example, "Beijing Dongcheng District" is converted to "North latitude 39.9042°, East longitude 116.4074° (110101)"; the device number is unified as "QM-DEV-Date of manufacture-Serial number" rule, for example, "DEV-0089-20240512" is standardized as "QM-DEV-20240512-0089".

[0018] Based on the standardized full-link data, four types of core features are extracted to fully characterize the characteristics of quantum cloud code flow. The coding features include coding device model, coding frequency, device registration status, etc., such as "device model: QM-FM-2024, single-day coding frequency: 1200 times, device registration status: authenticated". The space-time features include coding time interval, flow area span, cross-area flow number, etc., such as "adjacent coding time interval: 30 seconds, flow area span: from Shanghai Pudong New Area (110105) to Suzhou Gusu District, Jiangsu Province (320508), 24-hour cross-area flow number: 2 times".

[0019] The verification features include the number of verification passes / fails, verification terminal type, verification period distribution, etc., such as "cumulative verification number: 8 times, verification failure number: 1 time, verification terminal type: mobile terminal (VT-0123), peak verification period: 10:00-11:00". The flow node features involve node level, node jump frequency, node type distribution, etc., such as "flow node level: 3 levels (source node → first-level flow node → terminal node), node jump frequency: 2 times, node type distribution: 1 production enterprise, 1 distributor, 1 terminal pharmacy".

[0020] The feature mapping dimension and quantum kernel function type are determined based on a quantum machine learning framework, a quantum support vector machine algorithm is selected as a core modeling algorithm, and the quantum state initialization mode and sample data quantumization mapping rule of the algorithm are determined. According to the quantum bit resource and feature complexity, the feature mapping dimension is determined to be 12 dimensions (matching the 8-16 dimensional quantum computing adaptation range), the quantum radial basis kernel function is selected, and the quantumization mapping of the high-dimensional feature space is realized. The quantum state initialization based on the uniform distribution is adopted, and the feature vector corresponding to the classical data is mapped to the quantum superposition state, for example, "the feature vector [1200, 1, 0] is initialized to the quantum superposition state ".

[0021] The sample data quantumization mapping is the core link connecting the classical feature vector and the quantum computing system, and the core goal is to convert the standardized classical numerical information (such as the code frequency, the flow area span, etc.) into the physical quantity (phase or amplitude) that can be represented by the quantum bit through a specific quantum coding algorithm, to provide input for the subsequent quantum state operation of the quantum support vector machine.

[0022] According to the dimension (12 dimensions or less) of the quantum cloud code feature vector in the application and the quantum computing resource adaptability, the angle encoding (AngleEncoding) algorithm is selected as the core algorithm for sample data quantumization mapping. The algorithm has the following adaptation advantages. Low quantum bit consumption, without the need to allocate quantum bits for each feature dimension, multiple feature information can be carried by the phase or rotation angle of a single quantum bit (1 quantum bit can map 2-3 low-dimensional features in the application), which adapts to the bit resource limitation of small and medium-sized quantum computing hardware. The numerical mapping precision is controllable, and by adjusting the quantization step of the rotation angle, the numerical precision requirement of the standardized feature vector can be matched (in the application, the range of the standardized feature value is [0, 1], and the angle encoding can realize 0.01 level precision mapping). Strong compatibility with quantum support vector machine, the quantum state output by the angle encoding can be directly used as the input state of the quantum support vector machine, participating in the quantum kernel function calculation and quantum state reasoning, without the need for additional conversion links.

[0023] Taking the single-dimensional numerical feature "single-day code frequency" as an example, the complete mapping process is divided into three steps of classical standardization preprocessing, quantum angle mapping and quantum state generation, which are as follows: classical standardization preprocessing (preliminary step), first, the original sample data is normalized to compress the numerical value to the [0, 1] interval, eliminating the influence of dimension difference on quantumization mapping. The Min-Max standardization formula is adopted, wherein x is the original sample data (such as "single-day code frequency 1200 times"); is the minimum value of the feature (such as the minimum code frequency of the code device in the application, which is 300 times per day); This is the maximum value of the feature (e.g., the maximum daily coding frequency of the coding device in this invention is 1500 times). These are the standardized feature values. Substitute them into the example data to calculate: Considering the accuracy adaptation of subsequent quantum angle mapping, the result is rounded to one decimal place, and the final standardized value is [0.8].

[0024] Quantum angle mapping (core step): This involves using an angle encoding algorithm to map the standardized eigenvalues. Rotation angle mapped to qubit The mapping rules follow: ,choose As a result of the mapping coefficients, the rotation angle range of a qubit is [0, π] (angles outside this range will cause information redundancy due to the periodicity of the quantum state); normalized value [0,1], multiplied by This can ensure [0, This achieves complete adaptation of numerical values ​​and angles without information loss. Substituting the example standardized value [0.8] into the calculation... =0.8 =0.8 (Approximately 144°).

[0025] Quantum state generation (output step): The obtained angle is mapped through quantum logic gate operations (such as the RY rotation gate). Acting on the initial quantum state (usually The process involves generating a quantum state carrying sample data information. The specific steps are as follows: Initial quantum state: (Ground state of the qubit); Apply an RY rotation gate, the function of which is to rotate the qubit around the y-axis by an angle. Its matrix form is: .

[0026] Generate the target quantum state: Substitute 72°, calculated as follows: The amplitude information of this quantum state (0.3090, 0.9511) indirectly carries the original data information of "1200 coding times per day", which can be used for subsequent quantum support vector machine model training.

[0027] For the multi-dimensional vector (such as a 12-dimensional feature vector) containing code assignment features, space-time features, verification features, and flow node features in the application, the adaptation rules of the angle encoding algorithm are as follows: the quantum bits are allocated as follows, and a "1 quantum bit carrying 2-dimensional feature" allocation strategy is adopted, and 12-dimensional features only need 6 quantum bits (such as q0 carrying code assignment frequency and code assignment device registration state, q1 carrying flow area span and cross-area number, etc.). For angle superposition mapping, the two features carried by a single quantum bit are respectively mapped to two rotation angles 、 , through the continuous rotation gate operation of "RY( )→RY( )", the superposition storage of multi-feature information is realized.

[0028] For "single-day code assignment frequency 1200 times (standardized value 0.8)" and "cross-area flow number 2 times (standardized value 0.6)", 0.8 is mapped to =0.8 , and 0.6 is mapped to =0.6 , and then "RY(0.8π)→RY(0.6π)" is applied to quantum bit q0 to generate a quantum state that simultaneously carries two feature information.

[0029] Through the combination of Min-Max standardization and angle encoding, the numerical difference of the original sample data can be accurately reflected in the quantum state, and the information loss rate of the mapping rule is less than 2% after testing. The generated quantum state can be directly connected to the quantum kernel function calculation module of the quantum support vector machine, without additional format conversion, and the model training efficiency is improved by 15% compared with the traditional quantum encoding algorithm; for abnormal scenes such as "illegal code assignment" and "cross-area smuggling", the mapping rule can highlight the quantum state difference of key features such as "abnormal code assignment frequency" and "abnormal cross-area span", providing a basis for the model to accurately identify abnormal data.

[0030] Through the hierarchical optimization of quantum bit allocation, logic gate combination and parameter adjustment, the line noise and depth are reduced, the quantum computing efficiency is improved, and the training needs of the abnormal detection model are adapted. According to the importance of business features, quantum bit resources are allocated, and key features such as code assignment frequency and flow area span that are strongly related to abnormal detection are preferentially allocated to quantum bits with low noise sensitivity. The specific allocation scheme is: code assignment features (device model, code assignment frequency) are allocated to q0 and q1, space-time features (code assignment time interval, cross-area span) are allocated to q2 and q3, verification features (verification result, terminal type) are allocated to q4 and q5, and flow node features (node level, jump frequency) are allocated to q6 and q7, to ensure the stability of the quantum state of key business features.

[0031] In combination with the business feature association logic, the combination architecture of "Hadamard gate + CNOT gate + RY gate" is adopted: the q0 (code frequency feature) is made to enter the quantum superposition state through the Hadamard gate to realize the multi-feature combination operation; the correlation between the code feature and the space-time feature is constructed by using the CNOT gate (control bit q0, target bit q2) to adapt to the business logic that "code frequency anomalies are often accompanied by cross-regional flow anomalies"; the phase of the quantum bit is adjusted by the RY gate, for example, the phase of q1 (code device registration state feature) is adjusted by the RY gate (angle 0.6π) to strengthen the abnormal feature expression of the unregistered device code.

[0032] Parameter and line depth optimization: based on the gradient descent method to optimize the logic gate angle parameter, the abnormal feature recognition error is reduced as the target for iterative adjustment, for example, the RY gate initial angle 0.8π is optimized to 0.6π, the quantum line depth is reduced from 15 layers to 8 layers (≤10 layers of preset threshold), the noise interference is reduced by 30%, and the stability and efficiency of model training are improved.

[0033] Follow the process of "quantum state conversion-iterative training-hyperparameter optimization-business adaptation" to generate an abnormal detection model with the ability to accurately identify illegal coding and cross-regional channeling. Quantum state conversion, 12-dimensional standardized classical vectors containing code, space-time, verification, and flow node features are converted into quantum states composed of 8 quantum bits through angle encoding , for example, the abnormal data vector of "unregistered device code + cross-regional flow", is converted into the quantum superposition state , which fully carries the business abnormal features.

[0034] Input the quantum state into the quantum support vector machine model, set 100 rounds of iterative training (adapt to the feature learning needs of large-scale flow data), and obtain the output result through quantum measurement after each training, for example, after the 50th iteration, the output probability distribution P (abnormal) = 0.92, P (normal) = 0.08 of "unregistered device code" data is measured, which intuitively reflects the model's ability to identify abnormal business scenarios.

[0035] According to the quantum measurement results and business detection needs, adjust the model hyperparameters: adjust the regularization coefficient from 0.1 to 0.3 to reduce the misjudgment probability of abnormal data; adjust the quantum radial basis kernel function bandwidth from 0.5 to 0.7 to improve the recognition generalization ability of complex abnormal scenarios such as cross-regional channeling, and ensure that the model adapts to the traceability supervision needs of the food and pharmaceutical industries.

[0036] The finally generated quantum machine learning anomaly detection model can accurately identify two types of core abnormal scenarios: one is illegal code assignment (such as quantum cloud code generated by unregistered device DEV-0090), and the other is cross-regional smuggling (such as quantum cloud code verified in Guangdong Province although the registered sales area is Shandong Province), which completely matches the core supervision pain points in the flow of quantum cloud code.

[0037] In S103, the trained anomaly detection model is processed, a model inference optimization mechanism is introduced, the efficiency of abnormal feature matching is improved through quantum state inference acceleration algorithm, the model deployment adaptation logic is optimized, the quantum cloud code flow data stream is accessed in real time, the abnormal data of illegal code assignment and cross-regional smuggling are identified through model inference, and the abnormal data source and flow track are traced based on the unique identification characteristics of quantum cloud code to generate preliminary abnormal warning information and traceability report.

[0038] In one embodiment, the trained quantum support vector machine anomaly detection model is deployed and adapted, a model inference optimization mechanism is introduced, the efficiency of abnormal feature matching is improved through quantum state inference acceleration algorithm, the model deployment adaptation logic is optimized, the real-time data stream access interface and data analysis rules are configured to ensure low-latency transmission and format compatibility of quantum cloud code flow data. The trained quantum support vector machine anomaly detection model is deployed on a server node with a hybrid architecture of quantum computing and classical computing. The node needs to be equipped with an adapted quantum processor and a classical processor, and a collaborative scheduling mechanism is established through a quantum-classical interface to ensure real-time interaction between quantum state operation results and classical data. The quantum state inference acceleration algorithm is embedded in the model deployment process. The algorithm relies on the parallel operation characteristics of quantum superposition state to optimize the operation logic of abnormal feature matching, reduce the redundant steps of feature comparison, and improve the matching efficiency. For example, for the two types of core abnormal features of illegal code assignment and cross-regional smuggling, multiple dimensional features are matched simultaneously through quantum state superposition, replacing the traditional serial comparison mode, so that the feature matching time of a single frame of data is shortened from 5 milliseconds to 1 millisecond.

[0039] In combination with the transmission characteristics of quantum cloud code flow data and the requirements of business scenarios, the input and output interfaces, data caching strategies, and operation resource allocation logic of the model are optimized to ensure efficient adaptation of the model to real-time data flow. A low-latency data access interface is built using the WebSocket protocol, and an interface transmission rate threshold is set. At the same time, the TCP protocol is configured as a backup access method to ensure automatic switching when data transmission is interrupted and to guarantee the continuity of data flow. The parsing format of quantum cloud code flow data is defined, and the order of data fields and the parsing standards for each field are specified to ensure uniform and compatible data formats for the input model. For example, the data field order is set as "quantum cloud code unique identifier + code assignment device number + code assignment timestamp + code assignment geographic location + verification record + flow node information". The code assignment timestamp is uniformly parsed as UTC format "YYYY-MM-DDTHH:MM:SS.sssZ", the geographic location is parsed as "longitude and latitude + 6-digit administrative division code", and the flow node information is parsed according to the structure "node ID -> node type -> node location" to ensure that the parsed data can be directly converted into the required input format of the model.

[0040] Through interface parameter optimization and data format pre-verification, low-latency transmission and format compatibility of quantum cloud code flow data are ensured. For example, data packets transmitted through the interface are compressed to reduce transmission bandwidth occupancy, and format verification steps are added during data access to automatically exclude abnormal format data that does not meet the preset rules. At the same time, data with missing non-critical fields is completed to avoid model operation interruption due to data format problems, ensuring that data transmission delay is ≤30 milliseconds and format compatibility rate is 100%.

[0041] Relying on the quantum state reasoning acceleration algorithm to optimize the feature matching process, the model quantum state reasoning operation is used to analyze real-time data flow frame by frame, match abnormal feature patterns of illegal code assignment and cross-regional channeling, and generate abnormal data judgment results and confidence parameters. For the "device not registered + code assignment location abnormal" combined feature corresponding to illegal code assignment and the "flow transfer region span exceeds threshold + node authorization missing" combined feature corresponding to cross-regional channeling, the multi-dimensional features of the two types of abnormalities are loaded into the quantum circuit for parallel matching through quantum state superposition, replacing the traditional serial mode of "feature-by-feature comparison and abnormal type-by-abnormal type determination". This results in an 80% improvement in feature matching efficiency for a single data.

[0042] According to the time sequence of data transmission, the real-time access quantum cloud code stream is split into independent data frames, each frame of data corresponds to a complete flow record of a single quantum cloud code, ensuring that each frame of data contains full feature information such as code assignment, space-time, verification, and flow node, while controlling the frame processing interval to ensure real-time. For example, the 10 quantum cloud code flow data transmitted within 10 milliseconds from 10:25:33.456Z-10:25:33.466Z is split into 10 independent data frames, each frame of data contains complete features such as "quantum cloud code unique identifier QM-CODE-001 + code assignment device number QM-DEV-20240512-0090 + code timestamp 2024-06-19T10:25:33.456Z + code geographic location (North Latitude 22.5431°, East Longitude 114.0579°, Area Code 440304) + verification record (VT-0789_Pass) + flow node information (NODE-S-003→NODE-T-067→NODE-E-289)", and the frame processing interval is set to ≤10 milliseconds to ensure that there is no backlog of data flow.

[0043] For each frame of structured data after splitting, the classical feature vector is converted into a quantum state representation according to the preset quantization mapping rule (angle encoding algorithm), so that it can adapt to the quantum state operation requirements of the quantum support vector machine. For example, for a frame of classical vector containing code assignment features (device not registered: 1, single-day code assignment frequency: 800 times), space-time features (cross-region span: 1500 kilometers), verification features (verification pass count: 1), and flow node features (authorized node count: 0), the angle encoding algorithm is used to standardize and map each feature to the rotation angle of a quantum bit, and finally convert it into a quantum state , which completely carries the abnormal feature information of the frame data.

[0044] The converted quantum state is input into the quantum support vector machine model, and the similarity between the quantum state and the preset illegal code assignment and cross-region smuggling abnormal feature patterns is calculated through the quantum kernel function in the quantum circuit, and the matching result is quantized. For example, after inputting the quantum of a certain frame of data into the model, the quantum gate circuit is operated to calculate the similarity between the quantum state and the "illegal code assignment" abnormal feature pattern as 0.92, and the similarity between the quantum state and the "cross-region smuggling" abnormal feature pattern as 0.15, indicating that the frame data has a higher matching degree with the illegal code assignment feature pattern.

[0045] Set the similarity threshold, compare the similarity result obtained by quantum state reasoning operation with the threshold, if the similarity is greater than or equal to the threshold, it is determined that the corresponding type of abnormal data, if they are all lower than the threshold, it is determined that the normal data, while recording the abnormal type (illegal code assignment / cross-regional smuggling). Based on the quantum measurement result of quantum state reasoning operation, combined with the recognition accuracy of the abnormal characteristics in the model training process, the confidence parameter of the abnormal determination result is calculated and output, the confidence value range is 0-1, the higher the value represents the stronger the reliability of the determination result.

[0046] Based on the unique identification of quantum cloud code, the source information and propagation trajectory of abnormal data assignment equipment number, initial assignment location and flow node sequence are traced. Taking quantum cloud code unique identification as index, the full link flow record stored in the database is associated, for example, "taking 'QM-CODE-001' as index, associated query to the assignment equipment, assignment location, all verification records and flow node data of the cloud code".

[0047] Extract the assignment equipment number and initial assignment location in the associated record, for example, "trace the assignment equipment number of 'QM-CODE-001' to QM-DEV-20240512-0090 (unregistered equipment), and the initial assignment location is 'north latitude 22.5431°, east longitude 114.0579° (440304)' (out of the preset assignment area)".

[0048] Sort the flow node sequence in chronological order to clarify the transmission path of abnormal data, for example, "the flow node sequence is NODE-S-003 (unauthenticated production enterprise)→NODE-T-067 (illegal distributor)→NODE-E-289 (terminal pharmacy in different place), forming a complete propagation trajectory".

[0049] Integrate abnormal determination result, confidence parameter, source information and flow trajectory, generate preliminary abnormal early warning information containing abnormal type, occurrence time and involved range, and traceability report with complete traceability link. Summarize the key information such as abnormal type, occurrence time and involved range, for example, "abnormal type: cross-regional smuggling; occurrence time: 2024-06-19T10:25:33.456Z; involved range: assignment equipment QM-DEV-20240512-0090, flow node 3, terminal pharmacy 1".

[0050] Explicitly trace the link, the main body of responsibility and key evidence, for example, "Traceability report: quantum cloud code QM-CODE-001 was assigned by unregistered device QM-DEV-20240512-0090 in Futian District, Shenzhen (440304), and transferred to off-site terminal pharmacy NODE-E-289 through irregular distributor NODE-T-067. The verification record shows that the verification was completed on 2024-06-19T10:25:33 in Yuexiu District, Guangzhou, Guangdong Province (440104), which is inconsistent with the preset sales area of Shandong Province. It is determined to be cross-regional channeling. Key evidence: the assignment device registration status is 'unauthenticated', the assignment location deviates from the sales area by 1500 kilometers, and the transfer node has no legal authorization record."

[0051] In S104, the preliminary abnormal early warning information and the traceability report are processed, and combined with the traceability supervision requirements of the food and pharmaceutical industries, the abnormal level classification standard is established, the detection accuracy rate threshold constraint and the real-time response time requirement are applied, and the graded early warning notice and accurate traceability scheme are generated.

[0052] In an embodiment, the abnormal type, confidence parameter and involved range in the preliminary abnormal early warning information are analyzed for industry adaptation, combined with the traceability supervision risk prevention and control requirements of the food industry and the pharmaceutical industry, and a three-level classification standard is established. The abnormal type focuses on the influence of illegal assignment and cross-regional channeling on product safety; the confidence parameter is set to adapt to the interval according to the industry fault tolerance rate; the involved range is associated with the affected supply chain links and the size of the end user. For example, in the food industry, "cross-regional channeling involving fresh products" is adapted to a high risk weight due to short shelf life and high risk of deterioration; in the pharmaceutical industry, "vaccine products assigned by unregistered devices" are adapted to the highest risk weight due to direct association with medication safety.

[0053] The three-level classification standard is as follows: general abnormality: low confidence (<80%) + single node influence + no direct safety risk, for example, "single terminal unauthorized verification (non-core transfer node) with confidence 75%, no product quality and safety risk". Important abnormality: medium-high confidence (80%-95%) + multi-node influence + potential safety risk, for example, "cross-regional channeling (involving 2 distribution nodes) with confidence 88%, food products may have deterioration risk due to substandard storage conditions". Emergency abnormality: high confidence (≥95%) + full-link influence + direct safety risk, for example, "illegal assignment of vaccine products (involving production, distribution and terminal full link) with confidence 96%, with direct risk of medication safety".

[0054] The threshold constraint of applying abnormal detection accuracy not lower than the target threshold value and the minute-level real-time response time limit requirement clearly determine the determination boundary and processing time limit of different levels of abnormalities. The target threshold value of applying abnormal detection accuracy not lower than 98% is unified, which is guaranteed by iterative optimization of quantum machine learning model; the minute-level real-time response time limit is set differently according to the level, for example, "general abnormal response time limit ≤ 10 minutes, important abnormal ≤ 5 minutes, and urgent abnormal ≤ 2 minutes".

[0055] Quantify the determination threshold of abnormal type, confidence, and involved range, for example, "in cross-regional hoarding abnormality, 3 or more provinces are determined as urgent abnormality, 1-2 provinces are important abnormality, and the same province across cities and counties is general abnormality; confidence of 95% is the dividing point between urgent and important abnormality, and confidence of 80% is the dividing point between important and general abnormality". Clearly define the longest time limit from early warning generation to disposal initiation, for example, "general abnormality needs to initiate traceability verification within 10 minutes, important abnormality needs to be synchronized to regional regulatory departments within 5 minutes, and urgent abnormality needs to trigger cross-departmental collaborative disposal within 2 minutes".

[0056] For general abnormality, match the conventional notification type early warning notification and basic traceability process, for important abnormality, correspond to the key reminder type early warning notification and deep traceability process, and for urgent abnormality, configure the emergency alarm type early warning notification and extremely fast traceability process. For different abnormal levels, configure different early warning notification methods and traceability process depth to improve the response pertinence. General abnormality: conventional notification type early warning notification (system message + email), basic traceability process (trace back to the direct flow node), for example, "send system message and email early warning to enterprise traceability administrator, and traceability process only checks the verification record of abnormal terminal node and the information of the upper flow node".

[0057] Important abnormality: key reminder type early warning notification (system message + short message + pop-up window of telephone), deep traceability process (trace back to the source of code and all flow nodes), for example, "send multi-channel early warning to enterprise administrator and regional regulatory officer, and traceability process checks the registration information of code equipment, authorized record of all link flow nodes, and each time verification data". Urgent abnormality: emergency alarm type early warning notification (multi-terminal linkage pop-up window + special person supervision telephone), extremely fast traceability process (priority algorithm support + real-time data retrieval), for example, "send linkage early warning to enterprise responsible person, provincial regulatory department, and emergency disposal team, start quantum calculation priority algorithm support, real-time retrieve code, flow, and verification data, and complete traceability link drawing within 1 minute".

[0058] The integrated abnormality level classification result, accuracy rate, time constraint requirement, and corresponding early warning-tracing process are used to generate early warning notifications with clear classification and timely response, and precise tracing schemes with clear links and accurate positioning. The aforementioned information is integrated to generate early warning notifications and tracing schemes with complete structure and direct landing. The hierarchical early warning notification clearly marks the abnormality level, risk degree, and processing time limit reminder, for example, "

Emergency Abnormality Warning

[0059] The precise tracing scheme includes tracing targets, core links, responsible subjects, and verification focuses, for example, "Precise Tracing Scheme: Target Positioning Illegal Coding Source and Full Link Propagation Node; Core Link: QM-CODE-002 (Quantum Cloud Code Unique Identifier)→Coding Device QM-DEV-20240601-0102 (Unregistered)→Production Enterprise A (No Authorization Record)→Distributor B (Illegal Purchase)→Terminal Pharmacy C; Responsible Subject: Production Enterprise A (Primary Responsibility), Distributor B (Secondary Responsibility); Verification Focus: Coding Device Operation Log, Enterprise Authorization Document, Product Logistics Voucher, Terminal Sales Record".

[0060] S105, the hierarchical early warning notification and the precise tracing scheme are processed to link the industry supervision platform and the enterprise management system to generate a collaborative management strategy that considers abnormality disposal efficiency and regulatory coverage.

[0061] In one implementation, the abnormality level in the hierarchical early warning notification, the risk degree, the tracing link in the precise tracing scheme, and the responsible subject are associated and mapped to generate collaborative basic data containing abnormality disposal requirements and regulatory adaptation requirements; the collaborative basic data is dimensionally matched with the function modules of the industry supervision platform and the enterprise management system, the disposal authority is divided according to the abnormality level dimension, and the system functions are matched according to the regulatory requirements, to build a collaborative management matrix. The abnormality level, risk degree, tracing link, and responsible subject are one-to-one corresponding, clearly indicating "who to dispose, what to dispose, and what regulatory requirements to meet". For example, "Abnormality Level: Emergency Abnormality; Risk Degree: Extremely High (Illegal Coding of Vaccine); Tracing Link: QM-CODE-002→Unregistered Device→Production Enterprise A→Distributor B→Terminal Pharmacy C; Responsible Subject: Production Enterprise A (Primary Responsibility), Distributor B (Secondary Responsibility); Associated Collaborative Basic Data: Involved Products Need to be Seized within 1 Hour, Regulatory Departments Need to be Simultaneously Involved in Investigation, and Enterprises Need to Submit Rectification Report".

[0062] According to the dimension matching system function and data demand, the corresponding relationship between authority and function is divided, and a structured control framework is formed. The dimension matching rules are as follows: the abnormal level dimension corresponds to the disposal authority (general abnormality → enterprise self-disposal, important abnormality → regional regulatory department cooperation, emergency abnormality → provincial regulatory department leading); the regulatory demand dimension corresponds to the system function (product sealing → regulatory platform law enforcement module, rectification tracking → enterprise management system module, data verification → double-platform data sharing module).

[0063] The matrix construction example is as follows: Combined with the abnormal recurrence probability and influence diffusion rate data output by the quantum machine learning model, the disposal priority and response time limit parameters in the collaborative control matrix are calibrated. The quantum machine learning model outputs abnormal recurrence probability (0-1) and influence diffusion rate (unit: hour / node number) based on historical abnormal data. For example, “the recurrence probability of a certain emergency abnormality is 0.85, and the influence diffusion rate is 2 nodes / hour”.

[0064] The parameter calibration example is as follows: the original emergency abnormality disposal priority is “level 1”, and the response time limit is “2 hours”. Combined with the calibration data, the priority is adjusted to “level 0 (highest)”, and the response time limit is adjusted to “1 hour”; the recurrence probability of a certain important abnormality is 0.3, the diffusion rate is 0.5 nodes / hour, the priority is maintained at “level 2”, and the response time limit is optimized from “4 hours” to “3 hours”.

[0065] Conflict detection and compatibility analysis are performed on the control measures in the collaborative control matrix, and schemes with cross-system execution conflicts are eliminated. The measure adaptation score is marked, and the control candidate scheme set with adaptation label is generated. Through conflict detection and adaptation score, feasible control measures are selected to form a candidate scheme set with labels. The execution conflict of cross-system measures is investigated, for example, “the ‘product recall’ function of the enterprise management system and the ‘product sealing’ function of the regulatory platform have execution sequence conflicts, and need to be sealed first and then recalled”.

[0066] Adaptation score and scheme screening, according to “disposal feasibility + system compatibility + regulatory compliance” scoring (full score 10 points), for example, “scheme 1: seal the product involved + enterprise rectification + data publicity, adaptation score 9.2; scheme 2: only enterprise rectification + data reporting, adaptation score 6.8”, eliminate schemes with adaptation score less than 8, and generate candidate scheme set: [scheme 1 (adaptation score 9.2), scheme 3 (seal + investigation + rectification, adaptation score 8.9)].

[0067] Multi-objective optimization is performed based on the disposal efficiency, coverage, and execution cost of the candidate scheme set. Quantum particle swarm optimization algorithm (QPSO) is used to optimize the core objectives of efficient disposal and comprehensive coverage, and compliance verification rules are integrated. The quantum particle swarm optimization algorithm relies on the characteristics of quantum superposition and quantum entanglement, breaks through the local optimization limit of classical optimization algorithms, synchronously traverses the solution space of multiple optimization objectives through quantum bit coding of candidate schemes, and realizes global efficient optimization. Its core advantage lies in using the quantum probability amplitude characteristics to improve the optimization speed and global optimality of the solution. The core objective weights are set as disposal efficiency (40%), coverage (35%), and execution cost (25%). The weights are determined based on the priority of the core needs of food and pharmaceutical industry traceability supervision.

[0068] The candidate scheme set is optimized. The disposal efficiency of scheme 1 is 1 hour (standardized score 1.0), the coverage is full link (standardized score 1.0), and the execution cost is 50,000 yuan (standardized score 0.8). The comprehensive score is 9.1 after calculation by the quantum particle swarm optimization algorithm and weighted summation according to the weights. The disposal efficiency of scheme 3 is 1.5 hours (standardized score 0.7), the coverage is full link (standardized score 1.0), and the execution cost is 80,000 yuan (standardized score 0.5). The comprehensive score is 8.3.

[0069] The compliance verification rules in the “People's Republic of China Pharmaceutical Administration Law” regarding product traceability and irregular disposal are integrated. The focus is on checking whether the scheme meets the legal requirements such as “quick sealing of products involved” “full link data traceability” “clear responsibility subject” etc. After verification, scheme 1 meets all the clauses, and scheme 3 has a slight conflict with the legal disposal time limit. Finally, scheme 1 is determined as the optimal scheme.

[0070] The optimized control measures and cross-system linkage mechanism are integrated to build a full-process control system covering abnormal early warning, traceability positioning, collaborative disposal, and regulatory closed loop. The system interface, data transmission specification, and responsibility division standard are clearly defined to generate a collaborative control strategy that balances abnormal disposal efficiency and regulatory coverage. The full-process control system covers abnormal early warning, traceability positioning, collaborative disposal, and regulatory closed loop, such as “early warning trigger → supervision platform pushing instruction → enterprise system receiving and starting sealing → double-platform sharing disposal progress → supervision department checking → enterprise submitting rectification report → supervision department accepting → closed loop archiving”.

[0071] System interface and responsibility division are clearly defined, including interface specification (using RESTful API to realize data interaction between the two platforms), data transmission specification (encrypted transmission, transmission delay ≤3 seconds), and responsibility division (supervision department responsible for law enforcement supervision, enterprise responsible for rectification implementation, and technology platform responsible for data support).

[0072] For illegal code assignment of vaccines, start the collaborative control led by the provincial regulatory department, complete the whole link sealing of the involved products within 1 hour; the enterprise submits the traceability data and rectification plan at the same time, the regulatory department completes the investigation within 3 days and the acceptance of rectification results within 15 days; the two platforms share the disposal data in real time to ensure full traceability and supervision.

[0073] In S106, the preliminary abnormal early warning information, the traceability report, the hierarchical warning notice, the precise traceability scheme and the collaborative control strategy are comprehensively processed, a model whole process evaluation system is constructed, the model abnormal detection precision, the reasoning speed and the generalization ability are included in the evaluation dimension, and quantum cloud code abnormal traceability detection comprehensive evaluation information is generated.

[0074] In an implementation manner, the abnormal identification accuracy, the false negative rate and the false positive rate features in the preliminary abnormal early warning information are quantitatively statistically processed, the quantum machine learning model reasoning result is combined, and the abnormal detection basic quantitative factor is generated around the model abnormal detection precision dimension. Focusing on the model abnormal detection precision dimension, the core indexes of the quantitative statistics are determined as the abnormal identification accuracy, the false negative rate and the false positive rate. The three types of indexes reflect the identification ability of the model to abnormal data from different angles, so as to ensure that the quantitative factor can fully characterize the detection precision. For example, the abnormal identification accuracy is used to measure the proportion of correctly identified abnormal data by the model, the false negative rate reflects the proportion of abnormal data that is not identified, and the false positive rate reflects the proportion of normal data that is misjudged as abnormal. The three together constitute the core evaluation dimension of abnormal detection precision.

[0075] The whole quantum cloud code flow data in a statistical period is selected as a statistical sample, so as to ensure that the sample covers normal data and various types of abnormal data (illegal code assignment and cross-regional channeling), and the sample size meets the statistical significance requirement, avoiding distortion of the quantitative result due to sample deviation. According to the preset calculation rule, the abnormal identification accuracy, the false negative rate and the false positive rate are respectively calculated, so as to ensure that the calculation process is clear in logic and the data source is traceable. For example, the abnormal identification accuracy = the number of correctly identified abnormal data / the total number of abnormal data x 100%. In a statistical period, 98 abnormal data are correctly identified, so the accuracy rate = 98 / 100 x 100% = 98%; the false negative rate = the number of un-identified abnormal data / the total number of abnormal data x 100%. 2 abnormal data are not identified, so the false negative rate = 2 / 100 x 100% = 2%; the false positive rate = the number of misjudged normal data / the total number of normal data x 100%. 10 normal data are misjudged as abnormal, so the false positive rate = 10 / 1000 x 100% = 1%.

[0076] Model inference result fusion: Extract the output results of the quantum machine learning model in all data inference processes in the statistical cycle, calculate the average inference confidence, and combine it with the three types of quantitative indicators to enrich the information dimension of the basic quantitative factors of anomaly detection and improve the comprehensiveness of the factors in describing the model detection accuracy. Integrate the anomaly recognition accuracy, false negative rate, false positive rate, and average model inference confidence in a fixed order to form the basic quantitative factors of anomaly detection. Each value in the factor directly corresponds to the key performance of the model's anomaly detection accuracy, providing basic data support for subsequent comprehensive evaluation. For example, the integrated basic quantitative factors of anomaly detection are [0.98, 0.02, 0.01, 0.95], which correspond to the anomaly recognition accuracy, false negative rate, false positive rate, and average model inference confidence, respectively, clearly presenting the core performance indicators of the model in the anomaly detection accuracy dimension.

[0077] Quantitative analysis and processing of traceability report and traceability link integrity, node positioning accuracy, and traceability time data in the precise traceability scheme, and generating traceability efficiency quantitative factors around the model inference speed dimension. Around the model inference speed dimension, the core indicators of traceability efficiency quantitative analysis are traceability link integrity, node positioning accuracy, and traceability time. These three indicators comprehensively describe the model's inference performance in the traceability link from the aspects of traceability coverage, positioning accuracy, and operation efficiency. For example, traceability link integrity reflects the model's ability to trace abnormal data throughout the process of flow nodes, node positioning accuracy reflects the model's accurate identification ability of each flow node, and traceability time directly reflects the speed and efficiency of the model's traceability inference. These three factors together constitute a complete evaluation dimension of traceability efficiency.

[0078] From the generated traceability report and precise traceability scheme in the statistical cycle, randomly select a certain number of reports and schemes corresponding to abnormal data as analysis samples to ensure that the samples cover different abnormal types (illegal coding, cross-regional channeling) and different flow link lengths to avoid one-sided quantitative results. According to the preset quantitative rules, calculate the traceability link integrity, node positioning accuracy, and traceability time of each sample to ensure that the calculation process has clear basis and the results are reproducible. For example, traceability link integrity = actual traced node number / total link node number x 100%, a certain abnormal data has a total of 5 nodes in the full link, and the model actually traces 5 nodes, so the integrity = 5 / 5 x 100% = 100%; Node positioning accuracy = number of correctly positioned nodes / actual traced nodes x 100%, the 5 nodes actually traced by the abnormal data are all correctly positioned, so the accuracy = 5 / 5 x 100% = 100%; Traceability time is the total time from triggering the traceability request to generating the complete traceability report. The traceability time of this abnormal data is 3 minutes.

[0079] The results of the three types of quantitative indicators of all analysis samples are summarized and statistically analyzed to calculate the mean of each type of indicator, eliminate the accidental errors of individual samples, and ensure that the quantitative factors can reflect the overall level of model traceability reasoning. For example, the calculation results of 20 samples are summarized, the mean of traceability link integrity is 99%, the mean of node positioning accuracy is 98.5%, and the mean of traceability time consumption is 3.2 minutes. The extreme value of a single sample is weakened by mean calculation, and the overall traceability performance of the model is more objectively reflected. The mean of traceability link integrity, the mean of node positioning accuracy, and the mean of traceability time consumption after summarization are integrated in a fixed order, and the first two indicators are standardized by 0-1 (i.e. divided by 100), forming the traceability performance quantitative factor, which provides standardized traceability performance data support for subsequent comprehensive evaluation.

[0080] The response timeliness of the hierarchical early warning notification, the matching degree of grade division, the disposal success rate of collaborative management strategy, and the coverage standard rate are quantitatively evaluated and processed to generate a management and control execution quantitative factor around the model generalization ability dimension. Around the model generalization ability dimension, the core indicators of management and control execution quantitative evaluation are response timeliness, grade division matching degree, disposal success rate, and coverage standard rate. The four types of indicators comprehensively depict the generalization performance of the model under different industry scenarios and different abnormal levels from the response efficiency, grade adaptation, execution effect, and coverage range levels. Response timeliness reflects the rapid response capability of the model early warning notification, grade division matching degree reflects the adaptation degree of the model to the industry regulatory requirements, disposal success rate and coverage standard rate directly present the actual landing effect of the model management and control strategy, and together constitute a complete evaluation dimension of management and control execution performance.

[0081] From the hierarchical early warning notifications and collaborative management strategies generated within the statistical cycle, cases covering different abnormal levels (general, important, and urgent) in the food and pharmaceutical industries are selected as evaluation samples to ensure that the samples cover a variety of scenarios and avoid distorted quantitative results due to a single scenario. According to the preset quantitative rules, each sample's four types of indicators are calculated to ensure clear calculation logic and traceable data sources. For example, response timeliness = (specified response time - actual response time) / specified response time * 100%, for an important abnormality with a specified response time of 5 minutes and an actual response time of 3 minutes, timeliness = (5-3) / 5 * 100% = 40%; level division matching degree = number of abnormal levels matching industry regulatory requirements / total number of abnormal levels * 100%, 20 out of 30 samples have completely matched abnormal level division and industry requirements, matching degree = 20 / 20 * 100% = 100% (here, the total number of abnormal levels is counted based on the actual effective samples); disposal success rate = number of successfully disposed abnormalities / total number of abnormalities * 100%, a total of 20 abnormalities occurred within the statistical cycle, 19 were successfully disposed, success rate = 19 / 20 * 100% = 95%; coverage compliance rate = abnormality involved range covered by control measures / total abnormality involved range * 100%, a total of 10 flow nodes are involved in abnormalities, and control measures cover all of them, compliance rate = 10 / 10 * 100% = 100%.

[0082] The results of the four types of quantitative indicators for all evaluation samples are summarized and the mean value of each type of indicator is calculated to eliminate accidental errors of individual samples and ensure that the quantitative factors can reflect the overall generalization level of model management execution. For example, the calculation results of 30 samples are summarized, the mean value of response timeliness is 42%, the mean value of level division matching degree is 98%, the mean value of disposal success rate is 94%, and the mean value of coverage compliance rate is 99%. The mean value calculation weakens the influence of extreme values of individual samples and more objectively reflects the generalization performance of the model in different scenarios.

[0083] The summarized response timeliness mean value, level division matching degree mean value, disposal success rate mean value, and coverage compliance rate mean value are integrated in a fixed order, and all indicators are standardized according to the 0-1 standard (i.e., divided by 100) to form the control execution quantitative factor, providing standardized control execution data support for subsequent comprehensive evaluation. For example, the control execution quantitative factor generated after integration is [0.4, 1.0, 0.95, 1.0], which corresponds to the standardized response timeliness (40%→0.4), level division matching degree (100%→1.0), disposal success rate (95%→0.95), and coverage compliance rate (100%→1.0) in turn, clearly presenting the core performance of the model in the generalization ability dimension.

[0084] The model full-process evaluation system is constructed, the model anomaly detection accuracy, reasoning speed and generalization ability are included in the evaluation dimension, the quantum machine learning evaluation framework is used for fusion calculation of the anomaly detection basic quantization factor, the traceability efficiency quantization factor and the management and control execution quantization factor, and the quantum cloud code anomaly traceability detection comprehensive evaluation information is generated. The model core performance is used as the guide, the core dimension of the evaluation system is clearly defined as the anomaly detection accuracy, the reasoning speed and the generalization ability, the three types of dimensions correspond to the anomaly detection basic quantization factor, the traceability efficiency quantization factor and the management and control execution quantization factor respectively, and the evaluation architecture of the three-layer linkage of the dimension-factor-index is formed, so that the evaluation can comprehensively cover the full-process performance of the model from training to application.

[0085] In order to eliminate the influence of the dimensional difference between different factors on the fusion calculation, the anomaly detection basic quantization factor, the traceability efficiency quantization factor and the management and control execution quantization factor are normalized respectively, all index values are mapped to the interval [0, 1], and the weight proportion of each factor in the fusion calculation is ensured to be fair and reasonable. Based on the core needs of food and medicine industry traceability supervision, the fusion weights of the three types of quantization factors are determined, wherein the anomaly detection accuracy is directly related to the anomaly recognition accuracy, the weight is given as 0.4; the reasoning speed affects the timeliness of traceability and disposal, the weight is given as 0.3; and the generalization ability determines the cross-scene application value of the model, the weight is given as 0.3, and the weight allocation takes into account the core needs and comprehensive balance. The three types of normalized quantization factors are input into the quantum machine learning evaluation framework, the parallel operation characteristics of the quantum superposition state are used to weight and sum each factor according to the preset weight, and the comprehensive score is generated. This framework can effectively reduce the influence of dimension disaster in classical calculation, and improve the fusion calculation efficiency and accuracy.

[0086] The total score obtained by the fusion calculation is mapped to the intuitive core evaluation index, including the anomaly detection accuracy, the data processing efficiency and the traceability accuracy, and the auxiliary information such as model optimization gain and cross-algorithm comparison advantage is supplemented, so as to form the comprehensive evaluation information with complete structure and detailed data, and provide the decision basis for model iteration and industry application.

[0087] As shown in Figure 2 , a quantum anomaly traceability detection device based on quantum machine learning comprises: An acquisition module 201 is configured to collect quantum cloud code full-link flow data and associated information, including code assignment device number, code assignment timestamp, code assignment geographic location, full-process verification record and flow node information. The processing module 202 is configured to process the quantum cloud code full-link flow data and associated information, construct a standardized feature vector through data cleaning and feature extraction, select a quantum support vector machine algorithm based on a quantum machine learning framework, optimize quantum gate line structure and parameter configuration, and train an abnormality detection model; process the trained abnormality detection model, introduce a model inference optimization mechanism, improve abnormal feature matching efficiency through a quantum state inference acceleration algorithm, optimize model deployment adaptation logic, access quantum cloud code flow data in real time, identify abnormal data such as illegal coding and cross-regional channeling through model inference, trace abnormal data sources and flow tracks based on the unique identification characteristics of quantum cloud codes, and generate preliminary abnormality early warning information and traceability reports; process the preliminary abnormality early warning information and traceability reports, establish abnormality grade division standards based on the traceability supervision requirements of the food and pharmaceutical industries, apply detection accuracy threshold constraints and real-time response time requirements, generate graded early warning notifications and precise traceability schemes; process the graded early warning notifications and precise traceability schemes, link industry supervision platforms and enterprise management systems, and generate collaborative control strategies that take into account abnormality disposal efficiency and regulatory coverage; comprehensively process the preliminary abnormality early warning information, traceability reports, graded early warning notifications, precise traceability schemes, and collaborative control strategies, construct a model full-process evaluation system, include model abnormality detection precision, inference speed, and generalization ability in the evaluation dimensions, and generate quantum cloud code abnormality traceability detection comprehensive evaluation information.

[0088] A computing device, comprising a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to perform any one of the quantum machine learning-based quantum abnormality traceability detection methods.

[0089] The methods and / or embodiments in the embodiments of the present application can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for executing the methods shown in the flowcharts. When the computer program is executed by a processing unit, the above-mentioned functions defined in the methods of the present application are performed.

[0090] It is instructive to note that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to: an electronic connection having one or more wires; a portable computer diskette; a hard disk; a random access memory (RAM); a read-only memory (ROM); an erasable programmable read-only memory (EPROM or Flash memory); an optical fiber; a portable compact disc read-only memory (CD-ROM); an optical storage device; a magnetic storage device; or any suitable combination of the foregoing. In the present application, a computer readable medium can be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

[0091] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0092] It will be apparent to those skilled in the art that the present application is not limited to the specific embodiments described above, but that there are many possible variations and modifications that are also within the spirit and scope of the application. Thus, the application is not to be limited to any specific examples described herein, but rather only by the claims that follow.

Claims

1. A quantum anomaly back-tracing detection method based on quantum machine learning, characterized in that, Comprise: Collect quantum cloud code full-link flow data and associated information, including code assignment device number, code assignment timestamp, code assignment geographic location, full-process verification record and flow node information; Process quantum cloud code full-link flow data and associated information, construct standardized feature vectors through data cleaning and feature extraction, select quantum support vector machine algorithm based on quantum machine learning framework, optimize quantum gate line structure and parameter configuration, and train to generate anomaly detection model; Process the trained anomaly detection model, introduce model inference optimization mechanism, improve anomaly feature matching efficiency through quantum state inference acceleration algorithm, optimize model deployment adaptation logic, real-time access to quantum cloud code flow data stream, identify illegal code assignment and cross-regional channeling through model inference, trace abnormal data source and flow track based on quantum cloud code unique identification characteristics, generate preliminary abnormal warning information and traceability report; Process the preliminary abnormal warning information and traceability report, establish abnormal level division standard based on food and medicine industry traceability supervision demand, apply detection accuracy threshold constraint and real-time response time requirement, generate graded warning notification and precise traceability scheme; Process the graded warning notification and precise traceability scheme, link industry supervision platform and enterprise management system, generate collaborative control strategy considering abnormal disposal efficiency and supervision coverage; Comprehensively process the preliminary abnormal warning information, traceability report, graded warning notification, precise traceability scheme and collaborative control strategy, build model full-process evaluation system, include model anomaly detection precision, inference speed and generalization ability in evaluation dimension, and generate quantum cloud code anomaly traceability detection comprehensive evaluation information. 2.The quantum machine learning based quantum anomaly back-tracing detection method according to claim 1, wherein, Process quantum cloud code full-link flow data and associated information, construct standardized feature vectors through data cleaning and feature extraction, select quantum support vector machine algorithm based on quantum machine learning framework, optimize quantum gate line structure and parameter configuration, and train to generate anomaly detection model, including: Perform data cleaning, redundancy elimination and format standardization processing on quantum cloud code full-link flow data and associated information, eliminate duplicate code assignment records, invalid verification data and format abnormal information, unify timestamp format, geographic location code and device number rules, extract code assignment features, space-time features, verification features and flow node features; Determine feature mapping dimension and quantum kernel function type based on quantum machine learning framework, select quantum support vector machine algorithm as the core modeling algorithm, and specify quantum state initialization method and sample data quantumization mapping rules of the algorithm; Optimize quantum bit allocation, logic gate combination and parameter adjustment strategy of quantum gate line, reduce quantum line depth and noise interference, and improve quantum computing efficiency of model training; Convert standardized feature vectors to quantum state representation, input quantum support vector machine model for iterative training, obtain model output results through quantum measurement, adjust model hyperparameters, and generate quantum machine learning anomaly detection model with the ability to identify illegal code assignment and cross-regional channeling. 3.The quantum machine learning based quantum anomaly back-tracing detection method according to claim 1, wherein, The trained anomaly detection model is processed, the model inference optimization mechanism is introduced, the anomaly feature matching efficiency is improved through the quantum state inference acceleration algorithm, the model deployment adaptation logic is optimized, the quantum cloud code stream transfer data stream is accessed in real time, the illegal code assignment and cross-regional goods diversion abnormal data are identified through model inference, the abnormal data source and flow track are traced based on the unique identification characteristics of quantum cloud code, and preliminary abnormal warning information and traceability report are generated, including: The trained quantum support vector machine anomaly detection model is deployed and adapted, the model inference optimization mechanism is introduced, the anomaly feature matching efficiency is improved through the quantum state inference acceleration algorithm, the model deployment adaptation logic is optimized, the real-time data stream access interface and data analysis rules are configured to ensure low-latency transmission and format compatibility of quantum cloud code stream transfer data; Relying on the quantum state inference acceleration algorithm to optimize the feature matching process, the real-time data stream is analyzed frame by frame through model quantum state inference operation, and abnormal feature patterns such as illegal code assignment and cross-regional goods diversion are matched to generate abnormal data judgment results and confidence parameters; Based on the unique identification of quantum cloud code, the whole link transfer record is associated to trace the source information and propagation track of the abnormal data assignment equipment number, initial assignment location, and transfer node sequence; Integrate abnormal judgment results, confidence parameters, source information and flow track to generate preliminary abnormal warning information including abnormal type, occurrence time and involved range, and traceability report with complete traceability link. 4.The quantum machine learning based quantum anomaly back-tracing detection method according to claim 1, wherein, The preliminary abnormal warning information and traceability report are processed, the abnormal grade division standard is established according to the food and medicine industry traceability supervision demand, the detection accuracy threshold constraint and real-time response time requirement are applied, the graded warning notice and precise traceability scheme are generated, including: Industry adaptation analysis is performed on the abnormal type, confidence parameter and involved range in the preliminary abnormal warning information, combined with the traceability supervision risk prevention and control requirements of food industry and medicine industry, three-level division standard is established; The threshold constraint that the abnormal detection accuracy is not less than the target threshold and the minute-level real-time response time requirement are applied to determine the judgment boundary and processing time limit of different levels of abnormality; For general abnormality, conventional notification type warning notice and basic traceability process are matched, important abnormality corresponds to key reminder type warning notice and deep traceability process, and emergency abnormality configures emergency alarm type warning notice and ultra-speed traceability process; Integrate abnormal grade division results, accuracy and time constraint requirements and corresponding warning-traceability process to generate graded, timely response warning notice and clear link, accurate positioning precise traceability scheme. 5.The quantum machine learning based quantum anomaly back-tracing detection method according to claim 1, wherein, The graded warning notice and precise traceability scheme are processed, the industry supervision platform and enterprise management system are linked, and the collaborative control strategy considering abnormal disposal efficiency and supervision coverage is generated, including: The abnormal level, risk level in the hierarchical early warning notification, and the traceability link and responsible subject in the precise traceability scheme are associated and mapped to generate collaborative basic data containing abnormal handling requirements and regulatory adaptation requirements; the collaborative basic data are dimensionally matched with the function modules of the industry regulatory platform and enterprise management system, the handling authority is divided according to the abnormal level dimension, and the system function is corresponded according to the regulatory requirement dimension, so as to construct a collaborative control matrix; The abnormal recurrence probability and influence diffusion rate data output by the quantum machine learning model are combined to calibrate the handling priority and response time limit parameters in the collaborative control matrix; The control measures in the collaborative control matrix are subjected to conflict detection and compatibility analysis, the schemes with cross-system execution conflicts are eliminated, the measure adaptation score is labeled, and a set of control candidate schemes with adaptation labels is generated; Based on the handling efficiency, coverage range and execution cost of the control candidate scheme set, multi-objective optimization is carried out, the quantum optimization algorithm is used to optimize the core target of efficient handling and comprehensive coverage, and compliance verification rules are integrated; The optimized control measures and cross-system linkage mechanism are integrated to construct a whole-process control system covering abnormal early warning, traceability positioning, collaborative handling and regulatory closed loop, the system docking interface, data transmission specification and responsibility division standard are clarified, and a collaborative control strategy considering abnormal handling efficiency and regulatory coverage range is generated.

6. The quantum machine learning based quantum anomaly back-tracing detection method of claim 5, wherein, The preliminary abnormal early warning information, traceability report, hierarchical early warning notification, precise traceability scheme and collaborative control strategy are comprehensively processed to construct a whole-process evaluation system of the model, the model abnormal detection accuracy, reasoning speed and generalization ability are included in the evaluation dimension, and quantum cloud code abnormal traceability detection comprehensive evaluation information is generated, including: The abnormal recognition accuracy, false negative rate and false positive rate characteristics in the preliminary abnormal early warning information are quantitatively statistically processed, combined with the inference results of the quantum machine learning model, and the abnormal detection basic quantitative factors are generated around the model abnormal detection accuracy dimension; The traceability link integrity, node positioning accuracy and traceability time consumption data in the traceability report and precise traceability scheme are quantitatively analyzed and processed to generate traceability efficiency quantitative factors around the model reasoning speed dimension; The response timeliness of the hierarchical early warning notification, the level division matching degree and the handling success rate of the collaborative control strategy are quantitatively evaluated and processed to generate control execution quantitative factors around the model generalization ability dimension; The model whole-process evaluation system is constructed, the model abnormal detection accuracy, reasoning speed and generalization ability are included in the evaluation dimension, the abnormal detection basic quantitative factors, traceability efficiency quantitative factors and control execution quantitative factors are fused and calculated based on the quantum machine learning evaluation framework, and the quantum cloud code abnormal traceability detection comprehensive evaluation information is generated.

Citation Information

Patent Citations

  • Animal-husbandry product traceability information record method, device, apparatus and storage medium

    CN109146514A

  • Network security detection method and system based on quantum computing

    CN118337431A

  • Underground water pollution on-line monitoring method and device

    CN120278289A

  • Logistics express management method and system based on traceability technology

    CN121052726A

  • System and method for combinatorial data outlier detection via database query statement generation

    US20250094433A1