Risk optimization method and device
By encapsulating and signing the quantum optimization circuit in a trusted execution environment on the user side, and verifying it with classical optimization algorithms, the risks of data leakage and tampering in quantum computing in financial investment are resolved. This achieves the credibility of quantum computing results and the confidentiality of financial data, thereby improving the reliability of portfolio optimization.
Patent Information
- Application Number
- CN202512057124.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-17
AI Technical Summary
In existing technologies, the application of quantum computing in the field of financial investment lacks encryption protection, which poses risks of data leakage and tampering with quantum results. Furthermore, no mechanism is provided to verify quantum results in a confidential environment, making it difficult to guarantee the confidentiality of financial data and the credibility of computation results.
In a trusted execution environment on the user side, historical asset return data is preprocessed and modeled to construct a portfolio risk optimization model. This model is then encoded into a parameterized quantum optimization circuit, encapsulated and signed, and sent to a quantum computing server. The model is transmitted through an encrypted channel, and the quantum measurement results are decoded and verified on the user side. A benchmark value is generated using classical optimization algorithms for trusted verification.
It achieves integrity protection of quantum computing tasks and results in a confidential environment, reduces the risk of data leakage and tampering, enhances the credibility and stability of portfolio optimization decisions, and ensures the confidentiality of financial data and the reliability of computing results.
Smart Images

