Database updating method and apparatus, electronic device, and storage medium

By acquiring incremental transaction data from the production database, filtering and using a transaction data recommendation model to identify similar target transaction data, the problem of low synchronization efficiency caused by the large volume of transaction data in the production database was solved, and the quality and efficiency of test data were improved.

CN117149796BActive Publication Date: 2026-01-06BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311204022.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2026-01-06
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

In the development of financial software, the production database contains a large amount of transaction data, and the process of synchronizing it to the test database is inefficient, which affects testing efficiency.

Method used

Periodically retrieve incremental transaction data from the production database, filter out business transaction data that failed, and use a transaction data recommendation model to identify similar target transaction data, which is then uploaded to the test database.

Benefits of technology

This reduced the amount of data, improved the quality and efficiency of test data, and ensured the effectiveness of software testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117149796B_ABST
    Figure CN117149796B_ABST
Patent Text Reader

Abstract

The application provides a database updating method and device, electronic equipment and storage medium, which can be used in the field of artificial intelligence technology. The method comprises the following steps: periodically acquiring incremental transaction data from a production database; the incremental transaction data comprises first transaction data corresponding to a plurality of business transactions; acquiring second transaction data corresponding to a business transaction with transaction failure from the incremental transaction data; inputting the incremental transaction data into a trained transaction data recommendation model; determining target transaction data similar to the second transaction data from the incremental transaction data by using the transaction data recommendation model; and uploading the second transaction data and the target transaction data similar to the second transaction data into a test database. It can be seen that the method not only reduces the data volume, but also helps the filtered transaction data more than other transaction data in the incremental transaction data for software testing, thereby ensuring the quality of the test data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a database update method, apparatus, electronic device, and storage medium. Background Technology

[0002] In the fintech field, during the development of financial software, after obtaining the corresponding code files, functional testing is required to identify any issues. The test data used in this process typically comes from transaction data stored in the production database.

[0003] In related technologies, transaction data in the production database is typically synchronized to the test database using either a full update or an incremental update. However, the production database contains a large amount of data, and the synchronization process takes a considerable amount of time, resulting in low efficiency. Summary of the Invention

[0004] This application provides a database update method, apparatus, electronic device, and storage medium, which not only reduces the amount of data, but also ensures the quality of test data by selecting transaction data that is more helpful than other transaction data in the incremental transaction data for software testing.

[0005] Firstly, this application provides a database update method, including:

[0006] Periodically retrieve incremental transaction data from the production database; the incremental transaction data includes first transaction data corresponding to multiple business transactions respectively;

[0007] Obtain second transaction data from the incremental transaction data; the second transaction data is the transaction data corresponding to the failed business transaction.

[0008] The second transaction data is input into the trained transaction data recommendation model, and the transaction data recommendation model is used to determine target transaction data similar to the second transaction data from the incremental transaction data;

[0009] The second transaction data and the target transaction data similar to the second transaction data are uploaded to the test database, and the transaction data in the test database is used for software testing.

[0010] Optionally, determining target transaction data similar to the second transaction data from the incremental transaction data using the transaction data recommendation model includes:

[0011] The transaction data recommendation model is adopted:

[0012] Determine the transaction data similarity between each of the first transaction data (excluding the second transaction data) and the second transaction data in the incremental transaction data;

[0013] The first transaction data with the highest similarity to the transaction data is determined as the target transaction data.

[0014] Optionally, the transaction data includes multiple transaction parameters; determining the transaction data similarity between each of the first transaction data (excluding the second transaction data) and the second transaction data in the incremental transaction data includes:

[0015] For each of the first transaction data other than the second transaction data in the incremental transaction data:

[0016] Determine the parameter similarity between each first transaction parameter in the first transaction data and the corresponding second transaction parameter in the second transaction data;

[0017] According to the preset weights corresponding to each of the first transaction parameters, the parameter similarity corresponding to the multiple first transaction parameters is fused to obtain the transaction data similarity between the first transaction data and the second transaction data.

[0018] Optionally, the step of fusing the parameter similarities corresponding to the multiple first transaction parameters according to preset weights to obtain the transaction data similarity between the first transaction data and the second transaction data includes any one of the following:

[0019] According to the preset weights corresponding to each of the first transaction parameters, the parameter similarity corresponding to the multiple first transaction parameters is weighted and summed to obtain the transaction data similarity between the first transaction data and the second transaction data.

[0020] According to the preset weights corresponding to each of the first transaction parameters, the parameter similarity corresponding to the multiple first transaction parameters is weighted and averaged to obtain the transaction data similarity between the first transaction data and the second transaction data.

[0021] Optionally, the training process of the transaction data recommendation model includes:

[0022] Acquire a first sample transaction data and multiple second sample transaction data corresponding to the first sample transaction data, wherein each second sample transaction data carries a sample tag, the sample tag indicating whether the second sample transaction data is similar to the first sample transaction data;

[0023] Using the sample labels as supervision data, the transaction data recommendation model is iteratively trained based on the first sample transaction data and the multiple second sample transaction data;

[0024] If the transaction data recommendation model after iterative training satisfies the preset convergence condition, then the transaction data recommendation model that satisfies the preset convergence condition is determined as the completed transaction data recommendation model.

[0025] Optionally, the step of using the sample labels as supervised data and iteratively training the transaction data recommendation model based on the first sample transaction data and the plurality of second sample transaction data includes:

[0026] The first sample transaction data and the plurality of second sample transaction data are input into the transaction data recommendation model, and the transaction data recommendation model is used to determine the transaction data similarity between each second sample transaction data and the first sample transaction data.

[0027] Substitute the transaction data similarity and sample label corresponding to each of the second sample transaction data into a preset loss function to determine the loss value;

[0028] The model parameters of the transaction data recommendation model are adjusted based on the loss value to obtain the iteratively trained transaction data recommendation model.

[0029] Optionally, the first transaction data includes a reference identifier, which indicates whether the business transaction corresponding to the first transaction data was successful or failed; obtaining the second transaction data from the incremental transaction data includes:

[0030] The first transaction data in the incremental transaction data, which indicates a failed business transaction based on a reference identifier, is determined as the second transaction data.

[0031] Optionally, uploading the second transaction data and the target transaction data similar to the second transaction data to the test database includes:

[0032] The second transaction data and the target transaction data similar to the second transaction data are packaged together to obtain a packaged file;

[0033] The packaged file is sent to the device corresponding to the test database, so that the device decompresses the packaged file and stores the decompressed transaction data into the test database.

[0034] Secondly, this application provides a database updating apparatus, comprising:

[0035] The acquisition module is used to periodically acquire incremental transaction data from the production database; the incremental transaction data includes first transaction data corresponding to multiple business transactions respectively;

[0036] The acquisition module is further configured to acquire second transaction data from the incremental transaction data; the second transaction data is the transaction data corresponding to the failed business transaction;

[0037] The determination module is used to input the second transaction data into the trained transaction data recommendation model, and use the transaction data recommendation model to determine target transaction data similar to the second transaction data from the incremental transaction data;

[0038] An upload module is used to upload the second transaction data and the target transaction data similar to the second transaction data to a test database, wherein the transaction data in the test database is used for software testing.

[0039] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0040] The memory stores computer-executed instructions;

[0041] The processor executes computer execution instructions stored in the memory to implement the database update method as described in any of the first aspects.

[0042] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the database update method described in any one of the first aspects.

[0043] Fifthly, this application provides a computer program product, including computer execution instructions, which, when executed by a processor, implement the database update method described in any of the first aspects.

[0044] The database update method, apparatus, electronic device, and storage medium provided in this application periodically obtain incremental transaction data from the production database, then perform preliminary screening on the incremental transaction data to obtain second transaction data corresponding to failed business transactions, and then use a transaction data recommendation model to screen the incremental transaction data to determine target transaction data similar to the second transaction data. The second transaction data and the target transaction data are regarded as test data and uploaded to the test database. It can be seen that not only is the amount of data reduced, but for software testing, the screened transaction data is more helpful than other transaction data in the incremental transaction data, thus ensuring the quality of test data. Attached Figure Description

[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0046] Figure 1 This is a schematic diagram illustrating an application scenario according to an exemplary embodiment;

[0047] Figure 2 This is a flowchart illustrating a database update method according to an exemplary embodiment;

[0048] Figure 3 This is a flowchart illustrating a database update method according to another exemplary embodiment;

[0049] Figure 4 This is a schematic diagram illustrating the training process of a transaction data recommendation model according to an exemplary embodiment;

[0050] Figure 5 This is a schematic diagram illustrating the structure of a database update apparatus according to an exemplary embodiment;

[0051] Figure 6 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment.

[0052] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation

[0053] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0054] The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. In the following descriptions of embodiments, "a plurality of" means two or more, unless otherwise explicitly defined.

[0055] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0056] It should be noted that the database update method, apparatus, electronic device and storage medium of this application can be used in the field of artificial intelligence technology, or in any field other than artificial intelligence technology. This application does not limit the application field of the database update method, apparatus, electronic device and storage medium.

[0057] To clearly understand the technical solution of this application, the solutions of the prior art will be described in detail first.

[0058] In the fintech field, during the development of financial software, after obtaining the corresponding code files, functional testing is required to identify any issues. The test data used in this process typically comes from transaction data stored in the production database.

