Application program testing method and related device
By collecting historical transaction data, generating simulated data and encrypting it in bank data simulated transactions, the problem of insufficient data security in simulated transactions is solved, ensuring that only authorized personnel can obtain sensitive data and improving data security.
Patent Information
- Application Number
- CN202410775163.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-08-27
AI Technical Summary
Existing technology cannot effectively protect the security of bank data when simulating transactions, and there is a risk of data leakage.
By collecting historical transaction data in real bank transaction scenarios, a model is built to generate simulated transaction data, and the data to be detected is divided according to preset rules to determine its sensitivity. If the data is sensitive, it will be encrypted. Only developers with permission can decrypt and obtain this data.
It is realized that only authorized personnel are allowed to obtain sensitive data during application testing, and non-authorized personnel are prevented from obtaining it, which improves data security and avoids data leakage.
Smart Images

Figure CN118550831A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial computer technology, and in particular to an application testing method and related devices. Background Art
[0002] In the process of bank development, in order to promote innovation and cooperation, banks need to provide open APIs to third-party developers to access bank data and services. However, this open and innovative model also brings data security issues. Developers need real-world data to test applications, but testing in a real environment is prone to data leakage and financial risks. Therefore, the current existing technology is to test by simulating real transaction scenarios.
[0003] Currently, there are technical fields similar to simulated transactions in the industry, which allow banks and third-party developers to build, test and deploy open APIs, but there are still the following potential defects or shortcomings: when simulating transactions, developers need to process sensitive data in a test environment, data security issues cannot be well resolved, and there is a risk of data leakage. Summary of the invention
[0004] The main purpose of the present invention is to provide an application testing method, device, computer equipment and storage medium, which can solve the problem of being unable to ensure data security in the prior art.
[0005] To achieve the above object, the present invention provides a first aspect of an application testing method, the method comprising:
[0006] Collect historical transaction data of different transaction types of multiple users in real bank transaction scenarios to obtain a historical transaction data set, perform model training and simulated transaction data generation processing based on the historical transaction data set to obtain simulated transaction data;
[0007] Dividing the simulated transaction data into a plurality of data to be detected according to a preset rule, respectively obtaining the data to be detected in the simulated transaction data, and determining whether the data to be detected is sensitive data according to a preset sensitive data detection rule, and encrypting the data to be detected if the data to be detected is sensitive data;
[0008] A transaction scenario is simulated based on the encrypted simulated transaction data, and application testing is performed under the simulated transaction scenario. When a developer needs to obtain data to be tested that is sensitive data during application testing, it is determined whether the developer has permission to obtain the data to be tested. If the developer has permission to obtain the data to be tested, the data to be tested is decrypted and provided to the developer.
[0009] In combination with the first aspect, in a possible implementation method, the above-mentioned model training and simulated transaction data generation processing are performed according to the historical transaction data set to obtain simulated transaction data, including: establishing a preset simulated transaction data generation model, taking the historical transaction data set as a training set, and inputting historical transaction data of different transaction types in the historical transaction data set into the preset simulated transaction data generation model in sequence according to transaction type, so as to train the preset simulated transaction data generation model and obtain a target preset model; generating simulated transaction data by inputting condition information for generating simulated transaction data into the target preset model, wherein the condition information at least includes the transaction type.
[0010] In combination with the first aspect, in a possible implementation method, the above-mentioned condition information also includes a user ID. After the simulated transaction data is generated by inputting the condition information used to generate the simulated transaction data into the target preset model, the method includes: obtaining historical transaction data of the user ID under the transaction type in the condition information, calculating the similarity between the historical transaction data of the user ID under the transaction type in the condition information and the simulated transaction data, if the similarity does not reach the similarity threshold, improving the target preset model to obtain an improved target preset model, and returning to execute the step of generating the simulated transaction data by inputting the condition information used to generate the simulated transaction data into the target preset model.
[0011] In combination with the first aspect, in a possible implementation method, before the historical transaction data set is used as a training set, it also includes: performing data cleaning on the historical transaction data in the historical transaction data set to identify and process outliers, missing values and duplicate values in the historical transaction data, and standardizing the historical transaction data after data cleaning.
[0012] In combination with the first aspect, in a possible implementation method, the above-mentioned condition information also includes a user ID, and before dividing the simulated transaction data into multiple data to be detected according to preset rules, it includes: obtaining the user ID in the condition information, and obtaining the historical transaction data of the user ID in the condition information, identifying the parameter range of the historical transaction data of the user ID in the condition information, wherein the parameters at least include the transaction amount; determining whether the parameters of the simulated transaction data of the user ID in the condition information are within the parameter range, and if the parameters of the simulated transaction data of the user ID in the condition information are not within the parameter range, adjusting the parameters of the simulated transaction data of the user ID in the condition information to be within the parameter range.
[0013] In combination with the first aspect, in a possible implementation method, the above-mentioned adjustment of the parameters of the simulated transaction data of the user ID in the condition information to be within the parameter range includes: judging the size relationship between the parameter and the parameter range, if the parameter is less than the minimum value within the parameter range, then adding a first preset value on the basis of the parameter to obtain a first parameter value, setting the first parameter value to be the parameter of the simulated transaction data of the user ID in the condition information, and returning to execute the step of judging whether the parameters of the simulated transaction data of the user ID in the condition information are within the parameter range; if the parameter is greater than the maximum value within the parameter range, then reducing the second preset value on the basis of the parameter to obtain a second parameter value, setting the second parameter value to be the parameter of the simulated transaction data of the user ID in the condition information, and returning to execute the step of judging whether the parameters of the simulated transaction data of the user ID in the condition information are within the parameter range.
[0014] In combination with the first aspect, in a possible implementation method, the above-mentioned determination of whether the developer has the authority to obtain the data to be tested includes: determining whether the data to be tested is data required for testing the application; if the data to be tested is data required for testing the application, determining that the developer has the authority to obtain the data to be tested; if the data to be tested is not data required for testing the application, determining that the developer does not have the authority to obtain the data to be tested.
[0015] To achieve the above object, the second aspect of the present invention provides an application testing device, the device comprising:
[0016] Simulation data generation module: used to collect historical transaction data of different transaction types of multiple users in real bank transaction scenarios to obtain a historical transaction data set, perform model training and simulation transaction data generation processing according to the historical transaction data set to obtain simulation transaction data;
[0017] Data encryption module: used to divide the simulated transaction data into multiple data to be detected according to preset rules, respectively obtain the data to be detected in the simulated transaction data, determine whether the data to be detected is sensitive data according to preset sensitive data detection rules, and encrypt the data to be detected if the data to be detected is sensitive data;
[0018] Program testing module: used to simulate transaction scenarios based on encrypted simulated transaction data, and perform application testing under simulated transaction scenarios. When a developer needs to obtain data to be tested that is sensitive data during application testing, it is determined whether the developer has the authority to obtain the data to be tested. If the developer has the authority to obtain the data to be tested, the data to be tested will be decrypted and provided to the developer.
[0019] In combination with the second aspect, in a possible design, the above-mentioned simulation data generation module is specifically used to: establish a preset simulation transaction data generation model, take the historical transaction data set as a training set, and input the historical transaction data of different transaction types in the historical transaction data set into the preset simulation transaction data generation model in sequence according to the transaction type, so as to train the preset simulation transaction data generation model and obtain the target preset model; generate simulation transaction data by inputting condition information used to generate simulation transaction data into the target preset model, wherein the condition information at least includes the transaction type.
[0020] In combination with the second aspect, in a possible design, the above-mentioned simulation data generation module is specifically used to: obtain the historical transaction data of the user ID under the transaction type in the condition information, calculate the similarity between the historical transaction data of the user ID under the transaction type in the condition information and the simulated transaction data, if the similarity does not reach the similarity threshold, improve the target preset model to obtain the improved target preset model, and return to execute the step of generating simulated transaction data by inputting the condition information used to generate simulated transaction data into the target preset model.
[0021] In combination with the second aspect, in one possible design, the above-mentioned simulation data generation module is specifically used to: perform data cleaning on the historical transaction data in the historical transaction data set to identify and process outliers, missing values and duplicate values in the historical transaction data, and standardize the historical transaction data after data cleaning.
[0022] In combination with the second aspect, in a possible design, the above-mentioned data encryption module is specifically used to: obtain the user ID in the conditional information, and obtain the historical transaction data of the user ID in the conditional information, identify the parameter range of the historical transaction data of the user ID in the conditional information, wherein the parameters at least include the transaction amount; determine whether the parameters of the simulated transaction data of the user ID in the conditional information are within the parameter range, and if the parameters of the simulated transaction data of the user ID in the conditional information are not within the parameter range, adjust the parameters of the simulated transaction data of the user ID in the conditional information to be within the parameter range.
[0023] In combination with the second aspect, in one possible design, the above-mentioned simulation data generation module is specifically used to: perform data cleaning on the historical transaction data in the historical transaction data set to identify and process outliers, missing values and duplicate values in the historical transaction data, and standardize the historical transaction data after data cleaning.
[0024] In combination with the second aspect, in a possible design, the above-mentioned data encryption module is specifically used to: obtain the user ID in the conditional information, and obtain the historical transaction data of the user ID in the conditional information, identify the parameter range of the historical transaction data of the user ID in the conditional information, wherein the parameters at least include the transaction amount; determine whether the parameters of the simulated transaction data of the user ID in the conditional information are within the parameter range, and if the parameters of the simulated transaction data of the user ID in the conditional information are not within the parameter range, adjust the parameters of the simulated transaction data of the user ID in the conditional information to be within the parameter range.
[0025] In combination with the second aspect, in a possible design, the above-mentioned data encryption module is specifically used to: determine the size relationship between the parameter and the parameter range; if the parameter is smaller than the minimum value within the parameter range, then add a first preset value to the parameter to obtain a first parameter value, let the first parameter value be the parameter of the simulated transaction data of the user ID in the conditional information, and return to execute the step of determining whether the parameter of the simulated transaction data of the user ID in the conditional information is within the parameter range; if the parameter is greater than the maximum value within the parameter range, then reduce the second preset value to obtain a second parameter value based on the parameter, let the second parameter value be the parameter of the simulated transaction data of the user ID in the conditional information, and return to execute the step of determining whether the parameter of the simulated transaction data of the user ID in the conditional information is within the parameter range.
[0026] In combination with the second aspect, in a possible design, the above-mentioned program testing module is specifically used to: determine whether the data to be tested is the data required for testing the application; if the data to be tested is the data required for testing the application, determine that the developer has the authority to obtain the data to be tested; if the data to be tested is not the data required for testing the application, determine that the developer does not have the authority to obtain the data to be tested.
[0027] To achieve the above object, the third aspect of the present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps:
[0028] Collect historical transaction data of different transaction types of multiple users in real bank transaction scenarios to obtain a historical transaction data set, perform model training and simulated transaction data generation processing based on the historical transaction data set to obtain simulated transaction data;
[0029] Dividing the simulated transaction data into a plurality of data to be detected according to a preset rule, respectively obtaining the data to be detected in the simulated transaction data, and determining whether the data to be detected is sensitive data according to a preset sensitive data detection rule, and encrypting the data to be detected if the data to be detected is sensitive data;
[0030] A transaction scenario is simulated based on the encrypted simulated transaction data, and application testing is performed under the simulated transaction scenario. When a developer needs to obtain data to be tested that is sensitive data during application testing, it is determined whether the developer has permission to obtain the data to be tested. If the developer has permission to obtain the data to be tested, the data to be tested is decrypted and provided to the developer.
[0031] To achieve the above object, a fourth aspect of the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0032] Collect historical transaction data of different transaction types of multiple users in real bank transaction scenarios to obtain a historical transaction data set, perform model training and simulated transaction data generation processing based on the historical transaction data set to obtain simulated transaction data;
[0033] Dividing the simulated transaction data into a plurality of data to be detected according to a preset rule, respectively obtaining the data to be detected in the simulated transaction data, and determining whether the data to be detected is sensitive data according to a preset sensitive data detection rule, and encrypting the data to be detected if the data to be detected is sensitive data;
[0034] A transaction scenario is simulated based on the encrypted simulated transaction data, and application testing is performed under the simulated transaction scenario. When a developer needs to obtain data to be tested that is sensitive data during application testing, it is determined whether the developer has permission to obtain the data to be tested. If the developer has permission to obtain the data to be tested, the data to be tested is decrypted and provided to the developer.
[0035] The embodiments of the present invention have the following beneficial effects:
[0036] The present invention provides an application testing method, which determines sensitive data in simulated transaction data, encrypts the sensitive data, simulates a transaction scenario based on the encrypted simulated transaction data, and performs application testing based on the simulated transaction scenario. When a developer needs to obtain data to be tested that is sensitive data in the application testing, it is determined whether the developer has the authority to obtain the data to be tested. If the developer has the authority to obtain the data to be tested, the data to be tested is decrypted and provided to the developer. In the present invention, only authorized personnel are allowed to obtain sensitive data, and non-authorized personnel are prevented from obtaining sensitive data, so as to avoid data leakage and improve data security. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] in:
[0039] Figure 1 A schematic diagram of a flow chart of an application testing method in an embodiment of the present invention;
[0040] Figure 2 A structural block diagram of an application testing device according to an embodiment of the present invention;
[0041] Figure 3 4 is a structural block diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] In the development banking field, in order to promote innovation and cooperation, banks need to provide open interface APIs to third-party developers to access bank data and services. Third-party developers can be understood as partners of open banking business, such as cooperative enterprises or service providers of open banking business. Banks build a virtual open banking environment by simulating data, simulating real transaction processes, data exchanges and user behaviors. At the same time, this virtual open banking environment includes various bank services, such as payment, account inquiry, transfer, etc. This virtual open banking environment can be understood as a sandbox environment. The sandbox environment is a joint debugging test environment that is completely isolated from the real environment provided by the bank's open platform for developers. Third-party developers can use the sandbox joint debugging to conduct application testing in the sandbox environment.
[0044] In this embodiment, an application testing method is provided, which is used to generate a sandbox environment and implement third-party developer application testing. The method can be executed by a terminal device or server used by a bank developer. Figure 1 , Figure 1 A flowchart of an application testing method provided by an embodiment of the present invention is shown as follows: Figure 1 As shown, the method is specifically shown in steps S101 to S103:
[0045] Step S101: collect historical transaction data of different transaction types of multiple users in real bank transaction scenarios to obtain a historical transaction data set, perform model training and simulated transaction data generation processing based on the historical transaction data set to obtain simulated transaction data.
[0046] Step S102: divide the simulated transaction data into multiple data to be detected according to preset rules, obtain the data to be detected in the simulated transaction data respectively, and determine whether the data to be detected is sensitive data according to preset sensitive data detection rules; if the data to be detected is sensitive data, encrypt the data to be detected.
[0047] Step S103: simulate a transaction scenario based on the encrypted simulated transaction data, and perform application testing in the simulated transaction scenario. When a developer needs to obtain the data to be tested that is sensitive data during application testing, determine whether the developer has the authority to obtain the data to be tested. If the developer has the authority to obtain the data to be tested, decrypt the data to be tested and provide it to the developer.
[0048] Among them, the developer may be a third-party developer.
[0049] In this embodiment, a model for generating simulated transaction data is obtained by training a model, so as to obtain simulated transaction data based on the trained model, wherein the simulated transaction data is data used to simulate a banking transaction scenario.
[0050] First, historical transaction data of different transaction types of multiple users in real banking transaction scenarios are collected to obtain a historical transaction data set. The historical transaction data is transaction data in real banking business. In order to improve model training, the historical transaction data set should contain historical transaction data of all possible transaction types as much as possible. Transaction type refers to a financial action in which investors and merchants complete fund transfers in various markets such as investment and financial management activities. This includes transaction behaviors such as payment, buying and selling, deposit / withdrawal, settlement, financing, margin and investment, as well as other possible financial actions.
[0051] Model training and simulated transaction data generation processing are performed based on the historical transaction data set to obtain simulated transaction data, as shown in steps S201 to S202:
[0052] Step S201, establish a preset simulated transaction data generation model, take the historical transaction data set as a training set, and input the historical transaction data of different transaction types in the historical transaction data set into the preset simulated transaction data generation model in sequence according to the transaction type, so as to train the preset simulated transaction data generation model and obtain a target preset model.
[0053] Step S202: Generate simulated transaction data by inputting condition information for generating simulated transaction data into the target preset model.
[0054] The preset simulated transaction data generation model is a machine learning model for generating simulated transaction data. The historical transaction data set is used as a training set. The historical transaction data of different transaction types in the historical transaction data set are input into the preset simulated transaction data generation model in sequence according to the transaction type to train the preset simulated transaction data generation model and obtain the target preset model. In a possible implementation, before the historical transaction data set is used as a training set, the historical transaction data in the historical transaction data set is cleaned to identify and process outliers, missing values and duplicate values in the historical transaction data, and the cleaned historical transaction data is standardized to ensure data consistency and reduce the complexity of subsequent processing.
[0055] In one possible implementation, the historical transaction data set can be divided into a training set and a test set according to a preset ratio. The training set is used to train the preset simulated transaction data generation model, and the test set is used to test the trained preset simulated transaction data generation model to optimize the trained preset simulated transaction data generation model and improve the accuracy of the target preset model.
[0056] In a possible implementation, the preset simulated transaction data generation model can be a generative adversarial network (GANs). Generative adversarial networks (GANs) are an innovative architecture for deep learning. The basic idea is to learn data distribution through competition between two neural networks. The two neural networks are a generator and a discriminator. The generator is responsible for learning to generate data similar to real data from random noise, and the discriminator is used to try to distinguish between generated data and real data. The competition between the two promotes the continuous evolution of the model, so that the generated data gradually approaches the real data distribution. In this embodiment, different GANs variants (such as Conditional GANs) are investigated for open banking scenarios to better control the generated data. Realistic data can be generated through adversarial training. The generation effect can also be optimized by adjusting the hyperparameters of the preset simulated transaction data generation model (such as learning rate, number of layers of generator and discriminator, etc.).
[0057] In this embodiment, the condition information for generating simulated transaction data can be input into the target preset model to generate simulated transaction data, wherein the condition information at least includes the transaction type, and the condition information can be freely set according to the needs. In addition to the transaction type, the condition information can also include a user ID, and the user ID is selected from the user IDs of users corresponding to the historical transaction data in the training set. In a possible implementation, the condition information can also include transaction amount, transaction behavior, transaction frequency, etc.
[0058] This embodiment provides a greater degree of customization and flexibility, allowing bank developers to input conditional information based on actual needs to create a variety of transaction scenarios. Bank developers can define different transaction behaviors, transaction types, transaction volumes, and transaction frequencies to meet the testing requirements of different applications.
[0059] In a possible implementation, in order to improve the accuracy of the target preset model, this embodiment further performs the following steps after obtaining the simulated transaction data, with specific reference to step S301:
[0060] Step S301, obtaining the historical transaction data of the user ID under the transaction type in the condition information, calculating the similarity between the historical transaction data of the user ID under the transaction type in the condition information and the simulated transaction data, if the similarity does not reach the similarity threshold, improving the target preset model to obtain the improved target preset model, and returning to execute the step of generating the simulated transaction data by inputting the condition information used to generate the simulated transaction data into the target preset model.
[0061] The condition information also includes a user ID. Since there may not be only one user ID in the condition information, but there may be multiple user IDs, the simulated transaction data includes simulated transaction data corresponding to each user ID. Specifically, the historical transaction data of each user ID in the condition information under the transaction type in the condition information is obtained to obtain the historical transaction data corresponding to each user ID, and the similarity between the historical transaction data corresponding to each user ID and the simulated transaction data corresponding to each user ID is calculated respectively. If the similarity corresponding to each user ID does not reach the similarity threshold, the target preset model is improved to obtain the improved target preset model, and the step of generating simulated transaction data by inputting the condition information used to generate simulated transaction data into the target preset model is returned. For example, the condition information includes user IDs 12, 13, and 14, and the transaction type in the condition information is withdrawal. Then, the historical transaction data of user ID12, user ID13, and user ID14 in the withdrawal transaction behavior are obtained respectively, and the historical transaction data corresponding to user ID12, user ID13, and user ID14 are obtained respectively, and the simulated transaction data corresponding to each user ID in the withdrawal transaction behavior is obtained, and a first similarity between the historical transaction data corresponding to user ID12 and the simulated transaction data corresponding to user ID12, a second similarity between the historical transaction data corresponding to user ID13 and the simulated transaction data corresponding to user ID13, and a third similarity between the historical transaction data corresponding to user ID14 and the simulated transaction data corresponding to user ID14 are calculated respectively. If the first similarity and the second similarity reach the similarity threshold, and the third similarity does not reach the similarity threshold, the target preset model is improved to obtain an improved target preset model, and the improved target preset model is re-adopted to generate the simulated transaction data, that is, return to execute the step of generating the simulated transaction data by inputting the condition information used to generate the simulated transaction data into the target preset model. If the first similarity, the second similarity and the third similarity all reach the similarity threshold, the subsequent step S102 is continued to be executed.
[0062] The method for improving the target preset model is to adjust the model parameters and retrain the target preset model. The model parameters include at least the number of iterations. In one possible implementation method, the number of iterations used when training the preset simulated transaction data generation model to obtain the current target preset model is obtained, and the preset number of iterations is increased on the basis of the number of iterations to obtain the target number of iterations. The target preset model is retrained based on the target number of iterations and the historical transaction data set to obtain an improved target preset model.
[0063] Step S302 can further improve the validity of the simulated transaction data finally generated.
[0064] Furthermore, the simulated transaction data is divided into a plurality of data to be detected according to a preset rule, wherein the preset rule may be to divide the simulated transaction data into a plurality of data to be detected according to the transaction type, for example, the transaction data used for payment is divided into a type of data to be detected, and the transaction data used for deposit / withdrawal is divided into a type of data to be detected. The divided data to be detected are obtained, and for the obtained data to be detected, it is determined whether the data to be detected is sensitive data according to the preset sensitive data detection rule, and if the data to be detected is sensitive data, the data to be detected is encrypted.
[0065] In order to make the simulated transaction data used for the simulated transaction scenario closer to the real transaction data, so as to improve the transaction scenario closer to the real transaction scenario, in this embodiment, before dividing the simulated transaction data into a plurality of data to be detected according to the preset rules, the following steps are further performed, with specific reference to steps S401-S402:
[0066] Step S401: Acquire the user ID in the condition information, and acquire the historical transaction data of the user ID in the condition information, and identify the parameter range of the historical transaction data of the user ID in the condition information.
[0067] Step S402, determine whether the parameters of the simulated transaction data of the user ID in the condition information are within the parameter range; if the parameters of the simulated transaction data of the user ID in the condition information are not within the parameter range, adjust the parameters of the simulated transaction data of the user ID in the condition information to be within the parameter range.
[0068] The condition information may include a user ID, obtain historical transaction data of the user ID in the condition information, identify the parameter range in the historical transaction data of the user ID in the condition information, the parameter at least includes the transaction amount, and the parameter range can be determined by the minimum and maximum values of the parameter. For example, the user ID in the condition information is 12, and all transaction types in the historical transaction data include payment and deposit. Then, the maximum transaction amount of the payment transaction behavior and the deposit transaction behavior in the historical transaction data of the user ID 12 is 50 yuan and the minimum transaction amount is 500 yuan, and the parameter range is [50,500]. Determine whether the parameters of the simulated transaction data corresponding to the user ID in the condition information are within the parameter range. If the parameters of the simulated transaction data of the user ID in the condition information are not within the parameter range, adjust the parameters of the simulated transaction data of the user ID in the condition information to be within the parameter range. For the specific method of adjusting the parameters, refer to steps S501-S502:
[0069] Step S501, determine the size relationship between the parameter and the parameter range. If the parameter is less than the minimum value within the parameter range, add a first preset value to the parameter to obtain a first parameter value. Let the first parameter value be the parameter of the simulated transaction data of the user ID in the conditional information, and return to execute the step of determining whether the parameter of the simulated transaction data of the user ID in the conditional information is within the parameter range.
[0070] Step S502: if the parameter is greater than the maximum value within the parameter range, reduce the second preset value based on the parameter to obtain the second parameter value, and let the second parameter value be the parameter of the simulated transaction data of the user ID in the conditional information, and return to execute the step of determining whether the parameter of the simulated transaction data of the user ID in the conditional information is within the parameter range.
[0071] Determine the relationship between the parameters in the simulated transaction data corresponding to the user ID in the condition information and the parameter range. If the parameters in the simulated transaction data corresponding to the user ID in the condition information are smaller than the minimum value within the parameter range, then add the first preset value on the basis of the parameters to obtain the first parameter value. If the first parameter value after adding the first preset value is still smaller than the minimum value within the parameter range, it means that the first parameter value needs to be further increased. If the first parameter value after adding the first preset value is within the parameter range, then there is no need to adjust the first parameter value. Therefore, in this embodiment, after adding the first preset value on the basis of the parameters to obtain the first parameter value, it is still necessary to continue to determine whether the first parameter value is within the parameter range, that is, let the first parameter value be the parameter of the simulated transaction data of the user ID in the condition information, and return to execute the step of determining whether the parameters of the simulated transaction data of the user ID in the condition information are within the parameter range.
[0072] If the parameter in the simulated transaction data corresponding to the user ID in the conditional information is greater than the maximum value within the parameter range, the second preset value is reduced on the basis of the parameter to obtain the second parameter value. Similarly, if the second parameter value after reducing the second preset value is still greater than the maximum value within the parameter range, it means that the second parameter value needs to be further reduced. If the second parameter value after reducing the second preset value is within the parameter range, there is no need to adjust the second parameter value. Therefore, in this embodiment, after reducing the second preset value on the basis of the parameter to obtain the second parameter value, it is still necessary to continue to determine whether the second parameter value is within the parameter range, that is, let the second parameter value be the parameter of the simulated transaction data of the user ID in the conditional information, and return to execute the step of determining whether the parameter of the simulated transaction data of the user ID in the conditional information is within the parameter range.
[0073] According to the encrypted simulated transaction data, a transaction scenario is simulated to obtain a virtual open bank environment. Based on the application testing in the simulated transaction scenario, third-party developers can conduct application testing through sandbox joint debugging, so as to achieve cooperation between bank developers and third-party developers in application testing. In a possible implementation, an embodiment of the present invention can introduce an intelligent simulation engine generated based on simulated transaction data, and generate a simulated transaction scenario based on the intelligent simulation engine.
[0074] During the application testing process, third-party developers can access simulated transaction data through the sandbox environment. In order to improve data security, when the simulated transaction data that the third-party developer needs to obtain during application testing is sensitive data to be tested, it is determined whether the third-party developer has the permission to obtain the data to be tested. If the third-party developer has the permission to obtain the data to be tested, the data to be tested will be decrypted and provided to the third-party developer for use. If the third-party developer does not have the permission to obtain the data to be tested, the third-party developer is prohibited from obtaining the data to be tested.
[0075] Among them, the method for judging whether the developer has the authority to obtain the data to be tested is:
[0076] Step S601: determine whether the data to be detected is data required for testing the application; if the data to be detected is data required for testing the application, determine whether the developer has the authority to obtain the data to be detected.
[0077] Step S602: If the data to be tested is not data required for testing the application, it is determined that the developer does not have the authority to obtain the data to be tested.
[0078] In this embodiment, a list of data required for application testing can be stored in advance. Based on the list of data, it is determined whether the data to be tested is the data required for the application to be tested. If the data to be tested is the data required for the application to be tested, it is determined that the developer has the authority to obtain the data to be tested. If the data to be tested is not the data required for the application to be tested, it is determined that the developer does not have the authority to obtain the data to be tested. The above method can ensure that different applications can only access the data they need.
[0079] In one possible implementation, after simulating a transaction scenario based on the encrypted simulated transaction data, the transaction activities in the simulated transaction scenario are tracked, and a preset intelligent algorithm is used to detect whether there is abnormal behavior. When abnormal behavior is detected, the simulated transaction scenario is interrupted to ensure the security of the system and data.
[0080] In one possible implementation, data isolation technology is used to ensure that simulated transaction data is completely isolated from historical transaction data to avoid leakage of sensitive information.
[0081] Based on the above method, sensitive data in simulated transaction data is determined, the sensitive data is encrypted, a transaction scenario is simulated based on the encrypted simulated transaction data, and application testing is performed under the simulated transaction scenario. When a developer needs to obtain data to be tested that is sensitive data during application testing, it is determined whether the developer has the authority to obtain the data to be tested. If the developer has the authority to obtain the data to be tested, the data to be tested is decrypted and provided to the developer. In the present invention, only authorized personnel are allowed to obtain sensitive data, and non-authorized personnel are prevented from obtaining sensitive data, thereby avoiding data leakage and improving data security.
[0082] In order to better implement the above method, the embodiment of the present invention provides an application testing device, which can perform all the steps related functions in the above method, referring to Figure 2 , Figure 2 A structural block diagram of an application testing device provided by an embodiment of the present invention, such as Figure 2 As shown, the device 20 specifically includes:
[0083] Simulation data generation module 201: used to collect historical transaction data of different transaction types of multiple users in real bank transaction scenarios to obtain a historical transaction data set, and perform model training and simulation transaction data generation processing according to the historical transaction data set to obtain simulation transaction data;
[0084] Data encryption module 202: used to divide the simulated transaction data into multiple data to be detected according to preset rules, respectively obtain the data to be detected in the simulated transaction data, determine whether the data to be detected is sensitive data according to preset sensitive data detection rules, and encrypt the data to be detected if the data to be detected is sensitive data;
[0085] Program testing module 203: used to simulate transaction scenarios based on encrypted simulated transaction data, and perform application testing in the simulated transaction scenarios. When a developer needs to obtain data to be tested that is sensitive data during application testing, it is determined whether the developer has the authority to obtain the data to be tested. If the developer has the authority to obtain the data to be tested, the data to be tested will be decrypted and provided to the developer.
[0086] In one possible design, the simulation data generation module 201 is specifically used to: establish a preset simulation transaction data generation model, take the historical transaction data set as a training set, and input the historical transaction data of different transaction types in the historical transaction data set into the preset simulation transaction data generation model in sequence according to the transaction type, so as to train the preset simulation transaction data generation model and obtain a target preset model; generate simulation transaction data by inputting condition information used to generate simulation transaction data into the target preset model, wherein the condition information at least includes the transaction type.
[0087] In one possible design, the simulation data generation module 201 is specifically used to: obtain the historical transaction data of the user ID under the transaction type in the condition information, calculate the similarity between the historical transaction data of the user ID under the transaction type in the condition information and the simulated transaction data, if the similarity does not reach the similarity threshold, improve the target preset model to obtain the improved target preset model, and return to execute the step of generating the simulated transaction data by inputting the condition information used to generate the simulated transaction data into the target preset model.
[0088] In one possible design, the simulation data generation module 201 is specifically used to: perform data cleaning on the historical transaction data in the historical transaction data set to identify and process abnormal values, missing values and duplicate values in the historical transaction data, and standardize the historical transaction data after data cleaning.
[0089] In one possible design, the data encryption module 202 is specifically used to: obtain the user ID in the conditional information, and obtain the historical transaction data of the user ID in the conditional information, identify the parameter range of the historical transaction data of the user ID in the conditional information, wherein the parameter includes at least the transaction amount; determine whether the parameters of the simulated transaction data of the user ID in the conditional information are within the parameter range, and if the parameters of the simulated transaction data of the user ID in the conditional information are not within the parameter range, adjust the parameters of the simulated transaction data of the user ID in the conditional information to be within the parameter range.
[0090] In one possible design, the data encryption module 202 is specifically used to: determine the size relationship between the parameter and the parameter range; if the parameter is less than the minimum value within the parameter range, then add a first preset value to the parameter to obtain a first parameter value, let the first parameter value be the parameter of the simulated transaction data of the user ID in the conditional information, and return to execute the step of determining whether the parameter of the simulated transaction data of the user ID in the conditional information is within the parameter range; if the parameter is greater than the maximum value within the parameter range, then reduce a second preset value to obtain a second parameter value based on the parameter, let the second parameter value be the parameter of the simulated transaction data of the user ID in the conditional information, and return to execute the step of determining whether the parameter of the simulated transaction data of the user ID in the conditional information is within the parameter range.
[0091] In one possible design, the program testing module 203 is specifically used to: determine whether the data to be tested is the data required for testing the application; if the data to be tested is the data required for testing the application, determine that the developer has the authority to obtain the data to be tested; if the data to be tested is not the data required for testing the application, determine that the developer does not have the authority to obtain the data to be tested.
[0092] Based on the above device, unauthorized personnel can be prevented from obtaining sensitive data, thereby avoiding data leakage and improving data security.
[0093] Figure 3 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a terminal or a server. Figure 3 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement all the steps of the above method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement all the steps of the above method. Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0094] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes each step of the aforementioned method.
[0095] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes each step of the aforementioned method.
[0096] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0097] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0098] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An application testing method, characterized in that: The method comprises: Collect historical transaction data of different transaction types of multiple users in real bank transaction scenarios to obtain a historical transaction data set, perform model training and simulated transaction data generation processing based on the historical transaction data set to obtain simulated transaction data; Dividing the simulated transaction data into a plurality of data to be detected according to a preset rule, respectively obtaining the data to be detected in the simulated transaction data, and determining whether the data to be detected is sensitive data according to a preset sensitive data detection rule, and encrypting the data to be detected if the data to be detected is sensitive data; A transaction scenario is simulated based on the encrypted simulated transaction data, and application testing is performed under the simulated transaction scenario. When a developer needs to obtain data to be tested that is sensitive data during application testing, it is determined whether the developer has permission to obtain the data to be tested. If the developer has permission to obtain the data to be tested, the data to be tested is decrypted and provided to the developer.
2. The method according to claim 1, characterized in that The performing of model training and simulated transaction data generation processing according to the historical transaction data set to obtain simulated transaction data includes: Establishing a preset simulated transaction data generation model, taking the historical transaction data set as a training set, and inputting historical transaction data of different transaction types in the historical transaction data set into the preset simulated transaction data generation model in sequence according to transaction types, so as to train the preset simulated transaction data generation model and obtain a target preset model; The simulated transaction data is generated by inputting condition information for generating simulated transaction data into the target preset model, wherein the condition information at least includes a transaction type.
3. The method according to claim 2, characterized in that The condition information also includes a user ID. After the condition information for generating simulated transaction data is input into the target preset model, the simulated transaction data is generated, including: Obtain historical transaction data of the user ID under the transaction type in the condition information, calculate the similarity between the historical transaction data of the user ID under the transaction type in the condition information and the simulated transaction data, if the similarity does not reach the similarity threshold, improve the target preset model to obtain the improved target preset model, and return to execute the step of generating the simulated transaction data by inputting the condition information used to generate the simulated transaction data into the target preset model.
4. The method according to claim 2, characterized in that: Before the historical transaction data set is used as a training set, the method further includes: Data cleaning is performed on the historical transaction data in the historical transaction data set to identify and process abnormal values, missing values and duplicate values in the historical transaction data, and to standardize the historical transaction data after data cleaning.
5. The method according to claim 2, characterized in that: The condition information also includes a user ID. Before dividing the simulated transaction data into a plurality of to-be-detected data according to a preset rule, the following steps are performed: Obtaining a user ID in the condition information, and obtaining historical transaction data of the user ID in the condition information, and identifying a parameter range of the historical transaction data of the user ID in the condition information, wherein the parameter includes at least a transaction amount; Determine whether the parameters of the simulated transaction data of the user ID in the condition information are within the parameter range; if the parameters of the simulated transaction data of the user ID in the condition information are not within the parameter range, adjust the parameters of the simulated transaction data of the user ID in the condition information to be within the parameter range.
6. The method according to claim 5, characterized in that The parameter of the simulated transaction data of the user ID in the condition information is adjusted within the parameter range, including: Determine the magnitude relationship between the parameter and the parameter range. If the parameter is less than the minimum value within the parameter range, add a first preset value to the parameter to obtain a first parameter value, set the first parameter value as the parameter of the simulated transaction data of the user ID in the condition information, and return to execute the step of determining whether the parameter of the simulated transaction data of the user ID in the condition information is within the parameter range. If the parameter is greater than the maximum value within the parameter range, then reduce the second preset value based on the parameter to obtain the second parameter value, let the second parameter value be the parameter of the simulated transaction data of the user ID in the conditional information, and return to execute the step of determining whether the parameter of the simulated transaction data of the user ID in the conditional information is within the parameter range.
7. The method according to claim 1, characterized in that The determining whether the developer has the authority to obtain the data to be detected includes: Determining whether the data to be tested is data required for testing the application, and if the data to be tested is data required for testing the application, determining that the developer has the authority to obtain the data to be tested; If the data to be tested is not data required for testing the application, it is determined that the developer does not have the authority to obtain the data to be tested.
8. An application testing device, characterized in that: The device comprises: Simulation data generation module: used to collect historical transaction data of different transaction types of multiple users in real bank transaction scenarios to obtain a historical transaction data set, perform model training and simulation transaction data generation processing according to the historical transaction data set to obtain simulation transaction data; Data encryption module: used to divide the simulated transaction data into multiple data to be detected according to preset rules, respectively obtain the data to be detected in the simulated transaction data, determine whether the data to be detected is sensitive data according to preset sensitive data detection rules, and encrypt the data to be detected if the data to be detected is sensitive data; Program testing module: used to simulate transaction scenarios based on encrypted simulated transaction data, and perform application testing under simulated transaction scenarios. When a developer needs to obtain data to be tested that is sensitive data during application testing, it is determined whether the developer has the authority to obtain the data to be tested. If the developer has the authority to obtain the data to be tested, the data to be tested will be decrypted and provided to the developer.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
10. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
