A quantum anomaly backtracking detection method based on quantum machine learning

By collecting and cleaning quantum cloud code data, optimizing quantum gate circuits using quantum support vector machine algorithms, generating anomaly detection models, identifying anomalies in real time and tracing their origins, the accuracy and efficiency issues of quantum models in anomaly detection are solved, meeting industry regulatory requirements and achieving precise traceability and collaborative management.

CN121365987BActive Publication Date: 2026-04-10FUJIAN ZHONGXIN NET SAFETY INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
FUJIAN ZHONGXIN NET SAFETY INFORMATION TECHNOLOGY CO LTD
Filing Date
2025-12-23
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing sub-models suffer from problems such as low discriminative power of anomaly features, low model training efficiency, insufficient generalization ability, and insufficient integration with business logic in anomaly detection. This results in insufficient anomaly detection accuracy, high false positive and false negative rates, and an inability to adapt to 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, combine quantum state inference acceleration algorithm to identify anomalies in real time, establish anomaly level classification standard, and link with industry regulatory platform for collaborative management.

Benefits of technology

It enables anomaly tracing in quantum cloud code transfer, improves the accuracy and efficiency of anomaly detection, meets the traceability and supervision needs of the food and pharmaceutical industries, provides precise traceability and collaborative control strategies, and solves industry pain points such as cross-selling, counterfeiting, and regulatory lag.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121365987B_ABST
    Figure CN121365987B_ABST
Patent Text Reader

Abstract

The application discloses a quantum abnormality tracing detection method based on quantum machine learning, which is applied to the technical field of data processing, and collects quantum cloud code full-link flow data, which contains key information such as code equipment number and time stamp. After data cleaning and feature extraction, a standardized feature vector is constructed, and relying on a quantum machine learning framework, a quantum support vector machine algorithm is selected and a quantum gate circuit is optimized to train an abnormality detection model. The model accesses data flow in real time, identifies abnormalities such as illegal coding and traces the source, generates early warning and tracing reports. Combined with industry demand, the abnormality level is divided, a graded early warning and tracing scheme is generated, a collaborative management strategy is generated by a linkage platform, finally, multiple types of information are comprehensively processed, and evaluation information containing detection accuracy and other indicators 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 is not combined with the importance ranking of the features, and the quantum bits with high noise sensitivity of key business features are bound, resulting in serious interference of the 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 makes it 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 gaps". SUMMARY

[0006] To solve the above technical problems, the present application provides the following technical solutions:

[0007] 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 abnormal 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 abnormal 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.

[0008] 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 abnormality 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 the quantum particle swarm optimization algorithm. Finally, through the fusion calculation of three types of quantitative factors, the comprehensive evaluation information is output, effectively solving the industry channeling and counterfeiting, and the lagging supervision pain points. Attached Figure Description

[0009] Figure 1 A flowchart of a quantum anomaly tracing and detection method based on quantum machine learning provided in an embodiment of the present invention;

[0010] Figure 2 This is a schematic diagram of a quantum anomaly tracing and detection device based on quantum machine learning, provided in an embodiment of the present invention. Detailed Implementation

[0011] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention. Figure 1 This application describes a quantum anomaly tracing and detection method based on quantum machine learning, according to an exemplary embodiment of the present application.

[0012] In this application embodiment, a quantum anomaly tracing and detection method based on quantum machine learning, such as... Figure 1 As shown:

[0013] S101 collects the entire chain flow data and related information of quantum cloud codes.

[0014] In one implementation, a data acquisition terminal and transmission network covering the entire quantum cloud code flow process are used to systematically collect key data and related information from each stage of quantum cloud code generation to verification and use. This ensures data coverage, integrity, and timeliness, providing fundamental data support for subsequent anomaly detection and tracing. A unique identification coding rule is adopted, for example, "QM-DEV-20240512-0089," where "QM" represents the prefix for the dedicated quantum cloud code device, "20240512" is the device's manufacturing date, and "0089" is the device's serial number. This allows for precise location of the specific physical device generating the quantum cloud code and differentiation of operation records from different coding terminals. A unified UTC standard time format is used, for example, "2024-06-18T09:32:47.153Z," accurate to the millisecond level, recording the specific time point of quantum cloud code generation. This provides a time reference for judging the rationality of the coding sequence and investigating abnormal coding across different time periods.