[0059] In related technologies, transaction data in the production database is typically synchronized to the test database using either a full update or an incremental update. However, the production database contains a large amount of data, and the synchronization process takes a considerable amount of time, resulting in low efficiency.

[0060] Addressing the technical issues of large data volumes and time-consuming synchronization processes in production databases, the inventors discovered a solution: incremental transaction data in the production database can be filtered before being synchronized to the test database. Considering that the transaction data in the test database is used for software testing to identify problems in the financial software's code files, transaction data corresponding to failed business transactions is more beneficial for software testing. Accordingly, transaction data corresponding to failed business transactions can be filtered from the incremental transaction data. Specifically, incremental transaction data is periodically retrieved from the production database, then initially filtered to obtain second transaction data corresponding to failed business transactions. A transaction data recommendation model is then used to further filter the incremental transaction data, identifying target transaction data similar to the second transaction data. This second and target transaction data are considered test data and uploaded to the test database. This approach not only reduces the data volume but also ensures the quality of the filtered transaction data, making it more beneficial for software testing than other transaction data in the incremental data.

[0061] The application scenarios of the database update method provided in the embodiments of this application are described below.

[0062] Figure 1 This is a schematic diagram illustrating an application scenario according to an exemplary embodiment. For example... Figure 1 As shown, this application scenario includes an electronic device 1. Electronic device 1 is a device for updating the database. In some embodiments, electronic device 1 connects to a production database and a test database. The production database stores transaction data generated during actual production. The test database stores transaction data used for software testing. In this embodiment, the electronic device periodically retrieves incremental transaction data from the production database, i.e., first transaction data corresponding to multiple business transactions. Then, it retrieves second transaction data corresponding to failed business transactions from the incremental transaction data. Next, it uses a transaction data recommendation model to determine target transaction data similar to the second transaction data from the incremental transaction data. Finally, it uploads the second transaction data and the target transaction data similar to the second transaction data to the test database.

[0063] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0064] Figure 2 This is a schematic flowchart illustrating a database update method according to an exemplary embodiment. The execution entity of the database update method provided in this embodiment is a database update device, which is integrated into an electronic device. For example... Figure 2 As shown, the database update method provided in this embodiment includes the following steps:

[0065] Step S101: Periodically retrieve incremental transaction data from the production database; the incremental transaction data includes the first transaction data corresponding to multiple business transactions.

[0066] The electronic device connects to a production database and a test database. The production database stores transaction data generated during actual production. The test database stores transaction data used for software testing. Both the production and test databases contain a large amount of transaction data, and as the financial software is launched and used by users, the amount of transaction data generated increases, leading to a continuous increase in the production database. Accordingly, the electronic device periodically retrieves incremental transaction data from the production database. The period for retrieving incremental transaction data can be set as needed; this embodiment does not limit this, for example, a period of 1 day, 3 days, or 7 days. Incremental transaction data refers to the transaction data generated within this period. A business transaction is any business transaction implemented through the financial software, such as a transfer or remittance. Each business transaction has corresponding transaction data, which includes multiple transaction parameters. These parameters may include transaction identifier, transaction location, transaction type, and user account.

[0067] In this embodiment, after acquiring incremental transaction data, the incremental transaction data is filtered, and the filtered transaction data is uploaded to the test database. Accordingly, the electronic device executes step S102.

[0068] Step S102: Obtain the second transaction data from the incremental transaction data; the second transaction data is the transaction data corresponding to the failed business transaction.

[0069] There are two possible outcomes for business transactions: successful and failed. Considering that the transaction data in the test database is used for software testing to identify problems in the financial software's code files, the transaction data corresponding to failed business transactions is more helpful for software testing. Accordingly, the second transaction data corresponding to failed business transactions can be obtained from the incremental transaction data.

[0070] Step S103: Input the second transaction data into the trained transaction data recommendation model, and use the transaction data recommendation model to determine target transaction data similar to the second transaction data from the incremental transaction data.

[0071] In this process, the input data for the transaction data recommendation model is the second transaction data, and the output data is the target transaction data similar to the second transaction data. In this step, the transaction data recommendation model needs to determine the target transaction data from the incremental transaction data. Since the incremental transaction data includes the second transaction data, to prevent the transaction data recommendation model from identifying the second transaction data in the incremental transaction data as the target transaction data, the first transaction data other than the second transaction data in the incremental transaction data can be considered as reference transaction data. Accordingly, the reference transaction data can be set as a hyperparameter of the transaction data recommendation model before step S103. Alternatively, the reference transaction data can be used as the reference data corresponding to the second transaction data and input together with the second transaction data into the transaction data recommendation model so that the transaction data recommendation model can obtain the reference transaction data.

