Asset and liability calculation method based on dynamic load balancing and intelligent failover
Through the asset-liability calculation methods of dynamic load balancing and intelligent failover, the problems of high complexity of computing tasks and data loss in the banking system are solved, and high-precision and low-latency data processing in high concurrency environments are achieved.
Patent Information
- Application Number
- CN202510489173.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-04-18
AI Technical Summary
The existing technology has high complexity in the massive data processing of the banking system, and needs to be manually restarted and discarded in the event of failure, resulting in the problem of lower execution efficiency and calculation accuracy. Especially in high-frequency trading and risk assessment scenarios, there is a lack of breakpoint calculation mechanism and insufficient dynamic data flow processing capabilities.
The asset-liability calculation method based on dynamic load balancing and intelligent failover is adopted. Heterogeneous data sources are converted into standardized files through the unified data access layer, sharded folders are dynamically generated, and the computing task status is monitored in real time. The failure overflow mechanism is used to migrate abnormal tasks to idle processes, and the computing tasks are performed in combination with the core computing engine to ensure that data is not lost and the calculation results are accurate.
It realizes high accuracy and low latency of data processing in high concurrency scenarios, avoids the problems of low computing efficiency and slow failure recovery, and ensures the business continuity and calculation accuracy of the banking system.
Smart Images