[0015] 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)", among which the latitude and longitude ensures 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. 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.

[0016] 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.

[0017] 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, 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.

[0018] 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, 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, 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. For example, "3 identical quantum cloud code records generated by device number QM-DEV-20240512-0089 at 2024-06-18T09:32:47.153Z are removed".

[0019] 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°."

[0020] 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".

[0021] 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 code assignment features include code assignment device model, code assignment frequency, device registration status, etc., such as "device model: QM-FM-2024, single-day code assignment frequency: 1200 times, device registration status: authenticated". The space-time features include code assignment time interval, flow area span, cross-area flow number, etc., such as "adjacent code assignment 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".

[0022] 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".

[0023] Based on the quantum machine learning framework, the feature mapping dimension and the quantum kernel function type are determined, the quantum support vector machine algorithm is selected as the 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 the 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 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 ".

[0024] 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 code frequency, flow area span, etc.) into quantum bit representable physical quantities (phase or amplitude) through a specific quantum coding algorithm, providing input for subsequent quantum support vector machine quantum state operation.

[0025] In combination with 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, no need to allocate quantum bits for each feature dimension, can carry multiple feature information through the phase or rotation angle of a single quantum bit (1 quantum bit can map 2-3 low-dimensional features in the application), adapt 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 standardized feature numerical range 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 angle encoding can be directly used as the input state of quantum support vector machine, participating in quantum kernel function calculation and quantum state reasoning, without additional conversion link.

[0026] 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, 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, where 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); The maximum value of the feature (e.g., the maximum encoding frequency of 1500 times per day of the encoding device in the present application); The standardized feature value. Substituting the example data for calculation: , considering the accuracy adaptation of subsequent quantum angle mapping, rounding the result to one decimal place, the final standardized value is [0.8].

[0027] Quantum angle mapping (core step), through the angle encoding algorithm, the standardized feature value is mapped to the rotation angle of the quantum bit , the mapping rule follows: , the reason for choosing as the mapping coefficient. The rotation angle of the quantum bit ranges from [0, π] (angles exceeding this range will cause information redundancy due to the periodicity of quantum states); the standardized value [0, 1], multiplied by can ensure [0, ], realizing complete adaptation of numerical values and angles without information loss. Substituting the example standardized value [0.8] for calculation, =0.8 =0.8 (approximately 144°).

[0028] Quantum state generation (output step), through quantum logic gate operation (e.g., RY rotation gate), the angle obtained by mapping is acted on the initial quantum state (usually state), generating a quantum state carrying sample data information. The specific operation is as follows: the initial quantum state: (the ground state of the quantum bit); apply the RY rotation gate, the RY gate rotates the quantum bit around the y-axis by an angle , and its matrix form is: .

[0029] The target quantum state is generated: , substituting 72°, the calculation result is: , the amplitude information (0.3090, 0.9511) of this quantum state indirectly carries the original data information of "single-day encoding frequency 1200 times", which can be used for subsequent quantum support vector machine model training.

[0030] 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.

[0031] 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.

[0032] 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 channeling", the mapping rule can highlight the quantum state difference of key features such as "abnormal code assignment frequency" and "abnormal cross-area span", and provide a basis for the model to accurately identify abnormal data.

[0033] 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.

[0034] Combining the business feature association logic, the combination architecture of "Hadamard gate + CNOT gate + RY gate" is adopted: through the Hadamard gate, q0 (code frequency feature) enters the quantum superposition state, realizing multi-feature combination operation; the correlation between code features and space-time features is constructed by using CNOT gate (control bit q0, target bit q2), which adapts to the business logic that "code frequency anomaly is often accompanied by cross-regional flow anomaly"; the phase of the quantum bit is adjusted by RY gate, for example, the phase of q1 (code device registration state feature) is adjusted by RY gate (angle 0.6π), which strengthens the abnormal feature expression of unregistered device coding.

[0035] 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 iteration 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.

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

[0037] 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 coding" data is measured, which intuitively reflects the identification ability of the model to abnormal business scenarios.

[0038] According to the quantum measurement result and the business detection demand, 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 food and medicine industry.

[0039] 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.

[0040] 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.

[0041] In an 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.

[0042] 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.

[0043] 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%.

[0044] 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" combination feature corresponding to illegal code assignment and the "flow transfer region span exceeds threshold + node authorization missing" combination 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.