[0072] Step S104: Upload the second transaction data and target transaction data similar to the second transaction data to the test database. The transaction data in the test database is used for software testing.

[0073] In this embodiment, after determining the target transaction data, the second transaction data and the target transaction data are uploaded to the test database so that software testing can be performed using the transaction data in the test database.

[0074] In this embodiment, incremental transaction data is periodically retrieved from the production database. Then, the incremental transaction data is initially screened to obtain the second transaction data corresponding to the failed business transactions. A transaction data recommendation model is then used to further screen the incremental transaction data to identify target transaction data similar to the second transaction data. The second transaction data and the target transaction data are regarded as test data and uploaded to the test database. It can be seen that this not only reduces the amount of data, but also that for software testing, the screened transaction data is more helpful than other transaction data in the incremental transaction data, thus ensuring the quality of the test data.

[0075] Figure 3 This is a schematic flowchart illustrating a database update method according to another exemplary embodiment. The execution entity of the database update method provided in this embodiment is a database update device, which is integrated into an electronic device. For example... Figure 3 As shown, the database update method provided in this embodiment includes the following steps:

[0076] Step S201: Periodically retrieve incremental transaction data from the production database; the incremental transaction data includes the first transaction data corresponding to multiple business transactions.

[0077] In this embodiment, the implementation of step S201 is the same as that of step S101 described above, and will not be repeated here.

[0078] Step S202: Obtain the second transaction data from the incremental transaction data; the second transaction data is the transaction data corresponding to the failed business transaction.

[0079] In this context, a business transaction refers to any business transaction implemented through financial software. Each business transaction has corresponding transaction data, which includes multiple transaction parameters. These parameters may include transaction identifier, transaction location, transaction type, and user account. A business transaction has two possible outcomes: successful or failed. Considering that the transaction data in the test database is used for software testing to identify problems in the financial software's code files, the transaction data corresponding to failed business transactions is more helpful for software testing. Therefore, the second transaction data corresponding to failed business transactions can be obtained from the incremental transaction data.

[0080] Optionally, the first transaction data includes multiple transaction parameters, including a reference identifier and other transaction parameters. The reference identifier indicates whether the business transaction corresponding to the first transaction data was successful or failed. For example, the reference identifier is 0 or 1, where 0 indicates a failed transaction and 1 indicates a successful transaction. Accordingly, the implementation method for obtaining the second transaction data from the incremental transaction data includes: determining the first transaction data in the incremental transaction data whose reference identifier indicates a failed business transaction as the second transaction data.

[0081] In this embodiment, since the reference identifier can indicate whether the business transaction corresponding to the first transaction data is successful or unsuccessful, the accuracy of the determined second transaction data is high by determining the first transaction data, which indicates that the business transaction has failed, as the second transaction data.

[0082] After acquiring the second transaction data, the electronic device inputs the second transaction data into the trained transaction data recommendation model, and uses the transaction data recommendation model to determine target transaction data similar to the second transaction data from the incremental transaction data. Optionally, the implementation of using the transaction data recommendation model to determine target transaction data similar to the second transaction data from the incremental transaction data includes the following steps S203-S204:

[0083] Step S203: Using a transaction data recommendation model, determine the transaction data similarity between each of the first transaction data (excluding the second transaction data) and the second transaction data in the incremental transaction data.

[0084] Transaction data similarity is used to represent the degree of similarity between corresponding first and second transaction data. A higher transaction data similarity indicates a greater degree of similarity, and vice versa.

[0085] In one alternative implementation, step S203 is implemented by including the following steps S2031-S2032:

[0086] Step S2031: For each first transaction data in the incremental transaction data other than the second transaction data: determine the parameter similarity between each first transaction parameter in the first transaction data and the corresponding second transaction parameter in the second transaction data.

[0087] Here, parameter similarity is used to represent the degree of similarity between a first transaction parameter and its corresponding second transaction parameter. For example, if the first and second transaction parameters are represented as feature vectors, then the parameter similarity is the cosine similarity between the feature vectors. For instance, if the first transaction data includes three first transaction parameters: parameter A, parameter B, and parameter C, and the second transaction data includes three second transaction parameters: parameter a, parameter b, and parameter c, then the parameter similarity between parameter A and parameter a, the parameter similarity between parameter B and parameter b, and the parameter similarity between parameter C and parameter c are determined respectively.

[0088] Step S2032: According to the preset weights corresponding to each first transaction parameter, the parameter similarity corresponding to multiple first transaction parameters is fused to obtain the transaction data similarity between the first transaction data and the second transaction data.