Figure CN120295736A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer processing, and particularly to an asset-liability calculation method based on dynamic load balancing and intelligent failover. Background Art
[0002] In the scenario of massive data processing in the banking system, the diversification and volume of data have a great impact on the efficiency of computing tasks. The existing technical solutions process data in a preset sequential manner, evenly distribute computing tasks to fixed nodes, execute each piece of data according to the node order until all data is processed, and discard unfinished tasks when a node fails to simplify the processing flow. However, this solution results in high computing task complexity and requires manual restart and discarding of intermediate results in case of failures, thereby reducing the execution efficiency and computing accuracy.
[0003] In scenarios such as high-frequency trading and risk assessment in the banking system, the characteristics of multi-source heterogeneous and continuously increasing volume of data dimensions pose extremely high requirements for the real-time performance and accuracy of computing tasks. However, limited by the limitations of traditional distributed architectures, the existing technologies generally face the dual challenges of computing efficiency and result reliability when processing dynamic data streams. Currently, the mainstream solutions usually adopt a rigid task allocation mechanism. First, the computing tasks are linearly disassembled into serial queues according to preset static rules, and then each subtask is evenly distributed to a fixed number of computing nodes. When a node crashes or a network anomaly occurs, the system directly discards the unfinished computing tasks of that node to maintain basic operation by simplifying the fault tolerance logic.
[0004] However, in the actual execution process, the computing complexity increases exponentially due to task allocation, and the processing work of each computing task intensifies. Secondly, when a task fails, manual intervention is required to re-execute the entire task chain, and there is a lack of a breakpoint resumption mechanism. The abnormal interruption causes all intermediate results to be lost, seriously restricting the computing accuracy and the ability to guarantee business continuity. Summary of the Invention
[0005] In view of the above technical problems, the technical solution adopted by the present invention is an asset-liability calculation method based on dynamic load balancing and intelligent failover, including the following steps:
[0006] S01. Convert heterogeneous data sources from different databases into standardized source files with a unified encoding through a unified data access layer, and store them in a shared storage cluster, and each of the standardized source files is attached with identification information of the data source, format version, and generation timestamp;
[0007] S02. Analyze the system configuration parameters, including the number of parallel computing units dirNum and the single-file storage threshold fileMemory. Calculate the number of shards according to the formula N = ceil(total source file size / (dirNum × fileMemory)). Dynamically generate dirNum physical folders in the shared storage cluster, and create shard files in each physical folder, where the size of each shard file does not exceed the fileMemory threshold;
[0008] S03. Real-time monitor the status code of the physical folder and whether the number of shard files in each physical folder exceeds the threshold. When the processing time of the physical folder exceeds the threshold, trigger the failover mechanism, migrate the abnormal task to an idle process, clean up the intermediate results of the unfinished files and retain the completed files;
[0009] S04. Bind a process according to the calculation type of the physical folder, and call the core computing engine to execute cash flow calculation or simulate future calculation to generate atomized update files and folder status codes;
[0010] S05. Verify whether all the atomized update files and folder status codes are 1, and check the matching of the input and output file quantities. If the verification passes, execute step S06; otherwise, return to step S03;
[0011] S06. Append a globally unique timestamp and version number to the verified calculation results, and store them in a distributed database or file system.
[0012] Preferably, in step S01, the standardized source file converted to a unified encoding through the unified data access layer is based on containerized encapsulation technology to handle the syntax differences of heterogeneous data sources and generate a source file with a unified encoding;
[0013] The identification information includes the data source, format version, and generated timestamp, and the source file is stored in a shared storage cluster, and the shared storage cluster is built based on a distributed file system.
[0014] Preferably, in step S02, the naming format of the physical folder is CAL_[folder number]_[date (yyyyMMdd)]_[time (hhmmss)]_[server number]_[process number]_[calculation type (1 or 2)]_[status code (0 or 1)], where the calculation type 1 is cash flow calculation, the calculation type 2 is simulate future calculation, the status code 0 indicates unfinished, and the status code 1 indicates completed;
[0015] The naming format of the sharded files is CAL_[folder number]_[file number]_[INPUT / OUTPUT]_[status code (0 or 1)].txt;
[0016] And the input files and output files within the same physical folder are associated by the file number.
[0017] Preferably, the process number is dynamically allocated based on the number of server CPU cores, with an initial value of 1 and dynamically adjustable. When a failover is triggered, the server number and process number identifier of the abnormal folder are modified, and the status code of the unfinished input files is reset to 0, and reprocessed by the idle process.
[0018] Preferably, the failover mechanism in step S03 includes:
[0019] S031. Scan the available process resource pool and allocate abnormal tasks to idle processes;
[0020] S032. Retain the output files with a status code of 1 and delete the intermediate results of the output files with a status code of 0;
[0021] S033. Update the server number, process number, and status code of the folder through an atomic operation;
[0022] Among them, the scanning of the available process resource pool includes: periodically polling the number of server CPU cores and dynamically generating a list of available processes according to the number of idle cores;
[0023] The atomic operation is to update the server number, process number, and status code of the folder through a distributed lock mechanism to ensure that only one process modifies the folder status at the same time.
[0024] Preferably, the calling of the core computing engine to perform cash flow calculation or simulate future calculation in step S04 includes:
[0025] S41. For cash flow calculation, by parsing the existing data in the input file and calling the interface to generate the principal, interest, and accrued cash flow for each piece of data;
[0026] S42. For simulating future calculation, generate incremental data through a prediction model and output the expected data results;
[0027] The atomic update includes: immediately updating the status code of a single file to 1 after the calculation is completed, and when the status codes of all files in the folder are 1, updating the status code of the folder to 1;
[0028] The prediction model is an LSTM neural network model based on time series, and the historical data in the input file is used as the training set to output the prediction results of the principal, interest, and accrued cash flow for the next 3 years.
[0029] Preferably, the threshold value in step S03 is the maximum allowable processing duration.
[0030] The present invention has at least the following beneficial effects:
[0031] 1. By establishing a shared storage cluster, data standardization and unified processing are realized, and the intelligent sharding algorithm is executed to split the source file into multiple data files with approximately equal sizes, achieving dynamic load balancing;
[0032] 2. Through a dual monitoring mechanism, it is judged whether the computing task exceeds the maximum allowable processing duration to achieve intelligent failover, avoiding the problems of low current execution efficiency, slow fault recovery, and low multi-data source collaboration efficiency, and ensuring that the bank system meets the high-precision and low-latency requirements simultaneously in high-concurrency scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0034] Figure 1 It is a flowchart of an asset-liability calculation method based on dynamic load balancing and intelligent failover provided by Embodiment 1 of the present invention;
[0035] Figure 2 It is a flowchart of massive data calculation provided by Embodiment 1 of the present invention;
[0036] Figure 3 It is a process diagram of dynamic load balancing calculation provided by Embodiment 1 of the present invention;
[0037] Figure 4 It is a process diagram of monitoring the status of a computing task and implementing failover provided by Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0039] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of the present invention are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0040] Embodiment 1
[0041] This embodiment provides an asset-liability calculation method based on dynamic load balancing and intelligent failover. The method includes the following steps, as Figure 1 shown:
[0042] S01. Convert heterogeneous data sources of different databases into standardized source files with a unified encoding through a unified data access layer, and store them in a shared storage cluster. Each standardized source file is attached with identification information such as data source, format version, and generation timestamp;
[0043] Specifically, as Figure 2 shown, the above-mentioned standardized source files converted into a unified encoding through the unified data access layer are based on containerized encapsulation technology to process the syntax differences of heterogeneous data sources and generate source files with a unified encoding;
[0044] The identification information includes data source, format version, and generation timestamp, and the source files are stored in the shared storage cluster. The shared storage cluster is built based on a distributed file system.
[0045] In the above embodiment, multi-source data standardization transfer and storage are realized, and a shared storage cluster is established. Heterogeneous data sources (databases) are converted into a standardized file format through a unified data access layer. Containerized encapsulation technology is used to process data with different syntax structures to generate source files with a unified encoding, and a source data marking mechanism is implemented. Each source file is attached with identification information such as data source, format version, and generation timestamp. Thereby, the difficulty of data governance is reduced, data standardization is ensured, and the processing efficiency is also improved.
[0046] It should be noted that the above-mentioned multi-source data is a large amount of data of different business types in different databases, which includes:
[0047] 1. Different banks use different databases;
[0048] 2. The data within the bank is aggregated from different systems, with different data sources.
[0049] S02. Analyze system configuration parameters, including the number of parallel computing units dirNum and the single - file storage threshold fileMemory. Calculate the number of shards according to the formula N = ceil(total source file size / (dirNum × fileMemory)), dynamically generate dirNum physical folders in the shared storage cluster, and create shard files within each physical folder, where the size of each shard file does not exceed the fileMemory threshold.
[0050] In the above - mentioned embodiments, combined with Figure 3 As shown, if the source file size is 1024MB, the configuration file dirNum is 16, and fileMemory is 4 (MB), then the system will generate 16 folders in the shared storage. There are 16 files in each folder, and the file size is approximately 4MB. Through this dynamic load - balancing algorithm, the magnitude of each process is roughly evenly divided.
[0051] Among them, in order to ensure the orderly progress of computing tasks and the execution of the fault - transfer mechanism, there are strict specifications for the naming of folders and files.
[0052] The naming format of the above - mentioned physical folder is CAL_[folder number]_[date (yyyyMMdd)]_[time (hhmmss)]_[server number]_[process number]_[computing type (1 or 2)]_[status code (0 or 1)]. Among them, computing type 1 is cash - flow calculation, computing type 2 is simulated future calculation, status code 0 indicates unfinished, and status code 1 indicates completed; for example, CAL_001_20250319_201720_SERVICE01_1_1_0.
[0053] The naming format of the shard file is CAL_[folder number]_[file number]_[INPUT / OUTPUT]_[status code (0 or 1)].txt; for example, CAL_001_001_INPUT_0.txt.
[0054] It should be noted that the input file and the output file within the same physical folder are associated by the file number.
[0055] S03. Real - time monitor whether the status code of the physical folder and the number of shard files in each physical folder exceed the threshold. When the processing time of the physical folder exceeds the threshold, trigger the fault - transfer mechanism, migrate the abnormal task to an idle process, clean up the intermediate results of the unfinished files and retain the completed files.
[0056] Specifically, the process number is dynamically allocated based on the number of server CPU cores, with an initial value of 1 and being dynamically adjustable. When a failover is triggered, the server number and process number identifier of the abnormal folder are modified, and the status code of the unfinished input file is reset to 0, which is then reprocessed by an idle process.
[0057] Furthermore, the above failover mechanism includes:
[0058] S031. Scan the available process resource pool and allocate abnormal tasks to idle processes;
[0059] S032. Retain the output files with a status code of 1 and delete the intermediate results of the output files with a status code of 0;
[0060] S033. Update the server number, process number, and status code of the folder through an atomic operation.
[0061] Among them, scanning the available process resource pool includes: periodically polling the number of server CPU cores and dynamically generating a list of available processes based on the number of idle cores.
[0062] The atomic operation is to update the server number, process number, and status code of the folder through a distributed lock mechanism to ensure that only one process modifies the folder status at the same time.
[0063] In the above embodiments, when monitoring the execution status of the calculation task by judging the file-level status code and the folder-level timeout threshold, it includes the following two aspects:
[0064] On the one hand, the execution status of the file is reflected by monitoring the file-level status code: 0 (unfinished) / 1 (completed);
[0065] On the other hand, the execution status of the calculation task is reflected by the folder-level timeout threshold: execTime (maximum allowed processing duration).
[0066] And the above fault detection strategy is that when the processing time of a certain folder > execTime, an abnormal diagnosis process is triggered and intelligent failover is executed.
[0067] Among them, when the processing time of the monitored folder exceeds the threshold, it means that a process has a fault, or is in a frozen state, or has a memory overflow, or has an unpredictable error. In the current situation, it is necessary to switch the process to execute the calculation task. The system scans the available process resource pool to find an idle process, hands over the abnormal calculation task to this process for processing, modifies the [server number]_[process number] identifier of the faulty folder, clears the intermediate results of the unfinished files (status code = 0), and at the same time retains the processing results of the completed files (status code = 1). Re-execute the calculation task of the unfinished files, and finally achieve failover, and ensure that the data is neither lost nor redundant.
[0068] And the prerequisite for performing the failover in this embodiment is to monitor the file-level status code and the folder-level timeout threshold, judge the execution situation of the computing task, and monitor whether there is a process in the idle state; after the failover, it is necessary to update the naming of the computing task, and at the same time clean up the unfinished files and retain the completed files. See Figure 4 , the basic idea of the failover is that when the computing task exceeds the maximum allowed processing duration, it is determined as abnormal, and the abnormal computing task is handed over to other processes for reprocessing.
[0069] S04. Bind processes according to the calculation type of the physical folder, and call the core calculation engine to perform cash flow calculation or simulate future calculation to generate atomized update files and folder status codes;
[0070] Specifically, calling the core calculation engine to perform cash flow calculation or simulate future calculation includes:
[0071] S41. The cash flow calculation parses the existing data in the input file and calls the interface to generate the principal, interest, and accrued cash flow of each piece of data;
[0072] S42. The simulation of future calculation generates incremental data through the prediction model and outputs the expected data results;
[0073] The atomized update includes: immediately updating the status code of a single file to 1 after the single-file calculation is completed, and when the status codes of all files in the folder are 1, updating the folder status code to 1;
[0074] The prediction model is an LSTM neural network model based on time series. The historical data in the input file is used as the training set, and the prediction results of the principal, interest, and accrued cash flow for the next 3 years are output.
[0075] For the above-mentioned cash flow calculation and simulation of future calculation, a multi-process parallel calculation framework is constructed, and different paths are taken according to the calculation type of the folder (1: cash flow calculation; 2: simulation of future calculation), where:
[0076] The cash flow calculation is to parse each piece of existing data in the calculation file and perform engine splitting to obtain the cash flow results;
[0077] The simulation of future calculation is to generate incremental data through the prediction of the future to obtain the expected data results;
[0078] The calculation task binds an exclusive calculation folder to each process through [process number], loads the INPUT file into the memory buffer for calculation, calls the core calculation engine, and the engine passes the data information (data) into the calculation interface SunyardOcf.evaluateOcf(data). The corresponding principal and interest cash flows are generated through financial algorithms for different businesses. For example, when the data of a 20-year floating-rate equal principal and interest loan is passed into the engine, 240 corresponding principal and interest cash flows for the corresponding period will be generated. These cash flows are stored in the corresponding OUTPUT result file. After the calculation is completed, atomic state updates are implemented, including file level and folder level. The status code is immediately updated after the file completes the calculation, and the folder status code is updated when all files are calculated. When the folder status code is 1 (completed), it represents that the process calculation task is completed.
[0079] S05. Verify whether the status codes of all atomically updated files and folders are 1, and check the matching of the input and output file quantities. If the verification passes, execute step S06; otherwise, return to step S03.
[0080] The verification is to check the matching of the INPUT / OUTPUT file quantities to check the file integrity. In the above embodiment, in an environment with multiple data sources, only the syntax of the exported files and imported persistence needs to be considered, and the rest is processed by the files, improving the collaboration efficiency; and in a high-concurrency environment, a dynamic load balancing algorithm is adopted to make each process work as much as possible and process approximately equal amounts of data, improving the execution efficiency; on the one hand, a monitoring mechanism is established. In case of a failure, there is a stable failover algorithm to prevent data loss and improve the calculation accuracy, ultimately ensuring that the system meets the high-precision and low-latency requirements in a high-concurrency scenario.
[0081] S06. Append a globally unique timestamp and version number to the verified calculation results and store them in a distributed database or file system.
[0082] In summary, in Embodiment 1, by establishing a shared storage cluster, data standardization and unified processing are achieved. The intelligent sharding algorithm is executed to split the source file into multiple data files of approximately equal size, realizing dynamic load balancing; through a dual monitoring mechanism, it is judged whether the calculation task exceeds the maximum allowed processing duration to achieve intelligent failover, avoiding the problems of low current execution efficiency, slow fault recovery, and low multi-data-source collaboration efficiency, and ensuring that the banking system meets the high-precision and low-latency requirements in a high-concurrency scenario.
[0083] Embodiment 2
[0084] An embodiment of the present invention provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and the at least one instruction or at least one program segment is loaded and executed by a processor to implement the steps:
[0085] Convert the heterogeneous data sources of different databases into standardized source files with a unified encoding through a unified data access layer, and store them in a shared storage cluster. Each standardized source file is appended with identification information such as the data source, format version, and generation timestamp.
[0086] Parse the system configuration parameters, including the number of parallel computing units dirNum and the single-file storage threshold fileMemory. Calculate the number of shards according to the formula N = ceil(total source file size / (dirNum × fileMemory)). Dynamically generate dirNum physical folders in the shared storage cluster, and create shard files in each physical folder, where the size of each shard file does not exceed the fileMemory threshold.
[0087] Real-time monitor the status code of the physical folder and whether the number of shard files in each physical folder exceeds the threshold. When the processing time of the physical folder exceeds the threshold, trigger the failover mechanism, migrate the abnormal task to an idle process, clean up the intermediate results of the unfinished files and retain the completed files.
[0088] Bind a process according to the calculation type of the physical folder, and call the core computing engine to execute cash flow calculation or simulate future calculation to generate atomized update files and folder status encodings.
[0089] Verify whether all atomized update files and folder status encodings are 1, and check the matching of the input and output file quantities. If the verification passes, execute step S06; otherwise, return to step S03.
[0090] Append a globally unique timestamp and version number to the verified calculation results, and store them in a distributed database or file system.
[0091] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0092] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In practical applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.
[0093] Embodiment III
[0094] An embodiment of the present invention provides an electronic device, including a processor and a memory. At least one instruction or at least one program segment is stored in the memory. The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the steps of:
[0095] Convert heterogeneous data sources from different databases into standardized source files with a unified encoding through a unified data access layer, and store them in a shared storage cluster. Each standardized source file is attached with identification information such as the data source, format version, and generation timestamp.
[0096] Parse the system configuration parameters, including the number of parallel computing units dirNum and the single-file storage threshold fileMemory. Calculate the number of shards according to the formula N = ceil(total source file size / (dirNum × fileMemory)). Dynamically generate dirNum physical folders in the shared storage cluster, and create shard files within each physical folder, where the size of each shard file does not exceed the fileMemory threshold;
[0097] Monitor in real time the status code of the physical folder and whether the number of shard files in each physical folder exceeds the threshold. When the processing time of the physical folder exceeds the threshold, trigger the failover mechanism, migrate the abnormal task to an idle process, clean up the intermediate results of the unfinished files and retain the completed files;
[0098] Bind a process according to the calculation type of the physical folder, and call the core computing engine to execute the cash flow calculation or simulate future calculations to generate atomized update files and folder status codes;
[0099] Verify whether all atomized update files and folder status codes are 1, and check the matching of the input and output file quantities. If the verification passes, execute step S06; otherwise, return to step S03;
[0100] Append a globally unique timestamp and version number to the verified calculation results, and store them in a distributed database or file system.
[0101] The above is only a preferred embodiment of the present invention and does not impose any form of limitation on the present invention. Although the present invention has been disclosed above with the preferred embodiment, it is not intended to limit the present invention. Any person skilled in the art can make some changes or modifications to the equivalent embodiments by using the above-disclosed technical content within the scope of the technical solution of the present invention. However, as long as the content does not depart from the technical solution of the present invention, any simple modifications, equivalent changes and modifications made to the above embodiments according to the technical essence of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. An asset-liability calculation method based on dynamic load balancing and intelligent failover, characterized in that, It includes the following steps: S01. Convert heterogeneous data sources from different databases into standardized source files with a unified encoding through a unified data access layer, store them in a shared storage cluster, and attach identification information of the data source, format version, and generation timestamp to each of the standardized source files; S02. Parse system configuration parameters, including the number of parallel computing units dirNum and the single-file storage threshold fileMemory, calculate the number of shards according to the formula N = ceil(total source file size / (dirNum × fileMemory)), dynamically generate dirNum physical folders in the shared storage cluster, and create shard files in each of the physical folders, where the size of each shard file does not exceed the fileMemory threshold; S03. Real-time monitor the status code of the physical folders and whether the number of shard files in each physical folder exceeds the threshold. When the processing time of a physical folder exceeds the threshold, trigger a failover mechanism, migrate the abnormal task to an idle process, clean up the intermediate results of unfinished files, and retain the completed files; S04. Bind a process according to the calculation type of the physical folder, and call the core computing engine to perform cash flow calculation or simulate future calculation to generate atomized update files and folder status encodings; S05. Verify whether all the atomized update files and folder status encodings are 1, and check the matching of the input and output file quantities. If the verification passes, execute step S06; otherwise, return to step S03; S06. Attach a globally unique timestamp and version number to the verified calculation results, and store them in a distributed database or file system.
2. The method for calculating assets and liabilities based on dynamic load balancing and intelligent failover according to claim 1, wherein In step S01, the standardized source files converted into a unified encoding through the unified data access layer are based on containerized encapsulation technology to handle the syntax differences of heterogeneous data sources and generate source files with a unified encoding; The identification information includes the data source, format version, and generation timestamp, and the source files are stored in the shared storage cluster, and the shared storage cluster is built based on a distributed file system.
3. The method for calculating assets and liabilities based on dynamic load balancing and intelligent failover according to claim 1, wherein In step S02, the naming format of the physical folder is CAL_[folder number]_[date (yyyyMMdd)]_[time (hhmmss)]_[server number]_[process number]_[calculation type (1 or 2)]_[status code (0 or 1)], where the calculation type 1 is cash flow calculation, the calculation type 2 is simulate future calculation, the status code 0 indicates unfinished, and the status code 1 indicates completed; The naming format of the shard file is CAL_[folder number]_[file number]_[INPUT / OUTPUT]_[status code (0 or 1)].txt; And the input files and output files in the same physical folder are associated by the file number.
4. The method for calculating assets and liabilities based on dynamic load balancing and intelligent failover according to claim 3, characterized in that, The process number is dynamically allocated based on the number of server CPU cores, with an initial value of 1 and being dynamically adjustable. When a failover is triggered, the server number and process number identifier of the abnormal folder are modified, and the status code of the unfinished input file is reset to 0, to be reprocessed by an idle process.
5. The method for calculating assets and liabilities based on dynamic load balancing and intelligent failover according to any one of claims 1 or 4, characterized in that, The failover mechanism in step S03 includes: S031. Scan the available process resource pool and allocate abnormal tasks to idle processes; S032. Retain the output files with a status code of 1 and delete the intermediate results of the output files with a status code of 0; S033. Update the server number, process number, and status code of the folder through an atomic operation; Among them, scanning the available process resource pool includes: periodically polling the number of server CPU cores and dynamically generating a list of available processes according to the number of idle cores; The atomic operation is to update the server number, process number, and status code of the folder through a distributed lock mechanism to ensure that only one process modifies the folder status at the same time.
6. The method for calculating assets and liabilities based on dynamic load balancing and intelligent failover according to claim 1, characterized in that, In step S04, the calling of the core computing engine to perform cash flow calculation or simulate future calculation includes: S41. For cash flow calculation, by parsing the existing data in the input file, call the interface to generate the principal, interest, and accrual cash flow for each piece of data; S42. For simulating future calculation, generate incremental data through a prediction model and output the expected data results; The atomic update includes: immediately updating the status code of a single file to 1 after the calculation of the single file is completed, and when the status codes of all files in the folder are 1, updating the status code of the folder to 1; The prediction model is an LSTM neural network model based on time series, with the historical data in the input file as the training set, and outputting the prediction results of the principal, interest, and accrual cash flow for the next 3 years.
7. The method for calculating assets and liabilities based on dynamic load balancing and intelligent failover according to claim 1, characterized in that, In step S03, the threshold is the maximum allowable processing duration.
8. A non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by a processor to implement the asset-liability calculation method based on dynamic load balancing and intelligent failover as described in any one of claims 1-7.
9. An electronic device, characterized in that, It includes a processor and a memory, and at least one instruction or at least one program segment is stored in the memory, and the at least one instruction or the at least one program segment is loaded and executed by the processor to implement the asset-liability calculation method based on dynamic load balancing and intelligent failover as described in any one of claims 1-7.
Citation Information
Patent Citations
Intelligent management method and system based on server cluster
CN119473803A
Ultrasonic liquid flow controller
US20050288873A1
Loadbalancing multiple files across computing devices
US7631310B1