[0045] 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.

[0046] 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 completely carrying the abnormal feature information of the frame data.

[0047] 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 quantitatively output. 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.

[0048] Set the similarity threshold, compare the similarity result obtained by quantum state reasoning operation with the threshold, if the similarity ≥ threshold, it is determined as abnormal data of corresponding type, if all are lower than the threshold, it is determined as normal data, and the abnormal type (illegal code assignment / cross-regional channeling) is recorded. 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.

[0049] 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".

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

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

[0052] 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 channeling; occurrence time: 2024-06-19T10:25:33.456Z; involved range: assignment equipment QM-DEV-20240512-0090, 3 flow nodes, 1 terminal pharmacy".

[0053] 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."

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

[0055] In one implementation, 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, a three-level classification standard is established. The abnormal type focuses on the impact 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; and 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 spoilage; in the pharmaceutical industry, "vaccine products assigned by unregistered devices" are adapted to the highest risk weight due to direct association with medication safety.

[0056] The three-level classification standard is as follows: general abnormality: low confidence (<80%) + single node impact + 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 impact + potential safety risk, for example, "cross-regional channeling (involving 2 distribution nodes) with confidence 88%, food products may have spoilage risk due to substandard storage conditions". Emergency abnormality: high confidence (≥95%) + full-link impact + 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".

[0057] 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 differentiated according to the level, for example, "general abnormal response time limit ≤ 10 minutes, important abnormal ≤ 5 minutes, and urgent abnormal ≤ 2 minutes".

[0058] 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".

[0059] 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 differentiated early warning notification mode and traceability process depth to improve 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".

[0060] 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".

[0061] By integrating the results of anomaly classification, accuracy and timeliness constraints, and corresponding early warning and tracing processes, we generate clearly tiered and timely early warning notifications, as well as precise tracing solutions with clear links and accurate positioning. Integrating the aforementioned information, we generate complete and directly implementable early warning notifications and tracing solutions. Tiered early warning notifications clearly indicate the anomaly level, risk degree, and processing time limit reminder. For example, “[Emergency Anomaly Warning] Anomaly Type: Illegal Code Assignment (Vaccine Product); Confidence Level: 96%; Scope Affected: Manufacturer A → Distributor B → Terminal Pharmacy C (Entire Chain); Risk Level: Extremely High (Directly Affects Medication Safety); Processing Time Limit: 1 minute remaining, please immediately initiate cross-departmental collaborative handling.”

[0062] The precise traceability solution includes the traceability target, core link, responsible entity, and key verification points. For example, "Precise traceability solution: Targeting the source of illegal coding and the entire chain of propagation nodes; Core link: QM-CODE-002 (unique identifier of quantum cloud code) → coding device QM-DEV-20240601-0102 (unregistered) → Manufacturer A (no authorization record) → Distributor B (illegal procurement) → Terminal pharmacy C; Responsible entities: Manufacturer A (primary responsibility), Distributor B (secondary responsibility); Key verification points: Coding device operation log, enterprise authorization documents, product logistics vouchers, and terminal sales records."

[0063] S105 processes tiered early warning notifications and precise traceability solutions, linking industry regulatory platforms and enterprise management systems to generate collaborative control strategies that balance the efficiency of anomaly handling with the scope of regulatory coverage.

[0064] In one implementation, the abnormality level and risk degree in the graded early warning notification, as well as the traceability link and responsible entity in the precise traceability plan, are correlated and mapped to generate collaborative basic data containing abnormality handling needs and regulatory adaptation requirements. This collaborative basic data is then matched dimensionally with the functional modules of the industry regulatory platform and enterprise management system. Handling authority is divided according to the abnormality level dimension, and system functions are matched according to regulatory needs dimension, constructing a collaborative control matrix. An abnormality level and risk degree are mapped one-to-one with the traceability link and responsible entity, clarifying "who handles it, what is handled, and what regulatory requirements must be met." For example, "Abnormality level: Emergency abnormality; Risk degree: Extremely high (illegal vaccine coding); Traceability link: QM-CODE-002 → Unregistered equipment → Manufacturer A → Distributor B → Terminal pharmacy C; Responsible entities: Manufacturer A (primary responsibility), Distributor B (secondary responsibility); Corresponding collaborative basic data: The product involved must be sealed within 1 hour, the regulatory department must simultaneously intervene in the investigation, and the enterprise must submit a rectification report."

