CN114490415A - Service testing method, computer device, storage medium, and computer program product - Google Patents

Service testing method, computer device, storage medium, and computer program product Download PDF

Info

Publication number
CN114490415A
CN114490415A CN202210137724.5A CN202210137724A CN114490415A CN 114490415 A CN114490415 A CN 114490415A CN 202210137724 A CN202210137724 A CN 202210137724A CN 114490415 A CN114490415 A CN 114490415A
Authority
CN
China
Prior art keywords
service
data
file
processing
file structure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210137724.5A
Other languages
Chinese (zh)
Inventor
朱琼飞
郑培龙
叶建锋
杨琼云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210137724.5A priority Critical patent/CN114490415A/en
Publication of CN114490415A publication Critical patent/CN114490415A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Abstract

The present application relates to a traffic testing method, a computer device, a storage medium and a computer program product. The business testing method can be used for testing a business executor for processing transaction data in the financial field, and comprises the following steps: acquiring an original service data form, and acquiring service input data from the original service data form; inputting the service input data into a service executor for processing to obtain a service processing file; acquiring an associated file structure corresponding to the business processing file, performing data analysis on the business processing file according to an analysis strategy corresponding to the associated file structure, and writing the business processing data obtained by analysis into a business data table to obtain a target business data table; and performing data check according to the original service data table and the target service data table to obtain a data check result, wherein the data check result is used for determining a service test result of the service executor. By adopting the method, the efficiency and the accuracy of the service test can be improved.

Description