[0089] In this embodiment, each transaction parameter in the transaction data has a pre-set weight. The pre-set weight can be seen as the degree of influence of the transaction parameter on the transaction data; the larger the pre-set weight, the greater the influence, and vice versa. The pre-set weights can be set as needed, and this embodiment does not limit this. For example, the pre-set weights for the three transaction parameters are 0.4, 0.3, and 0.3, respectively.

[0090] In this embodiment, when determining the similarity of transaction data, the parameter similarity between the first transaction parameter and the corresponding second transaction parameter is taken into account. The greater the parameter similarity, the greater the similarity between the transaction parameters; the smaller the parameter similarity, the smaller the similarity between the transaction parameters. In addition, the preset weights corresponding to each transaction parameter in the transaction data are also taken into account. The greater the preset weight, the greater the influence of the transaction parameter on the transaction data; the smaller the preset weight, the smaller the influence of the transaction parameter on the transaction data. The determined transaction data similarity is relatively accurate.

[0091] Optionally, the implementation method of the fusion processing can be set as needed, and this embodiment does not limit it. For example, it can be weighted summation or weighted average. Accordingly, the implementation method of step S2032 includes any of the following:

[0092] The first method involves weighted summation of the parameter similarities corresponding to multiple first transaction parameters according to their respective preset weights, to obtain the transaction data similarity between the first transaction data and the second transaction data. The weighted summation value is then determined as the transaction data similarity.

[0093] The second method involves performing a weighted average of the parameter similarities corresponding to multiple first transaction parameters according to their respective preset weights, to obtain the transaction data similarity between the first transaction data and the second transaction data. The average value obtained from the weighted average is then determined as the transaction data similarity.

[0094] This embodiment provides two fusion processing methods: the weighted summation method is simpler than the weighted average method, while the weighted average method is more accurate than the weighted summation method.

[0095] In another optional implementation, step S203 includes: for each first transaction data in the incremental transaction data other than the second transaction data: determining the parameter similarity between each first transaction parameter in the first transaction data and the corresponding second transaction parameter in the second transaction data; and determining the average value of the parameter similarities corresponding to the multiple first transaction parameters as the transaction data similarity between the first transaction data and the second transaction data. This method is simpler than the optional implementations described above.

[0096] Step S204: The first transaction data with the highest similarity to the transaction data is identified as the target transaction data.

[0097] It should be noted that the number of first transaction data in the incremental transaction data is relatively large. Accordingly, the target number of first transaction data with the highest similarity can all be determined as target transaction data, thus obtaining a larger amount of test data. The target number can be set as needed, and this embodiment does not limit it. For example, the target number can be 10, 20, or 30.

[0098] In this embodiment, the greater the similarity of the transaction data, the greater the similarity between the first transaction data and the second transaction data. Therefore, the first transaction data with the highest similarity is the transaction data with the highest similarity to the second transaction data among the incremental transaction data. Thus, the first transaction data can be identified as the target transaction data, and the identified target transaction data is more valuable for software testing.

[0099] Step S205: Upload the second transaction data and target transaction data similar to the second transaction data to the test database. The transaction data in the test database is used for software testing.

[0100] In this embodiment, after determining the target transaction data, the second transaction data and the target transaction data are uploaded to the test database so that software testing can be performed using the transaction data in the test database.

[0101] In one alternative implementation, if the electronic device is connected to the test database, the electronic device directly stores the second transaction data and the target transaction data into the test database.

[0102] In another optional implementation, the test database has a corresponding device, and the electronic device is communicatively connected to the device. Then, step S205 is implemented by: packaging the second transaction data and target transaction data similar to the second transaction data into a package file; sending the package file to the device corresponding to the test database so that the device can decompress the package file and store the decompressed transaction data into the test database.

[0103] In this embodiment, transaction data is uploaded as a packaged file, which can speed up the upload process and improve upload efficiency.

[0104] The above embodiments illustrate a database update method for determining target transaction data from incremental transaction data using a transaction data recommendation model. The training process of the transaction data recommendation model will be described below.

[0105] Figure 4 This is a schematic diagram illustrating the training process of a transaction data recommendation model according to an exemplary embodiment. The execution entity for the training process of the transaction data recommendation model provided in this embodiment is a database update device, which is integrated into an electronic device. For example... Figure 4 As shown, the training process of the transaction data recommendation model provided in this embodiment includes the following steps:

[0106] Step S301: Obtain first sample transaction data and multiple second sample transaction data corresponding to the first sample transaction data, and each second sample transaction data carries a sample label, which indicates whether the second sample transaction data is similar to the first sample transaction data.

[0107] The sample labels are pre-labeled manually. The representation of the sample labels can be set as needed; this embodiment does not limit this. For example, the sample label can be 0 or 1, where 0 indicates dissimilarity and 1 indicates similarity. The number of multiple second sample transaction data can be set as needed; this embodiment does not limit this, for example, the number can be 2, 4, or 6.