[0065] 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).

[0066] The matrix construction example is as follows:

[0067]

[0068] 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: node / hour) 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".

[0069] 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".

[0070] The control measures in the collaborative control matrix are subjected to conflict detection and compatibility analysis, and the 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 labeled candidate scheme set. 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 conflict, and need to be sealed first and then recalled".

[0071] 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 the schemes with adaptation score less than 8, and generate the candidate scheme set: [scheme 1 (adaptation score 9.2), scheme 3 (seal + investigation + rectification, adaptation score 8.9)].

[0072] 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.

[0073] 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. 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.

[0074] Compliance verification rules related to product traceability and irregular disposal in the “People’s Republic of China Pharmaceutical Administration Law” 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”, and “clear responsibility subject”. After verification, scheme 1 meets all the provisions, and scheme 3 has a slight conflict with the legal disposal time limit. Finally, scheme 1 is determined as the optimal scheme.

[0075] 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”.

[0076] 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).

[0077] 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.

[0078] 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.

[0079] In an embodiment, the accuracy of abnormal identification, the false negative rate and the false positive rate in the preliminary abnormal early warning information are quantitatively statistically processed, combined with the inference result of the quantum machine learning model, 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 quantitative statistics are determined as the accuracy of abnormal identification, 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 accuracy of abnormal identification is used to measure the proportion of correctly identified abnormal data, 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.

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

[0081] 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.

[0082] 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.

[0083] 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, and the traceability time of this abnormal data is 3 minutes.

[0084] 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.

[0085] The response timeliness, grade division matching degree, and disposal success rate of the hierarchical early warning notification, and the coverage standard rate of the collaborative management strategy 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 the 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.

[0086] 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%.

[0087] 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.

[0088] The summarized mean values of response timeliness, level division matching degree, disposal success rate, and coverage compliance rate 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.

[0089] 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 to fuse and calculate 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 “dimension-factor-index” three-layer linkage is formed, so that the evaluation can comprehensively cover the full-process performance of the model from training to application.

[0090] 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 accuracy of anomaly identification, 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.

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

[0092] As shown in Figure 2 , a quantum anomaly traceability detection device based on quantum machine learning comprises:

[0093] 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.

[0094] 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 code, 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.

[0095] 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.

[0096] 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.

[0097] 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.

[0098] 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).

