Asset liability calculation method based on dynamic load balancing and intelligent failover
By employing a dynamic load balancing and intelligent failover method for asset and liability calculation, the problems of high computational complexity and data loss during failures in banking systems have been solved. This method enables high-precision and low-latency calculations in high-concurrency scenarios, thereby improving the processing efficiency and accuracy of banking systems.
Patent Information
- Application Number
- CN202510489173.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-04-18
AI Technical Summary
Existing technologies suffer from high computational complexity in processing massive amounts of data in banking systems. In case of failure, manual restart and discarding of intermediate results are required, leading to reduced execution efficiency and computational accuracy. This is especially true in high-frequency trading and risk assessment scenarios, where there is a lack of breakpoint resume mechanism and insufficient dynamic data stream processing capabilities.
An asset and liability calculation method based on dynamic load balancing and intelligent failover is adopted. Heterogeneous data sources are converted into standardized files through a unified data access layer, sharded folders are dynamically generated, and folder status is monitored in real time. An failover mechanism is used to migrate abnormal tasks to idle processes, and the core computing engine is combined to execute computing tasks, ensuring that data is not lost and improving computing accuracy.
It achieves high-precision and low-latency computing task processing in high-concurrency scenarios, avoiding problems such as low execution efficiency and slow fault recovery, and ensuring the business continuity and computing accuracy of the banking system.
Smart Images

