Index generation method and apparatus, computer device, and storage medium
By optimizing the generation method of fund portfolio indicators through pagination and streaming computing, the problems of timeliness and flexibility in generating fund portfolio indicators have been solved, enabling fast and flexible indicator calculation and improving user experience and system performance.
Patent Information
- Application Number
- CN202210126444.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-10
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-02-10
AI Technical Summary
Existing technologies suffer from poor timeliness and low flexibility in calculation formulas when generating fund portfolio indicators. In particular, calculations during the user's day require waiting for batch processing at night, and database hardware performance limitations result in slow execution speed.
By acquiring indicator models and data templates, pagination parameters are used to process the data in pages, allowing for the rapid acquisition and input of indicator models to generate indicator results. Furthermore, asynchronous streaming matching and streaming computing nodes optimize the data processing flow, reducing reliance on databases.
It enables rapid calculation of fund of funds indicators, avoids waiting for batch processing at night, improves the timeliness and flexibility of indicator calculation, reduces the burden on the database, and improves the overall business processing speed.
Smart Images

Figure CN114461647B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of big data, and in particular, relates to an index generation method and device, computer equipment, a storage medium, and a computer program product. BACKGROUND
[0002] With the development of asset custody business, the number and types of portfolio funds are increasing, and the amount of related data generated by daily changes is also large.
[0003] Currently, when performing portfolio fund index generation and the like, data is usually entered into a database through a front-end system and merged, deleted, modified, and the like with original portfolio fund data. Due to the characteristics of large data volume of original portfolio fund data and multiple partitions of database tables, new imported portfolio fund data can easily cause other business processing related to original portfolio fund data processing to slow down. Therefore, in the prior art, a batch program is usually executed to match and calculate portfolio fund indexes at night when the number of user requests is small, which is referred to as night batch processing.
[0004] However, when using night batch processing, if a user calculates a group of portfolio fund indexes during the day and wants to see the calculation results, the user can only see the results after the calculation is completed the next night, and the timeliness of portfolio fund index generation is poor. Moreover, the calculation formula of the portfolio fund index is fixed in the program, and the flexibility is low. In addition, a large amount of data SQL statements are required during the execution of the calculation formula, and the existing database is usually a single node. Due to hardware performance reasons, the execution speed is slow.
[0005] Therefore, the current portfolio fund index generation technology has the problem of poor timeliness. SUMMARY
[0006] Therefore, it is necessary to provide an index generation method, device, computer equipment, computer readable storage medium, and computer program product capable of improving timeliness in view of the above technical problems.
[0007] In a first aspect, the present application provides an index generation method, which comprises:
[0008] obtaining an index model of a to-be-counted index and a data template corresponding to the index model;
[0009] According to the data template, obtaining first data associated with the index model; the first data is data recorded in the data template;
[0010] According to a preset paging parameter, the first data is paginated to obtain paginated first data;
[0011] searching for second data after the page corresponding to the first data after the page; the second data after the page is associated with the index model and is not recorded in the data template;
[0012] inputting the first data after the page and the second data after the page into the index model to obtain the index result of the index to be counted.
[0013] In one embodiment, the step of inputting the first data after the page and the second data after the page into the index model to obtain the index result of the index to be counted further comprises:
[0014] determining whether the first data after the page is the data of the last page in the first data;
[0015] If yes, a data processing completion message is generated and sent to a target user to inform the target user to view the index result.
[0016] In one embodiment, the step of determining whether the first data after the page is the data of the last page in the first data comprises:
[0017] obtaining the total amount of data of the first data and the amount of data per page of the first data after the page;
[0018] calculating the quotient and the remainder of the total amount of data divided by the amount of data per page;
[0019] If the remainder is not 0, it is determined whether the quotient meets a preset condition;
[0020] If yes, it is determined that the first data after the page is the data of the last page in the first data.
[0021] In one embodiment, the step of determining whether the quotient meets a preset condition comprises:
[0022] adding 1 to the quotient to obtain the last page identifier of the first data after the page;
[0023] obtaining a real-time page identifier according to the page identifier corresponding to the first data after the page;
[0024] determining whether the real-time page identifier is equal to the last page identifier;
[0025] If yes, it is determined that the quotient meets a preset condition.
[0026] In one embodiment, the step of obtaining the index model of the index to be counted and the data template corresponding to the index model further comprises:
[0027] Obtain the model script, data template, and model identifier of the indicator model;
[0028] Determine whether the model script meets the preset conditions;
[0029] If the conditions are met, then determine whether the model script can be successfully compiled;
[0030] If possible, the model script and the data template are stored accordingly based on the model identifier to obtain the model identifier mapping relationship.
[0031] In one embodiment, obtaining the indicator model of the indicator to be statistically analyzed and the data template corresponding to the indicator model includes:
[0032] Obtain the model identifier of the indicator model;
[0033] Based on the model identifier mapping relationship, the model script of the indicator model is determined through the model identifier;
[0034] The indicator model is obtained by compiling the model script.
[0035] Secondly, this application also provides a method for generating indicators, the method comprising:
[0036] In response to a trigger operation on the indicator model, the data template corresponding to the indicator model is displayed;
[0037] Based on the data template, obtain the first data associated with the indicator model; the first data is the data recorded in the data template.
[0038] The first data is sent to the server, so that the server can paginate the first data according to the preset pagination parameters to obtain the paginated first data. The server then finds the paginated second data corresponding to the paginated first data and inputs the paginated first data and the paginated second data into the indicator model to obtain the indicator result of the indicator to be statistically analyzed. The paginated second data is associated with the indicator model and is not recorded in the data template.
[0039] Thirdly, this application also provides an indicator generation device. The device includes:
[0040] The template acquisition module is used to acquire the indicator model of the indicator to be statistically analyzed and the data template corresponding to the indicator model;
[0041] The first data acquisition module is used to acquire the first data associated with the indicator model according to the data template; the first data is the data recorded in the data template.
[0042] The pagination module is used to paginate the first data according to preset pagination parameters to obtain the paginated first data;
[0043] The second data acquisition module is used to find the second data after pagination that corresponds to the first data after pagination; the second data after pagination is associated with the indicator model and is not recorded in the data template;
[0044] The indicator generation module is used to input the first data after pagination and the second data after pagination into the indicator model to obtain the indicator results of the indicator to be statistically analyzed.
[0045] Fourthly, this application also provides an indicator generation apparatus. The apparatus includes:
[0046] The display module is used to display the data template corresponding to the indicator model in response to the trigger operation of the indicator model.
[0047] The data acquisition module is used to acquire the first data associated with the indicator model according to the data template; the first data is the data recorded in the data template.
[0048] The data sending module is used to send the first data to the server, so that the server can paginate the first data according to preset pagination parameters to obtain the paginated first data, find the paginated second data corresponding to the paginated first data, and input the paginated first data and the paginated second data into the indicator model to obtain the indicator result of the indicator to be statistically analyzed; the paginated second data is the data associated with the indicator model and is not recorded in the data template.
[0049] Fifthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0050] Obtain the indicator model for the indicator to be statistically analyzed and the data template corresponding to the indicator model;
[0051] Based on the data template, obtain the first data associated with the indicator model; the first data is the data recorded in the data template.
[0052] The first data is paginated according to the preset pagination parameters to obtain the paginated first data;
[0053] Find the second data after pagination that corresponds to the first data after pagination; the second data after pagination is associated with the indicator model and is not recorded in the data template;
[0054] The first and second data after pagination are input into the indicator model to obtain the indicator results of the indicator to be statistically analyzed.
[0055] Sixthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0056] Obtain the indicator model for the indicator to be statistically analyzed and the data template corresponding to the indicator model;
[0057] Based on the data template, obtain the first data associated with the indicator model; the first data is the data recorded in the data template.
[0058] The first data is paginated according to the preset pagination parameters to obtain the paginated first data;
[0059] Find the second data after pagination that corresponds to the first data after pagination; the second data after pagination is associated with the indicator model and is not recorded in the data template;
[0060] The first and second data after pagination are input into the indicator model to obtain the indicator results of the indicator to be statistically analyzed.
[0061] Seventhly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0062] Obtain the indicator model for the indicator to be statistically analyzed and the data template corresponding to the indicator model;
[0063] Based on the data template, obtain the first data associated with the indicator model; the first data is the data recorded in the data template.
[0064] The first data is paginated according to the preset pagination parameters to obtain the paginated first data;
[0065] Find the second data after pagination that corresponds to the first data after pagination; the second data after pagination is associated with the indicator model and is not recorded in the data template;
[0066] The first and second data after pagination are input into the indicator model to obtain the indicator results of the indicator to be statistically analyzed.
[0067] The aforementioned indicator generation method, apparatus, computer equipment, storage medium, and computer program product, by acquiring the indicator model and corresponding data template of the indicator to be statistically analyzed, obtains the first data required by the indicator model based on the data template, and can quickly import the data to be processed for indicator calculation using the data template, and paginates the first data according to preset pagination parameters to obtain the paginated first data, eliminates the need to process all data at once, and performs indicator calculation only on a specified number of pages of data each time, and finds the second data after pagination corresponding to the first data after pagination, can quickly obtain the basic parameters required for indicator calculation, and inputs the first and second data after pagination into the indicator model to obtain the indicator result of the indicator to be statistically analyzed. This allows for rapid import of data to be processed and rapid acquisition of basic data, and enables indicator calculation only on a specified number of pages of data each time, avoiding slowing down other business processing speeds, thus eliminating the need to wait for nighttime batch processing, and allowing indicator calculation to be performed at any time, improving the timeliness of indicator calculation. Attached Figure Description
[0068] Figure 1 This is a diagram illustrating the application environment of the index generation method in one embodiment;
[0069] Figure 2 This is a flowchart illustrating an indicator generation method in one embodiment;
[0070] Figure 3 A user operation flowchart of an indicator generation method in one embodiment;
[0071] Figure 4 This is a flowchart illustrating the developer's operation of the indicator generation method in one embodiment;
[0072] Figure 5 This is a flowchart illustrating asynchronous streaming matching in one embodiment;
[0073] Figure 6 A flowchart illustrating the configuration of dynamically calculated formulas in one embodiment;
[0074] Figure 7 This is a flowchart illustrating the process of streaming computation in one embodiment;
[0075] Figure 8 Here is a block diagram of the index generation system in one embodiment;
[0076] Figure 9 This is a flowchart illustrating the indicator generation method in another embodiment;
[0077] Figure 10 This is a structural block diagram of an indicator generation device in one embodiment;
[0078] Figure 11This is a structural block diagram of the index generation device in another embodiment;
[0079] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0080] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0081] The indicator generation method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located in the cloud or on other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0082] In one embodiment, such as Figure 2 As shown, an indicator generation method is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:
[0083] Step S210: Obtain the indicator model of the indicator to be statistically analyzed and the data template corresponding to the indicator model.
[0084] Among them, the indicators to be statistically analyzed can be the indicators of the portfolio fund that need to be statistically analyzed.
[0085] Among them, the indicator model can be the calculation formula for the indicators of a fund of funds.
[0086] The data template can be a table used to obtain the data required for indicator calculation.
[0087] In practice, an indicator model can be designed in advance for each indicator based on its physical meaning. A data template can be designed based on the input parameters in the indicator model, and a model identifier can be added to the indicator model. Then, the indicator model and data template can be stored in the server according to the model identifier. When it is necessary to collect statistics on an indicator, the server can obtain the model identifier of the indicator to be counted, and find the corresponding indicator model and data template according to the model identifier to obtain the indicator model and corresponding data template of the indicator to be counted.
[0088] For example, for the Sharpe ratio metric, the Sharpe ratio calculation formula can be used as the indicator model, and a calculation formula ID can be assigned to it through random generation or manual setting. An Excel spreadsheet can also be generated as a data template, with the header containing the code and date of the portfolio fund needed to calculate the Sharpe ratio. Based on the calculation formula ID, the Sharpe ratio calculation formula and the corresponding Excel spreadsheet are stored on the server. When the Sharpe ratio needs to be calculated, the customer can generate a Sharpe ratio calculation request by clicking the Sharpe ratio calculation button on the terminal. The Sharpe ratio calculation request can contain the Sharpe ratio calculation formula ID. The terminal sends the Sharpe ratio calculation request to the server, and the server can find the Sharpe ratio calculation formula and the corresponding Excel template based on the calculation formula ID received in the Sharpe ratio calculation request.
[0089] Step S220: Obtain the first data associated with the indicator model according to the data template; the first data is the data recorded in the data template.
[0090] The first data can be the input parameter of the indicator model.
[0091] In practice, the server can send the retrieved data template to the terminal. Upon receiving the template, the terminal can display it on its screen. The user can then enter initial data according to the template's instructions. Specifically, the user can manually enter the initial data or import it from a database, which can be either on the terminal or the server. After receiving the initial data, the terminal can return it to the server.
[0092] For example, after the server finds the Sharpe ratio calculation formula and the corresponding Excel template, the terminal can download the Excel template from the server and display it on the screen. The user can manually fill in the fund codes and dates according to the header of the Excel template, or click the data import button to automatically import the codes and dates from the database. The terminal can then send the Excel template containing the fund codes and dates back to the server, allowing the server to obtain the fund codes and dates required for the Sharpe ratio calculation.
[0093] Step S230: Paginate the first data according to the preset pagination parameters to obtain the paginated first data.
[0094] The pagination parameters can include the total amount of data, the amount of data per page, and the page number per page.
[0095] In the specific implementation, the amount of data per page for paginating the first data can be pre-configured, and the total number of the first data can be counted to obtain the total data volume. If the amount of data per page is greater than or equal to the total data volume, the first data can be used as the first data after pagination. Otherwise, if the amount of data per page is less than the total data volume, the data of each page volume can be extracted from the first data in sequence and used as the first data after pagination, and a page number identifier can be added to the first data after pagination.
[0096] For example, you can configure the number of records per page to be 10,000. If you get 9,000 records of fund portfolios from the Excel template, you can put all the records on one page and mark it as page 1. If you get 19,000 records of fund portfolios from the Excel template, you can extract the first 10,000 records and put them on one page and mark it as page 1.
[0097] Step S240: Locate the second data after pagination that corresponds to the first data after pagination; the second data after pagination is data associated with the indicator model and not recorded in the data template.
[0098] The second data can be input parameters for indicator models that could not be obtained through the data template.
[0099] In practice, the correspondence between the first data and the second data can be stored in the server in advance. After paging the first data and obtaining the paging first data, the second data corresponding to each paging first data can be found through the correspondence between the first data and the second data, and the paging second data can be obtained.
[0100] For example, the correspondence between fund code, date, and net asset value can be stored on the server. After pagination, if the current page has 10,000 fund records, and each record contains a specified code and date, the net asset value corresponding to the code and date in each record can be found by traversing the correspondence between code, date, and net asset value.
[0101] It should be noted that the indicator generation method can be implemented through an indicator generation system. This system can include asynchronous streaming matching nodes, message queue nodes, streaming computing nodes, and database nodes, each of which can be a terminal or a server. Specifically, the asynchronous streaming matching node can find the second data after pagination that corresponds to the first data after pagination, and then send both the first and second data after pagination to the message queue node. The message queue node can store the first and second data after pagination in memory.
[0102] Step S250: Input the first and second data after pagination into the indicator model to obtain the indicator results of the indicator to be statistically analyzed.
[0103] In practice, on the current page, the first data after each pagination and its corresponding second data after the pagination can be input into the indicator model for indicator calculation to obtain the indicator calculation result for the current page. Then, the same method can be used to calculate the indicator for the next page until the indicator calculation for all pages is completed, and the final indicator calculation result is obtained.
[0104] For example, you can input the codes, dates, and net asset values of 10,000 fund portfolios on the current page into the Sharpe ratio calculation formula to obtain 10,000 Sharpe ratios. Then, you can use the codes, dates, and net asset values of fund portfolios on the next page to calculate the Sharpe ratio, and so on, until the Sharpe ratio calculation for all pages is completed, to obtain the final indicator calculation result. After that, you can generate an email to notify the user that the indicator calculation is complete, and you can also send the indicator calculation result in the email.
[0105] In practical applications, the first and second data after pagination can be distributed to streaming computing nodes for calculation through the distributed message queue (Kafka) in the message queue node to obtain the indicator results. At the same time, the calculation job status of the current page can be created and saved to the database to monitor the running status of the entire portfolio fund indicator calculation. Afterwards, the second data after pagination can be destroyed in memory, and the second data corresponding to the first data after pagination on the next page can be traversed and queried.
[0106] The above-described indicator generation method obtains the indicator model and corresponding data template of the indicator to be statistically analyzed. Based on the data template, it obtains the first data required by the indicator model. The data template can be used to quickly import the data required for indicator calculation. The first data is paginated according to preset pagination parameters to obtain the paginated first data. It is not necessary to process all data at once; indicator calculation is performed only on a specified number of pages of data each time. The second data after pagination corresponding to the first data after pagination can be found quickly to obtain the basic parameters required for indicator calculation. The paginated first data and paginated second data are input into the indicator model to obtain the indicator result of the indicator to be statistically analyzed. Based on the rapid import of data to be processed and the rapid acquisition of basic data, indicator calculation is performed only on a specified number of pages of data each time, avoiding the reduction of other business processing speed. Therefore, it is not necessary to wait for nighttime batch processing; indicator calculation can be performed at any time, improving the timeliness of indicator calculation.
[0107] In one embodiment, after step S250 above, the method further includes:
[0108] Step S260: Determine whether the first data after pagination is the data from the last page of the first data;
[0109] Step S270: If yes, generate a data processing completion message and send the data processing completion message to the target user to notify the target user to view the indicator results.
[0110] In the specific implementation, the total amount of data in the first data set, the amount of data per page after pagination, and the page number of the first data set after pagination can be obtained. The total amount of data is divided by the amount of data per page. If the remainder is not 0, the quotient of the total amount of data divided by the amount of data per page is incremented by 1 and then checked against the page number of the first data set after pagination. If it equals the page number, the first data set after pagination is considered the last page of the first data set; otherwise, it is not the last page. Conversely, if the remainder is 0, the quotient of the total amount of data divided by the amount of data per page is directly checked against the page number of the first data set after pagination. If it equals the page number, the first data set after pagination is considered the last page of the first data set; otherwise, it is not the last page. When the first data set after pagination is indeed the last page of the first data set, a data processing completion message can be generated and sent to the target user. The target user can then view the generated metrics upon receiving this message.
[0111] For example, if an Excel template retrieves 19,000 records of a portfolio fund, with 10,000 records per page, and the current portfolio fund is on page 2, the remainder of 19,000 divided by 10,000 is not zero. Therefore, we can check if the quotient plus 1 equals the current page number. Since the quotient is 1, adding 1 equals the current page number, we determine that the current portfolio fund is on the last page. Similarly, if the template retrieves 20,000 records, with the same 10,000 records per page, and the current page is on page 2, the remainder of 20,000 divided by 10,000 is zero. We can directly check if the quotient equals the current page number, which is clearly the same, thus determining that the current portfolio fund is on the last page. After determining that the current portfolio fund is on the last page, an email can be generated and sent to the target user, notifying them to view the calculated indicator results.
[0112] In this embodiment, by determining whether the first data after pagination is the data of the last page in the first data, if so, a data processing completion message is generated and sent to the target user. This allows the user to be notified in a timely manner to view the generated indicator results after all the first data has been processed, thus improving the timeliness of the calculation of the portfolio fund indicators.
[0113] In one embodiment, step S260 may specifically include:
[0114] Step S262: Obtain the total amount of data in the first data and the amount of data per page when paginating the first data;
[0115] Step S264: Calculate the quotient and remainder when the total amount of data is divided by the amount of data per page;
[0116] Step S266: If the remainder is not 0, determine whether the quotient meets the preset conditions;
[0117] Step S268: If the condition is met, then determine that the first data after pagination is the data of the last page in the first data.
[0118] In the specific implementation, the total amount of data in the first data, the amount of data per page after pagination of the first data, and the page number of the first data after pagination can be obtained. The total amount of data is divided by the amount of data per page. If the remainder is not 0, the quotient of the total amount of data divided by the amount of data per page is incremented by 1 and then checked to see if it is equal to the page number of the first data after pagination. If it is equal, the first data after pagination is determined to be the last page of the first data. If it is not equal, it is not the last page of the first data. Otherwise, if the remainder is 0, the quotient of the total amount of data divided by the amount of data per page is directly checked to see if it is equal to the page number of the first data after pagination. If it is equal, the first data after pagination is determined to be the last page of the first data. If it is not equal, it is not the last page of the first data.
[0119] In this embodiment, by obtaining the total amount of the first data and the amount of data per page when the first data is paginated, the quotient and remainder of the total amount of data divided by the amount of data per page are calculated. If the remainder is not 0, it is determined whether the quotient meets the preset condition. If it does, it is determined that the first data after pagination is the last page of the first data. This can quickly determine whether the data being processed is the last page of data, thus improving the processing speed of index calculation.
[0120] In one embodiment, step S266 may specifically include: adding 1 to the quotient to obtain the last page identifier for paginating the first data; obtaining the real-time page identifier based on the page identifier corresponding to the first data after pagination; determining whether the real-time page identifier is equal to the last page identifier; if they are equal, determining that the quotient meets the preset conditions.
[0121] The last page identifier can be the page number of the last page.
[0122] The real-time page identifier can be the page number of the first piece of data currently being processed.
[0123] In the specific implementation, the total amount of data in the first data, the amount of data per page after pagination of the first data, and the page number of the first data after pagination can be obtained. The page number of the first data after pagination is used as the real-time page identifier. The total amount of data is divided by the amount of data per page. If the remainder is not 0, the quotient of the total amount of data divided by the amount of data per page is added by 1 as the last page identifier. It is determined whether the real-time page identifier is equal to the last page identifier. If they are equal, it can be determined that the quotient meets the preset condition, and the first data after pagination is the last page of the first data.
[0124] In this embodiment, by adding 1 to the quotient, the last page identifier for paginating the first data is obtained. Based on the page identifier corresponding to the first data after pagination, the real-time page identifier is obtained. It is then determined whether the real-time page identifier is equal to the last page identifier. If they are equal, the quotient is determined to meet the preset conditions. This allows for quick determination of whether the currently processed data is the last page of data, thus improving the processing speed of index calculation.
[0125] In one embodiment, prior to step S210, the method further includes:
[0126] Step S202: Obtain the model script, data template, and model identifier of the indicator model;
[0127] Step S204: Determine whether the model script meets the preset conditions;
[0128] Step S206: If the conditions are met, determine whether the model script can be successfully compiled.
[0129] Step S208: If possible, store the model script and data template according to the model identifier to obtain the model identifier mapping relationship.
[0130] Among them, the model script can be a script of the indicator calculation formula.
[0131] In practice, model scripts and data templates for indicator models can be written and input into the server. The server can identify whether a calculation function exists in the model script. If it does not exist, the model script is deemed not to meet the preset conditions. Otherwise, if it exists, the server can further identify whether the input and output parameters of the calculation function in the model script are both sets. If they are not sets, the model script is deemed not to meet the preset conditions. Otherwise, if they are sets, the model script is deemed to meet the preset conditions. If the preset conditions are met, the model script can be compiled and checked for compilation errors. If an error occurs, a compilation error notification is generated and sent to the user, instructing the user to re-upload the model script. Otherwise, if no error occurs, an indicator model identifier can be generated randomly or manually, and the model script and data model are stored on the server according to the identifier.
[0132] In practical applications, developers can upload calculation scripts and corresponding Excel templates to the server via a terminal page. The server obtains the file extension of the calculation script; for example, if the extension of a Python script is .py, the script type (script_type) will be recognized as Python. Based on the recognized script language, the server sequentially verifies whether a function named `calculate` exists in the script, and whether the input and output parameters of the `calculate` function are collections (of type List). If the verification is successful, the script can be compiled to check for compilation errors. If an error occurs, it means the script verification failed, and the user needs to re-upload the script file. Otherwise, if no error occurs, it means the verification passed, and the script and corresponding Excel template are saved to the database.
[0133] In this embodiment, by obtaining the model script, data template, and model identifier of the indicator model, it is determined whether the model script meets the preset conditions. If it does, it is determined whether the model script can be successfully compiled. If it can, the model script and data template are stored accordingly based on the model identifier to obtain the model identifier mapping relationship. This allows the indicator calculation formula to be scripted, and the indicator calculation formula can be dynamically added and flexibly configured in the server, thereby improving the flexibility of indicator calculation.
[0134] In one embodiment, step S210 may specifically include: obtaining the model identifier of the indicator model; determining the model script of the indicator model through the model identifier according to the model identifier mapping relationship; and obtaining the indicator model by compiling the model script.
[0135] Among them, the model identifier mapping relationship can be the correspondence between the indicator calculation formula and the formula identifier.
[0136] In practice, the identifier of the indicator model can be obtained, the corresponding model script can be found in the server based on the identifier, the language type of the model script can be identified, and the model script can be compiled according to the language type to obtain the compiled indicator model.
[0137] In practical applications, data can be polled and pulled from the streaming computation queue in Kafka. If data has been pulled, a record is inserted into the computation process log table in the database, indicating that the job for that batch of data has started execution. The data is submitted as a new thread job to the computation thread pool. The computation thread pool is checked for jobs to be computed. If there are any, the metric calculation formula script is read into memory according to the metric calculation formula identifier and compiled according to the language type of the calculation formula script to obtain the calculation formula script.
[0138] In this embodiment, by obtaining the model identifier of the indicator model, and based on the model identifier mapping relationship, the model script of the indicator model is determined by the model identifier. By compiling the model script, the indicator model is obtained. The indicator calculation formula can be scripted, and the indicator calculation formula can be flexibly obtained during indicator calculation, thereby improving the flexibility of indicator calculation.
[0139] To facilitate a deeper understanding of the embodiments of this application by those skilled in the art, the following description will be provided in conjunction with specific examples.
[0140] Traditionally, importing and calculating portfolio fund data requires first entering the data into a database through a front-end system. Because this data needs to be merged with the original portfolio fund data, which is large and the database tables are divided into multiple partitions, and to prevent slow database transactions caused by other business functions adding, deleting, or modifying portfolio fund data, this process can only be performed at night when user requests are low (usually in batch mode). This results in users only being able to see the calculated values during the day after the calculations are completed the following night, leading to poor timeliness in portfolio fund indicator calculations. Therefore, this system uses asynchronous streaming matching. Customers only need to select the value to be calculated in the front-end system and download the corresponding Excel template (e.g., when calculating the Sharpe ratio, selecting the Sharpe ratio calculation formula will bring up the corresponding Excel template download). They can then use Excel's features to quickly fill in the data using Office software and upload the Excel file to the front-end system. Clicking "import" will trigger the subsequent portfolio fund indicator calculations, and the results will be notified to the customer via email upon completion. When parsing and importing data from an Excel file, the system automatically completes the missing basic calculation data by querying the database. (For example, if the template only contains fund codes and dates, when calculating the Sharpe ratio, it will query all net asset values for the corresponding dates of that fund code.) To prevent memory overflow, the entire Excel data can be split into pages based on a pre-configured page size (e.g., 10,000 records per page, configured in a configuration file). After matching the data for a single page (i.e., all the basic data required for calculation is ready), the data is distributed to streaming computing nodes via Kafka. Simultaneously, the calculation job for that page is created and saved to the database to monitor the overall fund portfolio indicator calculation. Then, the basic fund portfolio data for the current page is destroyed from memory, and the system iterates to query the basic fund portfolio data for the next page. This asynchronous streaming matching solves the problem of poor timeliness in fund portfolio indicator calculation.
[0141] Traditionally, adding a new formula for a fund portfolio indicator requires developers to add new code for that indicator, resulting in a large and inflexible codebase. This application scripts the calculation formulas and stores them in a database. By uploading the script file and configuring the formula parameters, customers can import fund portfolio data, select the desired formula, and initiate the calculation. This simplifies and unifies the process, allowing developers to dynamically configure the formulas for out-of-the-box functionality. The scripting languages can be Python or Groovy. Since different languages require different compilers, the program reads the `script_type` field from the database to determine the language. Therefore, these different checking rules are stored uniformly in the database. Through dynamic formula configuration, new formulas can be imported without restarting the program, resulting in clear logic, high maintainability, and solving the problem of inflexible formula configuration.
[0142] Traditionally, stored procedures are used to calculate portfolio fund indicators on a large table. However, server nodes executing these large SQL statements are often very slow due to hardware limitations, and the database nodes cannot be horizontally scaled. Therefore, this application migrates import and calculation operations to the program's memory, performing database queries only during the import of basic matching calculation data for portfolio funds. Furthermore, the import and matching process is streamed, significantly reducing the database load and allowing it to better serve other business functions. Through stream computing nodes, the number of nodes can be horizontally scaled at any time, improving the efficiency of indicator calculation and solving the problem of slow execution speed.
[0143] Figure 3 This is a user operation flowchart for a metric generation method. Figure 3 The user operation process may include the following steps:
[0144] In step S301, the user selects the desired calculation formula on the page, such as the Sharpe ratio.
[0145] Step S302: After making the selection, an Excel download button will pop up on the page. Click the button to download the Excel file corresponding to the calculation formula.
[0146] In step S303, the user fills in the data required for the calculation in Excel. For example, to calculate the Sharpe ratio, the user fills in the fund ID and the time. Subsequent data matching will search the database for all the basic data matching the fund ID and the time to calculate the fund index.
[0147] Step S304: The system initiates the calculation.
[0148] Step S305: The user waits for the calculation to complete.
[0149] Figure 4 A flowchart illustrating the developer's workflow for a metric generation method. Based on... Figure 4 The developer workflow may include the following steps:
[0150] In step S401, the developers select a suitable programming language based on the calculation formula. For example, to calculate the Sharpe ratio, Python is a suitable language (Python has the pandas package, which is suitable for analysis and calculation).
[0151] Step S402: Write the calculation formula script and the corresponding Excel template.
[0152] In step S403, the script and Excel template are uploaded via the page and saved to the calculation formula table in the database. The system will then use the calculation formula ID to find the script.
[0153] After step S404 is completed, the script can be selected and used on the page.
[0154] Figure 5 This is a flowchart illustrating an asynchronous streaming matching process. Based on... Figure 5 Asynchronous streaming matching may include the following steps:
[0155] Step S501: The asynchronous streaming matching node obtains the Excel file uploaded by the user and the ID of the calculation formula selected by the user.
[0156] Step S502: Read the pagination parameters in the configuration file. For example, if there are 100,000 data entries in the Excel file, split the data according to the pageSize (size per page) parameter.
[0157] Step S503: Paginate the data in the Excel file according to the pageSize parameter. After each page is paginated, record the current page number (pageNum) and the total number of data (totalSize) in the pagination parameter.
[0158] Step S504: Create a new thread pool for sending computational data to Kafka.
[0159] Step S505: Submit the current page data (i.e., the calculated data, including page data, page parameters (pageSize, pageNum, totalSize), and calculation formula ID) as a new thread job to the thread pool.
[0160] Step S506: The thread pool determines whether it has any computational data jobs to be sent.
[0161] Step S507: Send the computation data to the streaming computation queue in Kafka.
[0162] Figure 6 A flowchart illustrating the configuration of a dynamic calculation formula. Based on... Figure 6 The configuration of dynamic calculation formulas may include the following steps:
[0163] In step S601, the developers upload the calculation script and the corresponding Excel template to the system via the webpage.
[0164] Step S602: Obtain the file extension of the calculation script. For example, if the extension of a Python script is .py, the script type (script_type) will be recognized as Python language.
[0165] Step S603: Verify whether a function named "calculate" exists in the script.
[0166] Step S604: Verify whether the input and output parameters of the calculate function in the script are collections (of type List).
[0167] Step S605: Compile the script and check if there are any compilation errors.
[0168] Step S606: Script verification failed. Please re-upload the script file.
[0169] Step S607: After successful verification, save the script and the corresponding Excel template to the database.
[0170] Figure 7 This is a flowchart illustrating a stream computing process. Based on... Figure 7 Streaming computing may include the following steps:
[0171] Step S701: The streaming computing nodes poll and pull computing data from the streaming computing queue in Kafka.
[0172] Step S702: Check whether the streaming computing node has pulled computing data.
[0173] Step S703: Insert a record into the calculation process log table in the database to indicate that the job for this batch of calculation data has started calculation.
[0174] Step S704: Submit the computation data as a new thread job to the computation thread pool.
[0175] Step S705: Check if there are any jobs to be computed in the computation thread pool.
[0176] Step S706: Read the calculation formula script in the data into memory according to the calculation formula ID in the calculation data.
[0177] Step S707: Compile according to the language type (script_type) of the calculation formula.
[0178] Step S708: Call the calculation function (calculate function) in the compiled file, and pass the pagination data as the parameter.
[0179] Step S709: Check if there are any errors in the calculation process.
[0180] Step S710: Store the calculated data in the result table.
[0181] Step S711: Update the status of this calculation job in the calculation process log table to "failed".
[0182] Step S712: Update the status of this job to success in the calculation process log table.
[0183] Step S713: Determine whether the current calculation job is the last page, that is, determine the total number of data (totalSize) divided by the size of each page (pageSize). If there is a remainder, determine whether adding 1 equals the current page (pageSize); otherwise, directly determine whether it equals the current page.
[0184] Step S714: Insert a record of successful calculation into the calculation result log table, indicating that the calculation of the portfolio fund index is complete.
[0185] Step S715: Check if a success record exists in the calculation result log table.
[0186] Step S716: Send an email to notify the user that the calculation is complete, and the user can download the calculation results from the page.
[0187] Step S717: Send an email to the user notifying them of the calculation failure and the reason for the failure. The user can share the reason and re-initiate the calculation later.
[0188] Figure 8 Generate a structural block diagram of a system for a given indicator. Figure 8 The indicator generation system may include an asynchronous streaming matching node 810, a message queue node 820, a streaming computing node 830, and a database node 840, wherein:
[0189] The asynchronous streaming matching node 810 is used to receive Excel files and perform data matching. For example, when it is necessary to calculate the Sharpe ratio, the customer can select the Sharpe ratio calculation formula on the front end. The front end will pop up the corresponding Excel download template, import the data to be filled from the template from the database, paginate the filled Excel spreadsheet, and send the current page of the Excel spreadsheet to the asynchronous streaming matching node. The asynchronous streaming matching node can match the data on the current page and traverse the database to find the basic data required for the corresponding indicator calculation.
[0190] Message queue node 820 is used to store data for metric calculation. Specifically, the asynchronous streaming matching node can store the first and second data after pagination and distribute the first and second data after pagination to the streaming computing nodes.
[0191] The streaming computing node 830 is used to perform index calculations. Specifically, the streaming computing node can input the first and second paginated data received into the index model to perform index calculations and obtain the index calculation results.
[0192] Database node 840 is used to store logs and metric calculation results.
[0193] The above embodiments, through asynchronous streaming matching, can calculate portfolio fund indicators at any time, solving the problem of poor timeliness in portfolio fund indicator calculation; through dynamic calculation formula configuration, the required calculation formulas are scripted, supporting import at any time, adding and using immediately, achieving clear logic and high maintainability, solving the problem of inflexible calculation formula configuration; through streaming computing, the number of nodes can be horizontally expanded at any time, improving the efficiency of indicator calculation, solving the hardware resource bottleneck problem of slow execution of large-scale SQL statements by single nodes in existing databases, thus realizing flexible streaming calculation of portfolio fund indicators in the field of asset custody.
[0194] In one embodiment, such as Figure 9 The diagram shows a flowchart of an indicator generation method, which is applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps:
[0195] Step S910: In response to the trigger operation on the indicator model, display the data template corresponding to the indicator model;
[0196] Step S920: Obtain the first data associated with the indicator model according to the data template; the first data is the data recorded in the data template.
[0197] Step S930: Send the first data to the server so that the server can paginate the first data according to the preset pagination parameters to obtain the paginated first data. Find the paginated second data corresponding to the paginated first data and input the paginated first data and the paginated second data into the indicator model to obtain the indicator result of the indicator to be statistically analyzed. The paginated second data is associated with the indicator model and is not recorded in the data template.
[0198] In practice, users can trigger an operation on the terminal display screen to select the desired indicator model. The terminal responds to the trigger operation, generates an indicator calculation request, and sends it to the server. The indicator calculation request may include a model identifier. After receiving the indicator calculation request, the server determines the corresponding data template based on the model identifier and returns the data template to the terminal. The terminal can display the data template on the screen, allowing the user to import initial data. After obtaining the initial data, the terminal can send it to the server, which processes the data to obtain the indicator calculation result.
[0199] Since the terminal processing procedure has been described in detail in the foregoing embodiments, it will not be repeated here.
[0200] The above-described indicator generation method displays a data template corresponding to the indicator model in response to a trigger operation on the indicator model. Based on the data template, the first data associated with the indicator model is obtained. The data template can be used to quickly import the data required for indicator calculation. The first data is sent to the server, which allows the server to perform indicator calculation at any time without waiting for nighttime batch processing by paginating and matching the first data, thereby improving the timeliness of indicator calculation.
[0201] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0202] Based on the same inventive concept, this application also provides an indicator generation apparatus for implementing the indicator generation method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more of the indicator generation apparatus embodiments provided below can be found in the limitations of the indicator generation method described above, and will not be repeated here.
[0203] In one embodiment, such as Figure 10 As shown, an indicator generation device 1000 is provided, including: a template acquisition module 1010, a first data acquisition module 1020, a pagination module 1030, a second data acquisition module 1040, and an indicator generation module 1050, wherein:
[0204] The template acquisition module 1010 is used to acquire the indicator model of the indicator to be statistically analyzed and the data template corresponding to the indicator model;
[0205] The first data acquisition module 1020 is used to acquire the first data associated with the indicator model according to the data template; the first data is the data recorded in the data template.
[0206] The pagination module 1030 is used to paginate the first data according to preset pagination parameters to obtain the paginated first data;
[0207] The second data acquisition module 1040 is used to find the second data after pagination corresponding to the first data after pagination; the second data after pagination is associated with the indicator model and is not recorded in the data template;
[0208] The indicator generation module 1050 is used to input the first data after pagination and the second data after pagination into the indicator model to obtain the indicator result of the indicator to be statistically analyzed.
[0209] In one embodiment, the above-mentioned indicator generation device 1000 further includes:
[0210] The page determination module is used to determine whether the first data after pagination is the data of the last page in the first data;
[0211] The notification module is used to generate a data processing completion message if the condition is met, and send the data processing completion message to the target user to notify the target user to view the indicator results.
[0212] In one embodiment, the page determination module further includes:
[0213] The total data acquisition module acquires the total data volume of the first data and the data volume of each page when the first data is paginated.
[0214] The calculation module is used to calculate the quotient and remainder when the total amount of data is divided by the amount of data per page;
[0215] The condition judgment module is used to determine whether the quotient meets a preset condition if the remainder is not 0;
[0216] The determination module is used to determine, if the conditions are met, that the first data after pagination is the data of the last page of the first data.
[0217] In one embodiment, the condition judgment module is further configured to add 1 to the quotient to obtain the last page identifier for paginating the first data; obtain the real-time page identifier based on the page identifier corresponding to the paginated first data; determine whether the real-time page identifier is equal to the last page identifier; if they are equal, determine that the quotient meets the preset conditions.
[0218] In one embodiment, the above-mentioned indicator generation device 1000 further includes:
[0219] The script acquisition module is used to acquire the model script, data template, and model identifier of the indicator model;
[0220] The script judgment module is used to determine whether the model script meets preset conditions;
[0221] The compilation judgment module is used to determine whether the model script can be successfully compiled if the conditions are met.
[0222] The storage module is used to, if possible, store the model script and the data template according to the model identifier to obtain the model identifier mapping relationship.
[0223] In one embodiment, the template acquisition module 1010 is further configured to acquire the model identifier of the indicator model; determine the model script of the indicator model through the model identifier according to the model identifier mapping relationship; and obtain the indicator model by compiling the model script.
[0224] In one embodiment, such as Figure 11 As shown, an indicator generation device 1100 is provided, including: a display module 1110, a data acquisition module 1120, and a data transmission module 1130, wherein:
[0225] Display module 1110 is used to display the data template corresponding to the indicator model in response to the trigger operation of the indicator model;
[0226] The data acquisition module 1120 is used to acquire the first data associated with the indicator model according to the data template; the first data is the data recorded in the data template.
[0227] The data sending module 1130 is used to send the first data to the server, so that the server can paginate the first data according to the preset pagination parameters to obtain the paginated first data, find the paginated second data corresponding to the paginated first data, and input the paginated first data and the paginated second data into the indicator model to obtain the indicator result of the indicator to be statistically analyzed; the paginated second data is the data associated with the indicator model and is not recorded in the data template.
[0228] Each module in the aforementioned indicator generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0229] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores index generation data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements an index generation method.
[0230] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0231] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0232] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0233] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0234] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0235] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0236] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0237] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for generating indicators, characterized in that, The method includes: Obtain the indicator model of the indicator to be statistically analyzed and the data template corresponding to the indicator model; wherein, the data template is a table used to obtain the data required for indicator calculation; Based on the data template, obtain the first data associated with the indicator model; the first data is the data recorded in the data template. The first data is paginated according to preset pagination parameters to obtain the paginated first data; wherein, the pagination parameters include the total amount of data, the amount of data per page, and the page number of each page; if the amount of data per page is greater than or equal to the total amount of data, then the first data is used as the paginated first data; if the amount of data per page is less than the total amount of data, then the data of the amount of data per page is extracted from the first data in order and used as the paginated first data; Find the second data after pagination corresponding to each of the first data after pagination; the second data after pagination is associated with the indicator model and is not recorded in the data template; The first and second data after pagination are input into the indicator model to obtain the indicator results of the indicator to be statistically analyzed.
2. The method according to claim 1, characterized in that, After the step of inputting the paginated first data and the paginated second data into the indicator model to obtain the indicator result of the indicator to be statistically analyzed, the method further includes: Determine whether the first data after pagination is the data from the last page of the first data; If so, a data processing completion message is generated and sent to the target user to notify the target user to view the indicator results.
3. The method according to claim 2, characterized in that, The step of determining whether the first data after pagination is the data of the last page of the first data includes: Obtain the total amount of data in the first data set, and the amount of data per page when paginating the first data set; Calculate the quotient and remainder when the total amount of data is divided by the amount of data per page; If the remainder is not 0, then determine whether the quotient meets the preset conditions; If the conditions are met, then the first data after pagination is determined to be the data from the last page of the first data.
4. The method according to claim 3, characterized in that, The determination of whether the quotient meets the preset conditions includes: Add 1 to the quotient to obtain the last page identifier for paginating the first data; The real-time page identifier is obtained based on the page identifier corresponding to the first data after pagination; Determine whether the real-time page identifier is equal to the last page identifier; If equal, the quotient is determined to meet the preset conditions.
5. The method according to claim 1, characterized in that, Before the step of obtaining the indicator model of the indicator to be statistically analyzed and the data template corresponding to the indicator model, the method further includes: Obtain the model script, data template, and model identifier of the indicator model; Determine whether the model script meets the preset conditions; If the conditions are met, then determine whether the model script can be successfully compiled; If possible, the model script and the data template are stored accordingly based on the model identifier to obtain the model identifier mapping relationship.
6. The method according to claim 5, characterized in that, The process of obtaining the indicator model for the indicator to be statistically analyzed and the corresponding data template for the indicator model includes: Obtain the model identifier of the indicator model; Based on the model identifier mapping relationship, the model script of the indicator model is determined through the model identifier; The indicator model is obtained by compiling the model script.
7. A method for generating an indicator, characterized in that, The method includes: In response to a trigger operation on the indicator model, the data template corresponding to the indicator model is displayed; Based on the data template, obtain the first data associated with the indicator model; the first data is the data recorded in the data template. The first data is sent to the server, which then paginates the first data according to preset pagination parameters to obtain paginated first data. The pagination parameters include the total data volume, the data volume per page, and the page number. If the data volume per page is greater than or equal to the total data volume, the first data is used as the paginated first data. If the data volume per page is less than the total data volume, the data of the specified data volume per page is extracted from the first data in sequence and used as the paginated first data. The corresponding paginated second data is then found, and the paginated first data and the paginated second data are input into the indicator model to obtain the indicator result for the target indicator. The paginated second data is associated with the indicator model and is not recorded in the data template.
8. An indicator generation device, characterized in that, The device includes: The template acquisition module is used to acquire the indicator model of the indicator to be statistically analyzed and the data template corresponding to the indicator model; The first data acquisition module is used to acquire the first data associated with the indicator model according to the data template; the first data is the data recorded in the data template. A pagination module is used to paginate the first data according to preset pagination parameters to obtain the paginated first data; wherein, the pagination parameters include the total amount of data, the amount of data per page, and the page number of each page; if the amount of data per page is greater than or equal to the total amount of data, then the first data is used as the paginated first data; if the amount of data per page is less than the total amount of data, then the data of the amount of data per page is extracted from the first data in sequence and used as the paginated first data; The second data acquisition module is used to find the second data after pagination corresponding to each of the first data after pagination; the second data after pagination is associated with the indicator model and is not recorded in the data template; The indicator generation module is used to input the first data after pagination and the second data after pagination into the indicator model to obtain the indicator results of the indicator to be statistically analyzed.
9. An indicator generation device, characterized in that, The device includes: The display module is used to display the data template corresponding to the indicator model in response to the trigger operation of the indicator model. The data acquisition module is used to acquire the first data associated with the indicator model according to the data template; the first data is the data recorded in the data template. A data sending module is used to send the first data to a server, so that the server can paginate the first data according to preset pagination parameters to obtain paginated first data. The pagination parameters include the total data volume, the data volume per page, and the page number. If the data volume per page is greater than or equal to the total data volume, the first data is used as the paginated first data. If the data volume per page is less than the total data volume, the data of the data volume per page is extracted from the first data in sequence and used as the paginated first data. A paginated second data is found corresponding to each paginated first data, and the paginated first data and the paginated second data are input into the indicator model to obtain the indicator result of the indicator to be statistically analyzed. The paginated second data is associated with the indicator model and is not recorded in the data template.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and system for concurrently and dynamically processing bank data
CN102609875A
Configurable grouping comparison project cost index analysis method and system
CN111242505A