Data processing method, device, equipment and computer storage medium
By implementing multi-threaded processing in parallel and in layers during the bank pricing process, the problems of cumbersome and inefficient yield curve processing operations are solved, and efficient and accurate automated processing is achieved.
Patent Information
- Application Number
- CN202111321669.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-09
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2041-11-09
AI Technical Summary
In the existing technology, the processing of yield curves in the bank pricing process is cumbersome and inefficient, manual calculations are prone to errors, and readjustment is required when the formula is changed.
By obtaining parameter configuration information, multiple processing levels of the curve processing process are determined, and multiple threads are called in parallel to execute the curve processing sub-processes in accordance with the processing order, thus realizing multi-threaded automatic processing.
It improves the efficiency and accuracy of curve processing, simplifies the user operation process, and reduces the risk of errors in manual calculations.
Smart Images

Figure CN114092221B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular relates to a data processing method, device, equipment and computer storage medium. Background Art
[0002] Typically, banks use two types of yield curves for pricing: externally purchased market curves and manually created curves by bankers. However, due to the diversity of business scenarios, these curves require a series of complex processing before they can be used for pricing. Therefore, automated curve processing has become a pressing issue in this process.
[0003] In the existing technology, the curve processing results are mainly calculated manually by business personnel and imported into the system for pricing. However, manually calculating the curve using Excel is prone to errors, and as the parameters change, the calculation formula will also change, resulting in cumbersome operations and low processing efficiency. Summary of the Invention
[0004] The embodiments of the present application provide a data processing method, apparatus, device, and computer storage medium, which can solve the problems of complicated operation and low processing efficiency in curve processing in the prior art.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:
[0006] Obtain parameter configuration information for generating the target curve;
[0007] When it is determined according to the parameter configuration information that the curve processing process is divided into multiple processing levels, the following steps are performed on each processing level in sequence according to the processing order corresponding to the multiple processing levels to obtain the target curve:
[0008] Obtaining source curve information, processing method information, and processing parameter information corresponding to the current processing level from the parameter configuration information;
[0009] Determining, based on the processing mode information, whether there are multiple curve processing sub-processes that are independent of each other in the current processing level;
[0010] When it is determined that multiple independent curve processing sub-processes exist, multiple threads are called to execute the multiple curve processing sub-processes in parallel based on the source curve information, processing method information, and processing parameter information; wherein one thread is used to execute one curve processing sub-process to obtain a result curve, and the result curve is used as the source curve corresponding to the next processing level of the current processing level.
[0011] In an optional implementation, calling multiple threads to execute the multiple curve processing sub-processes in parallel according to the source curve information, processing mode information, and processing parameter information includes:
[0012] For each curve processing sub-process, call an idle thread from the thread pool and perform the following steps:
[0013] According to the source curve information, curve data of a target source curve is acquired; wherein the target source curve is a source curve associated with the current curve processing sub-process;
[0014] Processing the curve data of the target source curve according to the processing method information and the processing parameter information to obtain processing result data;
[0015] The processing result data is fitted to obtain a target result curve.
[0016] In an optional implementation, acquiring curve data of a target source curve according to the source curve information includes:
[0017] exporting the curve data of the target source curve from a curve database according to the source curve information to obtain a first data file;
[0018] Importing the curve data of the target source curve into a memory database through the first data file;
[0019] The curve data of the target source curve is obtained from the memory database.
[0020] In an optional embodiment, after fitting the processing result data to obtain a target result curve, the method further includes:
[0021] Exporting the curve data corresponding to the target result curve from the memory database to obtain a second data file;
[0022] The curve data corresponding to the target result curve is stored in the curve database through the second data file.
[0023] In an optional embodiment, the processing the curve data of the target source curve according to the processing mode information and the processing parameter information to obtain processing result data includes:
[0024] For multiple preset processing logics, determine whether to execute the current processing logic according to the processing mode information in turn;
[0025] In the case of determining to execute the current processing logic, processing the target curve data according to the processing parameter information based on the current processing logic until the multiple processing logics are traversed to obtain processing result data;
[0026] Among them, when the current processing logic is the first processing logic traversed, the target curve data is the curve data of the target source curve; when the current processing logic is other processing logic except the first processing logic traversed, the target curve data is the curve data obtained by processing the previous processing logic of the current processing logic.
[0027] In an optional implementation, obtaining parameter configuration information for generating a target curve includes:
[0028] Scan the task table according to a preset period to determine whether there is a newly added task record in the task table;
[0029] When there is a newly added task record in the task table, the parameter configuration information corresponding to the task record is obtained.
[0030] In an optional embodiment, before scanning the task table according to a preset period to determine whether there is a newly added task record in the task table, the method further includes:
[0031] receiving a first input from a user;
[0032] In response to the first input, acquiring the parameter configuration information input by the user for generating a target curve;
[0033] Add a new task record to the task table according to the parameter configuration information.
[0034] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising an acquisition module and a processing module;
[0035] The acquisition module is used to acquire parameter configuration information for generating a target curve;
[0036] The processing module is configured to, when it is determined according to the parameter configuration information that the curve processing process is divided into multiple processing levels, sequentially perform the following steps on each processing level in accordance with the processing order corresponding to the multiple processing levels to obtain the target curve;
[0037] The processing module includes:
[0038] A first acquisition submodule is configured to acquire source curve information, processing method information, and processing parameter information corresponding to a current processing level from the parameter configuration information;
[0039] A first determining submodule is configured to determine whether there are a plurality of curve processing sub-processes that are independent of each other in the current processing level according to the processing mode information;
[0040] The calling submodule is configured to, upon determining the existence of multiple independent curve processing sub-processes, call multiple threads to execute the multiple curve processing sub-processes in parallel based on the source curve information, processing method information, and processing parameter information; wherein one thread is configured to execute one curve processing sub-process to obtain one result curve, and the result curve is configured to serve as a source curve corresponding to the next processing level of the current processing level.
[0041] In an optional embodiment, the calling submodule includes:
[0042] an acquiring unit, configured to call an idle thread from a thread pool to execute, based on the source curve information, acquiring curve data of a target source curve; wherein the target source curve is a source curve associated with a current curve processing sub-process;
[0043] a processing unit, configured to process the curve data of the target source curve according to the processing mode information and the processing parameter information to obtain processing result data;
[0044] The fitting unit is used to fit the processing result data to obtain a target result curve.
[0045] In an optional implementation, the acquiring unit includes:
[0046] A first export subunit is configured to export the curve data of the target source curve from a curve database according to the source curve information to obtain a first data file;
[0047] an import subunit, configured to import the curve data of the target source curve into a memory database through the first data file;
[0048] The acquisition subunit is used to acquire the curve data of the target source curve from the memory database.
[0049] In an optional embodiment, the device further includes:
[0050] A second export subunit is configured to, after fitting the processing result data to obtain a target result curve, export curve data corresponding to the target result curve from the memory database to obtain a second data file;
[0051] The storage subunit is used to store the curve data corresponding to the target result curve into the curve database through the second data file.
[0052] In an optional embodiment, the processing unit includes:
[0053] a determination subunit, configured to determine, for a plurality of preset processing logics, in sequence according to the processing mode information, whether to execute the current processing logic;
[0054] a processing subunit, configured to, when determining to execute the current processing logic, process the target curve data based on the current processing logic and the processing parameter information until the multiple processing logics are traversed to obtain processing result data;
[0055] Among them, when the current processing logic is the first processing logic traversed, the target curve data is the curve data of the target source curve; when the current processing logic is other processing logic except the first processing logic traversed, the target curve data is the curve data obtained by processing the previous processing logic of the current processing logic.
[0056] In an optional implementation, the acquisition module includes:
[0057] The second determining submodule is configured to scan the task table according to a preset period to determine whether there is a newly added task record in the task table;
[0058] The second acquisition submodule is configured to acquire the parameter configuration information corresponding to a newly added task record when there is a newly added task record in the task table.
[0059] In an optional implementation, the acquisition module further includes:
[0060] A receiving submodule, configured to receive a first input from a user before scanning the task table according to a preset period to determine whether there is a newly added task record in the task table;
[0061] a third acquisition submodule, configured to acquire, in response to the first input, the parameter configuration information input by the user for generating a target curve;
[0062] The adding submodule is used to add a new task record in the task table according to the parameter configuration information.
[0063] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;
[0064] When the processor executes the computer program instructions, the steps of the data processing method described in any one of the embodiments of the first aspect are implemented.
[0065] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the steps of the data processing method as described in any one of the embodiments of the first aspect are implemented.
[0066] The data processing method, apparatus, device, and computer storage medium in the embodiments of the present application determine multiple processing levels of a curve processing process based on parameter configuration information, and perform the following processing on each processing level in sequence according to the processing order corresponding to the multiple processing levels: obtaining source curve information, processing method information, and processing parameter information corresponding to the current processing level from the parameter configuration information; determining multiple independent curve processing sub-processes in the current processing level based on the processing method information; and calling multiple threads to execute the multiple curve processing sub-processes in parallel based on the source curve information, processing method information, and processing parameter information, ultimately obtaining a target curve. In this way, by performing multi-threaded processing on the curve based on the original curve according to different configuration parameters, multi-threaded automatic processing of the curve is achieved, improving the efficiency and accuracy of curve processing and simplifying the user's operation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0068] Figure 1 This is one of the flow charts of the data processing method provided in one embodiment of the present application;
[0069] Figure 2 This is the second flow chart of the data processing method provided in one embodiment of the present application;
[0070] Figure 3 This is a modular schematic diagram of a data processing method provided in one embodiment of the present application;
[0071] Figure 4 This is the third flow chart of the data processing method provided in one embodiment of the present application;
[0072] Figure 5 is a structural diagram of a data processing device provided in one embodiment of the present application;
[0073] Figure 6 It is a structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0074] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present application by illustrating the examples of the present application.
[0075] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of other identical elements in the process, method, article, or device comprising the elements.
[0076] To address the problems of the prior art, embodiments of the present application provide a data processing method, apparatus, device, and computer storage medium. This data processing method can be applied to scenarios involving curve processing, such as processing a yield curve used by banks for pricing to obtain a truly usable pricing curve. The following first introduces the data processing method provided in embodiments of the present application.
[0077] Figure 1 FIG. 1 shows a flow chart of a data processing method provided by an embodiment of the present application. Figure 1 As shown, the data processing method may specifically include the following steps:
[0078] Step 110: Obtain parameter configuration information for generating a target curve.
[0079] In step 120, when it is determined that the curve processing process is divided into multiple processing levels according to the parameter configuration information, the following steps are performed on each processing level in sequence according to the processing order corresponding to the multiple processing levels to obtain the target curve:
[0080] Step 1201: Obtain source curve information, processing method information, and processing parameter information corresponding to the current processing level from parameter configuration information.
[0081] Step 1202 : Determine whether there are multiple curve processing sub-processes that are independent of each other in the current processing level according to the processing mode information.
[0082] Step 1203: If it is determined that multiple independent curve processing sub-processes exist, multiple threads are called to execute the multiple curve processing sub-processes in parallel based on the source curve information, processing method information, and processing parameter information. One thread is used to execute one curve processing sub-process to obtain a result curve, which is used as the source curve corresponding to the next processing level of the current processing level.
[0083] Thus, by determining multiple processing levels of the curve processing process based on parameter configuration information, and following the corresponding processing order of the multiple processing levels, each processing level is processed in sequence as follows: the source curve information, processing method information, and processing parameter information corresponding to the current processing level are obtained from the parameter configuration information; based on the processing method information, multiple independent curve processing sub-processes in the current processing level are determined; and based on the source curve information, processing method information, and processing parameter information, multiple threads are called to execute the multiple curve processing sub-processes in parallel, ultimately obtaining the target curve. In this way, by performing multi-threaded processing on the original curve based on different configuration parameters, multi-threaded automatic processing of the curve is achieved, improving the efficiency and accuracy of curve processing and simplifying the user's operation process.
[0084] The above steps are explained in detail below:
[0085] Regarding step 110, in an embodiment of the present application, the parameter configuration information can be used to generate a target curve, wherein the target curve can be a curve obtained by processing the original curve, and the original curve can be the curve that needs to be processed, which can be one or more curves.
[0086] In a specific scenario, the target curve can be, for example, the pricing curve ultimately used for pricing in the financial industry, and the original curve can be, for example, the original yield curve in the financial industry. Specifically, it can include externally purchased market curves and manually customized curves created by business personnel. Due to the diversity of business scenarios, these original yield curves still require a series of complex processing before they can be truly used for pricing. Therefore, the data processing method provided in the embodiments of this application can be used to process the original yield curves, replacing the traditional process of business personnel manually calculating the processed curves and then importing the results into the system for pricing.
[0087] The parameter configuration information may include the source curve, processing parameters, and processing methods required for curve processing. The specific method of obtaining the parameter configuration information may be to receive information input by the user or to receive information carried in the curve processing instructions sent by other systems.
[0088] In a specific example, after a curve processing task is triggered, the parameter configuration information in the task record is obtained, and operations such as backing up and cleaning up old curve processing results are performed. The original curve is initialized and prepared for processing.
[0089] Based on this, in an optional implementation manner, the above step 110 may specifically include:
[0090] Scan the task table according to the preset period to determine whether there is a newly added task record in the task table;
[0091] When there is a newly added task record in the task table, obtain the parameter configuration information corresponding to the task record.
[0092] In the embodiment of the present application, the preset period can be a period arbitrarily set by the user according to actual needs, for example, it can be 30 seconds, and the task table can be a table for recording multiple curve processing tasks.
[0093] In a specific example, after the user enters a newly added task record in the task table, when the scan every 30 seconds finds that the task record is a newly added task record in the task table, the curve processing task corresponding to the task record is triggered, thereby obtaining the parameter configuration information corresponding to the task record.
[0094] Therefore, by scanning the task table according to the preset cycle, it is possible to determine whether there are newly added task records in the task table. When there are newly added task records in the task table, the parameter configuration information corresponding to the task record is obtained. In this way, the tasks in the task table can be supervised, and the curve processing tasks can be quickly called, thereby improving the efficiency of curve processing.
[0095] Based on this, in an optional implementation manner, before scanning the task table according to a preset period to determine whether there is a newly added task record in the task table, the data processing method may further include:
[0096] receiving a first input from a user;
[0097] In response to the first input, obtaining parameter configuration information input by the user for generating a target curve;
[0098] Add a new task record to the task table based on the parameter configuration information.
[0099] In the embodiment of the present application, the first input may be a user's selection input of parameter configuration information.
[0100] In a specific example, after the user enters parameter configuration information for curve processing on the curve processing interactive interface and clicks the start button, a task record can be inserted into the task table of the curve database. The task record includes parameter configuration information and can be used to generate the target curve.
[0101] Therefore, by obtaining the parameter configuration information input by the user for generating the target curve and adding a new task record in the task table according to the parameter configuration information, the corresponding curve processing task can be called according to the user's selection, thereby improving the user experience.
[0102] Regarding step 120, in an embodiment of the present application, for a complex processing process, the entire processing process can be divided into multiple levels for processing. In the case where the curve processing process is determined to be divided into multiple processing levels according to the parameter configuration information, processing is performed on each processing level in sequence according to the processing order corresponding to the multiple processing levels. Among them, one processing level can correspond to processing a curve at one level, and then the original curve is processed layer by layer starting from the first level, and multiple intermediate curves are generated through each level until the target curve is finally obtained through the last processing level.
[0103] In a specific example, after calling a curve processing task, the parameter configuration information in the task determines that curve m is to be obtained. The curve processing process is divided into two processing levels: the first level: x = a + b; y = c + d, and the second level: m = x + y. Here, x and y are independent curves, and a, b, c, and d are the original curves. Therefore, according to the processing order corresponding to these two processing levels, processing can be started from the first level, and then the second level, to finally obtain the processed curve m.
[0104] Regarding step 1201, in an embodiment of the present application, parameter configuration information may include source curve information, processing method information, and processing parameter information corresponding to each processing level in multiple processing levels. The source curve information may be a code or identification information that uniquely identifies the source curve. The processing method information may include specific processing methods for processing the source curve, such as spread processing, interest rate conversion, and curve deep processing. The processing parameter information may be configuration parameters required for curve processing, such as the weight information of each curve and the unit information required for unit conversion.
[0105] Regarding step 1202, in an embodiment of the present application, the curve processing sub-process may be a plurality of unrelated curve processing processes in the same processing level.
[0106] In a specific example, if the curve processing process of a task is divided into two processing levels, the first level: x = a + b, y = c + d, the second level: m = x + y, where curve x and curve y are independent curves, then x = a + b and y = c + d in the first level are two independent curve processing sub-processes.
[0107] Regarding step 1203, in an embodiment of the present application, multiple threads can execute different curve processing sub-processes in parallel, and the result curve can be a curve obtained after each thread executes the curve processing sub-process.
[0108] In addition, each processing level can process one or more result curves, and each result curve can be used as the source curve corresponding to the next processing level of the current processing level. If the result curve is the curve processed by the last processing level, then the result curve is the target curve.
[0109] In a specific example, when it is determined that x=a+b and y=c+d are two independent curve processing sub-processes, two idle threads are called to execute the two curve processing sub-processes in parallel based on the source curve code, curve processing method and processing parameters to obtain curves x and curve y. Curves x and curve y can be used as source curves corresponding to the next processing level to continue curve processing.
[0110] Thus, by determining multiple processing levels of the curve processing process based on parameter configuration information, and following the processing order corresponding to the multiple processing levels, each processing level is processed in sequence as follows: the source curve information, processing method information, and processing parameter information corresponding to the current processing level are obtained from the parameter configuration information; based on the processing method information, multiple independent curve processing sub-processes in the current processing level are determined; and based on the source curve information, processing method information, and processing parameter information, multiple threads are called to execute the multiple curve processing sub-processes in parallel, ultimately obtaining the target curve. In this way, by performing multi-threaded parallel processing on the original curve based on different configuration parameters, multi-threaded simultaneous curve processing is achieved, improving the efficiency and accuracy of curve processing and simplifying the user's operation process.
[0111] Based on this, in a possible embodiment, as Figure 2 As shown, the above step 1203 may specifically include: for each curve processing sub-process, calling an idle thread from the thread pool and executing steps 12031 to 12033, as shown below:
[0112] Step 12031: Obtain curve data of a target source curve according to the source curve information; wherein the target source curve is a source curve associated with the current curve processing sub-process.
[0113] Here, the thread pool may include multiple callable threads, and idle threads may be threads that have not been called in the thread pool. At each processing level, idle threads in the thread pool may be called to execute each curve processing sub-process. The target source curve may be the curve associated with the current curve processing sub-process, determined based on the source curve information, and the curve data may be data corresponding to the multiple discrete points that constitute the target source curve.
[0114] Based on this, in an optional implementation manner, the above step 12031 may specifically include:
[0115] exporting curve data of the target source curve from a curve database according to the source curve information to obtain a first data file;
[0116] Importing the curve data of the target source curve into the memory database through the first data file;
[0117] Get the curve data of the target source curve from the in-memory database.
[0118] Here, the curve database can be a relational database management system, such as an Oracle database, the first data file can be a curve data file of the target source curve exported from the curve database, and the memory database can be a database that can support the execution of advanced calculation methods based on the Java language, such as an H2 memory database.
[0119] In this way, by exporting the curve data of the target source curve from the curve database according to the source curve information, a first data file is obtained, and the curve data of the target source curve is imported into the memory database through the first data file. The memory database can be used for data caching, and then some complex algorithms can be implemented with Java code to complete the complex processing process of the curve, rather than being limited to simple data processing of the external database.
[0120] Step 12032: Process the curve data of the target source curve according to the processing method information and the processing parameter information to obtain processing result data.
[0121] Here, the processing result data may be curve data obtained after performing spread processing, interest settlement frequency conversion, and curve deep processing on the curve data corresponding to the target source curve.
[0122] Based on this, in an optional implementation manner, the above step 12032 may specifically include:
[0123] For multiple preset processing logics, determine whether to execute the current processing logic according to the processing mode information in turn;
[0124] When it is determined to execute the current processing logic, the target curve data is processed according to the processing parameter information based on the current processing logic until multiple processing logics are traversed to obtain processing result data;
[0125] Among them, when the current processing logic is the first processing logic traversed, the target curve data is the curve data of the target source curve; when the current processing logic is other processing logic except the first processing logic traversed, the target curve data is the curve data obtained by processing the previous processing logic of the current processing logic.
[0126] Here, the multiple processing logics may be all the processing logics preset for curve processing, and the processing mode information may include one or more processing logics selected by the user.
[0127] In a specific example, for the preset processing logics such as spread processing, interest rate conversion, and curve deep processing, the execution of each processing logic is determined in turn based on the processing method information. If the spread processing is determined to be executed based on the processing method information, and the spread processing is the first processing logic traversed, the curve data of the target source curve is processed based on the processing parameter information. If the curve deep processing is determined to be executed based on the processing method information, and the curve deep processing is the second processing logic traversed, since the spread processing is the previous processing logic of the curve deep processing, the curve data obtained after the spread processing can be processed based on the processing parameter information. This process is repeated in this way until all processing logics are traversed and the final processing result data is obtained.
[0128] In this way, by determining whether to execute the current processing logic according to the processing method information in turn, and when determining to execute the current processing logic, processing the target curve data according to the processing parameter information until multiple processing logics are traversed and the processing result data is obtained, the curve can be processed in a targeted manner to improve the efficiency of curve processing.
[0129] Step 12033: Fit the processed result data to obtain the target result curve.
[0130] Here, the target result curve can be obtained by fitting the discrete points corresponding to the processing result data, and the fitting method can specifically be solving high-order fitting coefficients.
[0131] Based on this, in an optional implementation manner, after the above step 12033, the data processing method may further include:
[0132] Exporting the curve data corresponding to the target result curve from the memory database to obtain a second data file;
[0133] The curve data corresponding to the target result curve is stored in the curve database through the second data file.
[0134] Here, the second data file may be a curve data file corresponding to the target result curve derived from the memory database.
[0135] In this way, by exporting the curve data corresponding to the target result curve from the memory database to obtain a second data file, and then storing the curve data corresponding to the target result curve in the curve database through the second data file, the mutual transmission of data between two different types of databases can be realized, and the data can be transferred back to the curve database, which can also avoid the memory database from losing processed data, thereby ensuring data security.
[0136] In addition, if Figure 3 As shown, an embodiment of the present application also provides a curve processing system, which may include a curve factory main program, a curve configuration library, a curve calculation core, etc.
[0137] The main program of the curve factory can include modules such as task monitoring process, data cleaning and backup, obtaining curve processing logic, analyzing curve processing sequence, initializing basic curves, calculating task allocation, curve unloading and loading, etc.
[0138] The curve factory main program interacts with the curve configuration library to obtain the source data required for curve processing and stores the final processing results in the curve configuration library. The curve configuration library can include modules such as the curve factory task table, curve factory configuration table, curve table, curve initialization table, and curve results.
[0139] The Curve Factory main program uses Java multithreading to call up multiple core calculation programs simultaneously. These core calculation programs utilize logic processing modules to implement curve processing, and utilize data loading and unloading modules to implement curve data file unloading and loading functions. They interact with an in-memory database, extracting a portion of curve data for each calculation and storing it in the in-memory database. Java-based algorithms and SQL are used to perform complex logic processing, ultimately generating a data file with the calculation results for the Curve Factory main program to load back into the curve configuration library. The core curve calculation program can include logic processing modules such as moving average, workday delay, natural day delay, spread, derivative, regression, and second-order difference, as well as transfer control modules such as data file loading and unloading.
[0140] Based on the above curve processing system, a specific example is given below to better illustrate the entire solution.
[0141] For example, Figure 4The data processing method flow chart shown in the figure shows that after the curve factory task is triggered, the parameter configuration information required for processing is obtained. The old curve processing results in the in-memory database are then backed up and cleared. The basic curves are then initialized in preparation for processing. Because the curves processed at each layer have dependencies, processing must begin layer by layer, starting from the first layer. After the core computing component's multithreading is activated, each asynchronous thread processes a curve. Once the current layer is fully processed, processing proceeds to the next layer. As each curve is processed, the curve factory main program exports the corresponding data from the Oracle database as a data file. The core computing program then imports these files into the H2 in-memory database. Because some complex algorithms cannot be implemented in SQL, they must be stored in Java objects for calculation. Curve processing logic can vary, such as spread processing, interest rate conversion, and deep curve processing. Each processing logic requires a decision on whether to initiate processing. After all processing logic is completed, the high-order fitting coefficients are calculated. The results are stored in the H2 in-memory database, exported as a data file, and then imported into the Oracle database's result table. When all curve layers are processed, the program exits.
[0142] Based on the same inventive concept, the present application also provides a data processing device, specifically combined with Figure 3 Provide detailed explanation.
[0143] Figure 3 FIG. 3 is a structural diagram of a data processing device 300 according to an exemplary embodiment.
[0144] like Figure 3 As shown, the data processing device 300 may include:
[0145] An acquisition module 301 is used to acquire parameter configuration information for generating a target curve;
[0146] The processing module 302 is configured to, when it is determined according to the parameter configuration information that the curve processing process is divided into multiple processing levels, sequentially execute the following steps for each processing level in accordance with the processing order corresponding to the multiple processing levels to obtain a target curve;
[0147] The processing module 302 includes:
[0148] The first acquisition submodule 3021 is used to acquire source curve information, processing method information and processing parameter information corresponding to the current processing level from the parameter configuration information;
[0149] The first determining submodule 3022 is configured to determine, based on the processing mode information, whether there are multiple independent curve processing subprocesses in the current processing level;
[0150] The calling submodule 3023 is used to call multiple threads to execute the multiple curve processing sub-processes in parallel based on the source curve information, processing method information, and processing parameter information when it is determined that multiple independent curve processing sub-processes exist. Among them, one thread is used to execute one curve processing sub-process to obtain a result curve, which is used as the source curve corresponding to the next processing level of the current processing level.
[0151] The data processing device 300 is described in detail below.
[0152] In some embodiments, the calling submodule 3023 includes:
[0153] An acquisition unit, configured to call an idle thread from a thread pool to execute, based on the source curve information, acquisition of curve data of a target source curve; wherein the target source curve is a source curve associated with the current curve processing sub-process;
[0154] A processing unit, configured to process the curve data of the target source curve according to the processing mode information and the processing parameter information to obtain processing result data;
[0155] The fitting unit is used to fit the processing result data to obtain the target result curve.
[0156] In some embodiments, the acquiring unit includes:
[0157] A first export subunit is used to export curve data of the target source curve from the curve database according to the source curve information to obtain a first data file;
[0158] An import subunit, configured to import the curve data of the target source curve into the memory database through the first data file;
[0159] The acquisition subunit is used to obtain the curve data of the target source curve from the memory database.
[0160] In some embodiments, the data processing device 300 further includes:
[0161] The second export subunit is used for, after fitting the processing result data to obtain the target result curve, exporting the curve data corresponding to the target result curve from the memory database to obtain a second data file;
[0162] The storage subunit is used to store the curve data corresponding to the target result curve into the curve database through the second data file.
[0163] In some embodiments, the processing unit includes:
[0164] A determination subunit, configured to determine whether to execute a current processing logic according to the processing mode information for a plurality of preset processing logics;
[0165] The processing subunit is used to process the target curve data according to the processing parameter information based on the current processing logic when determining to execute the current processing logic, until multiple processing logics are traversed to obtain processing result data;
[0166] Among them, when the current processing logic is the first processing logic traversed, the target curve data is the curve data of the target source curve; when the current processing logic is other processing logic except the first processing logic traversed, the target curve data is the curve data obtained by processing the previous processing logic of the current processing logic.
[0167] In some embodiments, the acquisition module 301 includes:
[0168] The second determining submodule is used to scan the task table according to a preset period to determine whether there is a newly added task record in the task table;
[0169] The second acquisition submodule is used to acquire parameter configuration information corresponding to a task record when there is a newly added task record in the task table.
[0170] In some embodiments, the acquisition module 301 further includes:
[0171] A receiving submodule, configured to receive a first input from a user before scanning the task table according to a preset period to determine whether there is a newly added task record in the task table;
[0172] a third acquisition submodule, configured to acquire, in response to the first input, parameter configuration information input by a user for generating a target curve;
[0173] Add a submodule to add new task records in the task table according to parameter configuration information.
[0174] Thus, by determining multiple processing levels of the curve processing process based on parameter configuration information, and following the corresponding processing order of the multiple processing levels, each processing level is processed in sequence as follows: the source curve information, processing method information, and processing parameter information corresponding to the current processing level are obtained from the parameter configuration information; based on the processing method information, multiple independent curve processing sub-processes in the current processing level are determined; and based on the source curve information, processing method information, and processing parameter information, multiple threads are called to execute the multiple curve processing sub-processes in parallel, ultimately obtaining the target curve. In this way, by performing multi-threaded processing on the original curve based on different configuration parameters, multi-threaded automatic processing of the curve is achieved, improving the efficiency and accuracy of curve processing and simplifying the user's operation process.
[0175] Figure 6 A schematic diagram of the electronic hardware structure provided by an embodiment of the present application is shown.
[0176] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.
[0177] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0178] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 602 may include removable or non-removable (or fixed) media. Where appropriate, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 402 is a non-volatile solid-state memory.
[0179] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present application.
[0180] The processor 601 implements any one of the data processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .
[0181] In some examples, the electronic device may further include a communication interface 603 and a bus 610. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.
[0182] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0183] Bus 610 comprises hardware, software or both, couples the parts of curve processing equipment to each other.For example, and not limitation, bus can comprise accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations.In suitable cases, bus 610 can comprise one or more buses.Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0184] The electronic device can execute the data processing method in the embodiment of the present application, thereby realizing the combination Figure 1 and Figure 3 Described data processing method and device.
[0185] In addition, in conjunction with the data processing methods in the above embodiments, embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the data processing methods in the above embodiments is implemented.
[0186] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0187] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0188] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0189] Aspects of the present application have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed via the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. This processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or the flowchart and the combination of the boxes in the block diagram and / or the flowchart can also be implemented by the dedicated hardware that performs the specified function or action, or can be implemented by the combination of dedicated hardware and computer instructions.
[0190] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.
Claims
1. A data processing method, characterized in that: Applied to a curve processing system, the curve processing system is provided with a curve configuration library, the curve configuration library includes a curve factory task table, a curve factory configuration table, a curve table and a curve result module, the method includes: Obtain parameter configuration information for generating the target curve; When it is determined according to the parameter configuration information that the curve processing process is divided into multiple processing levels, the following steps are performed on each processing level in sequence according to the processing order corresponding to the multiple processing levels to obtain the target curve: Obtaining source curve information, processing method information, and processing parameter information corresponding to the current processing level from the parameter configuration information; Determining, based on the processing mode information, whether there are multiple curve processing sub-processes that are independent of each other in the current processing level; If it is determined that multiple independent curve processing sub-processes exist, calling multiple threads to execute the multiple curve processing sub-processes in parallel based on the source curve information, processing method information, and processing parameter information; wherein one thread is used to execute one curve processing sub-process to obtain a result curve, and the result curve is used as the source curve corresponding to the next processing level of the current processing level; The obtaining of parameter configuration information for generating a target curve includes: receiving a first input from a user on a curve processing interactive interface, the first input including a selection input of the parameter configuration information by the user, the parameter configuration information including source curve information, processing method information, and processing parameter information corresponding to each processing level in a plurality of processing levels; In response to the first input, acquiring the parameter configuration information input by the user for generating a target curve; Add a new task record to the task table according to the parameter configuration information; Scan the task table according to a preset period to determine whether there is a newly added task record in the task table; In the case where there is a newly added task record in the task table, the curve processing task of the task record is triggered, and the parameter configuration information corresponding to the task record is obtained.
2. The method according to claim 1, characterized in that The calling of multiple threads to execute the multiple curve processing sub-processes in parallel according to the source curve information, the processing mode information, and the processing parameter information includes: For each curve processing sub-process, call an idle thread from the thread pool and perform the following steps: According to the source curve information, curve data of a target source curve is acquired; wherein the target source curve is a source curve associated with the current curve processing sub-process; Processing the curve data of the target source curve according to the processing method information and the processing parameter information to obtain processing result data; The processing result data is fitted to obtain a target result curve.
3. The method according to claim 2, characterized in that The step of acquiring curve data of a target source curve according to the source curve information includes: exporting the curve data of the target source curve from a curve database according to the source curve information to obtain a first data file; Importing the curve data of the target source curve into a memory database through the first data file; The curve data of the target source curve is obtained from the memory database.
4. The method according to claim 3, characterized in that After fitting the processing result data to obtain a target result curve, the method further includes: Exporting the curve data corresponding to the target result curve from the memory database to obtain a second data file; The curve data corresponding to the target result curve is stored in the curve database through the second data file.
5. The method according to claim 2, characterized in that The processing of the curve data of the target source curve according to the processing mode information and the processing parameter information to obtain processing result data includes: For multiple preset processing logics, determine whether to execute the current processing logic according to the processing mode information in turn; In the case of determining to execute the current processing logic, processing the target curve data according to the processing parameter information based on the current processing logic until the multiple processing logics are traversed to obtain processing result data; Among them, when the current processing logic is the first processing logic traversed, the target curve data is the curve data of the target source curve; when the current processing logic is other processing logic except the first processing logic traversed, the target curve data is the curve data obtained by processing the previous processing logic of the current processing logic.
6. A data processing device, characterized in that: Applied to a curve processing system, the curve processing system is provided with a curve configuration library, the curve configuration library includes a curve factory task table, a curve factory configuration table, a curve table and a curve result module, and the device includes an acquisition module and a processing module; The acquisition module is used to acquire parameter configuration information for generating a target curve; The processing module is configured to, when it is determined according to the parameter configuration information that the curve processing process is divided into multiple processing levels, sequentially perform the following steps on each processing level in accordance with the processing order corresponding to the multiple processing levels to obtain the target curve; The processing module includes: An acquisition submodule, configured to acquire source curve information, processing method information, and processing parameter information corresponding to the current processing level from the parameter configuration information; a determination submodule, configured to determine whether there are a plurality of curve processing sub-processes that are independent of each other in the current processing level according to the processing mode information; a calling submodule for, upon determining the existence of multiple independent curve processing sub-processes, calling multiple threads to execute the multiple curve processing sub-processes in parallel based on the source curve information, processing method information, and processing parameter information; wherein one thread is used to execute one curve processing sub-process to obtain one result curve, and the result curve is used as a source curve corresponding to the next processing level of the current processing level; The acquisition module is used to: receiving a first input from a user on a curve processing interactive interface, the first input including a selection input of the parameter configuration information by the user, the parameter configuration information including source curve information, processing method information, and processing parameter information corresponding to each processing level in a plurality of processing levels; In response to the first input, acquiring the parameter configuration information input by the user for generating a target curve; Add a new task record to the task table according to the parameter configuration information; Scan the task table according to a preset period to determine whether there is a newly added task record in the task table; In the case where there is a newly added task record in the task table, the curve processing task of the task record is triggered, and the parameter configuration information corresponding to the task record is obtained.
7. An electronic device, characterized in that: The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the steps of the data processing method according to any one of claims 1 to 5 are implemented.
8. A computer storage medium, characterized in that The computer storage medium stores computer program instructions, which, when executed by a processor, implement the steps of the data processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Task processing method and device, storage medium and server
CN111190725A
Business data processing method and device and server
CN112766907A