Business testing method, computer device, storage medium and computer program product
Through automated business testing methods, data analysis and verification technology are used to solve the problem of low efficiency of traditional manual testing and achieve efficient and accurate business testing results.
Patent Information
- Application Number
- CN202210137724.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-02-15
AI Technical Summary
Traditional business testing mainly relies on manual conduct, resulting in low testing efficiency.
By obtaining the original business data table, generating business input data, and inputting it into the business executor for processing, data analysis is performed using the associated file structure and analysis strategy, target business data table is generated, and finally determining the test results of the business executor through data verification.
Automated business testing is realized, improving testing efficiency and accuracy.
Smart Images

Figure CN114490415B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technologies, and in particular, to a service testing method, a computer device, a storage medium, and a computer program product. Background Art
[0002] With the development of computer technologies, in many cases, service processing can be performed through a service executor based on program codes to obtain required data. For example, according to service processing logics, abnormal judgments are made on transaction data in the financial field to determine whether there are abnormalities in the transaction data.
[0003] In traditional technologies, it is necessary to test the service executor to determine whether the service processing logics of the service executor are correct. Currently, service testing mainly relies on manual operations, resulting in low testing efficiency. Summary of the Invention
[0004] Based on this, it is necessary to provide a service testing method, a computer device, a computer-readable storage medium, and a computer program product for the above technical problems.
[0005] In a first aspect, the present application provides a service testing method. The method includes: obtaining an original service data table, and obtaining service input data from the original service data table; inputting the service input data into a service executor for processing to obtain a service processing file; obtaining an associated file structure corresponding to the service processing file, performing data parsing on the service processing file according to a parsing strategy corresponding to the associated file structure, and writing the parsed service processing data into a service data table to obtain a target service data table; performing data verification based on the original service data table and the target service data table to obtain a data verification result, where the data verification result is used to determine a service testing result of the service executor.
[0006] In a second aspect, the present application further provides a service testing device. The device includes: a service input data obtaining module, configured to obtain an original service data table and obtain service input data from the original service data table; a processing module, configured to input the service input data into a service executor for processing to obtain a service processing file; a target service data table obtaining module, configured to obtain an associated file structure corresponding to the service processing file, perform data parsing on the service processing file according to a parsing strategy corresponding to the associated file structure, and write the parsed service processing data into a service data table to obtain a target service data table; and a data verification module, configured to perform data verification based on the original service data table and the target service data table to obtain a data verification result, where the data verification result is used to determine a service testing result of the service executor.
[0007] In some embodiments, the target business data table obtaining module is configured to: obtain the file name of the service processing file, and determine whether the file name matches the naming rule corresponding to the target file structure; when they match, use the target file structure as the associated file structure.
[0008] In some embodiments, the target business data table obtaining module is configured to: when the file name does not match the naming rule corresponding to the target file structure, use the parent file structure corresponding to the service processing file as the associated file structure; obtain the structural inheritance relationship between the file structure corresponding to the service processing file and the parent file structure; perform data parsing on the service processing file according to the structural inheritance relationship and the parsing strategy corresponding to the parent file structure.
[0009] In some embodiments, performing data parsing on the service processing file according to the structural inheritance relationship and the parsing strategy corresponding to the parent file structure includes: determining, according to the structural inheritance relationship, the content of the first sub-file in the service processing file that inherits the parent file structure, and using the file content other than the content of the first sub-file in the service processing file as the content of the second sub-file; performing data parsing on the content of the first sub-file according to the parsing strategy corresponding to the parent file structure, and performing data parsing on the content of the second sub-file according to the preset field matching rule.
[0010] In some embodiments, the data verification module is configured to: obtain the data identifier corresponding to the target service processing data in the target business data table; obtain the original service processing data corresponding to the data identifier from the original business data table, and perform consistency verification on the target service processing data and the original service processing data to obtain a consistency verification result.
[0011] In some embodiments, the processing module is configured to: determine the associated data pairs in the service input data; input the service input data into a service executor for processing, and during the processing, when it is detected that the forward processing data of the associated data pair is processed, trigger an execution interruption instruction to interrupt the service processing process; when the interruption duration reaches the duration threshold, trigger a continue execution instruction to cause the service executor to continue to execute the service processing process for the service input data, and obtain a service processing file after processing.
[0012] In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: obtaining an original service data table, and obtaining service input data from the original service data table; inputting the service input data into a service executor for processing to obtain a service processing file; obtaining an associated file structure corresponding to the service processing file, performing data parsing on the service processing file according to a parsing strategy corresponding to the associated file structure, and writing the parsed service processing data into a service data table to obtain a target service data table; performing data verification based on the original service data table and the target service data table to obtain a data verification result, and the data verification result is used to determine a service test result of the service executor
[0013] In a fourth aspect, the present application also provides a computer-readable storage medium. On the computer-readable storage medium, a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: obtaining an original service data table, and obtaining service input data from the original service data table; inputting the service input data into a service executor for processing to obtain a service processing file; obtaining an associated file structure corresponding to the service processing file, performing data parsing on the service processing file according to a parsing strategy corresponding to the associated file structure, and writing the parsed service processing data into a service data table to obtain a target service data table; performing data verification based on the original service data table and the target service data table to obtain a data verification result, and the data verification result is used to determine a service test result of the service executor.
[0014] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented: obtaining an original service data table, and obtaining service input data from the original service data table; inputting the service input data into a service executor for processing to obtain a service processing file; obtaining an associated file structure corresponding to the service processing file, performing data parsing on the service processing file according to a parsing strategy corresponding to the associated file structure, and writing the parsed service processing data into a service data table to obtain a target service data table; performing data verification based on the original service data table and the target service data table to obtain a data verification result, and the data verification result is used to determine a service test result of the service executor.
[0015] The above-mentioned business testing method, device, computer equipment, storage medium and computer program product obtain an original business data table, generate business input data according to the original business data table; input the business input data into a business executor for processing to obtain a business processing file; obtain an associated file structure corresponding to the business processing file, perform data parsing on the business processing file according to the parsing strategy corresponding to the associated file structure, and write the parsed business processing data into a business data table to obtain a target business data table; perform data verification based on the original business data table and the target business data table to obtain a data verification result, and the data verification result is used to determine the business testing result of the business executor. Since business input data can be obtained based on the original business data table, and then a business processing file can be obtained based on the business input data, and this business processing file can be parsed according to the corresponding associated file structure to obtain a target business data table, and data verification is performed based on this target business data table and the original business data table, it is possible to determine whether the business processing logic of the business executor is correct based on the data verification result, obtain an accurate business testing result, and be able to automatically perform business testing, thus improving the efficiency of business testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is an application environment diagram of the business testing method in some embodiments;
[0017] Figure 2 is a schematic flowchart of the business testing method in some embodiments;
[0018] Figure 3 is a schematic flowchart of obtaining an associated file structure corresponding to a business processing file and performing data parsing on the business processing file according to the parsing strategy corresponding to the associated file structure in some embodiments;
[0019] Figure 4 is a schematic diagram of the principle of distributed storage and distributed processing in some embodiments;
[0020] Figure 5 is a processing flowchart of distributed batch files in some embodiments;
[0021] Figure 6 is a schematic diagram of performing business processing and data verification in some embodiments;
[0022] Figure 7 is a structural block diagram of the business testing device in some embodiments;
[0023] Figure 8 is an internal structural diagram of computer equipment in some embodiments. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0024] In order to make the objectives, technical solutions, and advantages of the present application more clearly understood, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0025] It should be noted that the business test method of the present disclosure can be used for testing business executors for processing transaction data in the financial field, and can also be used for business testing of business executors in any field other than the financial field. The present disclosure does not limit the application field of the business test method.
[0026] The business test method provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed in the cloud or other network servers. The terminal 102 can send a business test instruction to the server 104. The business test instruction can carry the identifier of the business executor. The server can determine the business executor to be tested based on the identifier of the business executor, obtain the original data table for testing the business executor, and execute the business test method provided by the embodiments of the present application. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart vehicle-mounted devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0027] In some embodiments, as Figure 2 shown, a business test method is provided. Taking the method applied to the Figure 1 server as an example, the method includes the following steps:
[0028] Step S202, obtain the original business data table, and obtain the business input data from the original business data table.
[0029] Among them, the original business data table may include business input data and the correct business processing data obtained by inputting the business input data into a business executor for processing. The business data in the original business data table is determined according to the actual business scenario. For example, assuming the original business data table is a table about transaction data, the original business data table may include the account names of the two parties to the transaction, the transaction amount, and the account amounts corresponding to the two parties before and after the transaction respectively. Or, if the original business data table is a table about business revenue, the original business data table may include the business revenue for each year.
[0030] The original business data table can be pre-set or generated in real time according to a test instruction. For example, a test data generation strategy corresponding to the business executor is pre-set. When a test instruction is received, the corresponding test data generation strategy is obtained according to the identifier of the business executor in the test instruction, and the original business data table is generated according to the test data generation strategy. For example, a visual file template in the form of a table is pre-set in the test data generation strategy. The pre-stored data can be obtained, filled into the visual file template in the form of a table, and the IP, port, directory, and primary key of each file are configured to generate the original business data table.
[0031] Specifically, since the original business data table includes business input data, the server can obtain the business input data from the original business data table. For example, when the original business data table includes the account names of the two parties to the transaction, the transaction amount, and the account amounts corresponding to the two parties before the transaction respectively, the account names, the transaction amount, and the account amount before the transaction of the two parties can be used as the business input data. Or, for another example, if the original data table includes transaction records and abnormal detection needs to be performed on the transaction records, the entire transaction record is the business input data, and the business processing data can be an identifier indicating whether the transaction record is abnormal.
[0032] Step S204: Input the business input data into the business executor for processing to obtain a business processing file.
[0033] Among them, the business executor is a program module for performing business processing. For example, an executor for performing transactions, or an executor for performing blacklist detection or abnormal transaction detection. It is necessary to perform business tests on the business executor to determine whether the business processing logic of the business executor is normal.
[0034] Specifically, the service executor can process data based on service input data and service processing logic to obtain a service processing file. The service processing file includes the data obtained from the data processing, such as the account amount after a transaction, the detection result of whether the transaction account is a blacklist account, or the detection result of whether the transaction record is abnormal. The service processing file is not a file in tabular format, and the specific file format varies according to the settings of different service executors. For example, it can be in json format or xml format.
[0035] Step S206: Obtain the associated file structure corresponding to the service processing file, perform data parsing on the service processing file according to the parsing strategy corresponding to the associated file structure, and write the parsed service processing data into the service data table to obtain the target service data table.
[0036] The file structure refers to the storage form of data in a file. For example, in a json-format file, the data can be stored in the form of key-value pairs and can be stored in accordance with a preset field order. In an xml-format file, the data can be arranged in a preset order. Here, xml refers to Extensible Markup Language, which is a markup language used to mark electronic files to make them structured. The associated file structure corresponding to the service processing file can be the file structure of the service processing file itself or the parent class structure corresponding to the service processing file. For example, according to the inheritance relationship, if the file structures of some subclasses are partially the same as those of the parent class, the associated file structure corresponding to the service processing file can be its corresponding parent class structure.
[0037] The server can pre-set the parsing strategy corresponding to each file structure, and this parsing strategy is used to parse the data corresponding to this file structure. For example, the parsing strategy includes the positions of the data corresponding to each field in this file structure. Therefore, when the associated file structure corresponding to the service processing file is obtained, the data in the service data file can be parsed according to the parsing strategy corresponding to this associated structure, and the required data can be extracted therefrom. The server can also obtain the field characteristics corresponding to the target file structure and parse the service processing data corresponding to the corresponding fields in the service processing file according to the field characteristics. After parsing the data, the server can write the data into the pre-set service data table according to the data writing rules, thereby obtaining the target service data table.
[0038] For example, for transaction data, when the amount after the transaction is obtained, the transaction identifier corresponding to the transaction can be retrieved, filled in the preset position in the preset business data table, and the transaction amount can also be correspondingly written into the cell corresponding to the transaction identifier in the business data table. Another example is that for a file in xml format, the file can be read in sequence, and then the data corresponding to the corresponding fields can be intercepted according to the structure, and then the data can be written into the business data table.
[0039] Step S208: Perform data verification based on the original business data table and the target business data table to obtain a data verification result, which is used to determine the business test result of the business executor.
[0040] During the verification, the correct business processing data corresponding to the business input data is extracted from the original business data table, that is, the original business processing data, and the original business processing data is compared with the target business processing data in the target business data table. The data verification result can be consistent or inconsistent. When it is consistent, it means that the business execution logic corresponding to the business executor passes the test. If it is inconsistent, it means that the business execution logic corresponding to the business executor fails the test, that is, there is a problem with the business execution logic, and it is necessary to further confirm the reason why the data obtained from the business execution is inaccurate.
[0041] In some embodiments, performing data verification based on the original business data table and the target business data table to obtain a data verification result includes: obtaining the data identifier corresponding to the target business processing data in the target business data table; obtaining the original business processing data corresponding to the data identifier from the original business data table, and performing a consistency verification on the target business processing data and the original business processing data to obtain a consistency verification result.
[0042] The data identifier corresponding to the service processing data can be, for example, a transaction identifier or an account identifier, which can be called the primary key in a table. Its value is used to uniquely identify a certain record in the table, such as a transaction record. The primary key in the target service data table is the same as the primary key in the original service data table. After the service executor processes the data, it can obtain the primary key corresponding to the service input data and write this primary key into the service processing file as well. When performing data parsing, the primary key is written into the target service data table, so that for the same service input data, the primary keys corresponding to it in the original service data table and the target service data table are consistent. Therefore, when performing data verification, the data identifier corresponding to the target service processing data in the target service data table can be obtained, and the original service processing data corresponding to the data identifier can be obtained from the original service data table. Then, the target service processing data is compared with the original service processing data for consistency verification to obtain a consistency verification result. This consistency verification result can indicate whether the expected service processing data of the same service input data is consistent with the actual service processing data obtained by the service executor.
[0043] In the above service testing method, since the service input data can be obtained based on the original service data table, and then the service processing file can be obtained based on the service input data, and this service processing file can be parsed according to the corresponding associated file structure to obtain the target service data table, and data verification is performed based on this target service data table and the original service data table. Therefore, it is possible to determine whether the service processing logic of the service executor is correct based on the data verification result, obtain an accurate service testing result, and be able to automatically perform service testing, thus improving the efficiency of service testing.
[0044] In some embodiments, obtaining the associated file structure corresponding to the service processing file includes: obtaining the file name of the service processing file, and determining whether the file name matches the naming rule corresponding to the target file structure; when they match, using the target file structure as the associated file structure.
[0045] Among them, the naming rule is the rule for naming the file name, and the naming rule corresponding to the target file structure is preset. For example, for the target file structure corresponding to the "xml" format, the naming rule is preset as "NfxxxxTableInfo", which means that the first two letters are "Nf", the "xxxx" from the 3rd to the 6th position represents that the characters can be set flexibly, and the subsequent string is "TableInfo". Suppose the file name of the service processing file is "NfabcdTableInfo", which means that the file name of the service processing file matches the naming rule corresponding to the target file structure, and the file structure corresponding to "NfxxxxTableInfo" can be used as the associated file structure. Suppose the file name of the service processing file is "abcdTableInfo", then the file name of the service processing file does not match the naming rule corresponding to the target file structure. It can be understood that since the file structure represents the storage structure of the internal data of the file, such as the arrangement method or the arrangement position of the data, which is specifically set according to the actual situation, for two files of the same format, the corresponding target file structures can be different.
[0046] In the embodiments of the present application, the naming rules of the files corresponding to each target file structure can be preset in advance. Therefore, the associated file structure corresponding to the service processing file can be determined according to the naming rules and the file name of the service processing file, thereby improving the efficiency of determining the associated file structure of the service processing file.
[0047] In some embodiments, as Figure 3 shown, obtaining the associated file structure corresponding to the service processing file and performing data parsing on the service processing file according to the parsing strategy corresponding to the associated file structure includes:
[0048] Step S302, when the file name does not match the naming rule corresponding to the target file structure, use the parent file structure corresponding to the service processing file as the associated file structure.
[0049] Step S304, obtain the structural inheritance relationship between the file structure corresponding to the service processing file and the parent file structure.
[0050] Step S306, perform data parsing on the service processing file according to the structural inheritance relationship and the parsing strategy corresponding to the parent file structure.
[0051] The file structure corresponding to the service processing file is a subclass file structure, and the parent class file structure corresponding to the subclass file structure is an associated file structure. The structure inheritance relationship can be pre-stored to indicate which parts of the subclass file structure are inherited from the parent class file structure, such as indicating the file location inherited from the parent class file structure. For example, when the file name corresponding to the service processing file is not "NfxxxxTableInfo", but there is a file structure of the parent class. At this time, the program file for reading and writing the corresponding file can be found through the Nfxxxx file first. For example, it is 01NaseWriteNfxxxx.java, and then the corresponding parent class 02NaseWriteNfyyyy.java can be found through the program file, and the file structure NfyyyyTableInfo.xml of Nfyyyy can be found. Assuming that according to the inheritance relationship, the first half of the file structure of the subclass is the same as that of the parent class, so the service processing files to be processed can be read in order, and then parsed according to the parent class structure, so that the first half of the file can be obtained. For the second half, other parsing strategies can be used for parsing.
[0052] In this embodiment, when the naming rule corresponding to the file name does not match the target file structure, that is, when the file structure of the service processing file itself cannot be found, data parsing can be performed according to its corresponding parent class file structure, thus improving the efficiency of data parsing.
[0053] In some embodiments, data parsing of the service processing file according to the structure inheritance relationship and the parsing strategy corresponding to the parent class file structure includes: determining the first sub-file content in the service processing file that inherits the parent class file structure according to the structure inheritance relationship, and the file content other than the first sub-file content in the service processing file is used as the second sub-file content; performing data parsing on the first sub-file content according to the parsing strategy corresponding to the parent class file structure, and performing data parsing on the second sub-file content according to the preset field matching rule.
[0054] The structure in the first sub-file content is inherited from the parent class, so the parsing strategy corresponding to the parent class file structure can be used to perform data parsing on the first sub-file content. The structure in the second sub-file content is not inherited from the parent class. Therefore, a field matching rule can be preset, and the matching rule for each field is determined in the field matching rule. If the data form corresponding to a piece of data matches the field matching rule, it means that the data is the data corresponding to the field. Therefore, the data corresponding to the field can be written into the cell corresponding to the field in the target service data table.
[0055] For example, for files transferred from other systems, by establishing a field element library, defining the conditions that each field meets clearly, analyzing which type this string belongs to one by one, and then performing automatic recognition. For different types of data, corresponding field matching rules can be set according to their data forms.
[0056] In the embodiments of the present application, for the file names that do not match the naming rules corresponding to the target file structure and the file contents that do not inherit the parent file structure, data parsing can be performed on the second sub-file content according to the preset field matching rules, so that the data obtained by data parsing can be more complete and accurate.
[0057] In some embodiments, the service input data includes multiple data. The service input data is input into the service executor for processing, and the processed service processing file includes: determining the associated data pairs in the service input data; inputting the service input data into the service executor for processing. During the processing, when it is detected that the forward processing data of the associated data pair is processed, an execution interruption instruction is triggered to interrupt the service processing process; when the interruption duration reaches the duration threshold, a continue execution instruction is triggered to continue executing the service processing process for the service input data, and the service processing file is obtained.
[0058] The service input data includes multiple data. The associated data pair includes two data with an associated relationship. For example, the result obtained by the service executor executing the previous data will be used in the calculation of the subsequent data, then the previous data and the subsequent data form an associated data pair. The forward processing data of the associated data pair refers to the data that is processed first in the service executor among the associated data pair. When the service executor performs service processing based on the service input data, if it is detected that the forward processing data of the associated data pair is processed, an execution interruption instruction can be triggered to pause the service processing by the service processor. When the terminal duration reaches the preset duration threshold, for example, when it reaches 5 minutes, a continue execution instruction can be triggered to enable the service executor to continue executing the service processing process for the service input data, and the service processing file is obtained. At this time, if the service execution logic of the service executor is accurate, when continuing to execute, the backward processing data of the associated data pair will be processed based on the processing structure of the forward processing data.
[0059] In the embodiments of the present application, for two associated data, the service processing processes corresponding to these two associated data are executed one before the interruption and one after the interruption, so that it can be detected whether the service executor can continue the associated processing, that is, the associated logic of the service executor can be detected, improving the accuracy of the detection.
[0060] The service testing method provided by the embodiments of the present application can be applied to the testing of batch files in a distributed system. For example, it can test distributed batch files scattered across various nodes. The obtained target service form can also be sent to a testing terminal for display and checked manually, thereby realizing visual testing.
[0061] In recent years, with the continuous advancement of the informatization process of banks, a single centralized system as the core system of banks can no longer meet the growing business requirements. The system architecture of banks has gradually transformed into a distributed system architecture that can support high-concurrency transactions and rapid expansion. For example, 10 million records are generated daily for bank account details, and these details need to be analyzed and screened to select the data that needs to be reported for anti-money laundering to various regulatory agencies. For example, as Figure 4 shown, set1~setn represent n pieces of split data, and File 1~File N represent N business processing files obtained after being processed by a business executor. For example, after adopting a distributed system, it is estimated that it is appropriate to place 10 million pieces of data in 12 databases, then n is equal to 12, and each database has approximately 830,000 records. Then, 12 databases will be established in terms of horizontal database sharding, and corresponding servers will be established at the same time. After receiving the data, the files will be respectively imported into 12 databases through routing from the files, and then the business executor of each server, such as an application program, will execute the screening logic. The data that meets the screening logic requirements will be generated into files and stored in each file server. Finally, the files will be merged and reported to the regulatory agency. Therefore, the screening logic in the application program can be tested to ensure the accuracy of the screening logic in the application program.
[0062] As Figure 5 shown, it is the processing principle diagram corresponding to the distributed batch file. The core system generates transactions and generates transaction detail files. The transaction detail files can be divided into n pieces: set1~setn. These n pieces of data are imported into the database. When service testing is required, the original service data form can be generated based on the data in the database, and it can be manually marked whether each transaction record in the form should be screened. For the transaction records in the original service data form, the business executor for anti-money laundering screening is used to screen the transaction records that need to be reported, and the business processing files corresponding to each set are obtained. The business processing files corresponding to each set can be merged, and the merged business processing files are reported to the regulatory system. To ensure the accuracy of the anti-money laundering screening logic, the anti-money laundering screening logic can be tested for services. After the anti-money laundering screening logic service test passes, the anti-money laundering screener can be put on the line.
[0063] In some embodiments, the automated testing steps for distributed files may include:
[0064] 1. Obtain the visual file template (in tabular form) of the file by calling the parsing module of the file.
[0065] 2. Fill the file to be tested into the table, and configure the IP, port, directory, and primary key of each file, so as to generate the original business data table, which is a visual file in tabular form.
[0066] 3. Start executing the script, obtain the business input data in the original business data table, and generate a file processed by the business executor based on the business input data, such as a text file.
[0067] 4. Call the batch executors distributed in each server of the system. The program starts to obtain the files, then executes file processing, and finally generates the files in each server. When the job is executed smoothly, the system automatically obtains the files for verification. In addition, as Figure 6 shown, since there may be situations such as disconnection of the file server during the job execution process, it is necessary to automatically identify abnormal data and set conditions for verification. For example, when an exception such as job interruption occurs, the system will automatically resubmit 3 times and verify the final file. In addition, refer to Figure 5 , when the job is executed, an interruption can be initiated manually to verify whether each breakpoint is correctly recorded when the job is batch interrupted, and then the interruption is cancelled to verify whether the subsequent process is correct. Theoretically, for the two situations of complete execution of the batch and manual initiation of interruption followed by recovery, the finally generated files should be the same.
[0068] 5. Obtain and merge the files from each server, use the merged file as the business processing file, obtain the associated file structure corresponding to the business processing file, perform data parsing on the business processing file according to the parsing strategy corresponding to the associated file structure, write the parsed business processing data into the business data table to obtain the target business data table, and then obtain the data in the original business data table according to the set primary key for verification. The verification method is: search for the record in the original business data table according to the set primary key. If not found, this record fails the verification; if found, then verify item by item according to the verification fields set in the original business data table. If the verification passes, this transaction record test is completed. If the verification fails, mark this transaction record with the set color.
[0069] With the development of banking business, distributed batch processing is the norm. The bank distributed batch automation testing method provided by the embodiments of the present application visualizes complex files through a file parsing algorithm, reduces the complexity of preparing data and verifying data, and simultaneously uniformly manages and automatically schedules files, so as to achieve efficient retrospective testing and continuous integration.
[0070] It should be understood that although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0071] Based on the same inventive concept, an embodiment of the present application also provides a service test device for implementing the service test method involved above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the service test device provided below can refer to the limitations on the service test method in the above text, and will not be repeated here.
[0072] In some embodiments, as Figure 7 shown, a service test device is provided, including:
[0073] A service input data acquisition module 702, configured to acquire an original service data table and acquire service input data from the original service data table;
[0074] A processing module 704, configured to input the service input data into a service executor for processing to obtain a service processing file;
[0075] A target service data table obtaining module 706, configured to acquire an associated file structure corresponding to the service processing file, perform data parsing on the service processing file according to the parsing strategy corresponding to the associated file structure, and write the parsed service processing data into a service data table to obtain a target service data table;
[0076] A data verification module 708, configured to perform data verification based on the original service data table and the target service data table to obtain a data verification result, and the data verification result is used to determine the service test result of the service executor.
[0077] In some embodiments, the target service data table obtaining module is configured to: acquire the file name of the service processing file, and determine whether the file name matches the naming rule corresponding to the target file structure; when they match, use the target file structure as the associated file structure.
[0078] In some embodiments, the target service data table obtaining module is configured to: when the file name does not match the naming rule corresponding to the target file structure, use the parent file structure corresponding to the service processing file as the associated file structure; obtain the structural inheritance relationship between the file structure corresponding to the service processing file and the parent file structure; and perform data parsing on the service processing file according to the structural inheritance relationship and the parsing strategy corresponding to the parent file structure.
[0079] In some embodiments, performing data parsing on the service processing file according to the structural inheritance relationship and the parsing strategy corresponding to the parent file structure includes: determining, according to the structural inheritance relationship, the first sub-file content in the service processing file that inherits the parent file structure, and using the file content other than the first sub-file content in the service processing file as the second sub-file content; performing data parsing on the first sub-file content according to the parsing strategy corresponding to the parent file structure, and performing data parsing on the second sub-file content according to the preset field matching rule.
[0080] In some embodiments, the data verification module is configured to: obtain the data identifier corresponding to the target service processing data in the target service data table; obtain the original service processing data corresponding to the data identifier from the original service data table, and perform consistency verification on the target service processing data and the original service processing data to obtain a consistency verification result.
[0081] In some embodiments, the processing module is configured to: determine the associated data pairs in the service input data; input the service input data into the service executor for processing. During the processing, when it is detected that the forward processing data of the associated data pair is processed, trigger an execution interruption instruction to interrupt the service processing process; when the interruption duration reaches the duration threshold, trigger a continue execution instruction to enable the service executor to continue the service processing process for the service input data and obtain a service processing file.
[0082] Each module in the above service testing device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the above respective modules.
[0083] In some embodiments, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 8As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the original business data table. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a business test method.
[0084] Those skilled in the art can understand that Figure 8 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0085] In some embodiments, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the steps of the above-mentioned business test method are implemented.
[0086] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps of the business test method are implemented.
[0087] In some embodiments, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps of the business test method are implemented.
[0088] 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 for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0089] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memories can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., and are not limited thereto.
[0090] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, 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, it should be considered as the scope described in this specification.
[0091] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A service testing method, characterized in that, The method includes: Obtain an original business data table, and obtain business input data from the original business data table; Input the business input data into a business executor for processing to obtain a business processing file; Obtain the file name of the business processing file; When it is determined that the file name does not match the naming rule corresponding to the target file structure, use the parent file structure corresponding to the business processing file as the associated file structure, perform data parsing on the business processing file according to the parsing strategy corresponding to the associated file structure, and write the parsed business processing data into a business data table to obtain a target business data table; Perform data verification based on the original business data table and the target business data table to obtain a data verification result, and the data verification result is used to determine the business test result of the business executor; The performing data parsing on the business processing file according to the parsing strategy corresponding to the associated file structure includes: Parse and obtain the structural inheritance relationship between the file structure corresponding to the business processing file and the parent file structure; Perform data parsing on the business processing file according to the structural inheritance relationship and the parsing strategy corresponding to the parent file structure.
2. The method according to claim 1, wherein The method further includes: When the file name matches the naming rule corresponding to the target file structure, use the target file structure as the associated file structure.
3. The method according to claim 1, wherein The performing data parsing on the business processing file according to the structural inheritance relationship and the parsing strategy corresponding to the parent file structure includes: Determine the content of the first sub-file in the business processing file that inherits the parent file structure according to the structural inheritance relationship, and use the file content other than the content of the first sub-file in the business processing file as the content of the second sub-file; Perform data parsing on the content of the first sub-file according to the parsing strategy corresponding to the parent file structure, and perform data parsing on the content of the second sub-file according to a preset field matching rule.
4. The method according to claim 1, wherein The performing data verification based on the original business data table and the target business data table to obtain a data verification result includes: Obtain the data identifier corresponding to the target business processing data in the target business data table; Obtain the original business processing data corresponding to the data identifier from the original business data table, and perform consistency verification on the target business processing data and the original business processing data to obtain a consistency verification result.
5. The method according to claim 1, characterized in that The business input data includes multiple pieces of data, and the inputting the business input data into a business executor for processing to obtain a business processing file includes: Determine the associated data pairs in the business input data; Input the business input data into a business executor for processing. During the processing, when it is detected that the forward processing data of the associated data pair is processed, trigger an execution interruption instruction to interrupt the business processing process; When the interruption duration reaches the duration threshold, trigger a continue execution instruction to enable the business executor to continue executing the business processing process for the business input data to obtain a business processing file.
6. A service testing device, characterized in that, The device includes: A business input data acquisition module, which is used to acquire an original business data table and obtain business input data from the original business data table; A processing module, which is used to input the business input data into a business executor for processing to obtain a business processing file; A target business data table obtaining module, which is used to obtain an associated file structure corresponding to the business processing file, perform data parsing on the business processing file according to a parsing strategy corresponding to the associated file structure, and write the parsed business processing data into a business data table to obtain a target business data table; A data verification module, which is used to perform data verification based on the original business data table and the target business data table to obtain a data verification result, and the data verification result is used to determine the business test result of the business executor; The target business data table obtaining module is specifically used for: Obtaining the file name of the business processing file; When it is determined that the file name does not match the naming rule corresponding to the target file structure, using the parent file structure corresponding to the business processing file as the associated file structure; Parsing and obtaining the structural inheritance relationship between the file structure corresponding to the business processing file and the parent file structure; Performing data parsing on the business processing file according to the structural inheritance relationship and the parsing strategy corresponding to the parent file structure.
7. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method for managing chip verification test cases
CN102331967A
File format converting method
CN103020024A
Service testing method and device
CN110008111A