Service test method, computer device, storage medium, and computer program product
Technical Field
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
With the development of computer technology, business processing can be performed by a business executor based on program codes in many cases to obtain required data. For example, according to business processing logic, abnormality judgment is carried out on transaction data in the financial field, and whether the transaction data is abnormal or not is determined.
In the conventional technology, a service executor needs to be tested to determine whether the service processing logic of the service executor is correct, and the current service test is mainly performed manually, which results in low test efficiency.
Disclosure of Invention
In view of the above, it is necessary to provide a service testing method, a computer device, a computer readable storage medium and a computer program product for solving the above technical problems.
In a first aspect, the present application provides a service testing method. The method comprises the following steps: acquiring an original service data form, and acquiring service input data from the original service data form; inputting the service input data into a service executor for processing to obtain a service processing file; acquiring an associated file structure corresponding to the service processing file, performing data analysis on the service processing file according to an analysis strategy corresponding to the associated file structure, and writing the analyzed service processing data into a service data table to obtain a target service data table; and performing data check according to the original service data table and the target service data table to obtain a data check result, wherein the data check result is used for determining a service test result of the service executor.
In a second aspect, the present application further provides a service testing apparatus. The device comprises: the service input data acquisition module is used for acquiring an original service data form and acquiring service input data from the original service data form; the processing module is used for inputting the service input data into the 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 analysis on the service processing file according to an analysis policy corresponding to the associated file structure, and write the service processing data obtained through analysis into a service data table to obtain a target service data table; and the data checking module is used for performing data checking according to the original service data table and the target service data table to obtain a data checking result, and the data checking result is used for determining a service test result of the service executor.
In some embodiments, the target business data table derivation module is to: acquiring a file name of the service processing file, and judging whether the file name is matched with a naming rule corresponding to a target file structure; and when the file structure is matched with the target file structure, taking the target file structure as an associated file structure.
In some embodiments, the target business data table derivation module is to: when the file name is not matched with a naming rule corresponding to a target file structure, taking a parent file structure corresponding to the service processing file as an associated file structure; acquiring a structure inheritance relationship between a file structure corresponding to the service processing file and the parent file structure; and carrying out data analysis on the service processing file according to the structure inheritance relationship and an analysis strategy corresponding to the parent file structure.
In some embodiments, the performing data analysis on the service processing file according to the structure inheritance relationship and the analysis policy corresponding to the parent file structure includes: determining first subfile contents inheriting the parent file structure in the service processing file according to the structure inheritance relation, wherein the file contents except the first subfile contents in the service processing file are used as second subfile contents; and performing data analysis on the content of the first subfile according to an analysis strategy corresponding to the parent file structure, and performing data analysis on the content of the second subfile according to a preset field matching rule.
In some embodiments, the data reconciliation module is to: acquiring a data identifier corresponding to target service processing data in the target service data table; and acquiring original service processing data corresponding to the data identification from the original service data table, and performing consistency check on the target service processing data and the original service processing data to obtain a consistency check result.
In some embodiments, the processing module is to: determining a relevant data pair in the business input data; inputting the service input data into a service executor for processing, and triggering and executing an interrupt instruction when detecting that the forward processing data of the associated data pair is processed completely in the processing process so as to interrupt the service processing process; and when the interruption duration reaches a duration threshold, triggering a continuous execution instruction so that the service executor continuously executes a service processing process aiming at the service input data to obtain a service processing file.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program: acquiring an original service data form, and acquiring service input data from the original service data form; inputting the service input data into a service executor for processing to obtain a service processing file; acquiring an associated file structure corresponding to the service processing file, performing data analysis on the service processing file according to an analysis strategy corresponding to the associated file structure, and writing the analyzed service processing data into a service data table to obtain a target service data table; performing data check according to the original service data table and the target service data table to obtain a data check result, wherein the data check result is used for determining a service test result of the service executor
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of: acquiring an original service data form, and acquiring service input data from the original service data form; inputting the service input data into a service executor for processing to obtain a service processing file; acquiring an associated file structure corresponding to the service processing file, performing data analysis on the service processing file according to an analysis strategy corresponding to the associated file structure, and writing the analyzed service processing data into a service data table to obtain a target service data table; and performing data check according to the original service data table and the target service data table to obtain a data check result, wherein the data check result is used for determining a service test result of the service executor.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of: acquiring an original service data form, and acquiring service input data from the original service data form; inputting the service input data into a service executor for processing to obtain a service processing file; acquiring an associated file structure corresponding to the service processing file, performing data analysis on the service processing file according to an analysis strategy corresponding to the associated file structure, and writing the analyzed service processing data into a service data table to obtain a target service data table; and performing data check according to the original service data table and the target service data table to obtain a data check result, wherein the data check result is used for determining a service test result of the service executor.
The service test method, the device, the computer equipment, the storage medium and the computer program product obtain an original service data table, and generate service input data according to the original service data table; inputting the service input data into a service executor for processing to obtain a service processing file; acquiring a related file structure corresponding to the business processing file, performing data analysis on the business processing file according to an analysis strategy corresponding to the related file structure, and writing the business processing data obtained by analysis into a business data table to obtain a target business data table; and performing data check according to the original service data table and the target service data table to obtain a data check result, wherein the data check result is used for determining a service test result of the service executor. The service processing file can be analyzed according to the corresponding associated file structure to obtain the target service data table, and the data is checked based on the target service data table and the original service data table, so that whether the service processing logic of the service executor is correct or not can be determined based on the result of data check, an accurate service test result can be obtained, and the service test can be automatically performed, so that the efficiency of the service test is improved.
Drawings
FIG. 1 is a diagram of an application environment of a method for service testing in some embodiments;
FIG. 2 is a flow diagram of a method for service testing in some embodiments;
fig. 3 is a schematic flow chart illustrating a process of acquiring an associated file structure corresponding to a service processing file and performing data analysis on the service processing file according to an analysis policy corresponding to the associated file structure in some embodiments;
FIG. 4 is a schematic diagram of distributed storage and distributed processing in some embodiments;
FIG. 5 is a flow diagram that illustrates the processing of a distributed batch file in some embodiments;
FIG. 6 is a schematic diagram of business processing and data reconciliation in some embodiments;
FIG. 7 is a block diagram of a traffic testing device in some embodiments;
FIG. 8 is a diagram of the internal structure of a computer device in some embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that the service test method disclosed in the present disclosure may be used for testing a service executor used for processing transaction data in the financial field, and may also be used for testing a service executor in any field other than the financial field.
The service testing method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. The terminal 102 may send a service test instruction to the server 104, where the service test instruction may carry an identifier of a service executor, and the server may determine, based on the identifier of the service executor, a service executor to be tested, obtain an original data table for testing the service executor, and execute the service test method provided in the embodiment of the present application. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In some embodiments, as shown in fig. 2, a service testing method is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:
step S202, an original business data form is obtained, and business input data is obtained from the original business data form.
The original business data table may include business input data and correct business processing data obtained by inputting the business input data to a business executor for processing. And determining the service data in the original service data table according to the actual service scene. For example, assuming that the original business data table relates to a table of transaction data, the original business data table may include account names of both transaction parties, transaction amounts, and account amounts corresponding to both transaction parties before and after a transaction, respectively. Or, the original service data table is a table about service revenue, and the original service data table may include service revenue for each year.
The original service data table may be preset, or may be generated in real time according to the test instruction. For example, a test data generation policy corresponding to the service executor is preset, and when a test instruction is received, the corresponding test data generation policy is obtained according to the identifier of the service executor in the test instruction, and an original service data table is generated according to the test data generation policy. For example, a visual file template in a form is preset in the test data generation policy, the pre-stored data can be acquired, the pre-stored data is filled in the visual file template in the form of the form, and the IP, port, directory, and primary key of each file are configured to generate an original service data form.
Specifically, the original service data table includes service input data, so the server can obtain the service input data from the original service data table. For example, when the original business data table includes account names of both transaction parties, transaction amounts, and account amounts corresponding to both transaction parties before and after a transaction, the account names, the transaction amounts, and the account amounts of both transaction parties before a transaction may be used as the business input data. For another example, the original data table includes transaction records, if the transaction records need to be detected abnormally, the whole transaction record is the service input data, and the service processing data may be an identifier for marking whether the transaction record is abnormal or not.
Step S204, inputting the service input data into the service executor for processing to obtain a service processing file.
The service executor is a program module for performing service processing, such as an executor for performing a transaction, and may also be an executor for performing blacklist detection or abnormal transaction detection. A service test needs to be performed on the service executor to determine whether the service processing logic of the service executor is normal.
Specifically, the service executor may perform data processing according to the service input data and the service processing logic to obtain a service processing file, where the service processing file includes data obtained by the data processing, and the data may be, for example, an account amount after a transaction, a detection result of whether a transaction account is a blacklist account, or a detection result of whether a transaction record is abnormal. The service processing file is not a file in a table format, and the specific file format is different according to the setting of different service executors, for example, the file format can be a json format or an xml format.
Step S206, acquiring the associated file structure corresponding to the service processing file, performing data analysis on the service processing file according to the analysis strategy corresponding to the associated file structure, and writing the analyzed service processing data into the service data table to obtain the target service data table.
The file structure refers to a storage form of data in a file, for example, in a json file, the data may be stored in a key-value pair format and may be stored according to a preset field sequence. In the xml format file, the data may be arranged according to a preset arrangement order. Where xml refers to extensible markup language, which is a markup language for marking electronic documents to be structured. The associated file structure corresponding to the service processing file may be a file structure of the service processing file itself, or may be a parent class structure corresponding to the service processing file, for example, according to an inheritance relationship, a file structure of some subclasses is partially the same as a parent class, and then the associated file structure corresponding to the service processing file may be a parent class structure corresponding thereto.
The server may preset an analysis policy corresponding to each file structure, where the analysis policy is used to analyze data corresponding to the file structure, for example, the analysis policy includes a location of data corresponding to each field in the file structure, so that when an associated file structure corresponding to the service processing file is obtained, data in the service data file may be analyzed according to the analysis policy corresponding to the associated structure, and the required data is extracted from the data. The server can also obtain the field characteristics corresponding to the target file structure, and analyze the service processing data corresponding to the corresponding fields in the service processing file according to the field characteristics. After the data is obtained through analysis, the server can write the data into a preset business data table according to a data writing rule, so that a target business data table is obtained.
For example, for transaction data, when the amount of money after the transaction is obtained, the transaction identifier corresponding to the transaction may be obtained, the transaction identifier is filled in a preset position in a preset service data form, and the transaction amount is correspondingly written into a cell corresponding to the transaction identifier in the service data form. For another example, for a file in xml format, the file may be read in order, and then the data corresponding to the corresponding field may be intercepted according to the structure, and then the data may be written into the service data table.
And S208, performing data check according to the original service data table and the target service data table to obtain a data check result, wherein the data check result is used for determining a service test result of the service executor.
When checking, correct service processing data corresponding to the service input data, namely original service processing data, is extracted from the original service data table, and the original service processing data is compared with target service processing data in the target service data table. The data check result may be consistent or inconsistent, and if the data check result is consistent, it indicates that the service execution logic test corresponding to the service executor passes, and if the data check result is inconsistent, it indicates that the service execution logic test corresponding to the service executor fails, that is, the service execution logic has a problem, and it is necessary to further confirm a reason that the data obtained by service execution is inaccurate.
In some embodiments, performing data check according to the original service data table and the target service data table, and obtaining the data check result includes: acquiring a data identifier corresponding to target service processing data in a target service data table; and acquiring original service processing data corresponding to the data identification from the original service data table, and performing consistency check on the target service processing data and the original service processing data to obtain a consistency check result.
The data identifier corresponding to the business process data may be, for example, a transaction identifier or an account identifier, and may be referred to as a primary key in a table, and its value is used to uniquely identify a 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, and after the service executor processes the obtained data, the primary key corresponding to the service input data can be obtained and written into the service processing file. When data analysis is carried out, the primary key is written into the target business data table, so that the corresponding primary keys of the same business input data in the original business data table and the target business data table are consistent. Therefore, when data checking is carried out, the data identification corresponding to the target service processing data in the target service data table can be obtained, the original service processing data corresponding to the data identification is obtained from the original service data table, the target service processing data and the original service processing data are subjected to consistency checking to obtain a consistency checking result, and the consistency checking 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 execution of the service executor.
In the service test method, the service input data can be obtained based on the original service data table, the service processing file can be obtained based on the service input data, the service processing file can be analyzed according to the corresponding associated file structure to obtain the target service data table, and the data check is performed based on the target service data table and the original service data table, so that whether the service processing logic of the service executor is correct or not can be determined based on the result of the data check, an accurate service test result can be obtained, and the service test can be automatically performed, so that the efficiency of the service test is improved.
In some embodiments, obtaining the associated file structure corresponding to the service processing file includes: acquiring a file name of a service processing file, and judging whether the file name is matched with a naming rule corresponding to a target file structure; and when the file structure is matched, taking the target file structure as an associated file structure.
The naming rule is a rule for naming the name of the file, and the naming rule corresponding to the target file structure is preset. For example, for a target file structure corresponding to the format of "xml", it is preset that the naming rule is "nfxxxxtablenfo", which means that the first two letters are "Nf", and the 3 rd to 6 th "xxxx" indicating characters can be flexibly set, and the following character string is "tablelnfo". Assuming that the file name of the service processing file is "nfabdtablnfo", it indicates 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 "nfxxxxtablelnfo" may be used as the associated file structure. Assuming that the file name of the service processing file is "abcdTableInfo", 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 a storage structure of data inside the file, for example, an arrangement manner of the data or an arrangement position of the data, which is set according to actual conditions, corresponding target file structures may be different for two files in the same format.
In the embodiment of the application, the naming rule of the file corresponding to each target file structure can be preset, so that the associated file structure corresponding to the business processing file can be determined according to the naming rule and the file name of the business processing file, and the efficiency of determining the associated file structure of the business processing file is improved.
In some embodiments, as shown in fig. 3, acquiring an associated file structure corresponding to the service processing file, and performing data analysis on the service processing file according to an analysis policy corresponding to the associated file structure includes:
step S302, when the file name is not matched with the naming rule corresponding to the target file structure, the parent file structure corresponding to the business processing file is used as the associated file structure.
Step S304, acquiring a structure inheritance relationship between a file structure corresponding to the service processing file and a parent file structure.
And step S306, performing data analysis on the service processing file according to the structure inheritance relationship and the analysis strategy corresponding to the parent file structure.
The file structure corresponding to the business processing file is a subclass file structure, and the parent 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 child class file structure are inherited from the parent class file structure, e.g., to indicate the location of the file inherited from the parent class file structure. For example, when the file name corresponding to the business process file is not "nfxxxxtablelnfo", but there is a file structure of a parent class. At this time, the program file corresponding to the read-write file, for example, 01 nasewritenfxxx.java, can be found through the Nfxxxx file, and then the corresponding parent class 02 nasewritenyyyyyy.java, can be found through the process program file, and the file structure nfyyyytalbleinfo.xml of Nfyyyy is found. Assuming that the first half of the file structure of the subclass is the same as the parent class according to the inheritance relationship, the service processing file to be processed can be read in sequence, and then the analysis is performed according to the parent class structure, so that the first half of the file can be obtained, and the second half of the file can be analyzed according to other analysis strategies.
In this embodiment, when the file name does not match the naming rule corresponding to the target file structure, that is, when the file structure of the service processing file itself cannot be found, the data analysis may be performed according to the parent file structure corresponding to the file name, so that the efficiency of data analysis is improved.
In some embodiments, the performing data analysis on the service processing file according to the structure inheritance relationship and the analysis policy corresponding to the parent file structure includes: determining first subfile content inheriting a parent file structure in the service processing file according to the structure inheritance relation, wherein the file content except the first subfile content in the service processing file is used as second subfile content; and performing data analysis on the content of the first subfile according to an analysis strategy corresponding to the parent file structure, and performing data analysis on the content of the second subfile according to a preset field matching rule.
The structure in the first subfile content is inherited to the parent class, so that the data analysis can be performed on the first subfile content by adopting the analysis strategy corresponding to the file structure of the parent class. The structure in the second subfile content is not an inheritance parent class, so a field matching rule can be preset, the matching rule corresponding to each field is determined in the field matching rule, if the data form corresponding to one data is matched with the field matching rule, the data is the data corresponding to the field, and therefore the data corresponding to the field can be written into the cell corresponding to the field in the target business data table.
For example, for files transmitted by other systems, a field element library is established, conditions which are clearly met by each field are defined, the type of the character string is analyzed one by one, and then automatic recognition is carried out. For different types of data, corresponding field matching rules can be set according to the data form of the data, for example, the field matching rules can be as shown in table one.
Table one: field matching rules
Figure BDA0003505037270000101
Taking a business processing file as a transaction detail file reported to a supervision institution, and performing data analysis on the transaction detail file as an example, the business processing file relates to key fields such as reported account numbers, transaction amounts and the like, and the transaction detail file is assumed to comprise the following two character strings:
1、0200062009206000342abcabc123321+12345678901234567aabbccceeffg
2、0200062009206000191ccdbac231111-1234567890123456789FFEGEDBAD
then, a pre-established field matching rule may be obtained for data analysis, for example, according to the field matching rule corresponding to the account, 19 consecutive digits may be scanned, and it is found that the data "020006200920600034", "0200062009206000191" and "1234567890123456789" are 10 digits and conform to the first matching rule corresponding to the account, so that it is further calculated whether the check digits are consistent by the 2121 algorithm using the top 17 digits. Through the check algorithm, the check digit corresponding to 02000620092060003 is 42, so that the check bits are consistent, the check digit corresponding to 02000620092060001 is 91, so that the check bits are consistent, and the check digit corresponding to 12345678901234567 is 20, so that the check bits are inconsistent. Therefore, "0200062009206000342" and "0200062009206000191" are accounts. And scanning the amount field by using a field matching rule corresponding to the amount to obtain the amounts of the '12345678901234567' in the 1 st character string and the '12345678901234567' in the 2 nd character string. Therefore, the account number "0200062009206000342" is corresponding to the amount of "12345678901234567" and the account number "0200062009206000191" is corresponding to the amount of "12345678901234567" from the business processing file. The 2121 algorithm may also be referred to as the Luhn algorithm.
In the embodiment of the application, for the file content of which the file name is not matched with the naming rule corresponding to the target file structure and does not inherit the parent file structure, data analysis can be performed on the content of the second subfile according to the preset field matching rule, so that the data obtained by the data analysis is more complete and accurate.
In some embodiments, the service input data includes a plurality of data, the inputting of the service input data into the service executor for processing includes: determining a relevant data pair in the service input data; inputting service input data into a service executor for processing, and triggering and executing an interrupt instruction when detecting that the forward processing data of the associated data pair is processed completely in the processing process so as to interrupt the service processing process; and when the interruption duration reaches a duration threshold, triggering a continuous execution instruction to continuously execute a service processing process aiming at the service input data, and processing to obtain a service processing file.
The service input data includes a plurality of data, and the associated data pair includes two data having an association relationship, for example, a result obtained by executing previous data by the service executor is used in calculation of the next data, and the previous data and the next data form an associated data pair. The forward processing data of the associated data pair refers to data that is processed in advance in the service executor in the associated data pair, and 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 completely, an execution interruption instruction may be triggered, so that the service processor suspends the service processing, and when the terminal time length reaches a preset time length threshold, for example, 5 minutes, the execution instruction may be continuously triggered, so that the service executor continues to execute the service processing process for the service input data, and processes to obtain a service processing file. At this time, if the service execution logic of the service executor is accurate, the service executor continues to execute, and processes the backward processing data of the associated data pair based on the processing structure of the forward processing data.
In the embodiment of the application, for two associated data, one of the business processing flows corresponding to the two associated data is executed before interruption, and the other business processing flow is executed after interruption, so that whether the business executor can continue the association processing can be detected, that is, the association logic of the business executor can be detected, and the detection accuracy is improved.
The service testing method provided by the embodiment of the application can be applied to testing of batch files of a distributed system, for example, the distributed batch files scattered in each node can be tested, the obtained target service table can also be sent to a testing terminal to be displayed, and manual checking is carried out, so that visual testing is realized.
In recent years, with the continuous progress of bank informatization, a single centralized system as a bank core system cannot meet the increasing business requirements, and the system architecture of a bank is gradually transformed into a distributed system architecture capable of supporting high-concurrency transaction and rapidly expanding capacity. For example, the details of a bank account generate 1000 ten thousand records every day, and the details need to be analyzed and screened, and data in which money needs to be washed back is selected and sent to each regulatory agency. For example, as shown in fig. 4, sets 1 to setn represent N pieces of split data, and files 1 to N represent N service processing files obtained through service executor processing. For example, after a distributed system is adopted, 1000 ten thousand calculated data are put into 12 databases, if n is equal to 12, each database has about 83 ten thousand records, and 12 databases are established in the aspect of level sub-base, and meanwhile, corresponding servers are established. After receiving data, the files are respectively imported into 12 databases from the files through a route, then a service executor of each server, such as an application program, executes screening logic, the data with the screening logic meeting requirements generate files, the files are stored in each file server, and finally the files are merged and reported to a supervision mechanism, so that the screening logic in the application program can be tested, and the accuracy of the screening logic in the application program is ensured.
Fig. 5 is a schematic diagram of a process corresponding to the distributed batch file. The core system generates transactions, generates transaction detail files, and can divide the transaction detail files into n parts: and set 1-setn, the n data are imported into a database, when a service test is required, an original service data table can be generated based on the data in the database, and whether each transaction record in the table should be screened or not is manually marked. For the transaction records in the original service data table, the transaction records to be reported are screened by the service executor for anti-money laundering screening to obtain service processing files corresponding to each set, the service processing files corresponding to each set can be merged, and the merged service processing files are reported to the monitoring system. In order to ensure the accuracy of the anti-money laundering screening logic, the anti-money laundering screening logic can be subjected to business test, and when the anti-money laundering screening logic passes the business test, the anti-money laundering screener is on line.
In some embodiments, the automated testing for distributed files step may include:
1. and acquiring a visual file template (in a table form) of the file by calling an analysis module of the file.
2. Filling the files to be tested into the form, and configuring the IP, the port, the directory and the primary key of each file, thereby generating an original business data form which is a visual file in the form of the form.
3. Starting to execute the script, obtaining the service input data in the original service data table, generating a file, such as a text format file, processed by the service executor based on the service input data,
4. and calling batch executors distributed in each server by the system, starting to acquire the file by the program, then executing file processing, and finally generating the file and placing the file in each server. When the operation is successfully executed, the system automatically acquires the file for checking. In addition, as shown in fig. 6, since there may be a case where the file server is disconnected during the execution of the job, it is necessary to automatically identify abnormal data and verify the setting conditions, for example, when an abnormality such as interruption of the job occurs, the system automatically recalls 3 times and checks the final file. In addition, referring to fig. 5, when the job is executed, the interrupt may be initiated manually, to verify whether each breakpoint record is correct when the job is interrupted in batch, and then cancel the interrupt to verify whether the subsequent flow is correct. In theory, the final generated file should be the same in both cases of a completely executed batch and a manually initiated interrupt and then a recovery.
5. The method comprises the steps of obtaining files from all servers, merging the files, taking the merged files as business processing files, obtaining associated file structures corresponding to the business processing files, conducting data analysis on the business processing files according to analysis strategies corresponding to the associated file structures, writing the business processing data obtained through analysis into a business data table to obtain a target business data table, and obtaining data in an original business data table according to a set main key to conduct checking. The checking method comprises the following steps: searching a record in an original business data table according to a set main key, and if the record cannot be found, checking the record to fail; if the data is found, checking the data item by item according to the checking field set by the original business data table. If the check is passed, the transaction record test is completed, if the check is not passed, the transaction record is marked by the set color,
with the development of banking, distributed batch processing is a normal state. According to the bank distributed batch automatic testing method provided by the embodiment of the application, complex files are visualized through a file analysis algorithm, the complexity of data preparation and data checking is reduced, and meanwhile, the files are uniformly managed and automatically scheduled, so that efficient review testing and continuous integration are realized.
It should be understood that, although the steps in the flowcharts related to the embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a service testing apparatus for implementing the service testing method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more embodiments of the service testing device provided below can be referred to the limitations of the service testing method in the foregoing, and details are not described here.
In some embodiments, as shown in fig. 7, there is provided a traffic testing apparatus, including:
a service input data obtaining module 702, configured to obtain an original service data table, and obtain service input data from the original service data table;
the processing module 704 is used for inputting the service input data into the service executor for processing to obtain a service processing file;
a target service data table obtaining module 706, configured to obtain an associated file structure corresponding to the service processing file, perform data analysis on the service processing file according to an analysis policy corresponding to the associated file structure, and write the service processing data obtained through analysis into a service data table to obtain a target service data table;
and the data checking module 708 is configured to perform data checking according to the original service data table and the target service data table to obtain a data checking result, where the data checking result is used to determine a service test result of the service executor.
In some embodiments, the target business data table derivation module is to: acquiring a file name of a service processing file, and judging whether the file name is matched with a naming rule corresponding to a target file structure; and when the file structure is matched, taking the target file structure as an associated file structure.
In some embodiments, the target business data table derivation module is to: when the file name is not matched with the naming rule corresponding to the target file structure, taking a parent file structure corresponding to the service processing file as an associated file structure; acquiring a structure inheritance relationship between a file structure corresponding to the service processing file and a parent file structure; and carrying out data analysis on the service processing file according to the structure inheritance relation and the analysis strategy corresponding to the parent file structure.
In some embodiments, the performing data analysis on the service processing file according to the structure inheritance relationship and the analysis policy corresponding to the parent file structure includes: determining first subfile content inheriting a parent file structure in the service processing file according to the structure inheritance relation, wherein the file content except the first subfile content in the service processing file is used as second subfile content; and performing data analysis on the content of the first subfile according to an analysis strategy corresponding to the parent file structure, and performing data analysis on the content of the second subfile according to a preset field matching rule.
In some embodiments, the data collation module is operable to: acquiring a data identifier corresponding to target service processing data in a target service data table; and acquiring original service processing data corresponding to the data identification from the original service data table, and performing consistency check on the target service processing data and the original service processing data to obtain a consistency check result.
In some embodiments, the processing module is to: determining a relevant data pair in the service input data; inputting service input data into a service executor for processing, and triggering and executing an interrupt instruction when detecting that the forward processing data of the associated data pair is processed completely in the processing process so as to interrupt the service processing process; and when the interruption time reaches a time threshold, triggering a continuous execution instruction to enable the service executor to continuously execute a service processing process aiming at the service input data, and processing to obtain a service processing file.
All or part of each module in the service testing device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In some embodiments, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 8. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured 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 an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing original service data tables. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of business testing.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In some embodiments, a computer device is provided, comprising a memory in which a computer program is stored and a processor which, when executing the computer program, carries out the steps of the above-described service testing method.
In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of the traffic testing method.
In some embodiments, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of the traffic testing method.
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, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method for service testing, the method comprising:
acquiring an original service data form, and acquiring service input data from the original service data form;
inputting the service input data into a service executor for processing to obtain a service processing file;
acquiring an associated file structure corresponding to the service processing file, performing data analysis on the service processing file according to an analysis strategy corresponding to the associated file structure, and writing the analyzed service processing data into a service data table to obtain a target service data table;
and performing data check according to the original service data table and the target service data table to obtain a data check result, wherein the data check result is used for determining a service test result of the service executor.
2. The method according to claim 1, wherein the obtaining of the associated file structure corresponding to the service processing file comprises:
acquiring a file name of the service processing file, and judging whether the file name is matched with a naming rule corresponding to a target file structure;
and when the file structure is matched with the target file structure, taking the target file structure as an associated file structure.
3. The method according to claim 2, wherein the obtaining of the associated file structure corresponding to the service processing file, and the performing of data analysis on the service processing file according to the analysis policy corresponding to the associated file structure includes:
when the file name is not matched with a naming rule corresponding to a target file structure, taking a parent file structure corresponding to the service processing file as an associated file structure;
acquiring a structure inheritance relationship between a file structure corresponding to the service processing file and the parent file structure;
and carrying out data analysis on the service processing file according to the structure inheritance relationship and an analysis strategy corresponding to the parent file structure.
4. The method of claim 3, wherein the performing data parsing on the service processing file according to the structure inheritance relationship and the parsing policy corresponding to the parent file structure comprises:
determining first subfile contents inheriting the parent file structure in the service processing file according to the structure inheritance relation, wherein the file contents except the first subfile contents in the service processing file are used as second subfile contents;
and performing data analysis on the content of the first subfile according to an analysis strategy corresponding to the parent file structure, and performing data analysis on the content of the second subfile according to a preset field matching rule.
5. The method of claim 1, wherein the performing data check according to the original service data table and the target service data table to obtain a data check result comprises:
acquiring a data identifier corresponding to target service processing data in the target service data table;
and acquiring original service processing data corresponding to the data identification from the original service data table, and performing consistency check on the target service processing data and the original service processing data to obtain a consistency check result.
6. The method of claim 1, wherein the service input data comprises a plurality of data, and wherein inputting the service input data into a service executor for processing comprises:
determining a relevant data pair in the business input data;
inputting the service input data into a service executor for processing, and triggering and executing an interrupt instruction when detecting that the forward processing data of the associated data pair is processed completely in the processing process so as to interrupt the service processing process;
and when the interruption duration reaches a duration threshold, triggering a continuous execution instruction so that the service executor continuously executes a service processing process aiming at the service input data to obtain a service processing file.
7. A traffic testing apparatus, characterized in that the apparatus comprises:
the service input data acquisition module is used for acquiring an original service data form and acquiring service input data from the original service data form;
the processing module is used for inputting the service input data into the 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 analysis on the service processing file according to an analysis policy corresponding to the associated file structure, and write the service processing data obtained through analysis into a service data table to obtain a target service data table;
and the data checking module is used for performing data checking according to the original service data table and the target service data table to obtain a data checking result, and the data checking result is used for determining a service test result of the service executor.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202210137724.5A 2022-02-15 2022-02-15 Service testing method, computer device, storage medium, and computer program product Pending CN114490415A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210137724.5A CN114490415A (en) 2022-02-15 2022-02-15 Service testing method, computer device, storage medium, and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210137724.5A CN114490415A (en) 2022-02-15 2022-02-15 Service testing method, computer device, storage medium, and computer program product

