CN115222496A - Batch transaction result file generation method and device - Google Patents
Batch transaction result file generation method and device Download PDFInfo
- Publication number
- CN115222496A CN115222496A CN202210635101.0A CN202210635101A CN115222496A CN 115222496 A CN115222496 A CN 115222496A CN 202210635101 A CN202210635101 A CN 202210635101A CN 115222496 A CN115222496 A CN 115222496A
- Authority
- CN
- China
- Prior art keywords
- transaction
- result
- batch
- filled
- record
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000004590 computer program Methods 0.000 claims description 16
- 238000012360 testing method Methods 0.000 abstract description 20
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000013507 mapping Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- General Engineering & Computer Science (AREA)
- Development Economics (AREA)
- Technology Law (AREA)
- Data Mining & Analysis (AREA)
- Accounting & Taxation (AREA)
- Human Computer Interaction (AREA)
- Economics (AREA)
- Finance (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Databases & Information Systems (AREA)
- General Business, Economics & Management (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a method and a device for generating a batch transaction result file, wherein the method comprises the following steps: acquiring a batch transaction request file sent by a front-end system; searching a transaction result coding strategy corresponding to batch transaction and a transaction result file template corresponding to batch transaction according to the attribute information of batch transaction; according to the transaction result coding strategy, coding the transaction result in the transaction record corresponding to each transaction request in the request file; and updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generating a transaction result file of batch transaction according to the updating result. The invention realizes the automatic generation of the batch transaction result files, the generation of the batch transaction result files is not influenced by background environment, the result files do not need to be made manually, the independent test of the system can be realized, the error of the generation of the result files is effectively reduced, the automatic test is realized, and the test efficiency is improved.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for generating a batch transaction result file.
Background
In the financial field, there are a large number of batch transactions. For example, a business sends wages for its employees at fixed times per month, etc. Batch transactions refer to a large number of transactions of the same type generated by the same transaction party. The transaction result is often an important reference data for determining the transaction success rate, and therefore how to generate the transaction result file efficiently and accurately is an important issue to be solved in the industry at present.
In the prior art, after batch texts are uploaded to a background system for transaction processing, the background system returns corresponding transaction result texts, but during testing, due to the unstable environment of the background system, the requirement of accurately and effectively generating transaction result files under various test scenes cannot be met, and at the moment, a tester needs to manually make the transaction result files aiming at various test scenes. And the transaction records of the batch files are more, so that the workload of manually generating the files is large, the files are easy to make mistakes, and time and labor are wasted. Therefore, it is difficult to generate a batch transaction result file quickly and efficiently by the conventional file generation method.
Disclosure of Invention
The invention provides a method and a device for generating a batch transaction result file, which are used for solving the defects of high workload, high error probability, time and labor waste and realizing the automatic and accurate generation of the batch transaction result file in the prior art.
The invention provides a method for generating a batch transaction result file, which comprises the following steps:
acquiring a batch transaction request file sent by a front-end system;
searching a transaction result coding strategy corresponding to the batch transaction and a transaction result file template corresponding to the batch transaction according to the attribute information of the batch transaction;
coding the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result coding strategy;
and updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generating the transaction result file of the batch transaction according to the updating result.
According to the method for generating the batch transaction result file provided by the invention, the encoding of the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result encoding strategy comprises the following steps:
for each transaction record the following is performed:
under the condition that the transaction results of all lines in the current transaction record are successful, coding the transaction result in the current transaction record according to a transaction success coding strategy in the transaction result coding strategy;
under the condition that a target row with a transaction result of transaction failure exists in the current transaction record, searching a transaction failure coding strategy corresponding to the transaction failure result of the target row in the transaction result coding strategy according to the position of the target row in the current transaction record;
and coding the transaction result in the current transaction record according to the transaction failure coding strategy.
According to the method for generating the batch transaction result files, provided by the invention, the transaction success coding strategy comprises a coding strategy of a transaction success return state, a coding strategy of a transaction success return code and a coding strategy of a transaction success return reason;
the transaction failure coding strategy comprises a coding strategy of a transaction failure return state, a coding strategy of a transaction failure return code and a coding strategy of a transaction failure return reason.
According to the method for generating the batch transaction result file, the transaction result file template comprises transaction text content to be filled, transaction date to be filled, transaction time to be filled, background serial number to be filled, transaction state to be filled, transaction return code to be filled and transaction return reason to be filled.
According to the method for generating the batch transaction result file provided by the invention, the updating of the transaction result file template is carried out according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and the method comprises the following steps:
for each transaction record the following is performed:
according to the parameter configuration of the transaction text content to be filled, acquiring target content matched with the transaction text content to be filled in a transaction result in a current transaction record, and filling the target content to a field where the transaction text content to be filled is located;
configuring the transaction date of the current transaction record according to the parameter configuration of the transaction date to be filled, and filling the configured transaction date to a column where the transaction date to be filled is located;
configuring the transaction time of the current transaction record according to the parameter configuration of the transaction time to be filled, and filling the configured transaction time to a column of the transaction time to be filled;
configuring the background serial number of the current transaction record according to the parameter configuration of the background serial number to be filled, and sequentially filling the configured background serial number to the column where the background serial number to be filled is located;
filling the transaction state code value in the code result corresponding to the current record into the column where the transaction state to be filled is located;
filling the transaction return code value in the coding result to the column position of the transaction return code to be filled;
and filling the transaction return reason code value in the code result into the column where the transaction return reason to be filled is located.
According to the method for generating the batch transaction result file, the parameter configuration of each data in the transaction text content to be filled, the transaction date to be filled, the transaction time to be filled and the background serial number to be filled comprises a data starting position, a data length and data default information.
The invention also provides a device for generating the batch transaction result file, which comprises:
the acquisition module is used for acquiring the batch transaction request files sent by the front-end system;
the searching module is used for searching a transaction result coding strategy corresponding to the batch transaction and a transaction result file template corresponding to the batch transaction according to the attribute information of the batch transaction;
the coding module is used for coding the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result coding strategy;
and the generation module is used for updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generating the transaction result file of the batch transaction according to the updating result.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the batch transaction result file generation method.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the batch transaction result file generating method as described in any of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the batch transaction result file generation method as described in any one of the above.
According to the batch transaction result file generation method and device, a transaction result coding strategy and a transaction result file template corresponding to batch transactions can be obtained in a database in real time according to attribute information of the batch transactions, the transaction result in a transaction record corresponding to each transaction request in a request file is coded according to the transaction result coding strategy, the transaction result file template is updated according to a coding result corresponding to each transaction record and a transaction result in each transaction record, and the batch transaction result file is automatically and accurately generated, so that the whole batch transaction result file generation process is automatically completed on line, the automatic file generation is realized, manual participation is effectively reduced, the manual workload is reduced, the accuracy and the effectiveness of the generated batch transaction result file are improved, and the file generation efficiency is improved; the generation of the batch transaction result files is independent of a background system and is not influenced by a background environment, the accuracy and the effectiveness of the generation of the result files are further improved, the batch transaction result files with different attribute information can be compatible, and the applicability is good.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a batch transaction result file generation method provided by the present invention;
FIG. 2 is a schematic structural diagram of a batch transaction result file generation apparatus provided in the present invention;
fig. 3 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
In the prior art, batch texts are uploaded to a background system for transaction processing, and the background system returns corresponding batch transaction result texts, but during testing, due to the unstable environment of the background system, the requirements of various test scenes cannot be met, and due to the fact that batch transaction result files are manually made by testing personnel, due to the fact that transaction records in the batch transaction result files are large, the workload of manually generating the files is large, and errors are prone to occurring.
In view of the problems of large workload and high error liability of generating files in the prior art, the present embodiment provides a method for generating a batch transaction result file, which can quickly find a transaction result encoding policy and a transaction result file template corresponding to each batch transaction according to attribute information, and encode and update transaction results of the batch transactions according to the transaction result encoding policy, so that not only can a batch transaction result file be quickly and accurately generated, but also batch transactions with different attribute information can be compatible.
The method for generating the batch transaction result file of the invention is described below with reference to fig. 1, and the method comprises the following steps:
batch transactions refer to a large number of transactions of the same type generated by the same transaction party.
The request files for batch transaction are transaction files with fixed length formats, and one request file comprises a plurality of transaction request data with the same format.
The batch transaction result may be a batch payroll transaction result, a batch investment financing transaction result, and the like, which is not particularly limited in this embodiment.
The request file for the batch transaction is a batch transaction request file manually generated by the front-end system or the client. The request files for batch transaction have different formats according to different service scenes.
Optionally, the front-end system is monitored in real time to obtain the request file of batch transaction sent by the front-end system in real time.
102, searching a transaction result coding strategy corresponding to the batch transaction and a transaction result file template corresponding to the batch transaction according to the attribute information of the batch transaction;
the attribute information includes a transaction type or a transaction data format, which is not specifically limited in this embodiment.
A transaction result coding strategy of batch transaction with different attribute information and a transaction result file template of batch transaction with different attribute information are pre-configured in the database;
the transaction result coding strategy is a plurality of preset transaction result coding strategies aiming at different line numbers;
and a plurality of columns are preset in the transaction result file template and are used for storing the transaction results corresponding to batch transactions according to the columns.
Optionally, after the request file for batch transaction is obtained, a transaction result encoding strategy corresponding to batch transaction may be obtained according to a mapping relationship between the attribute information and the transaction result encoding strategy; according to the attribute information and the transaction result file template, the transaction result file template corresponding to batch transaction is searched, so that different transaction result coding strategies are adopted for coding aiming at batch transaction of different attribute information, and batch result files of different formats are generated, and the applicability is strong.
103, coding the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result coding strategy;
the transaction result coding strategy pre-stores the transaction result coding strategy of each transaction record in different test scenes and different lines;
test scenarios include, but are not limited to, a transaction that is completely successful, completely failed, or partially successful and partially failed.
Different transaction failure line numbers are provided with different transaction failure encoding strategies.
Optionally, after the transaction result encoding policy corresponding to the batch transaction is obtained, the transaction result in the transaction record corresponding to each transaction request in the request file may be encoded to obtain the encoding result corresponding to each transaction record.
For each transaction record, determining a test scenario to which the transaction record belongs according to the transaction result in the transaction record, determining the position of a target line in which the transaction result is failed in the transaction record, and encoding the transaction result in the transaction record according to the test scenario to which the transaction record belongs and the position of the target line in which the transaction is failed to obtain an encoding result corresponding to the transaction record.
And 104, updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generating the transaction result file of the batch transaction according to the updating result.
Optionally, after the coding result corresponding to each transaction record and the transaction result in each transaction record are obtained, the coding result corresponding to each transaction record and the transaction result in each transaction record may be directly filled in the corresponding field of the transaction result file template to obtain a transaction result file of batch transaction;
or, according to the parameter configuration of the transaction result file template, after the coding result corresponding to each transaction record and the transaction result in each transaction record are configured, filling the coding result and the transaction result in each transaction record into the corresponding field of the transaction result file template to obtain the transaction result file for batch transaction, which is not specifically limited in this embodiment.
According to the embodiment, a transaction result coding strategy and a transaction result file template corresponding to batch transactions can be obtained in a database in real time according to the attribute information of the batch transactions, the transaction results in the transaction records corresponding to each transaction request in the request file are coded according to the transaction result coding strategy, the transaction result file template is updated according to the coding result corresponding to each transaction record and the transaction results in each transaction record, and the transaction result files of the batch transactions are automatically and accurately generated, so that the whole batch transaction result file generation process is automatically completed on line, the automatic file generation is realized, the manual participation is effectively reduced, the manual workload is reduced, the accuracy and the effectiveness of the generated batch transaction result files are improved, and the file generation efficiency is improved; and the generation of the batch transaction result file is independent of a background system and is not influenced by a background environment, the accuracy and the effectiveness of the generation of the result file are further improved, the compatibility of the batch transaction result files with various different attribute information can be realized, and the applicability is good.
In some embodiments, the encoding, according to the transaction result encoding policy, the transaction result in the transaction record corresponding to each transaction request in the request file includes: for each transaction record, performing the following: under the condition that the transaction results of all lines in the current transaction record are successful, coding the transaction result in the current transaction record according to a transaction success coding strategy in the transaction result coding strategy; under the condition that a target row with a transaction result of transaction failure exists in the current transaction record, searching a transaction failure coding strategy corresponding to the transaction failure result of the target row in the transaction result coding strategy according to the position of the target row in the current transaction record; and coding the transaction result in the current transaction record according to the transaction failure coding strategy.
The trading result coding strategy comprises a trading success coding strategy and a trading failure coding strategy; the transaction success coding strategy is a scene aiming at that the transaction results in the transaction records are transaction success, and the transaction failure coding strategy is a scene aiming at that the transaction results in the transaction records are transaction failure or partial transaction failure.
The transaction result encoding policy includes, but is not limited to, one or more of an encoding policy for a transaction result return state, an encoding policy for a transaction result return code, an encoding policy for a transaction result return reason, and an encoding policy for a transaction result return type, which is not specifically limited in this embodiment.
TABLE 1 different transaction failure encoding strategies with different transaction failure line numbers
Different transaction failure encoding strategies are set for different transaction failure line numbers, and the different transaction failure encoding strategies can be specifically set according to attribute information of batch transaction results. As shown in table 1, different transaction failure encoding strategies are set for different numbers of transaction failure lines.
Optionally, the step of encoding the transaction result in each transaction record in step 103 specifically includes the following steps:
and judging whether the transaction results of all lines in the current transaction record have the condition of transaction failure or not, if the transaction results of all lines in the current transaction record do not have the target line of transaction failure, encoding the transaction results in the current transaction record by adopting a transaction success encoding strategy to obtain an encoding result corresponding to each transaction record.
If a target row with transaction failure exists, determining a transaction failure coding strategy corresponding to the transaction failure result of the target row according to the position of the target row in the current transaction record, and coding the target row according to the transaction failure coding strategy to obtain a coding result corresponding to each transaction record.
As shown in table 1, if the target row is in rows 2 to 10, the transaction result return state code of the target row is F, the transaction result return code is FF0001, and the transaction result return reason is coded as account abnormality.
In the embodiment, different transaction result coding strategies are automatically selected to code the transaction result in the transaction record corresponding to each transaction request in the request file according to different transaction test scenes, so that the obtained coding result corresponding to each transaction record is more reliable and accurate.
In some embodiments, the transaction success coding strategy comprises a coding strategy of a transaction success return state, a coding strategy of a transaction success return code, and a coding strategy of a transaction success return reason; the transaction failure coding strategy comprises a coding strategy of a transaction failure return state, a coding strategy of a transaction failure return code and a coding strategy of a transaction failure return reason.
The transaction result encoding policy may be a default encoding policy or an encoding policy configured in advance by a user, which is not specifically limited in this embodiment.
The transaction success coding strategy comprises a coding strategy of a transaction success return state, a coding strategy of a transaction success return code and a coding strategy of a transaction success return reason;
the transaction failure coding strategy is provided with a coding strategy of a transaction failure return state, a coding strategy of a transaction failure return code and a coding strategy of a transaction failure return reason corresponding to each row according to the rows. And if not, the transaction failure encoding strategy is realized according to the default encoding strategy. As shown in table 2, the default encoding policy for the transaction success policy and the transaction failure policy are encoded.
TABLE 2 Default encoding strategy
In the embodiment, different transaction result coding strategies are configured for different transaction test scenarios, and the transaction result in each transaction record can be uniformly coded according to the transaction result coding strategies, such that the coding result corresponding to each transaction record includes richer information, and thus, a transaction result file can be generated more accurately and effectively.
In some embodiments, the transaction result file template includes a transaction text content to be filled, a transaction date to be filled, a transaction time to be filled, a background serial number to be filled, a transaction status to be filled, a transaction return code to be filled, and a transaction return reason to be filled.
The transaction result file template may be a form file or a text file, which is not specifically limited in this embodiment.
The transaction result file template comprises a plurality of columns, and each column is empty in the initial state; the column where the transaction text content to be filled is located is a column where the transaction text content to be filled is located; the column where the transaction date is to be filled is the column where the transaction date is to be filled; the column where the transaction time is to be filled is the column where the transaction time is to be filled; the column position where the background serial number is to be filled is the column position where the background serial number is to be filled; the column where the transaction state to be filled is located is the column to be filled with the transaction state; the column where the transaction return code to be filled is located is the column where the transaction return code to be filled is located; and the column where the transaction return reason is to be filled is the column filled with the transaction return reason to be processed.
In the embodiment, different transaction result file templates are configured for batch transactions with different attribute information, and the transaction result file templates can contain transaction text contents to be filled, transaction dates to be filled, transaction time to be filled, background serial numbers to be filled, transaction states to be filled, transaction return codes to be filled and transaction return reasons to be filled, so that the transaction result files contain richer information, and the availability of the transaction result files is improved; and different columns are used for storing different transaction data, so that the transaction result file is more visual.
In some embodiments, the updating the transaction result file template according to the encoding result corresponding to each transaction record and each transaction record includes: for each transaction record, performing the following: according to the parameter configuration of the transaction text content to be filled, acquiring target content matched with the transaction text content to be filled in a transaction result in a current transaction record, and filling the target content to a field where the transaction text content to be filled is located; configuring the transaction date of the current transaction record according to the parameter configuration of the transaction date to be filled, and filling the configured transaction date to a column where the transaction date to be filled is located; configuring the transaction time of the current transaction record according to the parameter configuration of the transaction time to be filled, and filling the configured transaction time to a column of the transaction time to be filled; configuring the background serial number of the current transaction record according to the parameter configuration of the background serial number to be filled, and sequentially filling the configured background serial number to a column where the background serial number to be filled is located; filling the transaction state code value in the code result corresponding to the current record into a column where the transaction state to be filled is located; filling the transaction return code encoding value in the encoding result to a column where the transaction return code to be filled is located; and filling the transaction return reason code value in the code result into the column where the transaction return reason to be filled is located.
The parameter configuration includes one or more combinations of a data start position, an end position, a data length, and data default information, which is not specifically limited in this embodiment.
The parameter configuration may be a default configuration, or may be a configuration preset by a user according to actual needs. It should be noted that, in the case that there is no user personalized configuration, the default configuration is used; in case there is a user personalized configuration, the user personalized configuration is preferred.
Optionally, the step of updating the transaction result file template in step 104 specifically includes the following steps:
and intercepting target content matched with the transaction text to be filled at the initial position and the end position in the transaction result of the current transaction record according to the initial position and the end position in the parameter configuration of the transaction text content to be filled, namely the target content meeting the parameter configuration of the transaction text content to be filled.
Or intercepting the target content of which the starting position and the length are matched with the transaction text to be filled from the transaction result of the current transaction record according to the starting position and the length in the parameter configuration of the transaction text content to be filled, which is not specifically limited in this embodiment.
The number of the transaction text contents to be filled is multiple, and the parameter configuration of different transaction text contents to be filled is different; two, one of the parameters to be filled in with the transaction text content is configured as: the starting position is 1, the length is 200, and the ending position is 200; another parameter to be populated with the transaction text content is configured to: the start position is 215, the length is 80 and the end position is 294.
And then, filling the acquired target content into a field where the transaction text content to be filled is located.
Meanwhile, the transaction date of the current transaction record is configured according to the parameter configuration of the transaction date to be filled, and the configured transaction date is filled to the column where the transaction date to be filled is located;
meanwhile, the transaction time of the current transaction record is configured according to the parameter configuration of the transaction time to be filled, and the configured transaction time is filled to a column where the transaction date to be filled is located;
meanwhile, the background serial number of the current transaction record is configured according to the parameter configuration of the background serial number to be filled, and the configured background serial number is sequentially filled to a column where the background serial number to be filled is located; if the background serial number to be filled establishes a sequence according to the default value variable, the variable sequence is taken from the background serial number of the current transaction record in sequence and is filled in the column.
Meanwhile, the transaction state code value, the transaction return code value and the transaction return reason code value in the coding result in the step 103 are sequentially filled to the column where the transaction state to be filled is located, the column where the transaction return code to be filled is located and the column where the transaction return reason to be filled is located; filling a transaction success coding result when a target line which fails in transaction does not exist; and when the target row with the transaction failure exists and the transaction result coding strategy is configured by the user, the transaction return state, the transaction return code and the transaction return reason are coded and then filled according to the transaction failure coding strategy configured by the user, otherwise, the transaction return state, the transaction return code and the transaction return reason are coded and then filled according to the transaction failure configured by default.
Illustratively, as shown in table 3, is an example of the content of the final file of a batch transaction result.
In the embodiment, different columns in the transaction result file template are filled according to the parameter configuration of the different columns in the transaction result file template, so that the final file of batch transaction results can be quickly and accurately generated; in the whole batch transaction result file generation process, the batch transaction result files are not influenced by background environment, the result files do not need to be made manually, system independent testing can be achieved, result file generation errors can be effectively reduced, automatic testing is achieved, and testing efficiency is improved.
Table 3 content example of final file of batch transaction result
In some embodiments, the parameter configuration for each data of the transaction text content to be filled, the transaction date to be filled, the transaction time to be filled, and the background serial number to be filled comprises one or more combinations of a data start position, a data length, and data default information.
Wherein, the data starting position is used for limiting the starting position of the data, and the data length is used for limiting the length of the data.
The data default information includes a default value type and a default value.
The default value type is the default type of the data; the default value is a default value of the data. If the default value type of the transaction text content to be filled is the original text content filling; the default value type of the background serial number to be filled is sequential filling and the like.
According to the embodiment, different configurations are configured for each field in the transaction result file template, so that the generated final file of the batch transaction result is more accurate.
The following describes the device for generating a batch transaction result file according to the present invention, and the device for generating a batch transaction result file described below and the method for generating a batch transaction result file described above may be referred to in correspondence.
As shown in fig. 2, the present embodiment provides an apparatus for generating a batch transaction result file, which includes an obtaining module 201, a searching module 202, an encoding module 203, and a generating module 204, where:
the obtaining module 201 is configured to obtain a request file for batch transaction sent by a front-end system;
batch transactions refer to a large number of transactions of the same type generated by the same transaction party.
The request files for batch transaction are transaction files with fixed length formats, and one request file comprises a plurality of transaction request data with the same format.
The batch transaction result may be a batch payroll transaction result, a batch investment financing transaction result, and the like, which is not particularly limited in this embodiment.
The request file for the batch transaction is a batch transaction request file manually generated by the front-end system or the client. The request files for batch transaction have different formats according to different service scenes.
Optionally, the front-end system is monitored in real time to obtain the request file of batch transaction uploaded by the front-end system in real time.
The searching module 202 is configured to search, according to the attribute information of the batch transaction, a transaction result encoding policy corresponding to the batch transaction and a transaction result file template corresponding to the batch transaction;
optionally, after the request file for batch transaction is obtained, a transaction result encoding strategy corresponding to batch transaction may be obtained according to a mapping relationship between the attribute information and the transaction result encoding strategy; according to the attribute information and the transaction result file template, the transaction result file template corresponding to batch transaction is searched, so that different transaction result coding strategies are adopted for coding aiming at batch transaction of different attribute information, and batch result files of different formats are generated, and the applicability is strong.
The coding module 203 is configured to code the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result coding policy;
optionally, after the transaction result encoding strategy corresponding to the batch transaction is obtained, the transaction result in the transaction record corresponding to each transaction request in the request file may be encoded to obtain an encoding result corresponding to each transaction record.
For each transaction record, determining a test scenario to which the transaction record belongs according to the transaction result in the transaction record, determining the position of a target line where the transaction result in the transaction record fails, and encoding the transaction result in the transaction record according to the test scenario to which the transaction record belongs and the position of the target line where the transaction fails to obtain an encoding result corresponding to the transaction record.
The generating module 204 is configured to update the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generate the transaction result file of the batch transaction according to the update result.
Optionally, after the coding result corresponding to each transaction record and the transaction result in each transaction record are obtained, the coding result corresponding to each transaction record and the transaction result in each transaction record may be directly filled in the corresponding field of the transaction result file template to obtain a transaction result file of batch transaction;
or, according to the parameter configuration of the transaction result file template, after the coding result corresponding to each transaction record and the transaction result in each transaction record are configured, filling the coding result and the transaction result in each transaction record into the corresponding field of the transaction result file template to obtain the transaction result file for batch transaction, which is not specifically limited in this embodiment.
According to the embodiment, a transaction result coding strategy and a transaction result file template corresponding to batch transactions can be obtained in a database in real time according to the attribute information of the batch transactions, the transaction results in the transaction records corresponding to each transaction request in the request file are coded according to the transaction result coding strategy, the transaction result file template is updated according to the coding result corresponding to each transaction record and the transaction results in each transaction record, and the transaction result files of the batch transactions are automatically and accurately generated, so that the whole batch transaction result file generation process is automatically completed on line, the automatic file generation is realized, the manual participation is effectively reduced, the manual workload is reduced, the accuracy and the effectiveness of the generated batch transaction result files are improved, and the file generation efficiency is improved; the generation of the batch transaction result files is independent of a background system and is not influenced by a background environment, the accuracy and the effectiveness of the generation of the result files are further improved, the batch transaction result files with different attribute information can be compatible, and the applicability is good.
Fig. 3 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 3: a processor (processor) 301, a communication Interface (communication Interface) 302, a memory (memory) 303 and a communication bus 304, wherein the processor 301, the communication Interface 302 and the memory 303 complete communication with each other through the communication bus 304. Processor 301 may invoke logic instructions in memory 303 to perform a batch transaction result file generation method comprising: acquiring a batch transaction request file sent by a front-end system; according to the attribute information of the batch transaction, searching a transaction result coding strategy corresponding to the batch transaction and a transaction result file template corresponding to the batch transaction; coding the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result coding strategy; and updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generating the transaction result file of the batch transaction according to the updating result.
In addition, the logic instructions in the memory 303 may be implemented in the form of software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, when the computer program is executed by a processor, the computer can execute the batch transaction result file generation method provided by the above methods, the method includes: acquiring a batch transaction request file sent by a front-end system; searching a transaction result coding strategy corresponding to the batch transaction and a transaction result file template corresponding to the batch transaction according to the attribute information of the batch transaction; coding the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result coding strategy; and updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generating the transaction result file of the batch transaction according to the updating result.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which when executed by a processor, implements a batch transaction result file generation method provided by the above methods, the method including: acquiring a batch transaction request file sent by a front-end system; searching a transaction result coding strategy corresponding to the batch transaction and a transaction result file template corresponding to the batch transaction according to the attribute information of the batch transaction; according to the transaction result coding strategy, coding the transaction result in the transaction record corresponding to each transaction request in the request file; and updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generating the transaction result file of the batch transaction according to the updating result.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A method for generating a batch transaction result file, comprising:
acquiring a batch transaction request file sent by a front-end system;
searching a transaction result coding strategy corresponding to the batch transaction and a transaction result file template corresponding to the batch transaction according to the attribute information of the batch transaction;
coding the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result coding strategy;
and updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generating the transaction result file of the batch transaction according to the updating result.
2. The method for generating the batch transaction result file according to claim 1, wherein the encoding the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result encoding policy comprises:
for each transaction record, performing the following:
under the condition that the transaction results of all lines in the current transaction record are successful, the transaction results in the current transaction record are encoded according to a transaction success encoding strategy in the transaction result encoding strategy;
under the condition that a target row with a transaction result of transaction failure exists in the current transaction record, searching a transaction failure coding strategy corresponding to the transaction failure result of the target row in the transaction result coding strategy according to the position of the target row in the current transaction record;
and coding the transaction result in the current transaction record according to the transaction failure coding strategy.
3. The batch transaction result file generation method according to claim 2, wherein the transaction success coding strategy comprises a coding strategy of a transaction success return state, a coding strategy of a transaction success return code, and a coding strategy of a transaction success return reason;
the transaction failure coding strategy comprises a coding strategy of a transaction failure return state, a coding strategy of a transaction failure return code and a coding strategy of a transaction failure return reason.
4. The batch transaction result file generation method according to any one of claims 1 to 3, wherein the transaction result file template comprises transaction text content to be filled, transaction date to be filled, transaction time to be filled, background serial number to be filled, transaction state to be filled, transaction return code to be filled, and transaction return reason to be filled.
5. The batch transaction result file generating method according to claim 4, wherein the updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record comprises:
for each transaction record the following is performed:
according to the parameter configuration of the transaction text content to be filled, acquiring target content matched with the transaction text content to be filled in a transaction result in a current transaction record, and filling the target content to a column where the transaction text content to be filled is located;
configuring the transaction date of the current transaction record according to the parameter configuration of the transaction date to be filled, and filling the configured transaction date to a column where the transaction date to be filled is located;
configuring the transaction time of the current transaction record according to the parameter configuration of the transaction time to be filled, and filling the configured transaction time to a column of the transaction time to be filled;
configuring the background serial number of the current transaction record according to the parameter configuration of the background serial number to be filled, and sequentially filling the configured background serial number to a column where the background serial number to be filled is located;
filling the transaction state code value in the code result corresponding to the current record into a column where the transaction state to be filled is located;
filling the transaction return code value in the coding result to the column position of the transaction return code to be filled;
and filling the transaction return reason code value in the code result into the column where the transaction return reason to be filled is located.
6. The batch transaction result file generation method according to claim 5, wherein the parameter configuration for each data of the transaction text content to be filled, the transaction date to be filled, the transaction time to be filled and the background serial number to be filled comprises a data start position, a data length and data default information.
7. An apparatus for generating a batch transaction result file, comprising:
the acquisition module is used for acquiring the batch transaction request files sent by the front-end system;
the searching module is used for searching a transaction result coding strategy corresponding to the batch transaction and a transaction result file template corresponding to the batch transaction according to the attribute information of the batch transaction;
the coding module is used for coding the transaction result in the transaction record corresponding to each transaction request in the request file according to the transaction result coding strategy;
and the generation module is used for updating the transaction result file template according to the coding result corresponding to each transaction record and the transaction result in each transaction record, and generating the transaction result file of the batch transaction according to the updating result.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the batch transaction result file generating method according to any one of claims 1 to 6 when executing the program.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the batch transaction result file generating method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the batch transaction result file generation method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210635101.0A CN115222496A (en) | 2022-06-06 | 2022-06-06 | Batch transaction result file generation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210635101.0A CN115222496A (en) | 2022-06-06 | 2022-06-06 | Batch transaction result file generation method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115222496A true CN115222496A (en) | 2022-10-21 |
Family
ID=83607071
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210635101.0A Pending CN115222496A (en) | 2022-06-06 | 2022-06-06 | Batch transaction result file generation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115222496A (en) |
-
2022
- 2022-06-06 CN CN202210635101.0A patent/CN115222496A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3343411A1 (en) | Sql auditing method and apparatus, server and storage device | |
CN115167891B (en) | Data updating method, device and equipment of interface control file and storage medium | |
CN113505580A (en) | Method and device for analyzing table file | |
CN115391439B (en) | Document data export method, device, electronic equipment and storage medium | |
KR101737578B1 (en) | Method and device for automatically tuning for sql sentences generated automatically | |
CN111435367B (en) | Knowledge graph construction method, system, equipment and storage medium | |
CN111125067B (en) | Data maintenance method and device | |
WO2020233310A1 (en) | Asynchronous compensation method and apparatus for real-time processing data, device, and storage medium | |
CN114896161A (en) | File construction method and device based on artificial intelligence, computer equipment and medium | |
CN111143434A (en) | Intelligent data checking method, device, equipment and storage medium | |
CN110209442B (en) | Plug-in function automatic execution method, electronic device and storage medium | |
CN115222496A (en) | Batch transaction result file generation method and device | |
CN115544132A (en) | Data import method and system and electronic equipment | |
CN114372025A (en) | Consistency checking method and device for distributed edge cloud edge nodes | |
CN115587021A (en) | Simulation test message generation method and device | |
CN115422180A (en) | Data verification method and system | |
CN114511314A (en) | Payment account management method and device, computer equipment and storage medium | |
CN114492349A (en) | Table splitting method and device, electronic equipment and storage medium | |
CN109582330B (en) | Data model upgrading method, device, equipment and readable storage medium | |
CN113010588A (en) | Data table processing method | |
CN112579589A (en) | Information importing method and device | |
CN113362007B (en) | Zero inventory record processing method | |
CN117807977B (en) | Report processing method and device based on formula engine | |
CN113806505B (en) | Element comparison method, device, electronic apparatus, and storage medium | |
CN115187411A (en) | Insurance applicability automatic analysis method and system and computer equipment |
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 |