Anomaly detection method and device, computer device, storage medium and program product
By constructing multi-qubit pure states and kernel matrices, and combining them with the global decision function of quantum support vector machines, efficient anomaly detection in 5G core networks was achieved, solving the problem of excessive consumption of communication resources caused by multivariate time series data.
Patent Information
- Application Number
- CN202611309334.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-27
AI Technical Summary
In the 5G core network, the large volume of multivariate time series data leads to excessive consumption of communication resources during anomaly detection.
By constructing the current multi-qubit pure state and kernel matrix, and optimizing the key parameters of the quantum support vector machine to obtain the global decision function, the client-side local anomaly detection is realized, reducing communication resource consumption.
The anomaly detection process is completed locally on the client side, eliminating the need for data interaction with the server or other clients, thus reducing the communication resource consumption of anomaly detection.
Smart Images

Figure CN123185591A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of anomaly detection technology, and in particular to anomaly detection method, apparatus, computer equipment, storage medium and program product. Background Technology
[0002] In the 5G core network, a large number of devices generate multivariate time series data during operation. To ensure the continuous and stable operation of the core network, it is necessary to perform anomaly detection on the generated multivariate time series data in order to achieve real-time analysis of the core network's operating status.
[0003] However, the large volume of multivariate time series data leads to excessive consumption of communication resources during anomaly detection. Summary of the Invention
[0004] Therefore, it is necessary to provide an anomaly detection method, apparatus, computer equipment, storage medium, and program product that can reduce communication resource overhead in response to the above-mentioned technical problems.
[0005] Firstly, this application provides an anomaly detection method. The method includes:
[0006] Obtain the current time series data corresponding to the client service area at the current moment;
[0007] Based on the current time-series data, construct at least one current multi-qubit pure state;
[0008] Construct the current kernel matrix based on the similarity between the current multi-qubit pure states;
[0009] Anomaly detection is performed on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time series data; wherein, the global decision function is constructed based on global model parameters; the global model parameters are optimized based on the key parameters of the quantum support vector machine.
[0010] In one embodiment, the process of constructing the global decision function includes:
[0011] Based on the time-series data of the indicators corresponding to the client service area at the target time, construct at least one target multi-qubit pure state;
[0012] Construct a quantum support vector machine based on the pure states of each target multi-qubit;
[0013] The key parameters of the quantum support vector machine are sent to the server so that the server can perform global optimization on the key parameters to obtain global model parameters.
[0014] Receive the global model parameters sent by the server, and construct the global decision function based on the global model parameters.
[0015] In one embodiment, constructing at least one target multi-qubit pure state based on the time-series data of the index corresponding to the client service area at the target time includes:
[0016] The time series data of the indicator is segmented by a pre-set sliding window to obtain at least one real-valued feature vector;
[0017] Quantum feature mapping is performed on each of the real-valued eigenvectors to obtain at least one target multi-qubit pure state.
[0018] In one embodiment, the step of performing quantum feature mapping on each of the real-valued eigenvectors to obtain at least one target multi-qubit pure state includes:
[0019] Using a pre-configured parameterized quantum circuit, each of the real-valued eigenvectors is rotated through a gate encoding process to obtain at least one qubit.
[0020] Entanglement relationships between the qubits are created using controlled gates to obtain at least one target multi-qubit pure state.
[0021] In one embodiment, constructing a quantum support vector machine based on each of the target multi-qubit pure states includes:
[0022] Construct a target kernel matrix based on the similarity between the pure states of each target multi-qubit;
[0023] The initial vector machine is trained based on the target kernel matrix to obtain a quantum support vector machine.
[0024] In one embodiment, constructing a quantum support vector machine based on each of the target multi-qubit pure states includes:
[0025] Construct a target kernel matrix based on the similarity between the pure states of each target multi-qubit;
[0026] The initial vector machine is trained based on the target kernel matrix to obtain a quantum support vector machine.
[0027] Secondly, this application also provides an anomaly detection device. The device includes:
[0028] The acquisition module is used to acquire the current time series data corresponding to the client service area at the current moment;
[0029] The first construction module is used to construct at least one current multi-qubit pure state based on the current time-series data;
[0030] The first construction module is used to construct the current kernel matrix based on the similarity between the current multi-qubit pure states;
[0031] The detection module is used to perform anomaly detection on the current kernel matrix according to a pre-constructed global decision function, and obtain the anomaly detection result corresponding to the current time series data; wherein, the global decision function is constructed based on global model parameters; the global model parameters are optimized based on the key parameters of the quantum support vector machine.
[0032] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0033] Obtain the current time series data corresponding to the client service area at the current moment;
[0034] Based on the current time-series data, construct at least one current multi-qubit pure state;
[0035] Construct the current kernel matrix based on the similarity between the current multi-qubit pure states;
[0036] Anomaly detection is performed on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time series data; wherein, the global decision function is constructed based on global model parameters; the global model parameters are optimized based on the key parameters of the quantum support vector machine.
[0037] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0038] Obtain the current time series data corresponding to the client service area at the current moment;
[0039] Based on the current time-series data, construct at least one current multi-qubit pure state;
[0040] Construct the current kernel matrix based on the similarity between the current multi-qubit pure states;
[0041] Anomaly detection is performed on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time series data; wherein, the global decision function is constructed based on global model parameters; the global model parameters are optimized based on the key parameters of the quantum support vector machine.
[0042] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0043] Obtain the current time series data corresponding to the client service area at the current moment;
[0044] Based on the current time-series data, construct at least one current multi-qubit pure state;
[0045] Construct the current kernel matrix based on the similarity between the current multi-qubit pure states;
[0046] Anomaly detection is performed on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time series data; wherein, the global decision function is constructed based on global model parameters; the global model parameters are optimized based on the key parameters of the quantum support vector machine.
[0047] The aforementioned anomaly detection method, apparatus, computer equipment, storage medium, and program product acquire the current time-series data corresponding to the client service area at the current moment; construct at least one current multi-qubit pure state based on the current time-series data; construct a current kernel matrix based on the similarity between the current multi-qubit pure states; and finally, perform anomaly detection on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time-series data. The global decision function is constructed based on global model parameters, which are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client. As can be seen from the above, this application, by constructing at least one current multi-qubit pure state, achieves a nonlinear mapping of data from classical space to a quantum Hilbert space with exponentially increasing dimensions, thereby ensuring that anomalous data in the current time-series data can be captured during subsequent anomaly detection. By constructing the current kernel matrix, it achieves the acquisition of the similarity between the current multi-qubit pure states, and then performs anomaly detection on the current kernel matrix through a global decision function. This enables the anomaly detection process to be completed locally on the client, without data interaction with the server or other clients, reducing the communication resources required for anomaly detection. Attached Figure Description
[0048] Figure 1This application provides an illustration of the application environment for an anomaly detection method.
[0049] Figure 2 A flowchart illustrating the first anomaly detection method provided in this application embodiment;
[0050] Figure 3 A flowchart illustrating the second anomaly detection method provided in this application embodiment;
[0051] Figure 4 Signaling diagram of the first anomaly detection method provided in the embodiments of this application;
[0052] Figure 5 This is a structural block diagram of an anomaly detection device provided in an embodiment of this application;
[0053] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0055] The anomaly detection method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, client 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. The process involves acquiring the current time-series data corresponding to the client's service area at the current moment; constructing at least one current multi-qubit pure state based on the current time-series data; constructing a current kernel matrix based on the similarity between the current multi-qubit pure states; and finally, performing anomaly detection on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time-series data. The global decision function is constructed based on global model parameters, which are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client. Client 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.
[0056] In one embodiment, such as Figure 2As shown, an anomaly detection method is provided, which can be applied to... Figure 1 Taking client 102 as an example, the explanation includes the following steps:
[0057] S201, obtain the current time series data corresponding to the client service area at the current moment.
[0058] The client may include, but is not limited to, network function entities with computing capabilities in the core network architecture, such as: User Plane Function (UPF) and Access and Mobility Management Function (AMF) deployed in edge data centers; or, dedicated edge servers.
[0059] In one embodiment of this application, the current time-series data may include, but is not limited to: user equipment signaling traffic, data transmission rate, connection establishment success rate, latency, jitter, and network slice resource utilization.
[0060] S202, construct at least one current multi-qubit pure state based on the current time series data.
[0061] It should be noted that when it is necessary to construct at least one current multi-qubit pure state based on the current time series data, the following can be included: using a pre-set sliding window to slide and segment the current time series data, converting the current time series data in each window into a feature vector, and obtaining at least one current feature vector; performing quantum feature mapping on each current feature vector to obtain at least one current multi-qubit pure state.
[0062] To further explain, when it is necessary to perform quantum feature mapping on each current feature vector to obtain at least one current multi-qubit pure state, the following can be included: encoding each dimension of the current feature vector to the corner of a set of qubits through a rotation gate to obtain qubits; and introducing a controlled gate to create entanglement between qubits to obtain at least one current multi-qubit pure state to characterize the complex correlation between features.
[0063] S203, construct the current kernel matrix based on the similarity between the current multi-qubit pure states.
[0064] The current kernel matrix is used to measure the similarity between all current multi-qubit pure states in the local area.
[0065] In one embodiment of this application, if there are m current multi-qubit pure states, an m×m empty kernel matrix is pre-defined; the first current multi-qubit pure state is selected and SWAP tested with itself to obtain the similarity between the current multi-qubit pure state and itself, and the similarity is filled into the corresponding position of the empty kernel matrix; the first current multi-qubit pure state is selected and SWAP tested with the second current multi-qubit pure state to obtain the expected similarity between the current multi-qubit pure state and the second current multi-qubit pure state, and the similarity is filled into the corresponding position of the empty kernel matrix; the first current multi-qubit pure state is selected and SWAP tested with the third current multi-qubit pure state to obtain the expected similarity between the current multi-qubit pure state and the third current multi-qubit pure state, and the similarity is filled into the corresponding position of the empty kernel matrix, and so on, until the similarity between the first current multi-qubit pure state and the last current multi-qubit pure state is determined, and the similarity is filled into the corresponding position of the empty kernel matrix to obtain the current kernel matrix.
[0066] S204. Based on the pre-constructed global decision function, perform anomaly detection on the current kernel matrix to obtain the anomaly detection result corresponding to the current time series data.
[0067] The global decision function is constructed based on the global model parameters; the global model parameters are obtained by the server through optimization based on the key parameters of the quantum support vector machine fed back by the client.
[0068] It should be noted that the global model parameters are obtained by the server after optimizing the global information using a quadratic programming solver; the global information is constructed by the server based on the local support vector information in the key parameters, or the dual coefficients in the key parameters and the local support vector information.
[0069] In one embodiment of this application, when performing anomaly detection on the current kernel matrix according to a pre-built global decision function, the global decision function outputs a label corresponding to the current kernel matrix. This label is used to characterize the anomaly detection result corresponding to the current time series data. The anomaly detection result includes two cases: the presence of anomalies and the absence of anomalies.
[0070] The aforementioned anomaly detection method acquires the current time-series data corresponding to the client's service area at the current moment; constructs at least one current multi-qubit pure state based on the current time-series data; constructs a current kernel matrix based on the similarity between the current multi-qubit pure states; and finally, performs anomaly detection on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time-series data. The global decision function is constructed based on global model parameters, which are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client. As can be seen from the above, this application, by constructing at least one current multi-qubit pure state, achieves a nonlinear mapping of data from classical space to a quantum Hilbert space with exponentially increasing dimensions, thereby ensuring that anomalous data in the current time-series data can be captured during subsequent anomaly detection. By constructing the current kernel matrix, it acquires the similarity between the current multi-qubit pure states, and then performs anomaly detection on the current kernel matrix using a global decision function. This enables the anomaly detection process to be completed locally on the client, without data interaction with the server or other clients, reducing the communication resources required for anomaly detection.
[0071] In one embodiment, such as Figure 3 As shown, when it is necessary to construct a global decision function, the following can be included:
[0072] S301, construct at least one target multi-qubit pure state based on the time series data of the index corresponding to the client service area at the target time.
[0073] It should be noted that when it is necessary to construct at least one target multi-qubit pure state based on the index time series data corresponding to the client service area at the target time, the following may be included: using a pre-set sliding window to slide and segment the index time series data to obtain at least one real-valued feature vector; performing quantum feature mapping on each real-valued feature vector to obtain at least one target multi-qubit pure state.
[0074] To further explain, when it is necessary to perform quantum feature mapping on each real-valued eigenvector to obtain at least one target multi-qubit pure state, the following can be included: using a pre-configured parameterized quantum circuit to perform rotation gate encoding on each real-valued eigenvector to obtain at least one qubit; using a controlled gate to create entanglement between each qubit to obtain at least one target multi-qubit pure state.
[0075] In one embodiment of this application, each dimension of the real-valued eigenvector is encoded onto the corners of a set of qubits using a rotation gate to obtain at least one qubit; and a controlled gate is introduced to create entanglement between the qubits to characterize the complex correlations between features. Finally, the circuit prepares the input classical data into a specific multi-qubit pure state. This step nonlinearly maps the data from classical space to a quantum Hilbert space with exponentially increasing dimensions, theoretically capable of capturing high-order correlation modes that are difficult to represent efficiently using classical methods.
[0076] S302, construct a quantum support vector machine based on the pure states of each target multi-qubit.
[0077] It should be noted that when it is necessary to construct a quantum support vector machine based on the pure states of each target multi-qubit, the following can be included: constructing a target kernel matrix based on the similarity between the pure states of each target multi-qubit; training the initial vector machine based on the target kernel matrix to obtain the quantum support vector machine.
[0078] S303 sends the key parameters of the quantum support vector machine to the server, so that the server can perform global optimization of the key parameters and obtain the global model parameters.
[0079] Key parameters may include, but are not limited to: the index of the local support vector and the corresponding dual coefficient.
[0080] It should be noted that the global model parameters are obtained by the server after optimizing the global information using a quadratic programming solver; the global information is constructed by the server based on the local support vector information in the key parameters, or the dual coefficients in the key parameters and the local support vector information.
[0081] To further explain, when it is necessary to send the key parameters of the quantum support vector machine to the server, in order to further reduce the consumption of communication resources, the key parameters can be compressed to obtain compressed information, and then the compressed information can be sent to the server, thereby reducing the communication resources required for transmission.
[0082] In one embodiment of this application, the server can be a central server located in the 5G core network management and data analysis layer, acting as a federated learning coordinator. It polls or receives compressed information uploaded by each client through a secure communication channel (e.g., a TLS-based encrypted link). The server maintains a global sample index space and aligns and integrates the local support vector information (corresponding to subsets of their local data) uploaded by each client using an index mapping matrix, thereby reconstructing a global, but potentially incomplete, approximate representation of the kernel matrix. Alternatively, a more efficient aggregation method can be used to directly integrate the dual coefficients and support vector information uploaded by each client, constructing a global decision function on the server side. Subsequently, based on this global information, the server runs a classic quadratic programming solver to optimize the global objective function, obtaining global model parameters; wherein, the global model parameters may include, but are not limited to, the optimal set of dual coefficients and a global bias term.
[0083] S304 receives the global model parameters sent by the server and constructs a global decision function based on the global model parameters.
[0084] It should be noted that the server broadcasts global model parameters so that clients can receive the global model parameters sent by the server and construct a global decision function based on the global model parameters.
[0085] Among them, the global decision function can achieve fine localization of faults in different slices, different network elements, and different links through entangled enhanced quantum kernels and multi-level granularity judgment. Furthermore, the global decision function significantly reduces the computational latency of training and inference through random measurement acceleration, hierarchical aggregation, and local pre-screening.
[0086] The aforementioned anomaly detection method constructs at least one target multi-qubit pure state, trains a quantum support vector machine (SVM), and sends the key parameters of the SVM to a server. This enables the server to globally optimize the key parameters, ensuring that the global decision function constructed based on the global model parameters can effectively detect anomalies. Furthermore, by receiving the global model parameters sent by the server and constructing the global decision function based on these parameters, the method ensures that subsequent anomaly detection can be performed locally on the client side without real-time data interaction with the server or other clients, thus reducing the communication resource consumption for anomaly detection.
[0087] In one embodiment, such as Figure 4 As shown, when it is necessary to construct a global decision function, the following can be included:
[0088] S401, the client uses a pre-set sliding window to perform sliding segmentation on the indicator time series data to obtain at least one real-valued feature vector.
[0089] S402, the client uses a pre-configured parameterized quantum circuit to perform rotation gate encoding on each real-valued eigenvector to obtain at least one qubit.
[0090] S403, the client uses a controlled gate to create entanglement between each qubit, and obtains at least one target multi-qubit pure state.
[0091] S404, the client constructs the target kernel matrix based on the similarity between the pure states of each target multi-qubit.
[0092] S405, the client trains the initial vector machine based on the target kernel matrix to obtain the quantum support vector machine.
[0093] S406, the client sends the key parameters of the quantum support vector machine to the server.
[0094] S407, the server constructs global information based on the local support vector information in the key parameters, or the dual coefficients in the key parameters and the local support vector information.
[0095] In S408, the server uses a quadratic programming solver to optimize global information and obtain global model parameters.
[0096] S409 sends global model parameters to the client.
[0097] S410: The client receives the global model parameters sent by the server and constructs a global decision function based on the global model parameters.
[0098] The aforementioned anomaly detection method acquires the current time-series data corresponding to the client's service area at the current moment; constructs at least one current multi-qubit pure state based on the current time-series data; constructs a current kernel matrix based on the similarity between the current multi-qubit pure states; and finally, performs anomaly detection on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time-series data. The global decision function is constructed based on global model parameters, which are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client. As can be seen from the above, this application, by constructing at least one current multi-qubit pure state, achieves a nonlinear mapping of data from classical space to a quantum Hilbert space with exponentially increasing dimensions, thereby ensuring that anomalous data in the current time-series data can be captured during subsequent anomaly detection. By constructing the current kernel matrix, it acquires the similarity between the current multi-qubit pure states, and then performs anomaly detection on the current kernel matrix using a global decision function. This enables the anomaly detection process to be completed locally on the client, without data interaction with the server or other clients, reducing the communication resources required for anomaly detection.
[0099] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0100] Based on the same inventive concept, this application also provides an anomaly detection device for implementing the anomaly detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more anomaly detection device embodiments provided below can be found in the limitations of the anomaly detection method described above, and will not be repeated here.
[0101] In one embodiment, such as Figure 5 As shown, an anomaly detection device is provided, comprising: an acquisition module 10, a first construction module 20, a second construction module 30, and a detection module 40, wherein:
[0102] The acquisition module 10 is used to acquire the current time series data corresponding to the client service area at the current moment.
[0103] The first building module 20 is used to build at least one current multi-qubit pure state based on the current time-series data.
[0104] The second construction module 30 is used to construct the current kernel matrix based on the similarity between the current multi-qubit pure states.
[0105] The detection module 40 is used to perform anomaly detection on the current kernel matrix according to the pre-built global decision function, and obtain the anomaly detection result corresponding to the current time series data; wherein, the global decision function is constructed based on the global model parameters; the global model parameters are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client.
[0106] In one embodiment, at least one target multi-qubit pure state is constructed based on the time-series data of the index corresponding to the client service area at the target time.
[0107] Construct a quantum support vector machine based on the pure states of each target multi-qubit;
[0108] The key parameters of the quantum support vector machine are sent to the server so that the server can perform global optimization of the key parameters to obtain the global model parameters.
[0109] Receive global model parameters sent by the server and construct a global decision function based on the global model parameters.
[0110] In one embodiment, a pre-defined sliding window is used to slide segment the index time series data to obtain at least one real-valued feature vector.
[0111] By performing quantum feature mapping on each real-valued eigenvector, at least one target multi-qubit pure state is obtained.
[0112] In one embodiment, a pre-configured parameterized quantum circuit is used to perform rotation gate encoding on each real-valued eigenvector to obtain at least one qubit.
[0113] By using controlled gates to create entanglement relationships between qubits, at least one target multi-qubit pure state is obtained.
[0114] In one embodiment, a target kernel matrix is constructed based on the similarity between the pure states of each target multi-qubit;
[0115] The initial vector machine is trained based on the target kernel matrix to obtain the quantum support vector machine.
[0116] In one embodiment, the global model parameters are obtained by the server after optimizing the global information using a quadratic programming solver; the global information is constructed by the server based on the local support vector information in the key parameters, or the dual coefficients in the key parameters and the local support vector information.
[0117] The aforementioned anomaly detection device acquires the current time-series data corresponding to the client's service area at the current moment; constructs at least one current multi-qubit pure state based on the current time-series data; constructs a current kernel matrix based on the similarity between the current multi-qubit pure states; and finally, performs anomaly detection on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time-series data. The global decision function is constructed based on global model parameters, which are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client. As can be seen from the above, this application, by constructing at least one current multi-qubit pure state, achieves a nonlinear mapping of data from classical space to a quantum Hilbert space with exponentially increasing dimensions, thereby ensuring that anomalous data in the current time-series data can be captured during subsequent anomaly detection. By constructing the current kernel matrix, it acquires the similarity between the current multi-qubit pure states, and then performs anomaly detection on the current kernel matrix using a global decision function. This enables the anomaly detection process to be completed locally on the client, without data interaction with the server or other clients, reducing the communication resources required for anomaly detection.
[0118] Each module in the aforementioned anomaly detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0119] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements an anomaly detection method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0120] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0121] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0122] Retrieve the current time series data corresponding to the client service area at the current moment;
[0123] Based on the current time-series data, construct at least one current multi-qubit pure state;
[0124] Construct the current kernel matrix based on the similarity between the current multi-qubit pure states;
[0125] Anomaly detection is performed on the current kernel matrix based on a pre-built global decision function to obtain the anomaly detection result corresponding to the current time series data. The global decision function is constructed based on the global model parameters, which are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client.
[0126] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0127] Based on the time series data of the indicators corresponding to the client service area at the target time, construct at least one target multi-qubit pure state;
[0128] Construct a quantum support vector machine based on the pure states of each target multi-qubit;
[0129] The key parameters of the quantum support vector machine are sent to the server so that the server can perform global optimization of the key parameters to obtain the global model parameters.
[0130] Receive global model parameters sent by the server and construct a global decision function based on the global model parameters.
[0131] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0132] The time series data of the indicator is segmented by a pre-defined sliding window to obtain at least one real-valued feature vector;
[0133] By performing quantum feature mapping on each real-valued eigenvector, at least one target multi-qubit pure state is obtained.
[0134] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0135] By using a pre-configured parameterized quantum circuit, each real-valued eigenvector is encoded by a rotation gate to obtain at least one qubit;
[0136] By using controlled gates to create entanglement between qubits, at least one target multi-qubit pure state is obtained.
[0137] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0138] Construct a target kernel matrix based on the similarity between the pure states of each target multi-qubit;
[0139] The initial vector machine is trained based on the target kernel matrix to obtain the quantum support vector machine.
[0140] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0141] The global model parameters are obtained by the server after optimizing the global information using a quadratic programming solver; the global information is constructed by the server based on the local support vector information in the key parameters, or the dual coefficients in the key parameters and the local support vector information.
[0142] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0143] Retrieve the current time series data corresponding to the client service area at the current moment;
[0144] Based on the current time-series data, construct at least one current multi-qubit pure state;
[0145] Construct the current kernel matrix based on the similarity between the current multi-qubit pure states;
[0146] Anomaly detection is performed on the current kernel matrix based on a pre-built global decision function to obtain the anomaly detection result corresponding to the current time series data. The global decision function is constructed based on the global model parameters, which are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client.
[0147] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0148] Retrieve the current time series data corresponding to the client service area at the current moment;
[0149] Based on the current time-series data, construct at least one current multi-qubit pure state;
[0150] Construct the current kernel matrix based on the similarity between the current multi-qubit pure states;
[0151] Anomaly detection is performed on the current kernel matrix based on a pre-built global decision function to obtain the anomaly detection result corresponding to the current time series data. The global decision function is constructed based on the global model parameters, which are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client.
[0152] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0153] The time series data of the indicator is segmented by a pre-defined sliding window to obtain at least one real-valued feature vector;
[0154] By performing quantum feature mapping on each real-valued eigenvector, at least one target multi-qubit pure state is obtained.
[0155] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0156] By using a pre-configured parameterized quantum circuit, each real-valued eigenvector is encoded by a rotation gate to obtain at least one qubit;
[0157] By using controlled gates to create entanglement between qubits, at least one target multi-qubit pure state is obtained.
[0158] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0159] Construct a target kernel matrix based on the similarity between the pure states of each target multi-qubit;
[0160] The initial vector machine is trained based on the target kernel matrix to obtain the quantum support vector machine.
[0161] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0162] The global model parameters are obtained by the server after optimizing the global information using a quadratic programming solver; the global information is constructed by the server based on the local support vector information in the key parameters, or the dual coefficients in the key parameters and the local support vector information.
[0163] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0164] Retrieve the current time series data corresponding to the client service area at the current moment;
[0165] Based on the current time-series data, construct at least one current multi-qubit pure state;
[0166] Construct the current kernel matrix based on the similarity between the current multi-qubit pure states;
[0167] Anomaly detection is performed on the current kernel matrix based on a pre-built global decision function to obtain the anomaly detection result corresponding to the current time series data. The global decision function is constructed based on the global model parameters, which are optimized by the server based on the key parameters of the quantum support vector machine fed back by the client.
[0168] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0169] Based on the time series data of the indicators corresponding to the client service area at the target time, construct at least one target multi-qubit pure state;
[0170] Construct a quantum support vector machine based on the pure states of each target multi-qubit;
[0171] The key parameters of the quantum support vector machine are sent to the server so that the server can perform global optimization of the key parameters to obtain the global model parameters.
[0172] Receive global model parameters sent by the server and construct a global decision function based on the global model parameters.
[0173] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0174] The time series data of the indicator is segmented by a pre-defined sliding window to obtain at least one real-valued feature vector;
[0175] By performing quantum feature mapping on each real-valued eigenvector, at least one target multi-qubit pure state is obtained.
[0176] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0177] By using a pre-configured parameterized quantum circuit, each real-valued eigenvector is encoded by a rotation gate to obtain at least one qubit;
[0178] By using controlled gates to create entanglement between qubits, at least one target multi-qubit pure state is obtained.
[0179] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0180] Construct a target kernel matrix based on the similarity between the pure states of each target multi-qubit;
[0181] The initial vector machine is trained based on the target kernel matrix to obtain the quantum support vector machine.
[0182] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0183] The global model parameters are obtained by the server after optimizing the global information using a quadratic programming solver; the global information is constructed by the server based on the local support vector information in the key parameters, or the dual coefficients in the key parameters and the local support vector information.
[0184] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0185] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0186] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An anomaly detection method, characterized in that, Applied to a client, the method includes: Obtain the current time series data corresponding to the client service area at the current moment; Based on the current time-series data, construct at least one current multi-qubit pure state; Construct the current kernel matrix based on the similarity between the current multi-qubit pure states; Anomaly detection is performed on the current kernel matrix according to a pre-constructed global decision function to obtain the anomaly detection result corresponding to the current time series data; wherein, the global decision function is constructed based on global model parameters; the global model parameters are optimized based on the key parameters of the quantum support vector machine.
2. The method according to claim 1, characterized in that, The process of constructing the global decision function includes: Based on the time-series data of the indicators corresponding to the client service area at the target time, construct at least one target multi-qubit pure state; Construct a quantum support vector machine based on the pure states of each target multi-qubit; The key parameters of the quantum support vector machine are sent to the server so that the server can perform global optimization on the key parameters to obtain global model parameters. Receive the global model parameters sent by the server, and construct the global decision function based on the global model parameters.
3. The method according to claim 2, characterized in that, The step of constructing at least one target multi-qubit pure state based on the time-series data of the index corresponding to the client service area at the target time includes: The time series data of the indicator is segmented by a pre-set sliding window to obtain at least one real-valued feature vector; Quantum feature mapping is performed on each of the real-valued eigenvectors to obtain at least one target multi-qubit pure state.
4. The method according to claim 3, characterized in that, The step of performing quantum feature mapping on each of the real-valued eigenvectors to obtain at least one target multi-qubit pure state includes: Using a pre-configured parameterized quantum circuit, each of the real-valued eigenvectors is rotated through a gate encoding process to obtain at least one qubit. Entanglement relationships between the qubits are created using controlled gates to obtain at least one target multi-qubit pure state.
5. The method according to claim 2, characterized in that, The construction of a quantum support vector machine based on the pure states of each target multi-qubit includes: Construct a target kernel matrix based on the similarity between the pure states of each target multi-qubit; The initial vector machine is trained based on the target kernel matrix to obtain a quantum support vector machine.
6. The method according to claim 2, characterized in that, The global model parameters are obtained by the server after optimizing the global information using a quadratic programming solver; the global information is constructed by the server based on the local support vector information in the key parameters, or the dual coefficients and local support vector information in the key parameters.
7. An anomaly detection device, characterized in that, The device includes: The acquisition module is used to acquire the current time series data corresponding to the client service area at the current moment; The first construction module is used to construct at least one current multi-qubit pure state based on the current time-series data; The second construction module is used to construct the current kernel matrix based on the similarity between the current multi-qubit pure states; The detection module is used to perform anomaly detection on the current kernel matrix according to a pre-constructed global decision function, and obtain the anomaly detection result corresponding to the current time series data; wherein, the global decision function is constructed based on global model parameters; the global model parameters are optimized based on the key parameters of the quantum support vector machine.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