[0108] It should be noted that the training process of the transaction data recommendation model includes multiple iterations of training, and the number of first sample transaction data is relatively large. For ease of description, this embodiment will use 1 as the number of first sample transaction data.

[0109] Step S302: Using sample labels as supervised data, the transaction data recommendation model is iteratively trained based on the first sample transaction data and multiple second sample transaction data.

[0110] The training process of the transaction data recommendation model is a supervised learning process. The number of initial sample transaction data used in each training iteration can be set as needed, and this embodiment does not limit this. For ease of description, this embodiment uses 1 initial sample transaction data to illustrate the process.

[0111] Optionally, step S302 can be implemented by including the following steps S3021-S3023:

[0112] Step S3021: Input the first sample transaction data and multiple second sample transaction data into the transaction data recommendation model, and use the transaction data recommendation model to determine the transaction data similarity between each second sample transaction data and the first sample transaction data.

[0113] The implementation method of step S3021 is the same as that of step S203 above, and will not be repeated here.

[0114] Step S3022: Substitute the transaction data similarity and sample label corresponding to each second sample transaction data into the preset loss function to determine the loss value.

[0115] Here, transaction data similarity is used to represent the degree of similarity between the first sample transaction data and the second sample transaction data. The smaller the difference between the transaction data similarity and the sample label, the closer the transaction data similarity and the sample label are; conversely, the larger the difference, the less close the transaction data similarity and the sample label are. The preset loss function can be set as needed, and this embodiment does not limit it. For example, the preset loss function can be the cross-entropy loss function. The smaller the loss value, the more accurate the prediction of the transaction data recommendation model; the larger the loss value, the less accurate the prediction of the transaction data recommendation model. Accordingly, the training objective of the transaction data recommendation model is to make the loss value approach 0.

[0116] Step S3023: Adjust the model parameters of the transaction data recommendation model based on the loss value to obtain the transaction data recommendation model after iterative training.

[0117] After determining the loss value, the model parameters of the transaction data recommendation model are adjusted based on the loss value. Specifically, the transaction data recommendation model is backpropagated based on the loss value to adjust the model parameters, thereby obtaining the transaction data recommendation model after iterative training.

[0118] In this embodiment, an iterative training method is provided. By supervising the similarity of transaction data determined by the transaction data recommendation model based on sample labels, the model parameters of the transaction data recommendation model can be gradually adjusted based on the loss value during iterative training, thereby making the accuracy of the transaction data recommendation model higher and higher.

[0119] Step S303: If the transaction data recommendation model after iterative training satisfies the preset convergence condition, then the transaction data recommendation model that satisfies the preset convergence condition is determined as the completed transaction data recommendation model.

[0120] In this embodiment, if the transaction data recommendation model after iterative training does not meet the preset convergence condition, the transaction data recommendation model after iterative training will be trained again in the next iteration.

[0121] The preset convergence conditions can be set as needed, and this embodiment does not limit them. For example, the preset convergence conditions are that the number of training times reaches a threshold, or that the loss value is less than a threshold. The number of training times threshold and the loss value threshold can be set as needed, and this embodiment does not limit them.

[0122] In this embodiment, a training method for a transaction data recommendation model is provided. The transaction data recommendation model is trained through supervised learning, which enables the model to learn the similarity between the first sample transaction data and the second sample transaction data during the training process. As a result, the trained transaction data recommendation model is more accurate and can identify more accurate target transaction data.

[0123] This embodiment does not limit the network structure of the transaction data recommendation model. For example, the transaction data recommendation model can be a deep learning model, a machine learning model, etc. For example, the transaction data recommendation model is a content-based model.

[0124] Figure 5 This is a schematic diagram illustrating the structure of a database update apparatus according to an exemplary embodiment, such as... Figure 5 As shown, in this embodiment, the database update device 400 can be installed in an electronic device, and the database update device 400 includes:

[0125] The acquisition module 401 is used to periodically acquire incremental transaction data from the production database; the incremental transaction data includes the first transaction data corresponding to multiple business transactions.

[0126] The acquisition module 401 is also used to acquire second transaction data from the incremental transaction data; the second transaction data is the transaction data corresponding to the failed business transaction.

[0127] The determination module 402 is used to input the second transaction data into the trained transaction data recommendation model, and use the transaction data recommendation model to determine the target transaction data similar to the second transaction data from the incremental transaction data;

[0128] Upload module 403 is used to upload the second transaction data and target transaction data similar to the second transaction data to the test database. The transaction data in the test database is used for software testing.

[0129] Optionally, module 402 is specifically used for:

[0130] Recommendation model based on transaction data:

[0131] Determine the transaction data similarity between each of the first transaction data (excluding the second transaction data) and the second transaction data in the incremental transaction data;

[0132] The first transaction with the highest similarity to the transaction data is identified as the target transaction data.

[0133] Optionally, the transaction data includes multiple transaction parameters; the determination module 402 is specifically used for:

[0134] For each of the first transaction data points in the incremental transaction data, excluding the second transaction data:

[0135] Determine the parameter similarity between each first transaction parameter in the first transaction data and the corresponding second transaction parameter in the second transaction data;

[0136] According to the preset weights corresponding to each first transaction parameter, the parameter similarity corresponding to multiple first transaction parameters is fused to obtain the transaction data similarity between the first transaction data and the second transaction data.

[0137] Optionally, module 402 is specifically used for:

[0138] According to the preset weights corresponding to each first transaction parameter, the parameter similarity corresponding to multiple first transaction parameters is weighted and summed to obtain the transaction data similarity between the first transaction data and the second transaction data; or...

[0139] According to the preset weights corresponding to each first transaction parameter, the parameter similarity corresponding to multiple first transaction parameters is weighted and averaged to obtain the transaction data similarity between the first transaction data and the second transaction data.

[0140] Optionally, the device 400 also includes a training module, which is used for:

[0141] Obtain first sample transaction data and multiple second sample transaction data corresponding to the first sample transaction data, and each second sample transaction data carries a sample label, the sample label indicating whether the second sample transaction data is similar to the first sample transaction data;

[0142] Using sample labels as supervised data, the transaction data recommendation model is iteratively trained based on the first sample transaction data and multiple second sample transaction data.

[0143] If the transaction data recommendation model after iterative training satisfies the preset convergence condition, then the transaction data recommendation model that satisfies the preset convergence condition is determined as the completed transaction data recommendation model.

[0144] Optionally, the training module is specifically used for:

[0145] The first sample transaction data and multiple second sample transaction data are input into the transaction data recommendation model. The transaction data recommendation model is used to determine the transaction data similarity between each second sample transaction data and the first sample transaction data.

[0146] Substitute the transaction data similarity and sample label corresponding to each second sample transaction data into the preset loss function to determine the loss value;

[0147] The model parameters of the transaction data recommendation model are adjusted based on the loss value to obtain the transaction data recommendation model after iterative training.

[0148] Optionally, the first transaction data includes a reference identifier, which indicates whether the business transaction corresponding to the first transaction data was successful or failed; the acquisition module 401 is specifically used for:

[0149] The first transaction data in the incremental transaction data that indicates a failed business transaction is identified as the second transaction data.

[0150] Optionally, the upload module 403 is used for:

[0151] The second transaction data and target transaction data similar to the second transaction data are packaged together to obtain a packaged file;

[0152] Send a packaged file to the device corresponding to the test database so that the device can decompress the packaged file and store the decompressed transaction data into the test database.

[0153] The database update device provided in this embodiment can execute the technical solution of the corresponding method embodiment. Its implementation principle and technical effect are similar to those of the corresponding method embodiment, and will not be described in detail here.

[0154] This application also provides an electronic device. The electronic device is intended for various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.

[0155] Figure 6 This is a schematic diagram illustrating the structure of an electronic device according to an exemplary embodiment. For example... Figure 6 As shown, the electronic device 500 includes a processor 501 and a memory 502 communicatively connected to the processor 501.

[0156] The memory 502 stores computer-executable instructions; the processor 501 executes the computer-executable instructions stored in the memory 502 to implement the database update method provided in this application.

[0157] In this embodiment, the memory 502 and the processor 501 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0158] The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein. The various components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required.

[0159] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores computer-executable instructions that, when executed by a processor, are used to implement the database update method provided in this application.

[0160] In an exemplary embodiment, a computer program product is also provided, including computer execution instructions, which, when executed by a processor, are used to implement the database update method provided in this application.

[0161] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0162] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0163] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0164] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.

[0165] When an integrated unit / module is implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic component. Unless otherwise specified, memory can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as USB flash drives, random-access memory (RAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), enhanced dynamic random-access memory (EDRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), resistive random access memory (RRAM), high-bandwidth memory (HBM), and hybrid memory cube (HMC). Cube, magnetic storage, flash memory, disk, optical disk, portable hard drive or magnetic disk, and other media that can store program code.

[0166] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application.