[0099] 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, train to generate anomaly detection model, including data cleaning, redundant elimination and format standardization processing of quantum cloud code full-link flow data and associated information, eliminating duplicate code assignment records, invalid verification data and format abnormal information, unifying timestamp format, geographic location coding and device number rules, extracting code assignment features, spatiotemporal 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 determine the quantum state initialization method and sample data quantumization mapping rule of the algorithm; Optimize quantum bit allocation, logic gate combination and parameter adjustment strategy of quantum gate line; Convert the standardized feature vector into a quantum state representation, input the quantum support vector machine model for iterative training, obtain the model output result through quantum measurement, adjust the model hyperparameters, and generate a quantum machine learning anomaly detection model that includes illegal code assignment and cross-regional channeling of abnormal data recognition capabilities; 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 of abnormal data through model inference, trace the source and flow track of abnormal data based on the unique identification characteristics of quantum cloud code, and 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 regulatory coverage; Comprehensively process the preliminary abnormal warning information, traceability report, graded warning notification, precise traceability scheme and collaborative control strategy, build a model full-process evaluation system, include model anomaly detection precision, inference speed and generalization ability in the 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 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 of abnormal data through model inference, trace the source and flow track of abnormal data based on the unique identification characteristics of quantum cloud code, and generate preliminary abnormal warning information and traceability report, including: The trained quantum support vector machine anomaly detection model is deployed and adapted, a model inference optimization mechanism is introduced, the efficiency of anomaly 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 parsing rules are configured to ensure low-latency transmission and format compatibility of quantum cloud code stream conversion data; Relying on the optimization of feature matching process by quantum state inference acceleration algorithm, 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 channeling are matched to generate abnormal data judgment results and confidence parameters; Based on the unique identification of quantum cloud code, the full-link flow record is associated to trace the source information and propagation trajectory of the abnormal data assignment equipment number, initial assignment location, and flow node sequence; Integrate abnormal judgment results, confidence parameters, source information, and flow trajectory to generate preliminary abnormal warning information containing abnormal type, occurrence time, and involved range, as well as traceability report with complete traceability link. 3.The quantum machine learning based quantum anomaly back-tracing detection method of claim 1, wherein, Process the preliminary abnormal warning information and traceability report, establish abnormal level 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 to generate graded warning notifications and precise traceability plans, including: Industry-adapted analysis of abnormal types, confidence parameters, and involved ranges in preliminary abnormal warning information, combined with traceability supervision risk prevention and control requirements of the food and pharmaceutical industries, establishes a three-level division standard; Apply threshold constraints that the abnormal detection accuracy is not less than the target threshold and minute-level real-time response time requirements to clearly define the determination boundaries and processing time limits for different levels of abnormalities; For general abnormalities, match conventional notification type warning notifications and basic traceability processes, for important abnormalities, match key reminder type warning notifications and deep traceability processes, and for urgent abnormalities, configure emergency alarm type warning notifications and extremely fast traceability processes; Integrate abnormal level division results, accuracy and time constraints, and corresponding warning-traceability processes to generate graded and timely warning notifications and clear and accurate traceability plans. 4.The quantum machine learning based quantum anomaly back-tracing detection method of claim 1, wherein, Process the graded warning notifications and precise traceability plans, link industry supervision platforms and enterprise management systems, and generate collaborative control strategies that balance abnormal disposal efficiency and regulatory coverage, including: Correlate and map abnormal levels, risk levels in graded warning notifications, and traceability links, responsible subjects in precise traceability plans to generate collaborative basic data containing abnormal disposal requirements and regulatory adaptation requirements; dimensionally match collaborative basic data with functional modules of industry supervision platforms and enterprise management systems, divide disposal authorities by abnormal level dimension and correspond system functions by regulatory requirements to build a collaborative control matrix; Calibrate disposal priority and response time parameters in the collaborative control matrix based on abnormal recurrence probability and influence diffusion rate data output by quantum machine learning models; Detect conflicts and analyze compatibility of control measures in the collaborative control matrix, eliminate schemes with cross-system execution conflicts, label measure adaptation scores, and generate a set of control candidate schemes with adaptation labels. Based on the disposal efficiency, coverage, and execution cost of the candidate scheme set, multi-objective optimization is carried out, quantum optimization algorithm is adopted to optimize the core targets of efficient disposal and comprehensive coverage, and compliance verification rules are integrated; Integrate the optimized control measures and cross-system linkage mechanism to build a full-process control system covering abnormal early warning, traceability positioning, collaborative disposal, and regulatory closed loop. Define system interface, data transmission specification, and responsibility division standard to generate a collaborative control strategy that balances abnormal disposal efficiency and regulatory coverage.

5. The quantum machine learning based quantum anomaly back-tracing detection method of claim 4, wherein, Comprehensively process the preliminary abnormal early warning information, traceability report, hierarchical warning notification, precise traceability scheme, and collaborative control strategy to build a model full-process evaluation system. Include model abnormal detection accuracy, reasoning speed, and generalization ability in the evaluation dimension to generate quantum cloud code abnormal traceability detection comprehensive evaluation information, including: Quantitative statistical processing of abnormal identification accuracy, false negative rate, and false positive rate characteristics in preliminary abnormal early warning information, combined with quantum machine learning model inference results, generate abnormal detection basic quantitative factors around the model abnormal detection accuracy dimension; Quantitative analysis of traceability link integrity, node positioning accuracy, and traceability time consumption data in traceability report and precise traceability scheme, generate traceability efficiency quantitative factors around the model reasoning speed dimension; Quantitative evaluation of response timeliness, level division matching degree of hierarchical warning notification, and disposal success rate, coverage compliance rate of collaborative control strategy, generate control execution quantitative factors around the model generalization ability dimension; Build a model full-process evaluation system, include model abnormal detection accuracy, reasoning speed, and generalization ability in the evaluation dimension, based on quantum machine learning evaluation framework, integrate abnormal detection basic quantitative factors, traceability efficiency quantitative factors, and control execution quantitative factors to generate quantum cloud code abnormal traceability detection comprehensive evaluation information.

Citation Information

Patent Citations

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

    CN109146514A

  • Logistics express management method and system based on traceability technology

    CN121052726A