Data table data updating method and device, equipment, medium and program product
By using intermediate table accounting and thread pool allocation technology, the problem of time-consuming and labor-intensive updates to bank big data tables has been solved, achieving efficient and low-risk data table updates and improving the processing performance and batch update efficiency of the banking system.
Patent Information
- Application Number
- CN202511328380.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2026-01-13
AI Technical Summary
When banks reconcile accounts with external institutions, updating large data tables using existing technologies is time-consuming and labor-intensive, and the rollback process after updating erroneous data is also time-consuming, affecting efficiency.
An intermediate table is used for transaction accounting. After confirming that the verification is correct, the data table is updated. The update process is optimized by using thread pools and data segmentation techniques, and threads are allocated using hash functions to allocate computing resources reasonably.
It reduces the database pressure from direct updates to large data tables, improves batch update efficiency, reduces rollback risk, and enhances processing performance and overall efficiency when business ends.
Smart Images

Figure CN121326918A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of big data, and can be applied to the field of financial technology, and more particularly to a data updating method and device for a data table, an equipment, a medium and a program product. BACKGROUND
[0002] The deposit business of a bank is to accept the entrustment of a principal (such as a securities agency, a fund company or other external agencies), and to keep the funds of the bank customers opened in the external agencies. In this process, the bank needs to reconcile with the external agencies regularly (usually daily), record the transaction of the bank customers opened in the external agencies in time, accurately settle the interest, and ensure the safety of the customers' funds, etc.
[0003] The reconciliation is usually based on the transaction change data provided by the external agencies to update the data table for storing the account data of the customers opened in the external agencies. If the number of the bank customers opened in the external agencies is huge, the data table will be very large (for example, it can be as high as tens of thousands or even more account records). Directly updating the data table not only causes huge consumption of the database, but also if the external agencies find errors in the provided transaction change data and update the transaction change data during the reconciliation process, the bank needs to roll back the entire data table and recalculate, which is also very time-consuming. SUMMARY
[0004] The present application provides a data updating method and device for a data table, an equipment, a medium and a program product, which can at least partially solve the above problems.
[0005] In a first aspect, the present application provides a data updating method for a data table. The method comprises: receiving transaction change data sent by an external agency, the transaction change data comprising transaction data of an account in a first data table within a predetermined time period up to the present, the first data table being stored in the external agency; based on the transaction change data, performing transaction accounting on account data in a second data table, and recording change data of the accounts in the second data table that have changed in the transaction accounting to an intermediate table, wherein the second data table is consistent with the account data of the first data table before the predetermined time period; sending the intermediate table to the external agency; receiving a reconciliation result of the intermediate table by the external agency; and when the reconciliation result represents correct reconciliation, updating the second data table based on the intermediate table.
[0006] According to an embodiment of the present application, the method further comprises: deleting the intermediate table when the reconciliation result represents that the reconciliation is incorrect; receiving transaction change data re-sent by the external institution to update the transaction change data; and re-performing transaction reconciliation on account data in the second data table based on the re-sent transaction change data to obtain a new intermediate table.
[0007] According to an embodiment of the present application, the updating the second data table based on the intermediate table when the reconciliation result represents that the reconciliation is correct comprises: when a data amount of the second data table is greater than a first threshold, allocating an independent thread pool to update the second data table; and when the data amount of the second data table is less than the first threshold, updating the second data table in a common thread pool, wherein the common thread pool corresponds to a plurality of external institutions including the external institution.
[0008] According to an embodiment of the present application, the updating the second data table based on the intermediate table when the reconciliation result represents that the reconciliation is correct comprises: calculating a required computing amount and throughput based on a data amount of the second data table; allocating computing resources matching the required computing amount and throughput; and performing an operation of updating the second data table based on the intermediate table by using the computing resources.
[0009] According to an embodiment of the present application, the updating the second data table based on the intermediate table when the reconciliation result represents that the reconciliation is correct comprises: when a number of records of the intermediate table is greater than a second threshold, splitting the intermediate table into different data segments, wherein one record corresponds to one account; allocating independent threads for different data tables; and updating the second data table by different threads in parallel for different data segments.
[0010] According to an embodiment of the present application, the allocating independent threads for different data tables comprises: obtaining a number corresponding to each data segment; mapping the number corresponding to each data segment into a hash value by using a hash function, and then performing a modulo operation on the hash value to obtain a thread number; and creating a corresponding thread for each data segment based on the thread number.
[0011] A second aspect of the embodiment of the present application provides a data updating device of a data table. The device comprises an interaction module, a reconciliation module and an updating module.
[0012] The interaction module is configured to receive transaction change data sent by an external institution, wherein the transaction change data comprises transaction data of accounts in a first data table within a predetermined time period up to the present, and the first data table is stored in the external institution.
[0013] The accounting module is used to perform transaction accounting on the account data in the second data table based on the transaction change data, and record the change data of the accounts that have changed in the second data table during the transaction accounting to an intermediate table; wherein, the account data in the second data table is checked to be consistent with the account data in the first data table before the predetermined time period.
[0014] The interaction module is also used to send the intermediate table to the external organization and receive the verification result of the intermediate table from the external organization.
[0015] The update module is used to update the second data table based on the intermediate table when the verification result indicates that the verification is correct.
[0016] According to an embodiment of the present invention, the apparatus further includes a rollback module. The rollback module is used to delete the intermediate table when the verification result indicates an incorrect verification. The interaction module is also used to receive resent transaction change data from the external institution to update the transaction change data. The calculation module is further used to recalculate the account data in the second data table based on the resent transaction change data to obtain a new intermediate table.
[0017] A third aspect of the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0018] A fourth aspect of the present invention also provides a computer-readable storage medium having a computer program or instructions stored thereon, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.
[0019] A fifth aspect of the present invention also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps of the above-described method. Attached Figure Description
[0020] The above-described features, other objects, and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which:
[0021] Figure 1 The illustration schematically depicts an application scenario of a data update method, apparatus, device, medium, and program product for a data table according to embodiments of the present invention.
[0022] Figure 2 A flowchart illustrating a data update method for a data table according to an embodiment of the present invention is shown schematically.
[0023] Figure 3 The illustration schematically shows the logical architecture of a data table update method according to an embodiment of the present invention;
[0024] Figure 4 The diagram illustrates a segmented parallel update of a data table in a method according to an embodiment of the present invention.
[0025] Figure 5 The schematic diagram illustrates the structure of a separate thread pool in a method according to an embodiment of the present invention;
[0026] Figure 6 A block diagram schematically illustrates a data update apparatus for a data table according to an embodiment of the present invention; and
[0027] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a data table update method according to an embodiment of the present invention. Detailed Implementation
[0028] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the invention. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the invention for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.
[0029] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0030] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0031] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0032] Embodiments of the present invention provide a data update method, apparatus, device, medium, and program product for a data table. According to embodiments of the present invention, an intermediate table can be generated based on transaction change data over a predetermined time period (e.g., one day). If problems are found in the intermediate table data, the data in the intermediate table can be rolled back for secondary clearing. The intermediate table only serves as a data segment corresponding to the predetermined time period (e.g., the interest calculation segment for settlement and interest data). If problems occur, a quick rollback can be performed, requiring only the data of that day's segment to be cleared and interest recalculated.
[0033] Figure 1 The illustration schematically depicts an application scenario of a data update method, apparatus, device, medium, and program product for a data table according to embodiments of the present invention.
[0034] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first external institution 101, a second external institution 102, a third external institution 103, a network 104, and a banking system 105. Network 104 is a medium used to provide a communication link between the first external institution 101, the second external institution 102, the third external institution 103, and the banking system 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0035] The first external institution 101, the second external institution 102, and the third external institution 103 can be servers or clusters. The banking system 105 can be a server or cluster that provides services related to custody business.
[0036] The data update method for the data table provided in this embodiment of the invention can be executed by the bank system 105. Accordingly, the data update device for the data table provided in this embodiment of the invention can be installed in the bank system 105.
[0037] It should be understood that Figure 1 The number and type of networks and servers shown are merely illustrative. Depending on implementation needs, there can be any number and type of networks and servers.
[0038] The following will be based on Figure 1 The described scene, through Figures 2-5 A data update method for a data table according to an embodiment of the present invention will be described in detail.
[0039] Figure 2 A flowchart illustrating a data update method 200 for a data table according to an embodiment of the present invention is shown.
[0040] like Figure 2 As shown, method 200 may include operations S210 to S270.
[0041] In operation S210, transaction change data sent by an external institution is received. This transaction change data includes transaction data of accounts in a first data table stored in the external institution within a predetermined time period up to the present. The external institution can be any one of a first external institution 101, a second external institution 102, or a third external institution 103. In one embodiment, when the external institution is a server or cluster deployed at a securities institution, the transaction change data can be the settlement and interest record after the close of trading on the current trading day, for example, the settlement and interest record obtained by the securities institution from an exchange. This settlement and interest record can record detailed records (such as transaction details) of securities transactions conducted by accounts opened at the securities institution (i.e., accounts in the first data table) during the current trading day.
[0042] In operation S220, based on the transaction change data, transaction accounting is performed on the account data in the second data table, and the change data of the accounts that have changed in the second data table during the transaction accounting is recorded in the intermediate table.
[0043] The second data table is the data stored in the bank system 105 that has been reconciled and confirmed with external institutions before the transaction change occurred. The account data in the second data table is consistent with the account data in the first data table before the predetermined time period.
[0044] In this embodiment of the invention, when performing transaction accounting based on transaction change data, the second data table is not directly updated. Instead, the change data of the accounts that have changed is recorded in an intermediate table, such as... Figure 3 As shown. This avoids direct modification of the main table. The intermediate table can record the changes for each account according to the accounting content, such as changes in account principal and the resulting balance changes, changes in both account principal and interest and the resulting balance changes, or only changes in account accrued interest and the resulting balance changes, etc.
[0045] Next, in operation S230, the intermediate table is sent to the external agency.
[0046] Then, in operation S240, the verification result of the intermediate table by the external agency is received.
[0047] Next, in step S250, determine whether the verification result is correct. If not, proceed to step S260; otherwise, proceed to step S270.
[0048] In operation S260, if the reconciliation result indicates an incorrect reconciliation, the intermediate table is deleted. Then, operation S210 is returned to re-receive transaction change data sent by the external institution. The intermediate table is then recalculated based on the new transaction change data. In this way, when an external institution reports an error in the reconciliation, data rollback and recalculation can be triggered.
[0049] In operation S270, when the verification result indicates that the verification is correct, the second data table is updated based on the intermediate table. In this embodiment, the large table is updated only when the verification result is confirmed to be correct, thus avoiding the computational and time-consuming process of rolling back the large table when errors occur during the reconciliation process.
[0050] Combination Figure 3 As can be seen, after receiving transaction change data, the bank system 105 can perform accounting based on the transaction change data and generate an intermediate table according to the accounting results. The advantages of introducing an intermediate table include at least the following: 1) It avoids frequent updates to the second data table during high-frequency periods; 2) The intermediate table only serves as a slice of change information (such as interest calculation slice) for the current preset time period. If there is an error in the accounting process, it can be quickly rolled back by simply clearing the data of the slice for that day and recalculating interest, avoiding data rollback to the large table (i.e., the second data table). After the intermediate table is confirmed to be correct, the second data table is updated based on the intermediate table; 3) When there are many external institutions, batch update processing can be performed based on the intermediate tables corresponding to multiple external institutions (such as the first external institution 101, the second external institution 102, and the third external institution 103), improving the batch update efficiency of the data tables in the reconciliation.
[0051] According to an embodiment of the present invention, during the operation S270 of updating the second data table based on the intermediate table, if the number of records in the intermediate table exceeds a second threshold, the intermediate table is split into different data segments, each data segment comprising fewer than a predetermined number of records (one record corresponds to the data of one account). Then, independent threads are allocated to different data tables, so that different data segments update the second data table in parallel through different threads, such as... Figure 4 As shown.
[0052] refer to Figure 4 When the intermediate table is large, it is segmented. After each thread starts, it will obtain the data in the data segment corresponding to the thread and process it. Each thread updates the second data table according to the data segment read from the intermediate table, which can improve the data processing efficiency.
[0053] In one embodiment, the intermediate table can be sequentially divided into different data segments, and the data in each segment can be allocated to independent threads for concurrent processing. For example, the minimum and maximum values of the sequential numbers of the data records in the intermediate table can be obtained, and then the table can be divided according to fixed values. The number of threads and the start and end values for each thread to process the data can be calculated. Then, concurrent thread allocation and processing are performed: threads are allocated according to the start and end values of the segments.
[0054] In other embodiments, the number corresponding to each data segment is obtained (it can be numbered sequentially or a corresponding number is generated for each data segment according to a certain strategy). Then, the number corresponding to each data segment is first mapped to a hash value using a hash function, and then the hash value is moduloed to obtain a thread number. Finally, a corresponding thread is created for each data segment based on the thread number. This can avoid the reuse or sharing of threads and improve efficiency.
[0055] Furthermore, in the aforementioned operations S220 and S270, when the amount of data in the second data table exceeds the first threshold, an independent thread pool can be allocated to update the second data table; conversely, when the amount of data in the second data table is less than the first threshold, the second data table is updated in a shared thread pool. This shared thread pool corresponds to multiple external organizations, including the aforementioned external organization. Specifically, as... Figure 5 As shown, when an external institution has a large number of accounts held in custody by the bank, a dedicated thread pool can be allocated for processing. Conversely, when an external institution has a small number of accounts held in custody by the bank, multiple external institutions can share a single thread pool for processing.
[0056] Furthermore, in operations S220 and S270 above, the required computational load and throughput can be estimated based on the data volume of the second data table, and then computing resources matching the required computational load and throughput can be allocated when performing the corresponding operation for corresponding processing. For example, in operation S270, corresponding computing resources are allocated according to the computational load and throughput required for the update operation, and then the operation of updating the second data table based on the intermediate table is performed based on the allocated resources.
[0057] Bank system 105 often needs to perform reconciliation processing on multiple external institutions (such as external institution 101, external institution 102, and external institution 103) within roughly the same time period (e.g., a specific time in the evening) to update the corresponding account data tables in bank system 105. Therefore, to improve the efficiency of batch processing, considering the different resource consumption at different stages of the long process from operation S210 to operation S270, it is possible to... Figure 5As shown, the entire long process is divided into shorter processes. For example, each operation from S210 to S270 can be divided into a short process, or operations S210 to S270 can be combined, or a single operation can be further divided into a short process. Based on the computational load and throughput of each short process, it can be categorized as a high-IO job or a high-CPU job. Then, thread pools for high-IO and high-CPU jobs can be separated. High-CPU tasks (such as end-of-day reconciliation, file readiness notifications, and end-of-day settlement) can be executed concurrently using multiple threads. For example, each container can have 15 threads, and each database shard can have 10 containers. High-IO tasks (such as file transfers and downloads) can be assigned to independent thread pools for execution.
[0058] As can be seen, the embodiments of the present invention can avoid direct updates to the large table (second data table), reducing the overall database pressure. Furthermore, it can avoid direct rollback of the large table, improving batch performance. It reduces risk while improving processing performance. Moreover, it can uniformly update the second data tables corresponding to each external organization at the end of the business, improving batch efficiency. In addition, it can implement thread pool separation for high-IO jobs and high-CPU jobs, and through reasonable resource allocation, achieve reasonable thread usage in the case of large amounts of data, improving the overall batch execution efficiency.
[0059] Based on the data update methods for data tables described in the above embodiments, this invention also provides a data update apparatus for data tables. The following will be combined with... Figure 6 The device is described in detail.
[0060] Figure 6 A block diagram of a data table update apparatus 600 according to an embodiment of the present invention is shown schematically.
[0061] like Figure 6 As shown, the device 600 includes an interaction module 610, a calculation module 620, and an update module 630.
[0062] The interaction module 610 is used to receive transaction change data sent by an external institution. The transaction change data includes transaction data of an account in a first data table within a predetermined time period up to the present. The first data table is stored in the external institution.
[0063] The accounting module 620 is used to perform transaction accounting on the account data in the second data table based on the transaction change data, and record the change data of the accounts that have changed in the second data table during the transaction accounting to an intermediate table; wherein, the account data in the second data table is checked to be consistent with the account data in the first data table before the predetermined time period.
[0064] The interaction module 610 is also used to send the intermediate table to the external organization and receive the verification result of the external organization on the intermediate table.
[0065] The update module 630 is used to update the second data table based on the intermediate table when the verification result indicates that the verification is correct.
[0066] In some embodiments, the device 600 further includes a rollback module. The rollback module is used to delete the intermediate table when the verification result indicates an incorrect verification. The interaction module is also used to receive resent transaction change data from the external institution to update the transaction change data. The calculation module is further used to recalculate the account data in the second data table based on the resent transaction change data to obtain a new intermediate table.
[0067] In one embodiment, the interaction module 610 can perform the operations S210, S230, and S240 described above. The accounting module 620 can perform the operation S220 described above. The update module 630 can perform the operation S270 described above. The rollback module can perform the operation S260 described above.
[0068] According to an embodiment of the present invention, device 600 can perform reference Figure 2 The data update methods for the data tables described herein are explained in detail above and will not be repeated here.
[0069] According to embodiments of the present invention, any plurality of modules among the interaction module 610, accounting module 620, update module 630, and rollback module can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of the present invention, at least one of the interaction module 610, accounting module 620, update module 630, and rollback module can be at least partially implemented as hardware circuitry, such as field-programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits (ASICs), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, at least one of the interaction module 610, accounting module 620, update module 630, and rollback module can be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0070] Figure 7 A block diagram schematically illustrates an electronic device suitable for implementing a data table update method according to an embodiment of the present invention.
[0071] like Figure 7 As shown, an electronic device 900 according to an embodiment of the present invention includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0072] RAM 903 stores various programs and data required for the operation of electronic device 900. Processor 901, ROM 902, and RAM 903 are interconnected via bus 904. Processor 901 executes various operations of the method flow according to embodiments of the present invention by executing programs in ROM 902 and / or RAM 903. It should be noted that the programs may also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 may also execute various operations of the method flow according to embodiments of the present invention by executing programs stored in said one or more memories.
[0073] According to an embodiment of the present invention, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to a bus 904. The electronic device 900 may also include one or more of the following components connected to the input / output (I / O) interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0074] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present invention.
[0075] According to embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of the present invention, a computer-readable storage medium may include ROM 902 and / or RAM 903 and / or one or more memories other than ROM 902 and RAM 903 described above.
[0076] Embodiments of the present invention also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of the present invention.
[0077] When the computer program is executed by the processor 901, it performs the functions defined in the system / apparatus of this invention. According to embodiments of the invention, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0078] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 909, and / or installed from a removable medium 911. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0079] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, it performs the functions defined in the system of this embodiment of the invention. According to embodiments of the invention, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0080] According to embodiments of the present invention, program code for executing the computer programs provided in the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0081] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0082] Those skilled in the art will understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention can be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or combinations fall within the scope of the present invention.
Claims
1. A method for updating data in a data table, wherein, The method includes: Receive transaction change data sent by an external institution, the transaction change data including transaction data of an account in a first data table within a predetermined time period up to the present, the first data table being stored in the external institution; Based on the transaction change data, transaction accounting is performed on the account data in the second data table, and the change data of the accounts that have changed in the second data table during the transaction accounting is recorded in the intermediate table. The account data in the second data table is checked to be consistent with the account data in the first data table before the predetermined time period. Send the intermediate table to the external organization; Receive the verification results of the external organization on the intermediate table; When the verification result indicates that the verification is correct, the second data table is updated based on the intermediate table.
2. The method according to claim 1, wherein, The method further includes: If the verification result indicates that the verification is incorrect, delete the intermediate table; Receive the transaction change data resent by the external institution to update the transaction change data; Based on the resent transaction change data, the account data in the second data table is recalculated to obtain a new intermediate table.
3. The method according to claim 1, wherein, When the verification result indicates that the verification is correct, updating the second data table based on the intermediate table includes: When the amount of data in the second data table exceeds the first threshold, an independent thread pool is allocated to update the second data table. When the amount of data in the second data table is less than the first threshold, the second data table is updated in a public thread pool, wherein the public thread pool corresponds to multiple external organizations, including the external organization.
4. The method according to claim 1, wherein, When the verification result indicates that the verification is correct, updating the second data table based on the intermediate table includes: Based on the data volume of the second data table, calculate the required computational load and throughput; and Allocate computing resources that match the required computational load and throughput; and The computing resources are used to perform the operation of updating the second data table based on the intermediate table.
5. The method according to claim 1, wherein, When the verification result indicates that the verification is correct, updating the second data table based on the intermediate table includes: When the number of records in the intermediate table exceeds the second threshold, the intermediate table is split into different data segments; Allocate separate threads for different data tables; and Different data segments are updated in parallel using different threads in the second data table.
6. The method according to claim 5, wherein, The allocation of independent threads for different data tables includes: Get the number corresponding to each data segment; and The number corresponding to each data segment is first mapped to a hash value using a hash function, and then the thread number is obtained by performing a modulo operation on the hash value. A corresponding thread is created for each data segment based on the thread number.
7. A data update device for a data table, wherein, The device includes: An interaction module is used to receive transaction change data sent by an external institution. The transaction change data includes transaction data of an account in a first data table within a predetermined time period up to the present. The first data table is stored in the external institution. The accounting module is used to perform transaction accounting on the account data in the second data table based on the transaction change data, and record the change data of the accounts that have changed in the second data table during the transaction accounting to an intermediate table; wherein, the account data in the second data table is checked to be consistent with the account data in the first data table before the predetermined time period; The interaction module is also used to send the intermediate table to the external organization and receive the verification result of the external organization on the intermediate table; An update module is used to update the second data table based on the intermediate table when the verification result indicates that the verification is correct.
8. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program or instructions stored thereon, wherein, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program or instructions, wherein, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 6.