A data calculation method, system, intelligent terminal and storage medium
By performing two snapshots and screening of the original holding data and calculating the equity data, the problem of large calculation errors in the prior art is solved, and higher calculation accuracy and loss reduction are achieved.
Patent Information
- Application Number
- CN202411579257.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-07
AI Technical Summary
In the prior art, there will be problems with large calculation errors when obtaining equity data, resulting in inaccurate income data of financial products.
After the first snapshot of the original position data is used to generate the first position snapshot table, the filter position data is obtained based on the data update time, and the second snapshot of the filter position data is used to generate the second position snapshot table. After the snapshot synchronization task table is updated, the equity data is calculated based on the part with smaller positions data from the two positions.
Accurately calculate the equity data of non-automatically cleared holding data, improve the accuracy of equity calculation and reduce losses caused by the calculation of financial products that do not meet the storage time standards.
Smart Images

Figure CN119066084B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to a data calculation method, system, intelligent terminal and storage medium. Background Art
[0002] When calculating returns in the financial technology field, the Internet core system will obtain the user's holding data at the previous moment through asset snapshot technology, and then start calculating the user's daily financial product return data at the next moment's equity calculation time. Then, the Internet core system will include financial products that do not meet the storage time requirements in the calculation, resulting in large errors in the return data.
[0003] Therefore the prior art still needs to be improved and enhanced. Summary of the invention
[0004] The main purpose of the present invention is to provide a data calculation method, system, intelligent terminal and storage medium, aiming to solve the problem of large calculation errors when obtaining equity data in the prior art.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a data calculation method, including:
[0007] After taking a first snapshot of the original position data to generate a first position snapshot table, the original position data is filtered according to the data update time in the first position snapshot table to obtain filtered position data;
[0008] After taking a second snapshot of the filtered position data to generate a second position snapshot table, a first file is generated, and after the generation is successful, the snapshot synchronization task table is updated;
[0009] After the snapshot synchronization task table is successfully updated, the equity data corresponding to the non-automatically cleared position data is calculated based on the smaller position data in the first position snapshot table and the second position snapshot table.
[0010] In some embodiments, the data calculation method further includes:
[0011] Calculate the equity data of the automatically cleared position data based on the position data in the first position snapshot table;
[0012] The automatically cleared position data includes: historical position data that expired between the first moment and the second moment of the first snapshot and was automatically redeemed.
[0013] In some embodiments, after taking a first snapshot of the original position data to generate a first position snapshot table, filtering the original position data to obtain filtered position data according to the data update time in the first position snapshot table includes:
[0014] Taking a first snapshot of the original position data at a first moment to generate the first position snapshot table;
[0015] At a second moment, according to the data update time of the original position data in the first position snapshot table, the non-automatically cleared position data is filtered out from the original position data to obtain filtered position data;
[0016] The non-automatically cleared position data includes: the unchanged original position data, and the original position data that has changed between the first moment and the second moment.
[0017] In some embodiments, after taking a second snapshot of the filtered position data to generate a second position snapshot table, generating a first file, and updating the snapshot synchronization task table after the generation is successful, includes:
[0018] At the second moment, the filtered position data is written into a second file, and after the writing is successful, the second file is uploaded to a preset directory, and when the uploading is successful, the second file is written into a second position snapshot table to complete the second snapshot;
[0019] generating the first file when writing is successful, and after determining that the first file is successfully generated, writing a current snapshot record in the snapshot synchronization task table to update the snapshot synchronization task table;
[0020] The second moment is the equity calculation time corresponding to the first snapshot and the second snapshot.
[0021] In some embodiments, writing the filtered position data into a second file at the second moment further includes:
[0022] Determining whether the filtered position data is successfully written into the second file, and generating an alarm message when it is determined that the writing fails;
[0023] Wherein, the second file is a plain text file.
[0024] In some embodiments, uploading the second file to a preset directory after writing is successful may further include:
[0025] Determine whether the second file is successfully uploaded to the preset directory, and generate an alarm message when it is determined that the upload fails.
[0026] In some embodiments, when the upload is successful, the second file is written into the second position snapshot table, and then further includes:
[0027] Determining whether the second file is successfully written into the second position snapshot table, and generating an alarm message when determining that the writing fails;
[0028] The step of generating the first file when the writing is successful further comprises:
[0029] Determine whether the first file is generated successfully;
[0030] When it is determined that the generation fails, the judgment is continued after a preset time, and when it is determined that the generation still fails, an alarm message is generated;
[0031] The first file is a record file.
[0032] In a second aspect, an embodiment of the present application provides a data computing system, including:
[0033] A screening module, configured to, after taking a first snapshot of the original position data to generate a first position snapshot table, screen the original position data according to the data update time in the first position snapshot table to obtain screened position data;
[0034] A snapshot module, for generating a second snapshot table of a second position after taking a second snapshot of the filtered position data, generating a first file, and updating a snapshot synchronization task table after successful generation;
[0035] A calculation module is used to calculate the equity data corresponding to the non-automatically cleared position data according to the smaller position data in the first position snapshot table and the second position snapshot table after the snapshot synchronization task table is successfully updated.
[0036] In a third aspect, an embodiment of the present application provides an intelligent terminal, comprising: a memory, a processor, a display, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the data calculation method described above when executed by the processor.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the steps of the data calculation method described above when executed by a processor.
[0038] Compared with the prior art, the present invention provides a data calculation method, system, intelligent terminal and storage medium. The method performs a first snapshot of the original position data to generate a first position snapshot table, filters out filtered position data from the original position data according to the data update time, and performs a second snapshot of the filtered position data to generate a second position snapshot table. After updating the snapshot synchronization task table, the equity data corresponding to the non-automatically cleared position data is calculated based on the smaller position data in the first position snapshot table and the second position snapshot table, thereby accurately calculating the equity data of the non-automatically cleared position data, improving the accuracy of the equity calculation, and effectively reducing the losses caused by calculating financial products that do not meet the storage time requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A flowchart of a preferred embodiment of the data calculation method provided by the present invention;
[0041] Figure 2 A flowchart of step S100 in a preferred embodiment of the data calculation method provided by the present invention;
[0042] Figure 3 A flowchart of step S200 in a preferred embodiment of the data calculation method provided by the present invention;
[0043] Figure 4 A flowchart of executing the Datax task in a preferred embodiment of the data calculation method provided by the present invention;
[0044] Figure 5 A flowchart of updating the snapshot synchronization task table in a preferred embodiment of the data calculation method provided by the present invention;
[0045] Figure 6 A flowchart of S1000-S2000 in a preferred embodiment of the data calculation method provided by the present invention;
[0046] Figure 7 An architectural relationship diagram of the data computing system provided by the present invention;
[0047] Figure 8 A schematic diagram of the operating environment of a preferred embodiment of the intelligent terminal provided by the present invention. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0049] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0050] Hereinafter, the terms "including", "having" and their cognates that can be used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.
[0051] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0052] In order to facilitate understanding of the embodiments of the present application, the background technology involved in the embodiments of the present invention is first introduced here.
[0053] The Internet core system generates a user's daily asset snapshot by default at around 22:00 (the first moment in this application), and the equity calculation is around 6:00 a.m. the next day (the second moment in this application). However, when calculating equity, there will be cases where the calculation time error in the asset snapshot technology is used to maliciously obtain benefits. That is, if the core snapshot is directly used to calculate user equity, there will be a problem of being "fleeced". For example, if a user deposits funds at 21:50 and withdraws them at 22:10, the core snapshot will have a record of the user's deposit certificate, then the equity calculation task executed at 6:00 will calculate the equity points corresponding to the deposit certificate, but in fact the user only held it for 20 minutes, thereby causing economic losses to the financial company.
[0054] In order to prevent the above situation, when executing the equity calculation task at 6:00, the real-time amount calculation of the deposit certificate can be used to prevent the problem of "fleecing", but it will lead to inaccurate calculation results and non-repeatable execution. The execution of the equity calculation task is a process that takes about a few minutes. If the status or amount of the deposit certificate changes during the calculation process, the statistical caliber of the deposit certificate calculated first and the deposit certificate calculated later will be different. Even if unexpected situations occur, the task execution time will be delayed. At the same time, it is also contrary to the propaganda of the business department that as long as you hold it until 6:00 the next day, you will have equity.
[0055] In order to solve the above-mentioned prior art problems, the present invention provides a data calculation method, system, intelligent terminal and storage medium. In the present invention, after taking a first snapshot of the original position data to generate a first position snapshot table, the filtered position data is filtered out from the original position data according to the data update time, and a second snapshot of the filtered position data is taken to generate a second position snapshot table, and then after updating the snapshot synchronization task table, the equity data corresponding to the non-automatically cleared position data is calculated according to the smaller position data in the first position snapshot table and the second position snapshot table, thereby accurately calculating the equity data of the non-automatically cleared position data, improving the accuracy of the equity calculation, and effectively reducing the loss caused by calculating the financial products whose storage time does not meet the standard.
[0056] The data calculation method design scheme is described below through specific exemplary embodiments. It should be noted that the following embodiments are only used to explain the technical scheme of the invention and are not specifically limited:
[0057] See also Figure 1 , the present application embodiment provides a data calculation method, including:
[0058] S100. After taking a first snapshot of the original position data to generate a first position snapshot table, the original position data is filtered according to the data update time in the first position snapshot table to obtain filtered position data.
[0059] Optionally, the premise for implementing the data calculation method in the present application is to add a snapshot (i.e., the second snapshot) to form a dual-snapshot equity calculation technical solution based on the core snapshot (corresponding to the first snapshot) of the Internet core system.
[0060] The position snapshot table includes: the position amount, the update time field, the interest rate, the equity issuance cycle, the product ID and the product type, etc. If the position amount changes in the position snapshot table, the data update time will be saved.
[0061] Then, the data calculation method is implemented as follows:
[0062] First, the original position data (in this embodiment, the position data is the position amount) is snapshotted for the first time (i.e., the core snapshot) to generate the first position snapshot table (mainly including the position amount, the field of its update time, as well as the interest rate, the equity issuance cycle, the product ID and the product type, etc.), and the updated data is filtered according to the data update time in the first position snapshot table to obtain the filtered position data (also called incremental position snapshot data), so as to take the second snapshot of the filtered position data. Among them, the filtering condition is to retain the position data that has been held after the core snapshot or the most recent update time is after the core snapshot is generated.
[0063] The present application achieves dynamic understanding of the changing status of the position data by screening the first position snapshot table generated by the first snapshot according to the data update time, and reduces the data generated for the second position snapshot without affecting the calculation results, thereby reducing the occupation of computing resources.
[0064] For further information, see Figure 2 Step S100: after taking a first snapshot of the original position data to generate a first position snapshot table, the original position data is filtered according to the data update time in the first position snapshot table to obtain filtered position data, including:
[0065] S110, taking a first snapshot of the original position data at a first moment, and generating a first position snapshot table;
[0066] S120. At a second moment, based on the data update time of the original position data in the first position snapshot table, filter out the non-automatically cleared position data from the original position data to obtain filtered position data.
[0067] The non-automatically cleared position data includes: the unchanged original position data, and the original position data that has changed between the first moment and the second moment.
[0068] Optionally, the snapshot time of the core snapshot (first snapshot) is 22:00 (corresponding to the first moment in this application), and the corresponding equity calculation time is 6:00 in the morning of the next day (also the second moment in this application); and in this application, the snapshot time and equity calculation time of the second snapshot are both set at 6:00 in the morning (that is, the second moment is the equity calculation time corresponding to the first snapshot and the second snapshot). Among them, both the first moment and the second moment can be set, but the second moment must be later than the first moment.
[0069] Then, the specific implementation process of the data calculation method is as follows:
[0070] At the first time (e.g. 22:00), the current position amount is first snapshotted to generate the first position snapshot table. Then, according to the data update time of the original position data in the first position snapshot table at the second time (e.g. 6:00 the next day), the non-automatically cleared position data is filtered out from the original position data, that is, the position data that has been held after the core snapshot or the most recent update time is after the core snapshot is generated is filtered out.
[0071] That is, if the data update time of the target position data of the target product type does not exist in the first position snapshot table, it can be judged that the target position data belongs to the original position data that has not been changed, and based on the data update time of the target position data in the first position snapshot table, it can be judged that the target position data belongs to the original position data that has changed between the first moment and the second moment, and these target position data are saved to obtain the filtered position data.
[0072] For further information, please refer to Figure 1 S200: After taking a second snapshot of the filtered position data to generate a second position snapshot table, a first file is generated, and the snapshot synchronization task table is updated after the generation is successful.
[0073] Among them, the first file is a record file.
[0074] Optionally, after obtaining the filtered position data, a second snapshot is taken of the filtered position data to generate a second position snapshot table. After the generation is successful, an OK file (i.e., the first file; the OK file is a record file corresponding to the data file, which stores data volume information) is generated to confirm whether the snapshot file is successfully generated and is completely available. At the same time, the snapshot file generation record is updated in the snapshot synchronization task table.
[0075] In this application, a second snapshot is taken of the filtered position data so that the actual equity data can be accurately calculated based on the two position data, thereby implementing a dual snapshot technical solution. The calculation of equity points does not depend on the real-time data of the user's position table, but only requires core snapshot data (obtained in the first snapshot) and position snapshot data (obtained in the second snapshot). In this way, no matter when the equity calculation task is executed or how many times it is executed, the calculation results are accurate and consistent.
[0076] For further information, see Figure 3 Step S200: after taking a second snapshot of the filtered position data to generate a second position snapshot table, generate a first file, and update the snapshot synchronization task table after the generation is successful, including:
[0077] S210, writing the filtered position data into a second file at a second moment, uploading the second file to a preset directory after the writing is successful, and writing the second file to a second position snapshot table when the uploading is successful, so as to complete the second snapshot;
[0078] S220: Generate a first file when writing is successful, and after determining that the first file is successfully generated, write a current snapshot record into the snapshot synchronization task table to update the snapshot synchronization task table.
[0079] Among them, the second moment is the equity calculation time corresponding to the first snapshot and the second snapshot; the second file is a plain text file.
[0080] Optionally, the tool for generating position snapshots in this embodiment uses the data synchronization tool Datax (Datax is an offline synchronization tool for heterogeneous data sources, dedicated to realizing stable and efficient data synchronization functions between various heterogeneous data sources including relational databases (MySQL (MySQL is an open source relational database management system (RDBMS)), Oracle (short for Oracle Database, also known as Oracle RDBMS, a relational database management system)), HDFS (Hadoop Distributed File System, HDFS is a distributed file system used for distributed reading and writing of large-scale data), Hive (Hive is a data warehouse tool based on Hadoop (Hadoop is a distributed system infrastructure) that can map structured data files into a table), ODPS (ODPS (Open Data Processing Service) is a large-scale batch computing engine; ODPS is a big data computing service, an integrated component based on Hadoop, providing full process integration from log collection, data computing, data display to data analysis), HBase (HBase is a column-based storage non-relational database management system running on HDFS), FTP, etc.).
[0081] Among them, Datax supports multiple ways of data synchronization, such as table→table, table→file. This application adopts the table→file method to write the incremental position snapshot data (i.e., filtered position data) to a csv (cvs: Comma SeparateValues, a plain text file used to store table and spreadsheet information, the content is usually a table consisting of text, numbers or dates) file, and upload it to the ftp (ftp: File Transfer Protocol, Chinese name is File Transfer Protocol, a set of standard protocols for file transfer on the network) corresponding directory (i.e., the preset directory, a directory with the current date, test and production environment). Then, the cvs file is stored in the position snapshot table to form permanent and traceable persistent data.
[0082] Then, please refer to Figure 4 and Figure 5 The specific implementation process of taking a second snapshot of the filtered position data is as follows:
[0083] First, execute the Datax task: at 6 a.m. (i.e., the second moment), use the data synchronization tool Datax to write the filtered position data into the cvs file (i.e., the second file). After the writing is successful, upload the second file to the ftp directory (i.e., the preset directory) with the current date, test and production environments (corresponding to Figure 4 After the upload is successful, the second file is written to the second position snapshot table to complete the second snapshot file storage task.
[0084] Then, to ensure that Datax successfully generates the file and the file is complete, after Datax execution is completed, that is, the second file is successfully written to the second position snapshot table (corresponding to Figure 5 After inserting the data file into the snapshot table in the , a subtask will be triggered, and the subtask will generate an OK file (i.e. the first file) in the preset directory. The generation of the OK file means that the extraction of the position snapshot data has been completed, so as to ensure that no data is lost when calculating the equity. The content of the OK file does not matter, the key is that there is a file with a file name and date in the corresponding directory (i.e. the preset directory).
[0085] Furthermore, if the OK file does not exist, it means that the snapshot data extraction has not been completed, and the computing task needs to wait. While generating the first file, the current snapshot record will also be written to the snapshot synchronization task table (corresponding to Figure 5 Insert the data file into the snapshot synchronization task table in the Sync task table to update the snapshot synchronization task table.
[0086] In this application, Datax generates snapshots in a very short time. The underlying logic is directly connected to the database. The data is queried into the memory in a multi-channel parallel manner, and then written to the FTP directory, and finally persisted in the local file. This avoids the problem of inconsistent statistical caliber due to changes in the status of user withdrawal certificates during the equity calculation process, and supports recalculation due to unexpected situations.
[0087] Furthermore, the filtered position data is written into the second file at the second moment, and then further includes:
[0088] S10. Determine whether the filtered position data is successfully written into the second file, and generate an alarm message when it is determined that the writing fails.
[0089] Optionally, after writing the filtered position data into the second file at the second moment, it is determined whether the filtered position data is successfully written into the second file:
[0090] If the filtered position data is successfully written into the second file, the second file is uploaded to the preset directory; but if the filtered position data is failed to be written into the second file, an alarm message is generated, and manual intervention is required to troubleshoot the problem and handle it in a timely manner.
[0091] Among them, another example in the present application is that if it is determined that the filtered position data has failed to be written into the second file, it will wait for a preset time before continuing to judge, and only when it is determined that the writing still fails, will an alarm message be generated.
[0092] Furthermore, after the writing is successful, the second file is uploaded to the preset directory, and then the following steps are included:
[0093] S20: Determine whether the second file is successfully uploaded to the preset directory, and generate an alarm message when it is determined that the upload fails.
[0094] Optionally, after the second file is uploaded to the preset directory after writing successfully, it is determined whether the second file is successfully uploaded to the preset directory:
[0095] If the second file is successfully uploaded to the preset directory, the second file is written to the second position snapshot table; but if the second file fails to be uploaded to the preset directory, an alarm message is also generated.
[0096] Among them, another example in the present application is that if it is determined that uploading the second file to the preset directory fails, the judgment is continued after waiting for a preset time, and an alarm message is generated only when it is determined that the upload still fails.
[0097] Furthermore, when the upload is successful, the second file is written into the second position snapshot table, and then the following is also included:
[0098] S30: Determine whether the second file is successfully written into the second position snapshot table, and generate an alarm message when it is determined that the writing fails.
[0099] Optionally, after the second file is written to the second position snapshot table when the upload is successful, it is determined whether the second position snapshot table is written successfully:
[0100] If the second file is successfully written into the second position snapshot table, the first file is generated; but if the second file is failed to be written into the second position snapshot table, an alarm message is also generated.
[0101] Among them, another example in the present application is that if it is determined that writing the second position snapshot table into the second position snapshot table fails, it will wait for a preset time before continuing to judge, and only when it is determined that the writing still fails, will an alarm message be generated.
[0102] For further information, see Figure 6 , when writing is successful, the first file is generated, and then it also includes:
[0103] S1000, determining whether the first file is generated successfully;
[0104] S2000: When it is determined that generation fails, continue to judge after waiting for a preset time, and when it is determined that generation still fails, generate an alarm message.
[0105] Optionally, when the second snapshot file storage task is successful, the first file will be generated, and it is determined whether the first file is generated successfully:
[0106] If the first file is successfully generated, it means that the position snapshot file is available and complete. At this time, the current snapshot record is written into the snapshot synchronization task table to update the snapshot synchronization task table.
[0107] However, if the first file is not generated, it will wait until it is generated. If it is still not generated within the preset time (configurable), the task will time out, terminate the task and issue an alarm.
[0108] For further information, please refer to Figure 1 S300: After the snapshot synchronization task table is successfully updated, the equity data corresponding to the non-automatically cleared position data is calculated based on the smaller position data in the first position snapshot table and the second position snapshot table.
[0109] Optionally, before performing the equity calculation task, whether to perform the equity calculation will be decided based on the result of the current snapshot record storage. That is, the current snapshot record storage task is a necessary prerequisite for equity calculation. The equity calculation task will only be executed if the storage is successful; but if the storage fails, an alarm will be issued.
[0110] After the snapshot synchronization task table is successfully updated, the deposit certificate equity of the non-automatically cleared position data begins to be calculated:
[0111] Among them, since the position data of the second snapshot is the non-automatically cleared position data, that is, the unchanged original position data, and the original position data that has changed between the first moment and the second moment (for example, partial withdrawal or new position amount occurs during this time period); and if there is automatically cleared position data, the position data in the second position snapshot table must be smaller than the position data in the first position snapshot table. Furthermore, the equity data will eventually be calculated based on the smaller position data in the first position snapshot table and the second position snapshot table, so the calculated result is the certificate equity of the non-automatically cleared position data.
[0112] Then, when calculating the equity data of the same deposit certificate basic amount, the smaller value of the core snapshot and the position snapshot is taken, that is, the smaller position data of the first position snapshot table and the second position snapshot table is taken. In this way, if the user withdraws money in advance before the second moment, the amount withdrawn in advance will not receive equity, thus preventing the "wool-pulling" scenario. In addition, the position amount increased between the first moment and the second moment will not be calculated, thereby improving the accuracy of equity calculation and avoiding losses for financial companies.
[0113] Furthermore, the data calculation method also includes:
[0114] S400. Calculate the equity data of the automatically cleared position data according to the position data in the first position snapshot table.
[0115] The automatically cleared position data includes: historical position data that expired between the first moment and the second moment of the first snapshot and was automatically redeemed.
[0116] Optionally, for some special scenarios, such as the day when a time deposit expires or the day when a notice deposit is scheduled to expire, when calculating yesterday's equity, the amount of the deposit in the core snapshot table (i.e., the first position snapshot table) is the amount before automatic redemption. At 6:00 the next day, the deposit has been automatically redeemed successfully, and the amount in the position snapshot table (i.e., the second position snapshot table) is zero. This scenario is not considered a "wool-pulling" scenario, but a normal redemption scenario. Therefore, there should be normal equity on the day before expiration.
[0117] Then, for the equity calculation of the historical holding data (i.e., time deposits) that expired between the first moment and the second moment of the first snapshot and were automatically redeemed, it is necessary to calculate the equity data of the automatically cleared holding data using the historical holding data that expired between the first moment and the second moment of the first snapshot in the first holding snapshot table.
[0118] For further information, see Figure 7 , the present application embodiment provides a data computing system, including:
[0119] The screening module 1 is used to take a first snapshot of the original position data to generate a first position snapshot table, and then screen the original position data according to the data update time in the first position snapshot table to obtain screened position data.
[0120] Snapshot module 2 is used to generate a second position snapshot table after taking a second snapshot of the filtered position data, generate a first file, and update the snapshot synchronization task table after successful generation.
[0121] The calculation module 3 is used to calculate the equity data corresponding to the non-automatically cleared position data according to the smaller position data in the first position snapshot table and the second position snapshot table after the snapshot synchronization task table is successfully updated.
[0122] Optionally, the data computing method is applicable to a data computing system, and then the implementation process of the data computing system is as follows:
[0123] First, the first snapshot of the original position data is generated at the first time (for example, 22:00) to generate the first position snapshot table, and the non-automatically cleared position data in the original position data is filtered according to the data update time in the first position snapshot table to obtain the filtered position data.
[0124] Then, at the second moment (for example: 6 o'clock in the morning of the next day), a second snapshot of the filtered position data is taken to generate a second position snapshot table, and a subtask is triggered to generate the first file. After the first file is successfully generated, the current snapshot record is written to the snapshot synchronization task table to update the snapshot synchronization task table.
[0125] Secondly, determine whether the current snapshot record is successfully stored, that is, determine whether the snapshot synchronization task table is successfully updated:
[0126] If the storage is successful, the position data in the first position snapshot table and the second position snapshot table are compared, and the equity data corresponding to the non-automatically cleared position data is calculated based on the smaller position data in the first position snapshot table and the second position snapshot table.
[0127] However, if the storage fails, an alarm will be issued to prompt the staff to handle it.
[0128] Furthermore, if Figure 8 As shown, based on the above data calculation method, the present invention also provides a smart terminal, which includes a processor 10, a memory 20 and a display 30. Figure 8Only some components of the smart terminal are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0129] In some embodiments, the memory 20 may be an internal storage unit of the smart terminal, such as a hard disk or memory of the smart terminal. In other embodiments, the memory 20 may also be an external storage device of the smart terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the smart terminal. Further, the memory 20 may also include both an internal storage unit and an external storage device of the smart terminal. The memory 20 is used to store application software and various types of data installed in the smart terminal, such as program codes for installing the smart terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a computer program 40 is stored on the memory 20, and the computer program 40 can be executed by the processor 10, thereby realizing the data calculation method in the present application.
[0130] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, and is used to run program codes stored in the memory 20 or process data, such as executing a data calculation method.
[0131] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the smart terminal and to display a visual user interface. The components 10-30 of the smart terminal communicate with each other through a system bus.
[0132] In one embodiment, the steps implemented when the processor 10 executes the computer program 40 in the memory 20 can refer to the corresponding description in the above-mentioned data calculation method, and will not be repeated here.
[0133] For reference, in this embodiment, the specific functions of each module of the above-mentioned data calculation system can refer to the corresponding description in the above-mentioned data calculation method, and will not be repeated here.
[0134] Furthermore, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program 40, and when the computer program 40 is executed by a processor, the steps of the above data calculation method are implemented; since the steps of the data calculation method are described in detail above, they will not be repeated here.
[0135] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0137] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0138] In summary, the present invention provides a data calculation method, system, intelligent terminal and storage medium, the method comprising: after taking a first snapshot of the original position data to generate a first position snapshot table, filtering the original position data according to the data update time in the first position snapshot table to obtain filtered position data; after taking a second snapshot of the filtered position data to generate a second position snapshot table, generating a first file, and updating the snapshot synchronization task table after the generation is successful; after the snapshot synchronization task table is successfully updated, calculating the equity data corresponding to the non-automatically cleared position data according to the smaller position data in the first position snapshot table and the second position snapshot table. By comparing the position data in the two position snapshot tables obtained by the two snapshots, and calculating the equity data corresponding to the non-automatically cleared position data according to the smaller position data, the accuracy of calculating the income data is improved.
[0139] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A data calculation method, characterized in that: include: After taking a first snapshot of the original position data to generate a first position snapshot table, the original position data is filtered according to the data update time in the first position snapshot table to obtain filtered position data; After taking a second snapshot of the filtered position data to generate a second position snapshot table, a first file is generated, and after the generation is successful, the snapshot synchronization task table is updated; After the snapshot synchronization task table is successfully updated, the smaller position data in the first position snapshot table and the second position snapshot table is taken to calculate the equity data corresponding to the position data that is not automatically cleared; After taking a first snapshot of the original position data to generate a first position snapshot table, filtering the original position data to obtain filtered position data according to the data update time in the first position snapshot table includes: Taking a first snapshot of the original position data at a first moment to generate the first position snapshot table; At a second moment, according to the data update time of the original position data in the first position snapshot table, the non-automatically cleared position data is filtered out from the original position data to obtain filtered position data; The non-automatically cleared position data includes: the unchanged original position data, and the original position data that has changed between the first moment and the second moment.
2. The data calculation method according to claim 1, characterized in that: Also includes: Calculate the equity data of the automatically cleared position data based on the position data in the first position snapshot table; The automatically cleared position data includes: historical position data that expired between the first moment and the second moment of the first snapshot and was automatically redeemed.
3. The data calculation method according to claim 1, characterized in that: After taking a second snapshot of the filtered position data to generate a second position snapshot table, generating a first file, and updating the snapshot synchronization task table after the generation is successful, including: At the second moment, the filtered position data is written into a second file, and after the writing is successful, the second file is uploaded to a preset directory, and when the uploading is successful, the second file is written into a second position snapshot table to complete the second snapshot; generating the first file when writing is successful, and after determining that the first file is successfully generated, writing a current snapshot record in the snapshot synchronization task table to update the snapshot synchronization task table; The second moment is the equity calculation time corresponding to the first snapshot and the second snapshot.
4. The data calculation method according to claim 3, characterized in that: The step of writing the filtered position data into a second file at the second moment further comprises: Determining whether the filtered position data is successfully written into the second file, and generating an alarm message when it is determined that the writing fails; Wherein, the second file is a plain text file.
5. The data calculation method according to claim 3, characterized in that: After the writing is successful, the second file is uploaded to a preset directory, and then the method further includes: Determine whether the second file is successfully uploaded to the preset directory, and generate an alarm message when it is determined that the upload fails.
6. The data calculation method according to claim 3, characterized in that: When the upload is successful, the second file is written into the second position snapshot table, and then the method further includes: Determining whether the second file is successfully written into the second position snapshot table, and generating an alarm message when determining that the writing fails; The step of generating the first file when the writing is successful further comprises: Determine whether the first file is generated successfully; When it is determined that the generation fails, the judgment is continued after a preset time, and when it is determined that the generation still fails, an alarm message is generated; The first file is a record file.
7. A data computing system, characterized in that: include: A screening module, configured to, after taking a first snapshot of the original position data to generate a first position snapshot table, screen the original position data according to the data update time in the first position snapshot table to obtain screened position data; A snapshot module, for generating a second snapshot table of a second position after taking a second snapshot of the filtered position data, generating a first file, and updating a snapshot synchronization task table after successful generation; A calculation module, configured to obtain the smaller position data between the first position snapshot table and the second position snapshot table after the snapshot synchronization task table is successfully updated, and calculate the equity data corresponding to the position data that is not automatically cleared; After taking a first snapshot of the original position data to generate a first position snapshot table, filtering the original position data to obtain filtered position data according to the data update time in the first position snapshot table includes: Taking a first snapshot of the original position data at a first moment to generate the first position snapshot table; At a second moment, according to the data update time of the original position data in the first position snapshot table, the non-automatically cleared position data is filtered out from the original position data to obtain filtered position data; The non-automatically cleared position data includes: the unchanged original position data, and the original position data that has changed between the first moment and the second moment.
8. An intelligent terminal, characterized in that: include: A memory, a processor, a display, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the data calculation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the steps of the data calculation method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Transaction processing method and apparatus of finance products, computer equipment and storage medium
CN108305173A
Transaction account calculation method and device and computer readable storage medium
CN109658215A