A meteorological data prediction method and device, a storage medium and an electronic device
By constructing a meteorological data node graph and using variable quantum circuits for quantum feature encoding and feature calculation, the problem that traditional meteorological forecasting methods cannot achieve short-term forecasting is solved, and rapid and accurate meteorological data forecasting is realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2026-03-17
AI Technical Summary
Traditional weather forecasting methods cannot provide short-term weather forecasts, especially in environments with rapidly changing weather. Existing technologies require several hours to provide forecast results, which cannot meet the demand for fast and accurate weather forecasts.
A meteorological data node graph is constructed for multiple time points before the time to be predicted. Quantum feature encoding is performed on the node data of each meteorological data node graph using a variable quantum circuit. The node feature matrix is obtained through quantum parallel computing. Feature calculation is performed based on the adjacency matrix and the node feature matrix to obtain the predicted meteorological data features.
It enables rapid encoding and feature extraction of large amounts of complex meteorological data, improving the speed and accuracy of weather forecasting and enabling short-term weather forecasting.
Smart Images

Figure CN116011681B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of quantum computing technology, and in particular relates to a meteorological data prediction method, device, storage medium and electronic device. Background Technology
[0002] A quantum computer is a physical device that performs high-speed mathematical and logical operations, stores and processes quantum information in accordance with the laws of quantum mechanics. When a device processes and calculates quantum information and runs quantum algorithms, it is a quantum computer. Because of its ability to process mathematical problems more efficiently than ordinary computers—for example, reducing the time to crack RSA keys from hundreds of years to hours—quantum computers have become a key technology under research.
[0003] Weather forecasting can guide daily life and production, helping to avoid losses caused by extreme weather events. This includes essential sectors such as agriculture, transportation, and international business. Therefore, rapid and accurate weather forecasting is of paramount importance.
[0004] Traditional weather forecasting methods rely on prior knowledge, such as the thermodynamic properties of the atmosphere, the statistical distribution of data, and ensemble learning of multiple models with different initial conditions. These models belong to numerical weather prediction methods. However, meteorological data is highly complex, and even with the processing power of supercomputers, it takes several hours to provide forecast results. In environments with rapidly changing weather, traditional weather forecasting methods cannot achieve short-term weather prediction. Summary of the Invention
[0005] The purpose of this application is to provide a meteorological data forecasting method, apparatus, storage medium, and electronic device, aimed at achieving short-term weather forecasting.
[0006] To achieve the above objectives, a first aspect of the embodiments of this application provides a meteorological data forecasting method, the method comprising:
[0007] A meteorological data node map is constructed for multiple time points before the time to be predicted, wherein each node in the meteorological data node map represents the meteorological data of a sub-region within the region to be predicted;
[0008] The node feature matrix of each meteorological data node map is obtained by using a variable quantum circuit to encode the node data of each meteorological data node map.
[0009] Feature calculations are performed on the adjacency matrix and node feature matrix of the meteorological data node graph at each time point to obtain the predicted meteorological data features. The adjacency matrix represents the connection relationship between each node and other nodes in the meteorological data node graph.
[0010] The predicted meteorological data for the time to be predicted is determined based on the characteristics of the predicted meteorological data.
[0011] Optionally, the feature calculation based on the adjacency matrix and node feature matrix of the meteorological data node graph at each time moment to obtain the predicted meteorological data features includes:
[0012] Iterative graph convolution is performed on the adjacency matrix and node feature matrix of the meteorological data node graph at each time point, and the calculation results are downsampled to obtain the predicted meteorological data features.
[0013] Optionally, the adjacency matrix and node feature matrix of the meteorological data node graph at each time step can be calculated using iterative graph convolution using the following formula:
[0014] Z (n+1) =A′X n W n X n+1 =σ(Z) n+1 );
[0015] Where A′ represents the normalized adjacency matrix, n represents the number of iterations for graph convolution, and W n Let X represent the weight matrix in the nth calculation. n Z represents the node feature matrix at the nth computation, σ() represents the activation function, and Z (n+1) This represents the result of the nth graph convolution calculation.
[0016] Optionally, the variational quantum circuit includes an encoding layer, a parametric layer, and a measurement layer. The step of using the quantum variational circuit to perform quantum feature encoding on the node data of each meteorological data node map to obtain the node feature matrix of each meteorological data node map includes:
[0017] The encoding layer is used to encode the node data of each meteorological data node map into a preset number of qubits;
[0018] The quantum state evolution of the encoded qubits is performed using the parametric layering method.
[0019] The quantum state of each qubit after evolution is measured using the measurement layer, the expected value of the measurement result is calculated, and the node feature vector of each node data is obtained.
[0020] The node feature vectors of each node's data are concatenated to obtain the node feature matrix of the meteorological data node map.
[0021] Optionally, the encoding layer includes an H gate and a first RY gate, and the step of encoding the node data included in each meteorological data node map into a preset number of qubits using the encoding layer includes:
[0022] An H gate is applied to a predetermined number of qubits, causing each qubit to evolve from an initial state to a superposition state. Based on the qubit parameters determined by the data of each node included in the meteorological data node diagram, a first RY gate is applied to each qubit, causing each node data to be mapped to a predetermined number of qubits in a superposition state.
[0023] Optionally, the parametric layer includes a CNOT gate and a second RY gate.
[0024] Optionally, constructing a meteorological data node map for multiple times prior to the time to be predicted includes:
[0025] The area to be predicted is divided into multiple sub-regions according to latitude and longitude, and meteorological data of each sub-region within the area to be predicted are collected at multiple times before the time to be predicted.
[0026] The meteorological data of each sub-region is mapped to a node graph to obtain the meteorological data node graph.
[0027] According to a second aspect of this application, a meteorological data forecasting apparatus is also provided, the apparatus comprising:
[0028] The construction module is used to construct a meteorological data node map for multiple times before the time to be predicted, wherein each node in the meteorological data node map represents the meteorological data of a sub-region within the area to be predicted.
[0029] The encoding module is used to encode the node data of each meteorological data node map using variable quantum circuits to obtain the node feature matrix of each meteorological data node map.
[0030] The calculation module is used to perform feature calculations based on the adjacency matrix and node feature matrix of the meteorological data node graph at each time moment to obtain the predicted meteorological data features. The adjacency matrix represents the connection relationship between each node and other nodes in the meteorological data node graph.
[0031] The determination module is used to determine the predicted meteorological data for the time to be predicted based on the characteristics of the predicted meteorological data.
[0032] Optionally, the computing module is specifically used for:
[0033] Iterative graph convolution is performed on the adjacency matrix and node feature matrix of the meteorological data node graph at each time point, and the calculation results are downsampled to obtain the predicted meteorological data features.
[0034] Optionally, the adjacency matrix and node feature matrix of the meteorological data node graph at each time step can be calculated using iterative graph convolution using the following formula:
[0035] Z (n+1) =A′Xn W n X n+1 =σ(Z) n+1 );
[0036] Where A′ represents the normalized adjacency matrix, n represents the number of iterations for graph convolution, and W n Let X represent the weight matrix in the nth calculation. n Z represents the node feature matrix at the nth computation, σ() represents the activation function, and Z (n+1) This represents the result of the nth graph convolution calculation.
[0037] Optionally, the variable quantum circuit includes an encoding layer, a parametric layer, and a measurement layer. The encoding module is specifically used for:
[0038] The encoding layer is used to encode the node data of each meteorological data node map into a preset number of qubits;
[0039] The quantum state evolution of the encoded qubits is performed using the parametric layering method.
[0040] The quantum state of each qubit after evolution is measured using the measurement layer, the expected value of the measurement result is calculated, and the node feature vector of each node data is obtained.
[0041] The node feature vectors of each node's data are concatenated to obtain the node feature matrix of the meteorological data node map.
[0042] Optionally, the encoding module is specifically used for:
[0043] An H gate is applied to a predetermined number of qubits, causing each qubit to evolve from an initial state to a superposition state. Based on the qubit parameters determined by the data of each node included in the meteorological data node diagram, a first RY gate is applied to each qubit, causing each node data to be mapped to a predetermined number of qubits in a superposition state.
[0044] Optionally, the parametric layer includes a CNOT gate and a second RY gate.
[0045] Optionally, the building module is specifically used for:
[0046] The area to be predicted is divided into multiple sub-regions according to latitude and longitude, and meteorological data of each sub-region within the area to be predicted are collected at multiple times before the time to be predicted.
[0047] The meteorological data of each sub-region is mapped to a node graph to obtain the meteorological data node graph.
[0048] A third aspect of this application provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps of the method described in any of the first aspects above when running.
[0049] A fourth aspect of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps of the method described in any of the first aspects above.
[0050] Based on the above technical solution, this application constructs a meteorological data node graph at multiple time points, encodes the data of each node in the meteorological data node graph using variable quantum circuits, and leverages the quantum parallel computing characteristics of quantum circuits to achieve rapid encoding of a large amount of complex meteorological data, thereby obtaining a node feature matrix. Based on the node feature matrix and the adjacency matrix of the meteorological data node graph, feature calculation is performed to obtain the predicted meteorological data features. The predicted meteorological data is then determined based on the predicted meteorological data features, thereby improving the speed of predicting meteorological data and realizing short-term meteorological forecasting. Attached Figure Description
[0051] Figure 1 This is a hardware structure block diagram of a computer terminal for a meteorological data forecasting method according to an exemplary embodiment;
[0052] Figure 2 This is a flowchart illustrating a meteorological data forecasting method according to an exemplary embodiment;
[0053] Figure 3 This is a schematic diagram illustrating an adjacency matrix according to an exemplary embodiment;
[0054] Figure 4 This is a flowchart illustrating another meteorological data forecasting method according to an exemplary embodiment;
[0055] Figure 5 This is a schematic diagram of a variable quantum circuit according to an exemplary embodiment;
[0056] Figure 6 This is a flowchart illustrating another meteorological data forecasting method according to an exemplary embodiment;
[0057] Figure 7 This is a flowchart illustrating a method for predicting meteorological data based on a meteorological data node map, according to an exemplary embodiment.
[0058] Figure 8 This is a block diagram illustrating a meteorological data forecasting device according to an exemplary embodiment. Detailed Implementation
[0059] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0060] This application first provides a meteorological data forecasting method, which can be applied to electronic devices, such as computer terminals, specifically ordinary computers, quantum computers, etc.
[0061] The following detailed explanation uses a computer terminal as an example. Figure 1 This is a hardware structure block diagram of a computer terminal for a meteorological data forecasting method, according to an exemplary embodiment. For example... Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing a quantum circuit-based meteorological data prediction method are also shown. Optionally, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0062] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the meteorological data prediction method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0063] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0064] It's important to note that a true quantum computer has a hybrid structure, comprising two main parts: a classical computer responsible for performing classical computations and control, and a quantum device responsible for running quantum programs to achieve quantum computation. A quantum program is a sequence of instructions written in a quantum language such as QRunes that can run on a quantum computer, supporting operations on quantum logic gates and ultimately enabling quantum computing. Specifically, a quantum program is a sequence of instructions that operates on quantum logic gates according to a specific timing order.
[0065] In practical applications, due to limitations in the development of quantum device hardware, quantum computing simulations are typically required to verify quantum algorithms, quantum applications, and so on. Quantum computing simulation is the process of simulating the execution of a quantum program corresponding to a specific problem using a virtual architecture (i.e., a quantum virtual machine) built with the resources of a conventional computer. Typically, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program referred to in the embodiments of this application is a program written in a classical language that represents qubits and their evolution, wherein qubits, quantum logic gates, etc., related to quantum computing all have corresponding classical code representations.
[0066] Quantum circuits, also known as quantum logic circuits, are a manifestation of quantum programming and are the most commonly used general-purpose quantum computing model. They represent circuits that operate on qubits under an abstract concept. They consist of qubits, circuits (timelines), and various quantum logic gates. Finally, the results are often read out through quantum measurement operations.
[0067] Unlike traditional circuits that use metal wires to transmit voltage or current signals, in quantum circuits, the circuits can be seen as being connected by time. That is, the state of a quantum bit evolves naturally over time, following the instructions of the Hamiltonian operator until it encounters a logic gate and is operated on.
[0068] A quantum program corresponds to a single quantum circuit. The quantum program described in this application refers to this single quantum circuit, where the total number of qubits in the single quantum circuit is the same as the total number of qubits in the quantum program. This can be understood as follows: a quantum program can consist of a quantum circuit, measurement operations on the qubits within the quantum circuit, registers storing the measurement results, and control flow nodes (jump instructions). A single quantum circuit can contain dozens, hundreds, or even thousands of quantum logic gate operations. The execution of a quantum program is the process of executing all the quantum logic gates in a specific timing order. It should be noted that the timing order refers to the chronological sequence in which individual quantum logic gates are executed.
[0069] It's important to note that in classical computing, the most basic unit is the bit, and the most fundamental control mode is the logic gate. Circuit control can be achieved through combinations of logic gates. Similarly, the way to process qubits is through quantum logic gates. Quantum logic gates enable the evolution of quantum states and are the foundation of quantum circuits. Quantum logic gates include single-qubit gates, such as the Hadamard gate (H gate), Pauli-X gate (X gate, Pauli X gate), Pauli-Y gate (Y gate, Pauli Y gate), Pauli-Z gate (Z gate, Pauli Z gate), RX gate (RX rotation gate), RY gate (RY rotation gate), RZ gate (RZ rotation gate), etc.; and multi-qubit quantum logic gates, such as the CNOT gate, CR gate, iSWAP gate, Tofoli gate, etc. Quantum logic gates are generally represented using unitary matrices, which are not only matrix forms but also operations and transformations. Generally, the effect of a quantum logic gate on a quantum state is calculated by left-multiplying the unitary matrix by the vector corresponding to the right vector of the quantum state. For example, the vector corresponding to the right vector |0> of the quantum state can be... The vector corresponding to the right vector of the quantum state |1> can be
[0070] See Figure 2 , Figure 2 This is a flowchart illustrating a meteorological data forecasting method according to an exemplary embodiment. This embodiment provides a meteorological data forecasting method, which includes:
[0071] S201. Construct a node map of meteorological data for multiple moments before the moment to be predicted.
[0072] In this context, each node in the meteorological data node diagram represents the meteorological data of a sub-region within the area to be predicted.
[0073] In this embodiment of the application, meteorological data may include data such as air pressure, temperature, wind speed, and humidity.
[0074] The time to be predicted and the area to be predicted are the time and geographical area where meteorological data prediction is required. The first few times selected are at least the first two times. The specific times can be set according to the actual application scenario. This application embodiment does not make specific limitations on the number and selection method of the first few times.
[0075] For example, if the time to be predicted is 12:00 on January 1, 2023, then the preceding times can be 6:00 and 9:00 on January 1, 2023.
[0076] Specifically, a node map of meteorological data from multiple moments prior to the moment to be predicted can be constructed using the following steps:
[0077] Step 1: Divide the area to be predicted into multiple sub-regions according to latitude and longitude, and collect meteorological data of each sub-region within the area to be predicted at multiple times before the predicted time.
[0078] Step 2: Map the meteorological data of each sub-region to the node graph to obtain the meteorological data node graph.
[0079] In this embodiment of the application, the meteorological state is defined on a high-resolution longitude-latitude-barometric level grid. The area to be predicted can be divided into multiple sub-regions according to longitude and latitude, and the meteorological data of each sub-region can be recorded. The meteorological data of each sub-region can be mapped onto the nodes of the node graph to obtain the meteorological data node graph.
[0080] S202. Use variable quantum circuits to perform quantum feature encoding on the node data of each meteorological data node map to obtain the node feature matrix of each meteorological data node map.
[0081] In this embodiment of the application, each node data of the meteorological data node map can be quantum feature encoded by a variable quantum circuit, and multi-dimensional node feature vectors of the node data can be extracted to obtain a node feature matrix.
[0082] The specific method of using variable quantum circuits for quantum feature encoding will be introduced below.
[0083] S203. Based on the adjacency matrix and node feature matrix of the meteorological data node graph at each time moment, feature calculation is performed to obtain the predicted meteorological data features.
[0084] The adjacency matrix represents the connection relationship between each node and other nodes in the meteorological data node graph. The rows and columns in the adjacency matrix correspond to the nodes in the meteorological data node graph. If there is an edge between two nodes in the meteorological data node graph, the value at the intersection of the row and column corresponding to these two nodes is 1; otherwise, it is 0.
[0085] like Figure 3 As shown, Figure 3This is an exemplary schematic diagram of the adjacency matrix provided in an embodiment of this application. Figure 3 The adjacency matrix of a meteorological data node graph with 4 nodes is shown. Figure 3 In the graph, A, B, C, and D represent four nodes in the meteorological data node diagram. There is an edge between node A and node B, and an edge between node C and node D. Therefore, in... Figure 3 In the adjacency matrix shown, the value at the intersection of the row and column of node A and node B is 1, the value at the intersection of the row and column of node C and node D is 1, and the values of the remaining rows and columns are 0.
[0086] S204. Determine the forecast meteorological data for the time to be predicted based on the characteristics of the forecast meteorological data.
[0087] In this embodiment of the application, after S204, the predicted meteorological data of each sub-region within the predicted area at the predicted time can be mapped to a node graph to obtain the predicted meteorological data node graph at the predicted time. The first meteorological data node graph of the predicted meteorological data node graph at multiple times is deleted, and the predicted time is taken as the last time of the multiple times to obtain the updated predicted meteorological data node graph at multiple times. Then, S202 to S204 are executed again to obtain the predicted meteorological data at the next time after the predicted time. By repeating the above steps, the predicted meteorological data at multiple times after the predicted time can be obtained.
[0088] Based on the above technical solution, this application constructs a meteorological data node graph at multiple time points. By using variable quantum circuits to encode the quantum features of each node data in the meteorological data node graph, and leveraging the quantum parallel computing characteristics of variable quantum circuits, it achieves rapid encoding of a large amount of complex meteorological data, thereby obtaining a node feature matrix. Based on the node feature matrix and the adjacency matrix of the meteorological data node graph, feature calculation is performed to obtain the predicted meteorological data features. Based on the predicted meteorological data features, the predicted meteorological data is determined, thereby improving the speed of predicting meteorological data and realizing short-term meteorological forecasting.
[0089] like Figure 4 As shown, Figure 4 This is a flowchart illustrating another meteorological data prediction method provided in this application embodiment. The variational quantum circuit in the above embodiment includes an encoding layer, a parameterized layer, and a measurement layer. Based on the above embodiment, in step S202, the node data of each meteorological data node map is quantum feature encoded using the quantum variational circuit to obtain the node feature matrix of each meteorological data node map. Specifically, this can be implemented as follows:
[0090] S2021. The coding layer is used to encode the node data included in each meteorological data node map into a preset number of qubits.
[0091] The coding layer includes an H gate and a first RY gate. S2031 can be specifically implemented as follows:
[0092] An H gate is applied to a predetermined number of qubits, causing each qubit to evolve from an initial state to a superposition state. Based on the qubit parameters determined by the data of each node included in the meteorological data node diagram, a first RY gate is applied to each qubit, causing each node data to be mapped to a predetermined number of qubits in a superposition state.
[0093] In this embodiment of the application, the variable quantum circuit includes a preset number of qubits, which can be set by technicians according to the actual application scenario.
[0094] For example, the preset number can be set to 9 qubits, then the encoding layer can encode every 9 nodes of data in the meteorological data node graph into 9 qubits, with each node data corresponding to one qubit.
[0095] like Figure 5 As shown, Figure 5 This is a schematic diagram of a variable quantum circuit provided in an embodiment of this application. Figure 5 The variable quantum circuit shown includes nine qubits from q0 to q8, and also includes a coding layer, a parametric layer, and a measurement layer. The coding layer includes an H-gate and a first RY gate, with the H-gate acting on the initial states of the nine qubits from q0 to q8. Up, transform it into a superposition state. Then node data x i =[a0,...,a8] is used as the parameter of the first RY gate, in the form RY(a j ), j = 0, ..., 8, the first RY gate acts on the qubit in the superposition state, mapping the data of each node to the corresponding qubit.
[0096] S2022. Perform quantum state evolution on encoded qubits using parametric layering.
[0097] Among them, the parametric layer includes the CNOT gate and the second RY gate.
[0098] In this embodiment, the main function of the CNOT gate is to achieve quantum entanglement, enabling the exchange and transmission of information between qubits, such as... Figure 5 As shown, CNOT gates are first used to entangle two adjacent qubits, then entanglement is performed across qubits. Finally, a second RY gate is introduced into the variable quantum circuit. The second RY gate includes training parameters. By iteratively optimizing the training parameters, the variable quantum circuit can be optimized, so that the variable quantum circuit can learn more effective node feature vectors based on node data.
[0099] It should be noted that the variable quantum circuits provided in this application embodiment can be stacked multiple times to increase the depth according to the specific quantum coding task, in order to seek a better variable quantum circuit.
[0100] S2023. Measure the quantum state of each qubit after its evolution using the measurement layer, calculate the expected value of the measurement result, and obtain the node feature vector of each node data.
[0101] The measurement layer is the last layer of the variable quantum circuit. Its function is to decoher the qubits and realize the conversion of quantum data to classical data. Since the variable quantum circuit includes a preset number of qubits, the measurement layer takes the expected value of Pauli Z of each qubit as the output. The node feature vector of each node data output is a vector of a preset number of dimensions.
[0102] like Figure 5 As shown, the variable quantum circuit includes 9 qubits. The dimension of the node feature vector after quantum feature encoding of each node data is [1, 9], that is, the 9-dimensional node feature vector of each meteorological data is extracted.
[0103] S2024. Concatenate the node feature vectors of each node data to obtain the node feature matrix of the meteorological data node map.
[0104] In this embodiment of the application, the node feature vector x has a dimension of m, where m is a preset number. The node feature vector x corresponding to each node in the meteorological data node graph is concatenated to form a node feature matrix X, where the dimension of the node feature matrix X is h*m, and h is the number of nodes in the meteorological data graph.
[0105] Continuing with the example in S2023, assuming that the meteorological data node graph includes 18 nodes, the 9-dimensional node feature vectors of the 18 nodes in the meteorological data node graph can be concatenated to obtain a node feature matrix with a dimension of 18*9.
[0106] Using the embodiments of this application, the node data in the meteorological data node graph is encoded onto a preset number of qubits through the encoding layer included in the quantum circuit. The encoded qubits are then subjected to quantum state evolution through a parametric layer. The evolved quantum states are measured by a measurement device, and the expected value is calculated to obtain the node feature vector of each node data. By leveraging the parallel computing advantage of the variable quantum circuit, feature encoding of a large amount of meteorological data is achieved. Compared with traditional feature encoding methods, the processing speed of meteorological data is greatly improved, thereby improving the speed of meteorological forecasting and realizing short-term meteorological forecasting.
[0107] Furthermore, the CNOT gate in the parametric layered structure employs a multi-level quantum bit entanglement design, which enables the full exchange and transmission of information between quantum bits, improving the accuracy of feature extraction from meteorological data. The second RY gate includes training parameters, and the optimal value of these parameters can be obtained through multiple training sessions, thus obtaining the optimal variable quantum circuit. This further improves the accuracy of feature extraction from meteorological data, thereby greatly enhancing the accuracy of weather forecasting.
[0108] In another embodiment of this application, such as Figure 6 As shown, in step S203 above, feature calculation is performed based on the adjacency matrix and node feature matrix of the meteorological data node graph at each time point to obtain the predicted meteorological data features. Specifically, this can be implemented as follows:
[0109] S2031. Perform iterative graph convolution calculation on the adjacency matrix and node feature matrix of the meteorological data node graph at each time step, and downsample the calculation results to obtain the predicted meteorological data features.
[0110] Specifically, the adjacency matrix and node feature matrix of the meteorological data node graph at each time point are calculated using iterative graph convolution using the following formula:
[0111] Z (n+1) =A′X n W n X n+1 =σ(Z) n+1 );
[0112] Where A′ represents the normalized adjacency matrix, n represents the number of iterations for graph convolution, and W n Let X represent the weight matrix in the nth calculation. n Z represents the node feature matrix at the nth computation, σ() represents the activation function, and Z (n+1) This represents the result of the nth graph convolution calculation.
[0113] In this embodiment, the number of iterations n for the graph convolution calculation can be set according to the actual application scenario, and the weight matrix W... n This includes the parameters that need to be trained, and the activation function σ() can be set to ReLU.
[0114] If the final result calculated according to the above formula is the node feature matrix X n+1 Then it is necessary to consider the feature matrix X of this node. n+1 The node representations in the graph are subjected to graph pooling, which is a downsampling process, to obtain the features of the predicted meteorological data.
[0115] By employing the embodiments of this application, multiple iterative graph convolution calculations are performed on the node feature matrix and adjacency. Each calculation generates the feature vector of the current central node by aggregating the node feature vectors of adjacent nodes in the meteorological data node graph from the previous calculation. After multiple iterative calculations, an accurate representation of the meteorological data node graph can be obtained. Furthermore, based on the calculation results, accurate meteorological forecast data can be obtained.
[0116] Figure 7 This is a schematic diagram of a process for predicting meteorological data based on a meteorological data node map, provided in an embodiment of this application. The prediction is combined with the following... Figure 7 Please provide an explanation.
[0117] Step 1: Input the meteorological data node map into the variable quantum line for quantum feature encoding to obtain the node feature matrix.
[0118] The quantum feature encoding method for variable quantum circuits can be referred to the relevant description in the above embodiments, and will not be repeated here.
[0119] Step 2: Obtain the adjacency matrix of the meteorological data node graph.
[0120] An adjacency matrix is used to represent the connection relationship between each node and other nodes in a meteorological data node graph.
[0121] In this embodiment, there is no strict restriction on the execution order of step one and step two; step two can be executed first and then step one.
[0122] Step 3: Input the node feature matrix and adjacency matrix into n graph convolutional layers for iterative graph convolution calculation.
[0123] The specific formula for calculating the iterative graph convolution can be found in the description in the above embodiment, and will not be repeated here.
[0124] Step 4: Input the results of the iterative graph convolution calculation into the graph pooling layer to obtain the predicted meteorological data features, and determine the predicted meteorological data based on the predicted meteorological data features.
[0125] By constructing a classical quantum hybrid graph neural network model using variable quantum circuits combined with a classical neural network, the model parameters are reduced, and the efficiency of feature extraction and data processing is improved, which in turn increases the model running speed and thus improves the speed of weather forecasting. At the same time, the node features in the meteorological data node graph can be mapped to a high-dimensional Hilbert space, which improves the model stability and generalization ability.
[0126] Based on the same inventive concept, embodiments of this application also provide a meteorological data forecasting device, such as... Figure 8 As shown, the device includes:
[0127] Module 801 is used to construct a meteorological data node map for multiple times before the time to be predicted. Each node in the meteorological data node map represents the meteorological data of a sub-region within the area to be predicted.
[0128] The encoding module 802 is used to perform quantum feature encoding on the node data of each meteorological data node map using a variable quantum circuit to obtain the node feature matrix of each meteorological data node map.
[0129] The calculation module 803 is used to perform feature calculation based on the adjacency matrix and node feature matrix of the meteorological data node graph at each time moment to obtain the predicted meteorological data features. The adjacency matrix represents the connection relationship between each node and other nodes in the meteorological data node graph.
[0130] The determination module 804 is used to determine the forecast meteorological data for the time to be predicted based on the characteristics of the forecast meteorological data.
[0131] Optional, the calculation module 803 is specifically used for:
[0132] For each moment, the adjacency matrix and node feature matrix of the meteorological data node graph are subjected to iterative graph convolution calculation, and the calculation results are downsampled to obtain the predicted meteorological data features.
[0133] Optionally, the adjacency matrix and node feature matrix of the meteorological data node graph at each time step can be calculated using iterative graph convolution using the following formula:
[0134] Z (n+1) =A′X n W n X n+1 =σ(Z) n+1 );
[0135] Where A′ represents the normalized adjacency matrix, n represents the number of iterations for graph convolution, and W n Let X represent the weight matrix in the nth calculation. n Z represents the node feature matrix at the nth computation, σ() represents the activation function, and Z (n+1) This represents the result of the nth graph convolution calculation.
[0136] Optionally, the variable quantum circuit includes an encoding layer, a parametric layer, and a measurement layer. The encoding module 802 is specifically used for:
[0137] The coding layer is used to encode the node data of each meteorological data node map into a preset number of qubits;
[0138] Quantum state evolution of encoded qubits is performed using parametric layering;
[0139] The quantum state of each qubit after evolution is measured using the measurement layer, the expected value of the measurement result is calculated, and the node feature vector of each node data is obtained.
[0140] The node feature vectors of each node's data are concatenated to obtain the node feature matrix of the meteorological data node map.
[0141] Optional, encoding module 802, specifically used for:
[0142] An H gate is applied to a predetermined number of qubits, causing each qubit to evolve from an initial state to a superposition state. Based on the qubit parameters determined by the data of each node included in the meteorological data node diagram, a first RY gate is applied to each qubit, causing each node data to be mapped to a predetermined number of qubits in a superposition state.
[0143] Optionally, the parametric layer includes a CNOT gate and a second RY gate.
[0144] Optionally, build module 801 is specifically used for:
[0145] The area to be predicted is divided into multiple sub-regions according to latitude and longitude, and meteorological data of each sub-region within the area to be predicted are collected at multiple times before the time to be predicted.
[0146] Meteorological data for each sub-region is mapped onto a node graph to obtain a meteorological data node graph.
[0147] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0148] Another embodiment of this application provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in the above-described meteorological data prediction method embodiments when running.
[0149] Specifically, in this embodiment, the storage medium may include, but is not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.
[0150] Another embodiment of this application provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in the above-described meteorological data forecasting method embodiments.
[0151] Specifically, the aforementioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the aforementioned processor, and the input / output device is connected to the aforementioned processor.
[0152] Specifically, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0153] Step 1: Construct a node map of meteorological data from multiple moments before the moment to be predicted.
[0154] Step 2: Use variable quantum circuits to perform quantum feature encoding on the node data of each meteorological data node map to obtain the node feature matrix of each meteorological data node map.
[0155] Step 3: Based on the adjacency matrix and node feature matrix of the meteorological data node graph at each time point, perform feature calculation to obtain the predicted meteorological data features.
[0156] Step 4: Determine the predicted meteorological data for the time to be predicted based on the characteristics of the predicted meteorological data.
[0157] The above description, based on the embodiments shown in the drawings, details the structure, features, and effects of this application. The above description is only a preferred embodiment of this application, but this application does not limit the scope of implementation to what is shown in the drawings. Any changes made in accordance with the concept of this application, or modifications to equivalent embodiments, that do not exceed the spirit covered by the specification and drawings, should be within the protection scope of this application.
Claims
1. A weather data prediction method characterized by, The method comprises: constructing a meteorological data node graph of multiple time points before a to-be-predicted time point, each node data of the meteorological data node graph representing meteorological data of a subregion in a to-be-predicted region; performing quantum feature coding on the node data of each meteorological data node graph by using a variational quantum circuit to obtain a node feature matrix of each meteorological data node graph; performing iterative graph convolution calculation based on an adjacency matrix and the node feature matrix of the meteorological data node graph of each time point, the adjacency matrix representing a connection relationship between each node and other nodes in the meteorological data node graph, and performing down-sampling on a calculation result to obtain predicted meteorological data features; determining predicted meteorological data of the to-be-predicted time point according to the predicted meteorological data features.
2. The method of claim 1, wherein, The iterative graph convolution calculation on the adjacency matrix and the node feature matrix of the meteorological data node graph of each time point is performed by using the following formula: , ; wherein, denotes the normalized adjacency matrix, n denotes the number of iterations of the graph convolution calculation, denotes the weight matrix at the n-th calculation, denotes the node feature matrix at the n-th calculation, denotes the activation function, denotes the result of the n-th graph convolution calculation.
3. The method according to any one of claims 1 to 2, characterized in that, The variational quantum circuit comprises an encoding layer, a parametric variational layer, and a measurement layer, and the quantum feature coding on the node data of each meteorological data node graph by using the variational quantum circuit to obtain the node feature matrix of each meteorological data node graph comprises: encoding the node data included in each meteorological data node graph to a preset number of quantum bits by using the encoding layer; performing quantum state evolution on the encoded quantum bits by using the parametric variational layer; measuring a quantum state of each quantum bit after evolution by using the measurement layer, calculating an expected value of a measurement result, and obtaining a node feature vector of each node data; splicing the node feature vectors of each node data to obtain the node feature matrix of the meteorological data node graph.
4. The method of claim 3, wherein, The encoding layer comprises an H gate and a first RY gate, and the encoding of the node data included in each meteorological data node graph to the preset number of quantum bits by using the encoding layer comprises: applying the H gate to the preset number of quantum bits so that each quantum bit evolves from an initial state to a superposition state, applying the first RY gate to each quantum bit according to quantum gate parameters determined according to each node data included in the meteorological data node graph, and mapping each node data to the preset number of quantum bits in the superposition state.
5. The method of claim 3, wherein, The parametric variational layer comprises a CNOT gate and a second RY gate.
6. The method of claim 1, wherein, The construction of the meteorological data node graph of multiple time points before the to-be-predicted time point comprises: dividing the to-be-predicted region into multiple subregions according to latitude and longitude, collecting meteorological data of each subregion in the to-be-predicted region at multiple time points before the to-be-predicted time point; mapping the meteorological data of each subregion to a node graph to obtain the meteorological data node graph.
7. A weather data prediction apparatus characterized by comprising: The device comprises: a construction module configured to construct a meteorological data node graph of multiple time points before a to-be-predicted time point, each node data of the meteorological data node graph representing meteorological data of a subregion in a to-be-predicted region; an encoding module configured to perform quantum feature coding on the node data of each meteorological data node graph by using a variational quantum circuit to obtain a node feature matrix of each meteorological data node graph; The computing module is configured to perform an iterative graph convolution calculation based on an adjacency matrix and a node feature matrix of a meteorological data node graph at each time point, and to perform down-sampling on a calculation result to obtain predicted meteorological data features, the adjacency matrix representing a connection relationship between each node and other nodes in the meteorological data node graph. The determining module is configured to determine predicted meteorological data at a to-be-predicted time point according to the predicted meteorological data features.
8. A storage medium, characterized by The storage medium has stored therein a computer program, and the computer program is configured to execute the method in any one of claims 1 to 6 when executed. 9.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory has stored therein a computer program, and the processor is configured to execute the computer program to execute the method in any one of claims 1 to 6.
Citation Information
Patent Citations
Group prediction method and system for output power of wind power plant
CN113887843A
Meteorological prediction method based on variable component sub-line and related equipment
CN115144934A