Figure CN121883168A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of risk optimization technology, and in particular to a risk optimization method and apparatus. Background Technology
[0002] In the financial investment field, portfolio risk optimization is a core business segment for fund companies and asset management institutions. With the increasing complexity of financial markets and the diversification of asset classes, quantum computing, due to its parallelism and exponential acceleration potential, has emerged as a new direction for solving portfolio optimization problems. However, the deployment of quantum computing typically relies on cloud-based quantum computing services, requiring fund companies to upload core financial data to third-party service providers. This data not only contains dynamic relationships between assets but also implicitly includes the institution's risk control models and investment strategies. Leakage of this data could directly expose the institution's trade secrets and even trigger market manipulation risks. In this scenario, ensuring the confidentiality of data throughout its entire lifecycle, the integrity of the computation process, and the reliability of the results while leveraging quantum computing to improve optimization efficiency becomes a key challenge in the integration of finance and quantum technology.
[0003] In existing technologies, the commonly used technical solutions follow this process: First, calculate the historical data of the assets locally to generate an expected return vector and a covariance matrix. Second, submit these data along with a preset quantum approximation optimization algorithm (QAOA) parameterization circuit to a cloud-based quantum computing service provider. After executing the quantum circuit, the service provider returns a candidate portfolio weight vector. Finally, the optimal solution is selected locally.
[0004] However, existing technical solutions lack encryption protection, are at risk of being tampered with, and do not provide a mechanism for verifying quantum results in a confidential environment. Summary of the Invention
[0005] This application provides a risk optimization method and apparatus to address the problems in the prior art, such as lack of encryption protection, risk of tampering, and lack of a mechanism for verifying quantum results in a confidential environment.
[0006] In a first aspect, embodiments of this application provide a risk optimization method applied to a trusted execution environment on the user side, the method comprising:
[0007] The acquired historical asset return data is preprocessed, and a portfolio risk optimization model is built based on the preprocessed data.
[0008] The portfolio risk optimization model is encoded into a parameterized quantum optimization circuit, and the parameterized quantum optimization circuit is encapsulated, signed, and then sent to the quantum computing server on the server side.
[0009] Obtain the quantum measurement results sent by the quantum computing server;
[0010] A risk assessment is performed on the quantum measurement results to obtain a portfolio candidate weight vector and the corresponding risk and return values of the portfolio candidate weight vector;
[0011] Based on the classical optimization algorithm and the quantum measurement results, a classical benchmark weight vector and the risk benchmark value corresponding to the classical benchmark weight vector are generated.
[0012] The reliability of the portfolio candidate weight vector is verified based on the relationship between the risk value corresponding to the portfolio candidate weight vector and the risk benchmark value.
[0013] In one possible implementation, the preprocessing of the acquired historical asset return data and the construction of a portfolio risk optimization model based on the preprocessed data include:
[0014] Statistical analysis was performed on the historical return data of the assets to calculate the expected return vector and covariance matrix;
[0015] Based on the expected return vector and covariance matrix, a portfolio risk optimization model is constructed with the goal of minimizing portfolio risk and constrained by expected return and budget.
[0016] In one possible implementation, encoding the portfolio risk optimization model into a parameterized quantum optimization circuit, and then encapsulating and signing the parameterized quantum optimization circuit before sending it to the quantum computing server on the server side includes:
[0017] The portfolio risk optimization model is mapped to a quantum optimization problem;
[0018] Based on the aforementioned quantum optimization problem, a parameterized quantum-optimized circuit for quantum computing is generated;
[0019] The parameterized quantum optimization circuit and its corresponding parameters are encapsulated, and the encapsulated quantum computing task is signed using a key in a trusted execution environment.
[0020] The signed quantum computing task is sent to the quantum computing server on the server side via an encrypted channel.
[0021] In one possible implementation, the step of performing a risk assessment on the quantum measurement results to obtain a portfolio candidate weight vector and the corresponding risk and return values of the portfolio candidate weight vector includes:
[0022] Error mitigation processing is performed on the quantum measurement results to obtain the corrected quantum measurement distribution;
[0023] The portfolio candidate weight vector is obtained by decoding the corrected quantum measurement distribution.
[0024] Based on the expected return vector and covariance matrix, calculate the risk and return values corresponding to the candidate weight vector of the investment portfolio.
[0025] In one possible implementation, generating a classical benchmark weight vector and a corresponding risk benchmark value based on the classical optimization algorithm and the quantum measurement results includes:
[0026] The portfolio risk optimization model is solved using a classical optimization algorithm to obtain the classical benchmark weight vector;
[0027] The risk benchmark value corresponding to the classical benchmark weight vector is calculated based on the covariance matrix, and the risk benchmark value is used as a reference for the quantum measurement results.
[0028] In one possible implementation, the step of performing credibility verification on the portfolio candidate weight vector based on the relationship between the risk value corresponding to the portfolio candidate weight vector and the risk benchmark value includes:
[0029] Determine whether the return value corresponding to the candidate weight vector of the investment portfolio meets the preset return constraint;
[0030] If the preset return constraint is met, determine whether the risk value corresponding to the candidate weight vector of the investment portfolio does not exceed the sum of the risk benchmark value and the preset tolerance threshold;
[0031] If the threshold is not exceeded, the candidate weight vector of the portfolio is determined to have passed the credibility verification, and the portfolio weight result that meets the preset conditions is output.
[0032] In one possible implementation, the method further includes:
[0033] When the candidate weight vector of the portfolio fails the trusted verification, the parameters of the parameterized quantum optimization circuit are updated within the trusted execution environment, and the updated quantum computing task is resent to the quantum computing server on the server side for execution, so as to form an iterative optimization process.
[0034] Secondly, embodiments of this application provide a risk optimization method applied to a quantum computing server on the service side, the method comprising:
[0035] Receive signed quantum computing tasks sent by the trusted execution environment on the user side;
[0036] The signature of the quantum computing task is verified, and if the verification is successful, the quantum computing task is parsed to obtain the parameterized quantum optimization circuit and its corresponding parameters;
[0037] Based on the parameterized quantum optimization circuit, quantum computing is performed on quantum computing resources and quantum measurement is carried out to generate corresponding quantum measurement results.
[0038] The quantum measurement results are sent to the trusted execution environment on the user side.
[0039] Thirdly, embodiments of this application provide a risk optimization apparatus, which is applied to a trusted execution environment on the user side, comprising:
[0040] The first processing module is used to preprocess the acquired historical return data of assets and build an investment portfolio risk optimization model based on the preprocessed data.
[0041] The sending module is used to encode the portfolio risk optimization model into a parameterized quantum optimization circuit, and to encapsulate and sign the parameterized quantum optimization circuit before sending it to the quantum computing server on the server side.
[0042] The acquisition module is used to acquire the quantum measurement results sent by the quantum computing server;
[0043] The evaluation module is used to perform risk assessment on the quantum measurement results, and obtain the portfolio candidate weight vector and the risk value and return value corresponding to the portfolio candidate weight vector;
[0044] The second processing module is used to generate a classical benchmark weight vector and a risk benchmark value corresponding to the classical benchmark weight vector based on the classical optimization algorithm and the quantum measurement results.
[0045] The verification module is used to perform a credibility verification on the candidate weight vector of the investment portfolio based on the relationship between the risk value corresponding to the candidate weight vector of the investment portfolio and the risk benchmark value.
[0046] In one possible implementation, the first processing module is specifically used for:
[0047] Statistical analysis was performed on the historical return data of the assets to calculate the expected return vector and covariance matrix;
[0048] Based on the expected return vector and covariance matrix, a portfolio risk optimization model is constructed with the goal of minimizing portfolio risk and constrained by expected return and budget.
[0049] In one possible implementation, the sending module is specifically used for:
[0050] The portfolio risk optimization model is mapped to a quantum optimization problem;
[0051] Based on the aforementioned quantum optimization problem, a parameterized quantum-optimized circuit for quantum computing is generated;
[0052] The parameterized quantum optimization circuit and its corresponding parameters are encapsulated, and the encapsulated quantum computing task is signed using a key in a trusted execution environment.
[0053] The signed quantum computing task is sent to the quantum computing server on the server side via an encrypted channel.
[0054] In one possible implementation, the evaluation module is specifically used for:
[0055] Error mitigation processing is performed on the quantum measurement results to obtain the corrected quantum measurement distribution;
[0056] The portfolio candidate weight vector is obtained by decoding the corrected quantum measurement distribution.
[0057] Based on the expected return vector and covariance matrix, calculate the risk and return values corresponding to the candidate weight vector of the investment portfolio.
[0058] In one possible implementation, the second processing module is specifically used for:
[0059] The portfolio risk optimization model is solved using a classical optimization algorithm to obtain the classical benchmark weight vector;
[0060] The risk benchmark value corresponding to the classical benchmark weight vector is calculated based on the covariance matrix, and the risk benchmark value is used as a reference for the quantum measurement results.
[0061] In one possible implementation, the step of performing credibility verification on the portfolio candidate weight vector based on the relationship between the risk value corresponding to the portfolio candidate weight vector and the risk benchmark value includes:
[0062] Determine whether the return value corresponding to the candidate weight vector of the investment portfolio meets the preset return constraint;
[0063] If the preset return constraint is met, determine whether the risk value corresponding to the candidate weight vector of the investment portfolio does not exceed the sum of the risk benchmark value and the preset tolerance threshold;
[0064] If the threshold is not exceeded, the candidate weight vector of the portfolio is determined to have passed the credibility verification, and the portfolio weight result that meets the preset conditions is output.
[0065] In one possible implementation, the device further includes an update module for:
[0066] When the candidate weight vector of the portfolio fails the trusted verification, the parameters of the parameterized quantum optimization circuit are updated within the trusted execution environment, and the updated quantum computing task is resent to the quantum computing server on the server side for execution, so as to form an iterative optimization process.
[0067] Fourthly, embodiments of this application provide a risk optimization device, which is applied to a quantum computing server on the service side, comprising:
[0068] The receiving module is used to receive the signed quantum computing task sent by the trusted execution environment on the user side;
[0069] The processing module is used to verify the signature of the quantum computing task, and if the verification is successful, to parse the quantum computing task to obtain the parameterized quantum optimization circuit and its corresponding parameters;
[0070] An execution module is used to perform quantum computing and quantum measurement on quantum computing resources based on the parameterized quantum optimization circuit, and generate corresponding quantum measurement results.
[0071] A sending module is used to send the quantum measurement results to the trusted execution environment on the user side.
[0072] The risk optimization method and apparatus provided in this application, in a trusted execution environment on the user side, firstly preprocesses the acquired historical asset return data, and then constructs a portfolio risk optimization model based on this data, thereby forming an accurate and confidential optimization problem description within the trusted environment. Subsequently, the portfolio risk optimization model is mapped and encoded into a parameterized quantum optimization circuit, which is then encapsulated, signed, and sent to a quantum computing server. This ensures the integrity and verifiability of the quantum computing task during cross-environment transmission and execution, and improves the efficiency of solving complex optimization problems by leveraging quantum computing resources. Next, the quantum measurement results returned by the quantum computing server are obtained, and post-processed and decoded within the trusted execution environment to obtain portfolio candidates. The system generates weight vectors and calculates the corresponding risk and return values based on the covariance matrix and expected return vector, achieving a reliable conversion of quantum computing results into financial semantics. Building upon this, a classical optimization algorithm is used to solve the same portfolio risk optimization model, generating a classical benchmark weight vector and its corresponding risk benchmark value. This serves as a reference for the quantum computing results, thus avoiding the impact of quantum noise or instability on decision-making. Finally, based on the relationship between the risk values corresponding to the portfolio candidate weight vectors and the risk benchmark value, the quantum candidate solutions are reliably verified. Only when their risk level is within a preset acceptable range are they output as the final portfolio weight result. This ensures a reliable and optimized investment decision while maintaining data confidentiality and computational reliability. Attached Figure Description
[0073] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0074] Figure 1 Signaling diagram of the risk optimization method provided in the embodiments of this application;
[0075] Figure 2 A flowchart illustrating the risk optimization method provided in this application embodiment;
[0076] Figure 3 Schematic diagram of the risk optimization device provided in the embodiments of this application Figure 1 ;
[0077] Figure 4 Schematic diagram of the risk optimization device provided in the embodiments of this application Figure 2 ;
[0078] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0079] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0080] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0081] In the financial investment field, portfolio risk optimization is one of the core business processes for fund companies and asset management institutions. With the increasing complexity of financial markets and the diversification of asset classes, traditional classical computing methods face computational efficiency bottlenecks when processing high-dimensional data (such as the covariance matrix of thousands of assets). Quantum computing, with its parallelism and exponential acceleration potential, has emerged as a new direction for solving portfolio optimization problems. However, the deployment of quantum computing typically relies on cloud-based quantum computing services (such as IBM Quantum and D-Wave), requiring fund companies to upload core financial data (such as the covariance matrix of assets and expected returns) to third-party service providers. This data not only contains dynamic relationships between assets (such as volatility and correlation) but also implicitly contains the institution's risk control models and investment strategies. Leakage of this data could directly expose the institution's trade secrets and even trigger market manipulation risks. Furthermore, the reliability of quantum computing results is difficult to verify. For example, service providers might manipulate quantum circuit parameters or return forged optimization results to induce fund companies to select high-risk portfolios. In this scenario, ensuring the confidentiality of data throughout its entire lifecycle, the integrity of the computation process, and the reliability of the results while leveraging quantum computing to improve optimization efficiency becomes a key challenge in the integration of finance and quantum technology. This application focuses on addressing these contradictions, aiming to provide financial institutions with a secure, reliable, and verifiable quantum computing-driven investment decision-making solution.
[0082] In existing technologies, the commonly used technical solutions follow this process: First, calculate the historical data of the assets locally to generate an expected return vector and a covariance matrix. Second, submit these data along with a preset quantum approximation optimization algorithm (QAOA) parameterization circuit to a cloud-based quantum computing service provider. After executing the quantum circuit, the service provider returns a candidate portfolio weight vector. Finally, the optimal solution is selected locally.
[0083] However, in existing technologies, core data such as the covariance matrix must be transmitted in plaintext to a third party, lacking encryption protection and making them vulnerable to theft by service providers or cyber attackers. Quantum computing service providers may generate false optimal solutions by tampering with quantum circuit parameters or falsifying measurement results, leading fund companies to misjudge risks and returns. Furthermore, existing solutions do not provide a mechanism for verifying quantum results in a confidential environment, making it impossible to cross-verify the reliability of quantum solutions using classical methods. Moreover, the noise characteristics of quantum computing mean that a single result may deviate from the optimal solution.
[0084] Based on this, this application proposes a risk optimization method. Addressing the problems in existing portfolio risk optimization schemes—such as the lack of encryption protection, the risk of tampering with quantum computing tasks and results during transmission and execution, and the inability to effectively verify quantum computing results in a confidential environment—the inventor, Gui Tao, restricts the modeling, evaluation, and decision-making processes involving sensitive financial data such as asset returns and covariance to a trusted execution environment on the user side. Simultaneously, only the encapsulated and signed parameterized quantum optimization circuit is sent to the quantum computing server for execution, thereby preventing confidential data from being exposed in the external environment. In specific implementation, the quantum computing server is only responsible for executing the verified quantum computing tasks and returning quantum measurement results, while the trusted execution environment on the user side decodes the quantum measurement results, calculates risks and returns, and further introduces classical optimization algorithms to generate a benchmark for trusted verification of the quantum results to determine whether they meet the preset risk and return conditions. Through the above-mentioned technical means, the integrity of quantum computing tasks and results is protected and reliable verification is achieved in a confidential environment. This reduces the risk of quantum computing results being tampered with or misused, and improves the credibility and stability of portfolio optimization decisions, thereby effectively overcoming the shortcomings of existing technologies in terms of security and credibility.
[0085] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0086] Figure 1 Signaling diagram of the risk optimization method provided in the embodiments of this application; such as Figure 1 As shown, the method includes:
[0087] S101. Within a trusted execution environment, the acquired historical asset return data is preprocessed, and a portfolio risk optimization model is constructed based on the preprocessed data.
[0088] In one feasible approach, firstly, statistical analysis is performed on the historical return data of the assets to calculate the expected return vector and covariance matrix; then, based on the expected return vector and covariance matrix, a portfolio risk optimization model is constructed with the goal of minimizing portfolio risk and constrained by expected return and budget.
[0089] It should be understood that in this embodiment, historical return data of the asset is first obtained within the Trusted Execution Environment (TEE) on the user side, and the historical return data is preprocessed. Because the TEE provides a trusted computing space for processing historical return data through hardware isolation and memory encryption mechanisms, it prevents sensitive financial data from being illegally read or tampered with during the calculation process. Specifically, firstly, statistical methods are used to analyze the historical data to calculate the asset's expected rate of return vector (…). ) and the covariance matrix reflecting the volatility and correlation among assets ( The expected return vector represents the expected return level of each asset, and the covariance matrix represents the correlation between asset returns and the overall risk structure. Based on this, a portfolio risk optimization model is constructed within a trusted execution environment, with the objective function being to minimize portfolio risk (expressed as...). The constraints include the requirement that the portfolio's expected return must reach or exceed the target value. ) and the sum of all asset weights is 1 (i.e., budget constraint, Thus, a clear and computable optimization problem is formed in an absolutely confidential environment.
[0090] Understandably, by completing the preprocessing and statistical modeling of asset return data within a trusted execution environment, it is possible to ensure that core financial parameters such as the expected rate of return vector and covariance matrix are protected throughout the modeling phase, preventing the leakage of sensitive investment data from the source, and providing a unified and reliable optimization model foundation for subsequent quantum computing and classical computing.
[0091] S102. Within the trusted execution environment, the portfolio risk optimization model is encoded into a parameterized quantum optimization circuit, and the parameterized quantum optimization circuit is encapsulated, signed, and then sent to the quantum computing server on the server side.
[0092] In one feasible approach, the portfolio risk optimization model is first mapped to a quantum optimization problem; then, a parameterized quantum optimization circuit for quantum computing is generated based on the quantum optimization problem; next, the parameterized quantum optimization circuit and its corresponding parameters are encapsulated, and the encapsulated quantum computing task is signed using a key in a trusted execution environment; finally, the signed quantum computing task is sent to the quantum computing server on the server side through an encrypted channel.
[0093] It should be understood that to solve this optimization problem using quantum computing, the classical mathematical model needs to be transformed into a form that can be processed by quantum algorithms. Within the TEE, the aforementioned quadratic constraint optimization problem is first mapped to a combinatorial optimization problem (e.g., by discretizing the weights), and then encoded into a Hamiltonian suitable for quantum approximation optimization algorithms (QAOA). Based on this Hamiltonian, a parameterized quantum circuit U is generated. ,in Given the array of parameters to be optimized, the circuit's function is to approximate the solution space of the original optimization problem. Then, within a trusted execution environment, the generated parameterized quantum optimization circuit and its corresponding parameters are uniformly encapsulated. The encapsulated quantum computing task is digitally signed using the encryption key built into the trusted execution environment to ensure the integrity and immutability of the quantum computing task during transmission and execution. Finally, the signed quantum computing task is sent to the quantum computing server on the server side via an encrypted communication channel (such as TLS).
[0094] It is understandable that by completing the encoding, encapsulation, and signing of the quantum optimization model within a trusted execution environment, the confidentiality of the portfolio optimization model can be guaranteed while preventing the quantum computing task from being tampered with or replaced during transmission, thereby ensuring that the computing task executed by the quantum computing server is consistent with the original task generated by the user.
[0095] S103. The quantum computing server receives the signed quantum computing task sent by the trusted execution environment on the user side, verifies the signature of the quantum computing task, and if the verification is successful, parses the quantum computing task to obtain the parameterized quantum optimization circuit and its corresponding parameters.
[0096] It should be understood that after receiving a signed quantum computing task from the user's trusted execution environment (TEE), the quantum computing server first verifies the digital signature of the quantum computing task. Since the server holds the public key certificate corresponding to the user's TEE (or obtains the public key through remote proof), it uses this public key to verify the task signature. This step confirms the integrity and authenticity of the task data packet, which is crucial for defending against man-in-the-middle attacks and task forgery. Only tasks with successful signature verification are scheduled for execution; otherwise, they are rejected. Successful signature verification indicates that the quantum computing task has not been tampered with during transmission and indeed originates from the trusted execution environment. Subsequently, the quantum computing server parses the quantum computing task to obtain the parameterized quantum optimization circuit (such as the QAOA circuit) and its corresponding parameter information. This prepares the ground for subsequent quantum computing operations.
[0097] Understandably, by implementing a signature verification mechanism on the quantum computing server, malicious task injection or task replacement can be effectively prevented, ensuring that quantum computing resources are used only to execute legitimate quantum computing tasks from a trusted execution environment.
[0098] S104. The quantum computing server, based on parameterized quantum optimization circuits, performs quantum computing and quantum measurement on quantum computing resources, generates corresponding quantum measurement results, and sends them to the trusted execution environment on the user side.
[0099] It should be understood that the server-side quantum task scheduler deploys the verified quantum circuits and parameters to a real quantum processing unit (QPU) or a high-performance simulator. The QPU executes a series of logic gate operations (corresponding to U(γ, β)) on the qubits according to the circuit instructions to prepare the target quantum state. Due to the noise inherent in current quantum devices, the quantum state needs to be measured repeatedly (e.g., 8192 times) to obtain an approximate probability distribution. This distribution reflects the probability of each possible candidate solution (corresponding to different portfolio weight codes). Finally, the server returns the original measurement results, i.e., a histogram with binary strings (e.g., '010', '101', etc.) as keys and their occurrence counts as values, to the user-side TEE via a secure channel.
[0100] Understandably, by placing the quantum computing execution and measurement processes on the quantum computing server, the computing power of remote quantum computing resources can be fully utilized. The quantum computing server is only responsible for executing the computing tasks. It only obtains the encoded circuit and the probability distribution of the original bit string obtained by measurement. It cannot interpret the mapping relationship between these bit strings and the weights of specific financial assets, nor can it obtain core information such as the covariance matrix. This avoids directly exposing sensitive investment data on the user side to the quantum computing server.
[0101] S105. Within the trusted execution environment, acquire the quantum measurement results sent by the quantum computing server, and conduct a risk assessment on the quantum measurement results to obtain the portfolio candidate weight vector and the corresponding risk and return values.
[0102] In one feasible approach, the quantum measurement results are first subjected to error mitigation processing to obtain a corrected quantum measurement distribution; then, the portfolio candidate weight vector is decoded based on the corrected quantum measurement distribution; finally, the risk value and return value corresponding to the portfolio candidate weight vector are calculated based on the expected return vector and the covariance matrix.
[0103] It should be understood that after receiving the raw quantum measurement results, the trusted verification engine within the TEE first performs necessary post-processing, namely, error mitigation processing on the quantum measurement results to reduce the impact of quantum noise on the measurement results and obtain the corrected quantum measurement distribution; subsequently, according to predefined encoding rules, it decodes the one or several bit strings with the highest probability into specific portfolio candidate weight vectors. Following this, within a trusted execution environment, based on the expected return vector... With covariance matrix The actual financial indicator (risk value) of the candidate weight vector is calculated classically (i.e., using traditional mathematical formulas). and profit value The specific calculation method is as follows:
[0104]
[0105]
[0106] in, Risk value; For profit value, This is the candidate weight vector.
[0107] Understandably, by decoding and risk-assessing quantum measurement results within a trusted execution environment, abstract quantum measurement results can be transformed into concrete and understandable financial risk and return indicators under complete confidentiality, providing input for subsequent credible comparisons with classical methods.
[0108] S106. Within a trusted execution environment, based on classical optimization algorithms and quantum measurement results, generate a classical benchmark weight vector and the corresponding risk benchmark value.
[0109] In one feasible approach, a classical optimization algorithm is first used to solve the portfolio risk optimization model to obtain a classical benchmark weight vector. Then, the risk benchmark value corresponding to the classical benchmark weight vector is calculated based on the covariance matrix, and the risk benchmark value is used as a reference for the quantum measurement results.
[0110] It should be understood that, in order to objectively evaluate the quality of quantum solutions, a credible reference benchmark must be established in the same secure environment. This embodiment uses classical, deterministic optimization algorithms (such as convex optimization solvers and quadratic programming algorithms) to optimize the same portfolio risk model (i.e., using the same...) The algorithm solves this problem and outputs a classic optimal weight vector. and its corresponding minimum possible risk value This minimum possible risk value is taken as the theoretically optimal risk value achievable under the current model and constraints, i.e., the risk benchmark value.
[0111] Understandably, by introducing classical optimization algorithms to generate risk benchmarks, a quantifiable reference standard can be provided for quantum computing results, thereby improving the credibility and stability of quantum portfolio optimization results.
[0112] S107. Within a trusted execution environment, the candidate weight vectors of the portfolio are verified for trustworthiness based on the relationship between the risk value corresponding to the candidate weight vector and the risk benchmark value.
[0113] Understandably, by introducing a verification mechanism that compares quantum results with classical benchmark results within a trusted execution environment, it is possible to effectively prevent the direct adoption of low-quality or anomalous quantum computing results, thereby improving the reliability and engineering usability of portfolio risk optimization results.
[0114] The risk optimization method provided in this application, within a trusted execution environment on the user side, first preprocesses the acquired historical asset return data and constructs a portfolio risk optimization model based on this data. This forms an accurate and confidential optimization problem description within the trusted environment. Subsequently, the portfolio risk optimization model is mapped and encoded into a parameterized quantum optimization circuit. The quantum optimization circuit is then encapsulated, signed, and sent to a quantum computing server. This ensures the integrity and verifiability of the quantum computing task during cross-environment transmission and execution, and leverages quantum computing resources to improve the efficiency of solving complex optimization problems. Next, the quantum measurement results returned by the quantum computing server are obtained, and post-processed and decoded within the trusted execution environment to obtain portfolio candidate rights. The algorithm calculates the risk and return values based on the covariance matrix and expected return vector, achieving a reliable conversion of quantum computing results into financial semantics. Building upon this, a classical optimization algorithm is used to solve the same portfolio risk optimization model, generating a classical benchmark weight vector and its corresponding risk benchmark value. This serves as a reference for the quantum computing results, avoiding the influence of quantum noise or instability on the decision-making process. Finally, based on the relationship between the risk values corresponding to the portfolio candidate weight vectors and the risk benchmark value, the quantum candidate solutions are reliably verified. Only when their risk level is within a preset acceptable range are they output as the final portfolio weight result. This ensures both data confidentiality and computational reliability, resulting in a trustworthy and optimized investment decision.
[0115] Figure 2 A flowchart illustrating the risk optimization method provided in this application embodiment; as follows: Figure 2 As shown, in this embodiment... Figure 1Based on the examples, the process of verifying the credibility of the portfolio candidate weight vector is described in detail. The method includes:
[0116] S201. Determine whether the return value corresponding to the candidate weight vector of the investment portfolio meets the preset return constraint.
[0117] It should be understood that, in this embodiment, the portfolio candidate weight vector obtained by decoding the quantum measurement results is verified for return constraints within a trusted execution environment. Specifically, based on the expected return vector pre-calculated and stored within the trusted execution environment, the return value corresponding to the portfolio candidate weight vector is calculated, i.e., the return value. And determine whether the return value satisfies the preset return constraint conditions, that is, determine the inequality. Whether this holds true. This is a prerequisite for the viability of the portfolio, ensuring that the optimization results meet basic return requirements.
[0118] It should be noted that the preset return constraint can be that the expected return of the investment portfolio is not lower than a preset return threshold. The return threshold can be configured by the user according to their investment objectives or risk preferences. This return verification process is completed within a trusted execution environment to ensure that the expected return vector and candidate weight vector are not leaked or tampered with during the verification process.
[0119] Understandably, by constraining the payoff values of quantum candidate solutions within a trusted execution environment, quantum computing results that do not meet the basic payoff target can be prevented from entering the subsequent risk verification process, thereby improving the effectiveness and credibility of the overall portfolio optimization results while ensuring the payoff target.
[0120] S202. Under the condition of satisfying the preset return constraint, determine whether the risk value corresponding to the candidate weight vector of the portfolio does not exceed the sum of the risk benchmark value and the preset tolerance threshold.
[0121] It should be understood that, after confirming that the return value corresponding to the candidate weight vector of the investment portfolio meets the preset return constraint, the risk value corresponding to the candidate weight vector of the investment portfolio is further verified within a trusted execution environment. Specifically, a risk benchmark value will be calculated. The sum of this and a preset tolerance threshold (e.g., 1%, 5%) forms an acceptable risk ceiling. Subsequently, the risk of quantum solution was assessed. Whether it has not exceeded this upper limit, i.e., check Whether it is valid or not.
[0122] Understandably, by introducing a joint judgment mechanism of risk benchmark and tolerance threshold, we can ensure the quality of quantum computing results while avoiding excessive rejection of effective quantum solutions due to minor risk fluctuations caused by quantum noise, thereby improving the acceptability and engineering adaptability of quantum portfolio optimization results.
[0123] S203. If the limit is not exceeded, the candidate weight vector of the portfolio is determined to have passed the credibility verification, and the portfolio weight result that meets the preset conditions is output.
[0124] It should be noted that when the candidate weight vector of the portfolio fails the trusted verification, the parameters of the parameterized quantum optimization circuit are updated in the trusted execution environment, and the updated quantum computing task is resent to the quantum computing server on the server side for execution, so as to form an iterative optimization process.
[0125] It should be understood that within the trusted execution environment, when the portfolio candidate weight vector meets the preset conditions in both return verification and risk verification, the portfolio candidate weight vector is determined to have passed the trusted verification, and is securely output to the user application (such as an investment decision system) as the final portfolio weight result that meets the preset conditions. Furthermore, if either judgment in S201 or S202 is negative (i.e., fails trusted verification), the current result will not be output, and the parameters of the parameterized quantum optimization circuit need to be updated within the trusted execution environment. Based on a specific optimization strategy (such as classical gradient-based updates or heuristic search), a new set of QAOA parameters is generated within the TEE, and an iterative loop is triggered. Control is then returned to step S102, and the quantum computing task is repackaged and submitted with the new parameters until a verified solution is obtained, or the preset maximum number of iterations is reached (to prevent infinite loops). At this point, the system may output the classical optimal solution or indicate optimization failure.
[0126] It is understandable that by introducing a trusted verification mechanism under dual constraints of return and risk within a trusted execution environment, and combining iterative update strategies of parameterized quantum optimization circuits, adaptive improvement of quantum portfolio optimization results can be achieved, avoiding the direct adoption of low-quality quantum solutions, while gradually guiding the quantum computing process toward the optimal solution that satisfies both return and risk objectives.
[0127] Figure 3 Schematic diagram of the risk optimization device provided in the embodiments of this application Figure 1 ;like Figure 3 As shown, this device is used in a trusted execution environment on the user side, and includes:
[0128] The first processing module 301 is used to preprocess the acquired historical return data of assets and build an investment portfolio risk optimization model based on the preprocessed data.
[0129] The sending module 302 is used to encode the portfolio risk optimization model into a parameterized quantum optimization circuit, and to encapsulate and sign the parameterized quantum optimization circuit before sending it to the quantum computing server on the server side.
[0130] The acquisition module 303 is used to acquire the quantum measurement results sent by the quantum computing server;
[0131] The evaluation module 304 is used to perform risk assessment on the quantum measurement results and obtain the portfolio candidate weight vector and the risk value and return value corresponding to the portfolio candidate weight vector.
[0132] The second processing module 305 is used to generate a classical benchmark weight vector and a risk benchmark value corresponding to the classical benchmark weight vector based on classical optimization algorithms and quantum measurement results.
[0133] The verification module 306 is used to perform credibility verification on the candidate weight vector of the portfolio based on the relationship between the risk value corresponding to the candidate weight vector of the portfolio and the risk benchmark value.
[0134] In one possible implementation, the first processing module 301 is specifically used for:
[0135] Statistical analysis of historical asset return data is performed to calculate the expected return vector and covariance matrix;
[0136] Based on the expected return vector and covariance matrix, a portfolio risk optimization model is constructed with the goal of minimizing portfolio risk and constrained by expected return and budget.
[0137] In one possible implementation, the sending module 302 is specifically used for:
[0138] Map the portfolio risk optimization model to a quantum optimization problem;
[0139] Generate parameterized quantum-optimized circuits for quantum computing based on quantum optimization problems;
[0140] The parameterized quantum optimization circuit and its corresponding parameters are encapsulated, and the encapsulated quantum computing task is signed using a key in a trusted execution environment.
[0141] The signed quantum computing task is sent to the quantum computing server on the server side via an encrypted channel.
[0142] In one possible implementation, the evaluation module 304 is specifically used for:
[0143] Error mitigation processing is performed on the quantum measurement results to obtain the corrected quantum measurement distribution;
[0144] The portfolio candidate weight vector is obtained by decoding the corrected quantum measurement distribution.
[0145] Based on the expected return vector and covariance matrix, calculate the risk and return values corresponding to the candidate weight vectors of the investment portfolio.
[0146] In one possible implementation, the second processing module 305 is specifically used for:
[0147] The portfolio risk optimization model is solved using a classical optimization algorithm to obtain the classical benchmark weight vector;
[0148] The risk benchmark value corresponding to the classical benchmark weight vector is calculated based on the covariance matrix. The risk benchmark value is used as a reference for the quantum measurement results.
[0149] In one possible implementation, the portfolio candidate weight vector is reliably verified based on the relationship between the risk value corresponding to the portfolio candidate weight vector and the risk benchmark value, including:
[0150] Determine whether the return value corresponding to the candidate weight vector of the investment portfolio meets the preset return constraint;
[0151] Under the premise of meeting the preset return constraints, determine whether the risk value corresponding to the candidate weight vector of the portfolio does not exceed the sum of the risk benchmark value and the preset tolerance threshold;
[0152] If the threshold is not exceeded, the candidate weight vector of the portfolio is determined to have passed the credibility verification, and the portfolio weight result that meets the preset conditions is output.
[0153] In one possible implementation, the device further includes an update module for:
[0154] When the candidate weight vector of the portfolio fails the trusted verification, the parameters of the parameterized quantum optimization circuit are updated in the trusted execution environment, and the updated quantum computing task is resent to the quantum computing server on the server side for execution, so as to form an iterative optimization process.
[0155] Figure 4 Schematic diagram of the risk optimization device provided in the embodiments of this application Figure 2 ;like Figure 4 As shown, this device is used in a quantum computing server on the service side, and includes:
[0156] The receiving module 401 is used to receive the signed quantum computing task sent by the trusted execution environment on the user side;
[0157] The processing module 402 is used to verify the signature of the quantum computing task, and if the verification is successful, to parse the quantum computing task to obtain the parameterized quantum optimization circuit and its corresponding parameters.
[0158] The execution module 403 is used to perform quantum computing and quantum measurement on quantum computing resources based on parameterized quantum optimization circuits, and generate corresponding quantum measurement results.
[0159] The sending module 404 is used to send quantum measurement results to the trusted execution environment on the user side.
[0160] The risk optimization device provided in this application embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0161] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.
[0162] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.
[0163] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0164] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0165] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0166] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0167] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0168] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0169] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0170] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0171] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0172] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0173] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0174] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0175] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A risk optimization method, characterized in that, The method, applied to a trusted execution environment on the user side, includes: The acquired historical asset return data is preprocessed, and a portfolio risk optimization model is built based on the preprocessed data. The portfolio risk optimization model is encoded into a parameterized quantum optimization circuit, and the parameterized quantum optimization circuit is encapsulated, signed, and then sent to the quantum computing server on the server side. Obtain the quantum measurement results sent by the quantum computing server; A risk assessment is performed on the quantum measurement results to obtain a portfolio candidate weight vector and the corresponding risk and return values of the portfolio candidate weight vector; Based on the classical optimization algorithm and the quantum measurement results, a classical benchmark weight vector and the risk benchmark value corresponding to the classical benchmark weight vector are generated. The reliability of the portfolio candidate weight vector is verified based on the relationship between the risk value corresponding to the portfolio candidate weight vector and the risk benchmark value.
2. The method according to claim 1, characterized in that, The process of preprocessing the acquired historical asset return data and constructing a portfolio risk optimization model based on the preprocessed data includes: Statistical analysis was performed on the historical return data of the assets to calculate the expected return vector and covariance matrix; Based on the expected return vector and covariance matrix, a portfolio risk optimization model is constructed with the goal of minimizing portfolio risk and constrained by expected return and budget.
3. The method according to claim 1, characterized in that, The step of encoding the portfolio risk optimization model into a parameterized quantum optimization circuit, and then encapsulating and signing the parameterized quantum optimization circuit before sending it to the quantum computing server on the server side includes: The portfolio risk optimization model is mapped to a quantum optimization problem; Based on the aforementioned quantum optimization problem, a parameterized quantum-optimized circuit for quantum computing is generated; The parameterized quantum optimization circuit and its corresponding parameters are encapsulated, and the encapsulated quantum computing task is signed using a key in a trusted execution environment. The signed quantum computing task is sent to the quantum computing server on the server side via an encrypted channel.
4. The method according to claim 1 or 2, characterized in that, The step of performing a risk assessment on the quantum measurement results to obtain a portfolio candidate weight vector and the corresponding risk and return values for the portfolio candidate weight vector includes: Error mitigation processing is performed on the quantum measurement results to obtain the corrected quantum measurement distribution; The portfolio candidate weight vector is obtained by decoding the corrected quantum measurement distribution. Based on the expected return vector and covariance matrix, calculate the risk and return values corresponding to the candidate weight vector of the investment portfolio.
5. The method according to claim 1 or 2, characterized in that, The process of generating a classical benchmark weight vector and a corresponding risk benchmark value based on the classical optimization algorithm and the quantum measurement results includes: The portfolio risk optimization model is solved using a classical optimization algorithm to obtain the classical benchmark weight vector; The risk benchmark value corresponding to the classical benchmark weight vector is calculated based on the covariance matrix, and the risk benchmark value is used as a reference for the quantum measurement results.
6. The method according to claim 5, characterized in that, The step of verifying the credibility of the portfolio candidate weight vector based on the relationship between the risk value corresponding to the portfolio candidate weight vector and the risk benchmark value includes: Determine whether the return value corresponding to the candidate weight vector of the investment portfolio meets the preset return constraint; If the preset return constraint is met, determine whether the risk value corresponding to the candidate weight vector of the investment portfolio does not exceed the sum of the risk benchmark value and the preset tolerance threshold; If the threshold is not exceeded, the candidate weight vector of the portfolio is determined to have passed the credibility verification, and the portfolio weight result that meets the preset conditions is output.
7. The method according to claim 6, characterized in that, The method further includes: When the candidate weight vector of the portfolio fails the trusted verification, the parameters of the parameterized quantum optimization circuit are updated within the trusted execution environment, and the updated quantum computing task is resent to the quantum computing server on the server side for execution, so as to form an iterative optimization process.
8. A risk optimization method, characterized in that, The method, applied to a quantum computing server on the server side, includes: Receive signed quantum computing tasks sent by the trusted execution environment on the user side; The signature of the quantum computing task is verified, and if the verification is successful, the quantum computing task is parsed to obtain the parameterized quantum optimization circuit and its corresponding parameters; Based on the parameterized quantum optimization circuit, quantum computing is performed on quantum computing resources and quantum measurement is carried out to generate corresponding quantum measurement results. The quantum measurement results are sent to the trusted execution environment on the user side.
9. A risk optimization device, characterized in that, The device is used in a trusted execution environment on the user side, including: The first processing module is used to preprocess the acquired historical return data of assets and build an investment portfolio risk optimization model based on the preprocessed data. The sending module is used to encode the portfolio risk optimization model into a parameterized quantum optimization circuit, and to encapsulate and sign the parameterized quantum optimization circuit before sending it to the quantum computing server on the server side. The acquisition module is used to acquire the quantum measurement results sent by the quantum computing server; The evaluation module is used to perform risk assessment on the quantum measurement results, and obtain the portfolio candidate weight vector and the risk value and return value corresponding to the portfolio candidate weight vector; The second processing module is used to generate a classical benchmark weight vector and a risk benchmark value corresponding to the classical benchmark weight vector based on the classical optimization algorithm and the quantum measurement results. The verification module is used to perform a credibility verification on the candidate weight vector of the investment portfolio based on the relationship between the risk value corresponding to the candidate weight vector of the investment portfolio and the risk benchmark value.
10. A risk optimization device, characterized in that, The device is used in a quantum computing server on the service side, and includes: The receiving module is used to receive the signed quantum computing task sent by the trusted execution environment on the user side; The processing module is used to verify the signature of the quantum computing task, and if the verification is successful, to parse the quantum computing task to obtain the parameterized quantum optimization circuit and its corresponding parameters; An execution module is used to perform quantum computing and quantum measurement on quantum computing resources based on the parameterized quantum optimization circuit, and generate corresponding quantum measurement results. A sending module is used to send the quantum measurement results to the trusted execution environment on the user side.