[0167] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0168] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0169] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A database updating method characterized by comprising: The method comprises: periodically obtaining incremental transaction data from a production database; the incremental transaction data comprises first transaction data corresponding to a plurality of business transactions respectively; from the incremental transaction data, obtaining second transaction data; the second transaction data is transaction data corresponding to a business transaction that fails; inputting the second transaction data into a trained transaction data recommendation model, and using the transaction data recommendation model to determine target transaction data similar to the second transaction data from the incremental transaction data; uploading the second transaction data and the target transaction data similar to the second transaction data to a test database, wherein the transaction data in the test database is used for software testing; the using the transaction data recommendation model to determine target transaction data similar to the second transaction data from the incremental transaction data comprises: using the transaction data recommendation model: determining the transaction data similarity between each of the first transaction data in the incremental transaction data except the second transaction data and the second transaction data respectively; determining the first transaction data with the maximum transaction data similarity as the target transaction data.

2. The method of claim 1, wherein, The transaction data comprises a plurality of transaction parameters; the determining the transaction data similarity between each of the first transaction data in the incremental transaction data except the second transaction data and the second transaction data respectively comprises: for each of the first transaction data in the incremental transaction data except the second transaction data: determining the parameter similarity between each first transaction parameter in the first transaction data and the corresponding second transaction parameter in the second transaction data respectively; performing fusion processing on the parameter similarity corresponding to each of the first transaction parameters according to a preset weight corresponding to each of the first transaction parameters, to obtain the transaction data similarity between the first transaction data and the second transaction data.

3. The method of claim 2, wherein, The fusion processing on the parameter similarity corresponding to each of the first transaction parameters according to a preset weight corresponding to each of the first transaction parameters to obtain the transaction data similarity between the first transaction data and the second transaction data comprises any one of the following: performing weighted summation processing on the parameter similarity corresponding to each of the first transaction parameters according to a preset weight corresponding to each of the first transaction parameters, to obtain the transaction data similarity between the first transaction data and the second transaction data; performing weighted average processing on the parameter similarity corresponding to each of the first transaction parameters according to a preset weight corresponding to each of the first transaction parameters, to obtain the transaction data similarity between the first transaction data and the second transaction data.

4. The method according to any one of claims 1 to 3, characterized in that, The training process of the transaction data recommendation model comprises: obtaining first sample transaction data and a plurality of second sample transaction data corresponding to the first sample transaction data, and each of the second sample transaction data carries a sample label, wherein the sample label indicates whether the second sample transaction data is similar to the first sample transaction data; The sample label is used as supervised data, and a transaction data recommendation model is iteratively trained based on the first sample transaction data and the plurality of second sample transaction data. If the transaction data recommendation model after iterative training meets a preset convergence condition, the transaction data recommendation model meeting the preset convergence condition is determined as the trained transaction data recommendation model.

5. The method of claim 4, wherein, The sample label is used as supervised data, and a transaction data recommendation model is iteratively trained based on the first sample transaction data and the plurality of second sample transaction data. The first sample transaction data and the plurality of second sample transaction data are input into the transaction data recommendation model, and the transaction data recommendation model is used to determine the transaction data similarity between each of the second sample transaction data and the first sample transaction data. The transaction data similarity corresponding to each of the second sample transaction data and the sample label are substituted into a preset loss function to determine a loss value. Based on the loss value, the model parameters of the transaction data recommendation model are adjusted to obtain the transaction data recommendation model after iterative training.

6. The method of claim 1, wherein, The first transaction data includes a reference identifier, and the reference identifier indicates that the first transaction data corresponds to a successful or failed business transaction; The second transaction data is obtained from the incremental transaction data, including: The first transaction data in the incremental transaction data whose reference identifier indicates a failed business transaction is determined as the second transaction data.

7. A database updating apparatus characterized by comprising: Including: An acquisition module is configured to periodically acquire incremental transaction data from a production database; the incremental transaction data includes a plurality of first transaction data corresponding to a plurality of business transactions, respectively; The acquisition module is further configured to obtain second transaction data from the incremental transaction data; the second transaction data is transaction data corresponding to a failed business transaction; A determination module is configured to input the second transaction data into a trained transaction data recommendation model, and use the transaction data recommendation model to determine target transaction data similar to the second transaction data from the incremental transaction data; An upload module is configured to upload the second transaction data and the target transaction data similar to the second transaction data into a test database; the transaction data in the test database is used for software testing; The determination module is specifically configured to use the transaction data recommendation model to: Determine the transaction data similarity between each of the first transaction data in the incremental transaction data except the second transaction data and the second transaction data, respectively; Determine the first transaction data with the maximum transaction data similarity as the target transaction data.

8. An electronic device, comprising: Including: A processor and a memory in communication connection with the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the database updating method of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the database updating method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Distributed on-line money access card transaction processing system

    CA2233969A1

  • Data update method and device of inventory system

    CN106557482A