Figure CN120295736B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer processing, in particular to an asset liability calculation method based on dynamic load balancing and intelligent failover. BACKGROUND
[0002] In the massive data processing scene of the bank system, the diversity and magnitude of data have a great influence on the efficiency of computing tasks. The existing technical solution adopts a preset order to process data in series, divides the computing tasks into fixed nodes, executes each piece of data according to the node order until all the data are processed, and discards the unfinished tasks when the node fails to simplify the processing process. However, this solution leads to high complexity of computing tasks and requires manual restart and discarding of intermediate results when there is a failure, thereby reducing the execution efficiency and calculation accuracy.
[0003] In the massive data processing scene of the bank system, the diversity and magnitude of data have a great influence on the efficiency of computing tasks. The existing technical solution adopts a preset order to process data in series, divides the computing tasks into fixed nodes, executes each piece of data according to the node order until all the data are processed, and discards the unfinished tasks when the node fails to simplify the processing process. However, this solution leads to high complexity of computing tasks and requires manual restart and discarding of intermediate results when there is a failure, thereby reducing the execution efficiency and calculation accuracy.
[0004] However, in the actual execution process, the computing complexity increases exponentially due to task allocation, and each computing task processing work is intensified. Secondly, when the task fails, manual intervention is required to re-execute the complete task chain, and there is a lack of breakpoint resume mechanism. The abnormal interruption results in the loss of all intermediate results, which seriously restricts the calculation accuracy and business continuity guarantee capability. SUMMARY
[0005] To solve the above technical problems, the technical solution adopted by the present application is an asset liability calculation method based on dynamic load balancing and intelligent failover, comprising the following steps:
[0006] S01, converting the heterogeneous data sources of different databases into standardized source files with unified coding through a unified data access layer, and storing them in a shared storage cluster, and each standardized source file is attached with identification information of data source, format version and generation timestamp;
[0007] S02, analyze system configuration parameters, including the number of parallel computing units dirNum and single file storage threshold fileMemory, calculate the number of shards according to the formula N = ceil (total source file size / (dirNum x fileMemory)), dynamically generate dirNum physical folders in the shared storage cluster, and create shard files in each physical folder, and the size of each shard file does not exceed the fileMemory threshold;
[0008] S03, real-time monitoring of the state code of the physical folder and whether the number of shard files in each physical folder exceeds the threshold, when the physical folder processing time exceeds the threshold, triggering a failover mechanism to migrate abnormal tasks to an idle process, cleaning up intermediate results of unfinished files and retaining completed files;
[0009] S04, according to the calculation type of the physical folder, bind the process and call the core computing engine to perform cash flow calculation or simulate future calculation to generate atomic update files and folder state codes;
[0010] S05, check whether all the atomic update files and folder state codes are 1, and check the input and output file quantity matching, if the verification is passed, execute step S06, otherwise return to step S03;
[0011] S06, append a globally unique timestamp and version number to the verified calculation result, and store it in a distributed database or file system.
[0012] As preferred, the standardized source file converted into a unified code through the unified data access layer in step S01 is based on container encapsulation technology to process the syntax differences of heterogeneous data sources, and generates a unified coded source file;
[0013] The identification information includes data source, format version and generation timestamp, and the source file is stored in a shared storage cluster, and the shared storage cluster is based on a distributed file system.
[0014] As preferred, the naming format of the physical folder in step S02 is CAL_[folder number]_[date (yyyyMMdd)]_[time (hhmmss)]_[server number]_[process number]_[calculation type (1 or 2)]_[state code (0 or 1)], wherein calculation type 1 is cash flow calculation, calculation type 2 is simulation future calculation, and state code 0 indicates incomplete and state code 1 indicates completed;
[0015] The naming format of the fragment file is CAL_[folder number]_[file number]_[INPUT / OUTPUT]_[status code (0 or 1)].txt.
[0016] The input file and the output file in 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, the initial value is 1 and is dynamically adjustable, when the failover is triggered, the server number and the process number of the abnormal folder are modified, and the status code of the unfinished input file is reset to 0 and reprocessed by the idle process.
[0018] Preferably, the failover mechanism in step S03 comprises:
[0019] S031, scan the available process resource pool, and distribute the abnormal task to the idle process;
[0020] S032, reserve the output file with the status code 1, and delete the intermediate result of the output file with the status code 0;
[0021] S033, update the server number, the process number and the status code of the folder by atomic operation;
[0022] The scanning of the available process resource pool comprises: periodically polling the number of server CPU cores, and dynamically generating the available process list according to the number of idle cores.
[0023] The atomic operation is to update the server number, the process number and the status code of the folder by a distributed lock mechanism, so as to ensure that only one process modifies the folder state at the same time.
[0024] Preferably, the calling of the core calculation engine to perform the cash flow calculation or the simulation future calculation in step S04 comprises:
[0025] S41, the cash flow calculation generates the principal, interest and responsibility cash flow of each data by analyzing the existing data in the input file and calling the interface;
[0026] S42, the simulation future calculation generates the incremental data by a prediction model, and outputs the expected data result;
[0027] The atomic update comprises: immediately updating the status code of the single file to 1 after the calculation is completed, and updating the folder status code to 1 when the status code of all files in the folder is 1.
[0028] The prediction model is a LSTM neural network model based on time series, the historical data in the input file is used as a training set, and the prediction result of the principal, interest and responsibility cash flow in the next 3 years is output.
[0029] Preferably, the threshold in step S03 is the maximum allowed processing duration.
[0030] The present application has at least the following beneficial effects:
[0031] 1. By establishing a shared storage cluster, data standardization and unified processing are realized, intelligent fragmentation algorithm is executed to split the source file into multiple data files of approximately equal size, and dynamic load balancing is realized.
[0032] 2. By a double monitoring mechanism, whether the computing task exceeds the maximum allowed processing duration is judged to realize intelligent failover, avoid the problems of low execution efficiency, slow fault recovery and low efficiency of multi-data source cooperation, and ensure that the bank system meets the high precision and low delay demand under high concurrency scenario. BRIEF DESCRIPTION OF DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0034] Figure 1 A flow chart of an asset liability calculation method based on dynamic load balancing and intelligent failover is provided for the first embodiment of the present application.
[0035] Figure 2 A flow chart of mass data calculation is provided for the first embodiment of the present application.
[0036] Figure 3 A process chart of dynamic load balancing calculation is provided for the first embodiment of the present application.
[0037] Figure 4 A process chart of monitoring computing task state and realizing failover is provided for the first embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, 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 that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0040] Example 1
[0041] This embodiment provides a method for calculating assets and liabilities based on dynamic load balancing and intelligent failover. The method includes the following steps: Figure 1 As shown:
[0042] S01. Transform heterogeneous data sources from different databases into standardized source files with 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 data source, format version, and generation timestamp.
[0043] Specifically, such as Figure 2 As shown, the standardized source files converted into unified encoding through the unified data access layer are based on containerization encapsulation technology to handle the syntax differences of heterogeneous data sources and generate unified encoding source files.
[0044] The identification information includes the data source, format version, and generation timestamp, and the source file is stored in a shared storage cluster, which is built on a distributed file system.
[0045] In the above embodiments, standardized transfer of multi-source data is achieved, and a shared storage cluster is established. Heterogeneous data sources (databases) are converted into standardized file formats through a unified data access layer. Containerization encapsulation technology is used to process data with different syntax structures, generating source files with unified encoding. A source data tagging mechanism is implemented, attaching identification information such as data source, format version, and generation timestamp to each source file. This reduces the difficulty of data governance, ensures data standardization, and also improves processing efficiency.
[0046] It should be noted that the aforementioned multi-source data refers to massive amounts of data from different databases and different business types, including:
[0047] 1. Different banks use different databases;
[0048] 2、Bank internal data is from different systems, the source of the data is different.
[0049] S02, analyze system configuration parameters, including the number of parallel computing units dirNum and single file storage threshold fileMemory, according to the formula N = ceil (total source file size / (dirNum x fileMemory) to calculate the number of fragments, dynamically generate dirNum physical folders in the shared storage cluster, and create fragment files in each physical folder, and the size of each fragment file does not exceed the fileMemory threshold.
[0050] In the above embodiment, in combination with Figure 3 As shown in the figure, 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, each folder has 16 files, and the file size is about 4MB. Through this dynamic load balancing algorithm, the order of magnitude of each process is roughly divided.
[0051] Among them, in order to ensure the orderly progress of the computing task and the execution of the failover mechanism, the naming of the folder and the file has strict specifications.
[0052] The naming format of the above-mentioned physical folder is CAL_[folder number]_[date (yyyyMMdd)]_[time (hhmmss)]_[server number]_[process number]_[calculation type (1 or 2)]_[status code (0 or 1)], wherein, calculation type 1 is cash flow calculation, calculation type 2 is simulation future calculation, status code 0 indicates incomplete, and status code 1 indicates completed; For example, CAL_001_20250319_201720_SERVICE01_1_1_0.
[0053] The naming format of the fragment 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 in the same physical folder are associated through the file number.
[0055] S03, real-time monitoring of the status code of the physical folder and whether the number of fragment files in each physical folder exceeds the threshold value, when the processing time of the physical folder exceeds the threshold value, the failover mechanism is triggered, the abnormal task is migrated to the idle process, the intermediate result of the incomplete file is cleaned up and the completed file is retained;
[0056] Specifically, the process number is dynamically allocated based on the number of server CPU cores, the initial value is 1 and is dynamically adjustable, when the failover is triggered, the server number and process number of the abnormal folder are modified, and the state code of the unfinished input file is reset to 0, which is processed by the idle process.
[0057] Further, the above-mentioned failover mechanism comprises:
[0058] S031, scanning the available process resource pool, and distributing the abnormal task to the idle process;
[0059] S032, retaining the output file with the state code 1, and deleting the intermediate result of the output file with the state code 0;
[0060] S033, updating the server number, process number and state code of the folder through atomic operation.
[0061] Wherein, scanning the available process resource pool comprises: periodically polling the number of server CPU cores, and dynamically generating the available process list according to the number of idle cores.
[0062] The atomic operation is to update the server number, process number and state code of the folder through the distributed lock mechanism, so as to ensure that only one process modifies the folder state at the same time.
[0063] In the above-mentioned embodiment, the file level state code and folder level timeout threshold are monitored to judge the execution of the task, which includes the following two aspects:
[0064] On the one hand, the execution state of the file is reflected by monitoring the file level state code: 0 (unfinished) / 1 (finished);
[0065] On the other hand, the execution state of the computing task is reflected by the folder level timeout threshold: execTime (maximum allowed processing time).
[0066] And the above-mentioned fault detection strategy triggers the abnormal diagnosis process when the processing time of a folder is greater than execTime, and executes intelligent failover.
[0067] Wherein, when the processing time of the folder exceeds the threshold, it means that the process has failed, or is dead, or is out of memory, or is an unpredictable error. In the current situation, the process needs to be switched to execute the computing task, the system scans the available process resource pool to find the idle process, the abnormal computing task is handed over to the process for processing, the [server number]_[process number] identifier of the fault folder is modified, the intermediate result of the unfinished file (state code = 0) is cleaned up, and the processing result of the completed file (state code = 1) is retained. The computing task of the unfinished file is re-executed, and finally the failover is realized, and the data is not lost or redundant.
[0068] And before performing the failover in the present embodiment, it is necessary to monitor the file level state code and folder level timeout threshold, judge the calculation task execution, monitor whether there is a process in idle; after failover, the calculation task naming needs to be updated, and the unfinished files also need to be cleaned up and the completed files need to be reserved. Referring to Figure 4 The basic idea of failover is that when the calculation task exceeds the maximum allowed processing time, it is determined to be abnormal, and the abnormal calculation task is handed over to other processes for reprocessing.
[0069] S04, according to the calculation type of the physical folder, bind the process, and call the core calculation engine to execute cash flow calculation or simulate future calculation to generate atomized update file and folder state code;
[0070] Specifically, calling the core calculation engine to execute cash flow calculation or simulate future calculation includes:
[0071] S41, cash flow calculation generates principal, interest and liability cash flow for each data by analyzing existing data in the input file and calling interfaces;
[0072] S42, the simulation future calculation generates incremental data through the prediction model, and outputs the expected data result;
[0073] Atomic update includes: updating the state code of a single file to 1 immediately after the calculation is completed, and updating the folder state code to 1 when all file state codes in the folder are 1;
[0074] The prediction model is a LSTM neural network model based on time series, and the historical data in the input file is used as the training set, and the prediction results of principal, interest and liability cash flow in the next three years are output.
[0075] The above cash flow calculation and future simulation calculation construct a multi-process parallel computing framework, and different outputs are made according to the calculation type of the folder (1: cash flow calculation; 2: simulate future calculation), wherein:
[0076] Cash flow calculation is to split the engine by analyzing each existing data in the calculation file to get the cash flow result;
[0077] The simulation future calculation is to generate incremental data through the prediction of the future to get the expected data result;
[0078] The computing task binds a dedicated computing folder for each process through [process number], loads the INPUT file into a memory buffer for computing, calls the core computing engine, the engine transmits data information (data) into the computing interface SunyardOcf.evaluateOcf(data), generates corresponding principal and interest cash flows through different financial algorithms, for example, transmits a 20-year floating rate equal principal and interest loan data into the engine, and generates 240 corresponding period principal and interest cash flows. Store these cash flows in the corresponding OUTPUT result file. After the computation is completed, implement atomic state update, including file level and folder level, update the state code immediately after the file completes the computation, and update the folder state code when all files are computed. When the folder state code is 1, it means that the process computing task is completed.
[0079] S05, check whether the atomic update file and folder state code are 1, and check the input / output file quantity matching, if the verification is passed, execute step S06, otherwise return to step S03;
[0080] The verification is to check the INPUT / OUTPUT file quantity matching to check the file integrity. In the above embodiment, in the multi-data source environment, only the export file and import persistence syntax need to be considered, and other files are processed to improve the collaboration efficiency; and in the high concurrency environment, a dynamic load balancing algorithm is adopted, so that each process can work as much as possible and process data approximately equal, improving the execution efficiency; on the one hand, a monitoring mechanism is established, when a fault occurs, a stable failover algorithm is used to ensure that data is not lost, improving the computing accuracy, and finally ensuring that the system meets the high precision and low delay demand at the same time in the high concurrency scenario.
[0081] S06, a globally unique timestamp and version number are added to the verified computing result, and stored in a distributed database or a file system.
[0082] In summary, the first embodiment realizes data standardized unified processing by establishing a shared storage cluster, implements intelligent fragmentation algorithm to split the source file into multiple data files with approximately equal size, realizes dynamic load balancing; through the double monitoring mechanism, it is judged whether the computing task exceeds the maximum allowed processing time, to realize intelligent failover, avoid the problems of low execution efficiency, slow fault recovery and low multi-data source collaboration efficiency, and ensure that the banking system meets the high precision and low delay demand at the same time in the high concurrency scenario.
[0083] Embodiment two
[0084] The embodiment of the present application provides a non-transitory computer readable storage medium, at least one instruction or at least one program is stored in the non-transitory computer readable storage medium, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the steps of:
[0085] The heterogeneous data sources of different databases are converted into unified coding standardized source files through a unified data access layer, and are stored in a shared storage cluster, and each standardized source file is attached with identification information of a data source, a format version and a generation timestamp;
[0086] The system configuration parameters are parsed, including a parallel computing unit number dirNum and a single file storage threshold fileMemory, the number of fragments is calculated according to a formula N = ceil (total size of source files / (dirNum * fileMemory), dirNum physical folders are dynamically generated in the shared storage cluster, and the fragment files are created in each physical folder, and the size of each fragment file does not exceed the fileMemory threshold;
[0087] The state code of the physical folder and whether the number of fragment files of each physical folder exceeds the threshold are monitored in real time, when the physical folder processing time exceeds the threshold, a failover mechanism is triggered, the abnormal task is migrated to an idle process, the intermediate results of unfinished files are cleaned up and completed files are retained;
[0088] According to the computing type of the physical folder, a process is bound, and a core computing engine is called to execute cash flow calculation or simulate future calculation, so that an atomized update file and a folder state code are generated;
[0089] It is verified whether all the atomized update files and the folder state codes are 1, and the number matching of input and output files is checked, if the verification is passed, step S06 is executed, otherwise step S03 is returned;
[0090] A globally unique timestamp and a version number are attached to the verified calculation result, and are stored in a distributed database or a file system.
[0091] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. 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. As an illustration but 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 (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0092] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by 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 above-described functions.
[0093] Embodiment three
[0094] The embodiment of the present application provides an electronic device, including a processor and a memory, at least one instruction or at least one program is stored in the memory, the at least one instruction or the at least one program is loaded and executed by the processor to realize the steps of:
[0095] The heterogeneous data sources of different databases are converted into standardized source files with unified coding through a unified data access layer, and are stored in a shared storage cluster, and each standardized source file is attached with identification information of data source, format version and generation timestamp;
[0096] The system configuration parameters are parsed, including the number of parallel computing units dirNum and the single file storage threshold fileMemory, the number of shards is calculated according to the formula N = ceil (total size of source file / (dirNum x fileMemory)), dirNum physical folders are dynamically generated in the shared storage cluster, and shard files are created in each physical folder, and the size of each shard file does not exceed the fileMemory threshold;
[0097] The status code of the physical folder and whether the number of shard files in each physical folder exceeds the threshold are monitored in real time, when the physical folder processing time exceeds the threshold, the failover mechanism is triggered, the abnormal task is migrated to the idle process, the intermediate results of the unfinished files are cleaned up and the completed files are retained;
[0098] According to the computing type of the physical folder, the process is bound, and the core computing engine is called to perform cash flow calculation or simulate future calculation to generate atomized update files and folder state codes;
[0099] Verify whether all atomized update files and folder state codes are 1, and check the input and output file quantity matching, if the verification is passed, execute step S06, otherwise return to step S03;
[0100] A globally unique timestamp and version number are attached to the verified calculation result, and stored in a distributed database or file system.
[0101] The above is only a preferred embodiment of the present application, and does not limit the present application in any form. Although the present application has been disclosed as above, it is not intended to limit the present application. Any person skilled in the art can make some changes or modifications to the above disclosed technical content without departing from the scope of the present application, and any simple modification, equivalent change and modification of the above embodiments within the scope of the present application are still within the scope of the present application.
Claims
1. A method for calculating assets and liabilities based on dynamic load balancing and intelligent failover, characterized in that, Includes the following steps: S01. The heterogeneous data sources from different databases are converted into standardized source files with unified encoding through a unified data access layer and stored in a shared storage cluster. Each standardized source file is attached with identification information such as data source, format version and generation timestamp. 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 size of source files / (dirNum × fileMemory). Dynamically generate dirNum physical folders in the shared storage cluster, and create shard files in each physical folder. The size of each shard file does not exceed the fileMemory threshold. S03. Monitor the status code of the physical folder and whether the number of fragment files in each physical folder exceeds the threshold in real time. When the processing time of the physical folder exceeds the threshold, trigger the failover mechanism to migrate the abnormal task to the idle process, clean up the intermediate results of the incomplete files and retain the completed files. S04. Bind the 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 atomic update files and folder status codes; S05. Verify that the status code of all atomic update files and folders is 1, and check the matching of the number of input and output files. If the verification is successful, proceed to 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 asset and liability calculation method based on dynamic load balancing and intelligent failover as described in claim 1, characterized in that, The standardized source file that is converted into a unified encoding through the unified data access layer in step S01 is based on containerization encapsulation technology to handle the syntax differences of heterogeneous data sources and generate a unified encoding source file. The identification information includes the data source, format version, and generation timestamp, and the source file is stored in a shared storage cluster, which is built on a distributed file system.
3. The asset and liability calculation method based on dynamic load balancing and intelligent failover according to claim 1, characterized in that, The naming format of the physical folder in step S02 is CAL_[folder number]_[date(yyyyMMdd)]_[time(hhmmss)]_[server number]_[process number]_[calculation type (1 or 2)]_[status code (0 or 1)], where calculation type 1 is cash flow calculation, calculation type 2 is simulated future calculation, status code 0 indicates incomplete, and status code 1 indicates completed; The naming format of the fragmented files is CAL_[folder number]_[file number]_[INPUT / OUTPUT]_[status code (0 or 1)].txt; Furthermore, input and output files within the same physical folder are associated with each other via file number.
4. The asset and liability calculation method based on dynamic load balancing and intelligent failover as described in claim 3, characterized in that, The process number is dynamically assigned based on the number of server CPU cores, with an initial value of 1 and is 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 incomplete input file is reset to 0, so that it can be reprocessed by the idle process.
5. The asset and liability calculation method 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 assign abnormal tasks to idle processes; S032. Keep the output file with status code 1 and delete the intermediate results of the output file with status code 0; S033. Update the server ID, process ID, and status code of the folder using atomic operations; The scanned 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; The atomic operation involves updating the folder's server ID, process ID, and status code using a distributed locking mechanism, ensuring that only one process modifies the folder's status at any given time.
6. The asset and liability calculation method based on dynamic load balancing and intelligent failover according to claim 1, characterized in that, The step S04, which involves calling the core computing engine to perform cash flow calculations or simulate future calculations, includes: S41. Cash flow calculation: By parsing the existing data in the input file, the interface is called to generate the principal, interest, and accrual cash flow for each data item. S42. Simulating future calculations generates incremental data through predictive models and outputs expected data results. The atomic update includes: immediately updating the status code of a single file to 1 after the calculation is completed, and updating the status code of the folder to 1 when the status codes of all files in the folder are 1; The prediction model is a time-series-based LSTM neural network model. Historical data in the input file is used as the training set, and the output is the prediction results of principal, interest and accrual cash flow for the next 3 years.
7. The asset and liability calculation method based on dynamic load balancing and intelligent failover according to claim 1, characterized in that, The threshold mentioned in step S03 is the maximum allowed processing time.
8. A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores 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 the processor to implement the asset and 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, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the asset and 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