A scene simulation method and related device based on a Ray cluster framework
By adopting the Ray cluster framework in financial institutions, scenario data is split into independent subtasks for parallel processing, which solves the problem of low computational efficiency in scenario simulation and enables efficient risk assessment and management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XINFENG DIGITAL (BEIJING) TECHNOLOGY CO LTD
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies are inefficient in scenario simulation calculations within financial institutions, making it difficult to meet the application requirements of complex financial markets. In particular, the slow calculation speed affects risk management decisions when simulating a large number of scenarios.
By adopting the Ray cluster framework, the scenario data is split into independent subtasks, and a distributed cluster is established through the Ray cluster framework to dynamically allocate tasks to multiple CPU cores for parallel execution, thereby optimizing the configuration of computing resources.
It improves the computational efficiency of scenario simulation, maximizes the use of CPU resources, shortens simulation time, enables faster and better assessment of financial risks, and supports efficient risk management decisions.
Smart Images

Figure CN122152467A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of scenario simulation technology, and relates to a scenario simulation method and related apparatus based on the Ray cluster framework. Background Technology
[0002] Risk measurement is crucial in finance. In 1938, Macaulay proposed the "duration" measure of risk, an indicator that measures the sensitivity of bond prices to changes in interest rates, quantifying this sensitivity by calculating the weighted average time of bond cash flows. In 1950, Markowitz established a risk measure based on (variance, covariance) volatility. Markowitz's theory laid the foundation for modern portfolio theory; however, the traditional Markowitz optimization system has a series of important flaws, such as its assumption of normal distribution, which is not applicable to many assets with extremely high skewness. In the 1970s, option pricing models, represented by Black-Scholes, further advanced risk modeling techniques. In the 1980s, JP Morgan, considering non-normality and tail risk, invented the VaR,ES framework, which has good risk measurement and summability properties, becoming the modern standard for risk measurement. From the 1970s to the 1990s, sensitivity analysis frameworks emerged. These frameworks are highly scalable and possess good summation properties, such as the Sharpe Ratio for stock products and the Greek letter sensitivity metrics Delta and Gamma for options. Also from the 1970s to the 1990s, scenario simulation analysis frameworks appeared. These frameworks are also highly scalable and can adapt to random scenario testing and specific single-scenario testing, thus directly supporting gap analysis, financial simulation analysis, and stress scenario analysis. In fact, all types of risk can be quantitatively estimated using these three frameworks (distribution-based, sensitivity-based, and scenario simulation-based). However, due to the complexity of the real world, risk measurement frameworks based on distributions or functions cannot fit all phenomena. In such cases, scenario simulation is necessary to simulate tens of thousands of possible scenarios. Therefore, scenario simulation has the strongest universality and can adapt to various risk types. The risk measurement frameworks of actual financial institutions must include scenario simulation frameworks, but the disadvantages of scenario simulation are high complexity and slow computation speed.
[0003] On the other hand, cluster computing is the foundation of modern computing. Almost all large-scale computing projects utilize cluster computing to process multiple tasks in parallel, maximizing the utilization of computing resources. Generally, cluster computing divides complex computing tasks into a series of subtasks and assigns these tasks to different processors, allowing multiple processors to work simultaneously and achieving a leap in computing efficiency. Python offers a rich set of frameworks for cluster computing, with commonly used ones including Spark, Ray, and Dask. Spark is a relatively old and mature cluster acceleration framework, initiated by AMPLab at UC Berkeley, and is suitable for big data operations. Ray is a newer, simplified distributed computing framework, suitable for intensive workloads and with a wider range of applications. Dask is a pure Python framework that provides specialized acceleration for Pandas and NumPy computations. Research indicates that Ray is the fastest and best-performing multi-core package because it employs advanced mechanisms such as hybrid scheduling strategies and GCS management during its construction. These innovative design ideas give Ray its superior completeness and sophistication.
[0004] In current technological architectures, few financial institutions combine scenario simulation with clustered computing. Using traditional Excel-based calculations, most financial institutions, such as insurance companies, typically spend a significant amount of time simulating a single scenario for regulatory reporting and daily risk management. Even some insurance companies using more advanced procedural simulations often rely on for loops because the number of scenarios for regulatory reporting is limited. However, regulatory requirements generally involve only a few extreme scenarios, which are usually insufficient for the daily risk management needs of insurance companies. Therefore, based on actual business operations, it is inevitable to introduce tens of thousands of scenarios to simulate the company's daily operations, which places higher demands on computational efficiency.
[0005] In conclusion, with increasingly complex financial markets and ever-improving regulatory requirements, the number of scenarios that need to be simulated is also increasing. Using traditional technologies makes scenario simulation computationally inefficient, and simulating multiple scenarios usually takes several weeks, which is not conducive to the management decisions of financial institutions and thus causes unnecessary risks. Summary of the Invention
[0006] The purpose of this invention is to provide a scenario simulation method and related apparatus based on the Ray cluster framework to solve the technical problem that the existing technology has low computational efficiency and is difficult to meet the application requirements of complex financial markets.
[0007] To achieve the above objectives, the present invention employs the following technical solution: In a first aspect, the present invention provides a scenario simulation method based on the Ray cluster framework, comprising the following steps: Acquire the scenario data to be simulated, and preprocess the scenario data; Scenario numbers are assigned to the preprocessed scenario data, and each scenario is defined as an independent subtask, with each subtask corresponding to a scenario number, thus obtaining a set of subtasks; Based on the set of subtasks, estimate the total amount of computing resources required to execute all subtasks, configure the server according to the total amount of computing resources, and establish a distributed cluster through the Ray cluster framework; Use Ray to assign simulation tasks to a distributed cluster and execute them to obtain simulation results.
[0008] Furthermore, the preprocessing process specifically includes: reading the scenario data, cleaning, denoising, and filling missing values in the scenario data, and finally storing the scenario data in the form of a NumPy array.
[0009] Furthermore, the step of assigning scenario numbers to the preprocessed scenario data, defining each scenario as an independent subtask, and assigning a scenario number to each subtask to obtain a set of subtasks specifically includes: Construct a scenario matrix, where each row of the scenario matrix represents a scenario, each column represents a time point, and each scenario corresponds to a time path; define scenario numbers based on the group order and intra-group order of the scenarios in the scenario matrix set; Simultaneously, subtasks are created, simulating a scenario as a separate subtask. Each subtask corresponds to a scenario number, resulting in a set of subtasks.
[0010] Furthermore, the steps of estimating the total computing resources required to execute all subtasks based on the set of subtasks, configuring servers according to the total computing resources, and establishing a distributed cluster through the Ray cluster framework specifically include: A predetermined number of subtasks are selected from all subtasks as test samples; Execute each subtask in the test sample on a single test computer and record the CPU utilization rate during the execution of each subtask; calculate the average CPU utilization rate based on the CPU utilization rate of all test samples. Based on the average CPU utilization, the number of CPU cores of the test computer, and the total number of subtasks, calculate the total number of CPU cores required to execute all subtasks. Configure a server cluster based on the calculated total number of CPU cores; within the server cluster, establish a distributed cluster by setting up a master node and several slave nodes using the Ray cluster framework.
[0011] Furthermore, the step of using Ray to allocate simulation tasks to the distributed cluster and executing the steps to obtain simulation results specifically includes: Ray is used to distribute simulation tasks to a distributed cluster, establishing a mapping between scenario IDs and CPU cores; the Ray cluster framework schedules each subtask to idle CPU cores for parallel execution based on the current resource status of the cluster. After all subtasks have been completed, use the ray.get() function to obtain the simulation results.
[0012] Furthermore, the method also includes: Based on the simulation results of all sub-tasks, pre-set risk assessment indicators are calculated to assess financial risks.
[0013] Secondly, the present invention provides a scenario simulation system based on the Ray cluster framework, comprising: The data acquisition module is used to acquire scenario data to be simulated and to preprocess the scenario data. The scenario numbering module is used to set scenario numbers for the preprocessed scenario data, and to define each scenario as an independent subtask, with each subtask corresponding to a scenario number, thus obtaining a set of subtasks; The distributed cluster building module is used to estimate the total amount of computing resources required to execute all subtasks based on the set of subtasks, configure the server according to the total amount of computing resources, and establish a distributed cluster through the Ray cluster framework. The task allocation and execution module is used to allocate simulation tasks to the distributed cluster using Ray and execute them to obtain simulation results.
[0014] Furthermore, the system also includes a risk assessment module, used to calculate preset risk assessment indicators based on the simulation results of all sub-tasks, in order to assess financial risks.
[0015] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the scenario simulation method based on the Ray cluster framework as described above.
[0016] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the scenario simulation method based on the Ray cluster framework described above.
[0017] Compared with the prior art, the present invention has the following beneficial effects: This invention discloses a scenario simulation method and related apparatus based on the Ray cluster framework. By numbering each scenario and defining it as an independent subtask, it achieves fine-grained decomposition of complex simulation tasks, enabling large-scale scenarios to be broken down into computationally granular units with clear boundaries, creating the necessary conditions for parallel processing. Based on this, by estimating the total computing resource requirements and configuring the server cluster accordingly, it is possible to achieve precise supply and efficient utilization of computing resources, avoiding performance bottlenecks caused by insufficient resources or waste caused by excess resources. Finally, by using the Ray cluster framework, massive quantum tasks are dynamically allocated to multiple CPU cores in a distributed cluster for parallel execution, fundamentally changing the traditional serial or simple loop computing mode. This invention enables financial institutions to conduct scenario simulations more efficiently based on massive amounts of scenario data, maximizing the utilization of CPU resources and significantly improving simulation speed compared to traditional technologies. This allows for better and faster assessment of the current risk level and risk tolerance of financial institutions. Simultaneously, this invention can also be applied to the asset and liability management systems of various enterprises or financial institutions, providing higher-quality suggestions for management decisions. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the system of the present invention; Figure 3 This is a schematic diagram of the computer device structure of the present invention. Detailed Implementation
[0020] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0021] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this invention is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.
[0022] See Figure 1This invention discloses a scenario simulation method based on the Ray cluster framework, comprising the following steps: S1, acquire the scenario data to be simulated, and preprocess the scenario data; Acquire scenario data, which can be interest rate scenarios, such as a continuously declining interest rate curve, or scenarios where surrender rates or disease incidence rates are gradually increasing. Use Python's Pandas library to read this scenario data from CSV or XLSX files. Then, use Pandas to clean and preprocess this data, including noise removal and missing value imputation. Finally, store the scenario data as NumPy arrays for easy matrix calculations and processing.
[0023] S2, set scenario numbers for the preprocessed scenario data, and define each scenario as an independent subtask, with each subtask corresponding to a scenario number, to obtain a set of subtasks; Set the scenario ID. Each row of the scenario matrix represents a scenario, and each column represents a time point. Without loss of generality, taking the interest rate scenario (1) as an example, there are M groups of interest rate scenarios, and each group of interest rate scenarios contains N scenarios, with each scenario representing a different interest rate curve. Since scenario simulations are time-dependent, an entire time path is usually treated as a simulation task. The scenario ID can be set as follows:
[0024] Simultaneously, subtasks are created. Simulating a scenario is treated as a separate subtask (ensuring the input parameters for constructing the simulation task are serializable). Taking the interest rate scenario above as an example, a total of... Sub-tasks:
[0025] Each subtask corresponds to a scenario number, resulting in a set of subtasks.
[0026] S3. Based on the set of subtasks, estimate the total amount of computing resources required to execute all subtasks, configure the server according to the total amount of computing resources, and establish a distributed cluster through the Ray cluster framework. Based on the set of subtasks, after obtaining the number of tasks, several scenarios (3 by default) are randomly selected for testing. The CPU resource utilization required for each scenario is calculated on a computer, thereby calculating the average CPU utilization and estimating the number of CPU cores required to simulate all scenarios.
[0027] Specifically, assuming the CPU utilization rates for the three scenarios are as follows: The average CPU utilization rate is:
[0028] Assume the number of computer cores used for testing is The total number of CPU cores required for scenario testing is:
[0029] Then, servers are selected appropriately based on the calculated total number of CPU cores to ensure that the total number of CPU cores across all servers is accurate. Greater than This frees up additional CPU resources for handling the computer's external communications. After configuring the server, use the Ray cluster framework to set up a master node and several slave nodes to establish a distributed cluster. Specifically, ① Start Ray on the master node: Run the following command in the terminal of the master node: ray start --head ② Obtain the address of the master node: Note down the IP address of the master node, xxx; ③ Connect to the master node from the slave nodes: In the terminal of each slave node, run the following command: ray start --address='xxx' ④ Initialize the Ray cluster architecture in the Python environment: importray #Initialize the Ray cluster and start the master node ray.init(address='auto') # Define subtasks @ray.remote defprocess_scenario(scenario): #Conduct a single scenario simulation result=simulate_risk(scenario) returnresult S4 uses Ray to distribute simulation tasks to the distributed cluster and executes them to obtain simulation results.
[0030] To maximize cluster utilization efficiency, this invention employs a CPU resource allocation algorithm. Specifically, Ray is used to allocate simulation tasks to the distributed cluster, establishing a mapping between scenario IDs and CPU cores. Since CPU resources are sufficient, i.e. Use @ray.remote to assign to each subtask With one CPU resource, all scenario simulations can be completed in one round of computation:
[0031] The simulation task can be executed using the following command: [process_scenario.remote(scenario) for scenario in scenarios] After all simulation tasks have been completed, use the `ray.get()` function to retrieve the simulation results. The simulation results are stored as lists or tuples; specifically, one simulation task corresponds to one simulation result.
[0032] S5 calculates preset risk assessment indicators (such as VaR, Value at Risk, etc.) based on the simulation results of all sub-tasks to assess financial risks.
[0033] This invention combines the advantages of Ray cluster parallel computing with scenario simulation, and rationally allocates CPU resources to simulate multiple scenarios, thereby greatly improving computing efficiency and addressing the shortcomings in the field of scenario simulation technology.
[0034] See Figure 2 This invention discloses a scenario simulation system based on the Ray cluster framework, including a data acquisition module, a scenario numbering module, a distributed cluster construction module, and a task allocation and execution module.
[0035] The data acquisition module is used to acquire scenario data to be simulated and preprocess the scenario data. By acquiring comprehensive and accurate scenario data, a solid foundation is provided for subsequent scenario simulation. The preprocessing operation can purify the data, remove noise and invalid information, and unify the data format, making the data more in line with the requirements of the simulation system, thereby improving the accuracy and reliability of the simulation results and avoiding simulation deviations caused by data quality issues.
[0036] The scenario numbering module is used to assign scenario numbers to the preprocessed scenario data and define each scenario as an independent subtask, with each subtask corresponding to a scenario number, resulting in a set of subtasks. The scenario number provides a unique identifier for each subtask, facilitating precise management and tracking of numerous subtasks. Breaking scenario simulation into independent subtasks allows the system to process different scenarios in parallel, fully utilizing computing resources and significantly improving simulation efficiency. This is particularly suitable for simulating large-scale, complex scenarios, enabling the rapid completion of simulation tasks for multiple scenarios.
[0037] The distributed cluster building module estimates the total computing resources required to execute all subtasks based on a set of subtasks, configures servers according to this total computing resource amount, and establishes a distributed cluster using the Ray cluster framework. Accurate estimation of total computing resources and reasonable server configuration ensure that the distributed cluster can meet the computing needs of all subtasks, avoiding resource insufficiency leading to task failure or resource waste. The distributed cluster is built using the Ray cluster framework, which boasts efficient distributed computing capabilities and good scalability, easily handling large-scale subtask processing, further improving the system's computing performance and scalability, enabling the system to adapt to scenario simulation tasks of varying scales and complexities.
[0038] The task allocation and execution module uses Ray to distribute simulation tasks to a distributed cluster and execute them to obtain simulation results. Leveraging Ray's task allocation mechanism, subtasks can be intelligently and efficiently distributed to appropriate servers based on the resource status and load of each server in the distributed cluster, achieving load balancing and improving resource utilization. Simultaneously, Ray's parallel computing capabilities allow multiple subtasks to execute concurrently, significantly shortening the overall simulation time, quickly obtaining simulation results, providing users with timely and effective decision-making support, and enhancing the system's usability and responsiveness.
[0039] In one feasible embodiment of the present invention, the system further includes a risk assessment module, used to calculate preset risk assessment indicators based on the simulation results of all sub-tasks, in order to assess financial risk. It directly outputs key risk quantification results for decision-making reference, such as value-risk indicators, enabling the efficient computing capabilities at the technical level to directly serve the core business objectives of financial risk management, thereby enhancing the overall system's business usability and output value.
[0040] This invention, through the collaborative work of its various modules, forms a complete, efficient, and scalable simulation process, from data acquisition and preprocessing to subtask definition and management, distributed cluster construction, and efficient task allocation and execution. This system can fully utilize distributed computing resources to quickly and accurately complete simulation tasks of large-scale complex scenarios, providing users with comprehensive and reliable simulation results. It has significant advantages in improving simulation efficiency and quality and is suitable for various scenario simulation scenarios with high requirements for real-time performance and accuracy.
[0041] In one embodiment of the invention, see [link to embodiment]. Figure 3A computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions from the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment can be used for the operation of a scenario simulation method based on a Ray cluster framework.
[0042] This invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the scenario simulation method based on the Ray cluster framework in the above embodiments.
[0043] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0044] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0045] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0046] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A scenario simulation method based on the Ray cluster framework, characterized in that, Includes the following steps: Acquire the scenario data to be simulated, and preprocess the scenario data; Scenario numbers are assigned to the preprocessed scenario data, and each scenario is defined as an independent subtask, with each subtask corresponding to a scenario number, thus obtaining a set of subtasks; Based on the set of subtasks, estimate the total amount of computing resources required to execute all subtasks, configure the server according to the total amount of computing resources, and establish a distributed cluster through the Ray cluster framework; Use Ray to assign simulation tasks to a distributed cluster and execute them to obtain simulation results.
2. The scenario simulation method based on the Ray cluster framework according to claim 1, characterized in that, The preprocessing process specifically includes: reading the scenario data, cleaning, denoising, and filling missing values in the scenario data, and finally storing the scenario data in the form of a NumPy array.
3. The scenario simulation method based on the Ray cluster framework according to claim 1, characterized in that, The step of assigning scenario numbers to the preprocessed scenario data and defining each scenario as an independent subtask, with each subtask corresponding to a scenario number, to obtain a set of subtasks, specifically includes: Construct a scenario matrix, where each row of the scenario matrix represents a scenario, each column represents a time point, and each scenario corresponds to a time path; define scenario numbers based on the group order and intra-group order of the scenarios in the scenario matrix set; Simultaneously, subtasks are created, simulating a scenario as a separate subtask. Each subtask corresponds to a scenario number, resulting in a set of subtasks.
4. The scenario simulation method based on the Ray cluster framework according to claim 1, characterized in that, The steps of estimating the total computing resources required to execute all subtasks based on the set of subtasks, configuring servers according to the total computing resources, and establishing a distributed cluster through the Ray cluster framework specifically include: A predetermined number of subtasks are selected from all subtasks as test samples; Execute each subtask in the test sample on a single test computer and record the CPU utilization rate during the execution of each subtask; calculate the average CPU utilization rate based on the CPU utilization rate of all test samples. Based on the average CPU utilization, the number of CPU cores of the test computer, and the total number of subtasks, calculate the total number of CPU cores required to execute all subtasks. Configure a server cluster based on the calculated total number of CPU cores; within the server cluster, establish a distributed cluster by setting up a master node and several slave nodes using the Ray cluster framework.
5. The scenario simulation method based on the Ray cluster framework according to claim 1, characterized in that, The steps of using Ray to allocate simulation tasks to the distributed cluster and executing them to obtain simulation results specifically include: Ray is used to distribute simulation tasks to a distributed cluster, establishing a mapping between scenario IDs and CPU cores; the Ray cluster framework schedules each subtask to idle CPU cores for parallel execution based on the current resource status of the cluster. After all subtasks have been completed, use the ray.get() function to obtain the simulation results.
6. The scenario simulation method based on the Ray cluster framework according to claim 1, characterized in that, Also includes: Based on the simulation results of all sub-tasks, pre-set risk assessment indicators are calculated to assess financial risks.
7. A scenario simulation system based on the Ray cluster framework, characterized in that, include: The data acquisition module is used to acquire scenario data to be simulated and to preprocess the scenario data. The scenario numbering module is used to set scenario numbers for the preprocessed scenario data, and to define each scenario as an independent subtask, with each subtask corresponding to a scenario number, thus obtaining a set of subtasks; The distributed cluster building module is used to estimate the total amount of computing resources required to execute all subtasks based on the set of subtasks, configure the server according to the total amount of computing resources, and establish a distributed cluster through the Ray cluster framework. The task allocation and execution module is used to allocate simulation tasks to the distributed cluster using Ray and execute them to obtain simulation results.
8. A scenario simulation system based on the Ray cluster framework according to claim 7, characterized in that, It also includes a risk assessment module, which calculates preset risk assessment indicators based on the simulation results of all sub-tasks to assess financial risks.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the scenario simulation method based on the Ray cluster framework as described in any one of claims 1-6.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the scenario simulation method based on the Ray cluster framework as described in any one of claims 1-6.