Publications (1)

Publication Number Publication Date
CN114490415A true CN114490415A (en) 2022-05-13

Family

ID=81480331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210137724.5A Pending CN114490415A (en) 2022-02-15 2022-02-15 Service testing method, computer device, storage medium, and computer program product

Country Status (1)

Country Link
CN (1) CN114490415A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116483872A (en) * 2023-06-20 2023-07-25 合肥青谷信息科技有限公司 Complex data processing method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116483872A (en) * 2023-06-20 2023-07-25 合肥青谷信息科技有限公司 Complex data processing method and device and electronic equipment
CN116483872B (en) * 2023-06-20 2023-09-12 合肥青谷信息科技有限公司 Complex data processing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN108509485B (en) Data preprocessing method and device, computer equipment and storage medium
US10657530B2 (en) Automated transactions clearing system and method
US20230004979A1 (en) Abnormal behavior detection method and apparatus, electronic device, and computer-readable storage medium
CN114490415A (en) Service testing method, computer device, storage medium, and computer program product
CN111277465A (en) Abnormal data message detection method and device and electronic equipment
CN107016028A (en) Data processing method and its equipment
CN109324963A (en) The method and terminal device of automatic test profitable result
CN111367776A (en) Recording method, device, equipment and storage medium of resource transfer service
CN114493821B (en) Data verification and cancellation method and device, computer equipment and storage medium
CN112214495B (en) Data execution tracking method, device and equipment
CN115827478A (en) Code viewing method and device, computer equipment and storage medium
CN114579462A (en) Method and device for determining test case execution information and computer equipment
CN116541344A (en) File processing control method, apparatus, device, storage medium, and program product
CN115629958A (en) Universal field level automatic checking method and device for different service interfaces
CN116881164A (en) Verification and correction method, device and equipment for test data in financial information system
CN117370160A (en) Code auditing method, apparatus, computer device, storage medium and program product
CN115422897A (en) Method and device for processing resource transfer message, computer equipment and storage medium
CN116301733A (en) Service transaction logic arrangement method, device, computer equipment and storage medium
CN117132283A (en) Identification method, apparatus, computer device, storage medium, and program product
CN114416805A (en) Data checking method and device, computer equipment and storage medium
CN115268717A (en) Method and device for adding measurement points in point inspection management system and computer equipment
CN114581109A (en) Data consistency detection method and device, computer equipment and storage medium
CN115758179A (en) Method and device for evaluating aggregated transaction platform, computer equipment and storage medium
CN117314603A (en) Resource acquisition method, device, equipment and storage medium based on block chain system
CN116975072A (en) Data processing method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination