Batch file processing method and device, storage medium and electronic device
By assembling and encrypting various types of financial business data, the generated batch file identifies multiple business types in a single file, solving the problem of poor generation methods in existing technologies, achieving higher security and versatility, and reducing labor costs.
Patent Information
- Application Number
- CN202411619957.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The prior art has a poor method for generating batch files, resulting in poor batch file generation effects and problems of high security and manpower and time costs.
By identifying various types of financial business data, assembling and encrypting them according to specific rules, generating batch files, and using extended data bits to identify various business types, security and versatility are improved.
The security and versatility of batch files are improved, the manpower and time cost of generating batch files for each business is reduced, and the generation effect is improved.
Smart Images

Figure CN119539948B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of file processing technology, and in particular to a batch file processing method and device, a storage medium, and an electronic device. Background Art
[0002] With the rapid development of the Internet industry, Internet financial companies have increasingly higher standards for fund security, information transmission security, sensitive information security, etc., and are paying more and more attention to the security of large quantities of fund-related submission documents.
[0003] In the related art of enterprise batch file processing, most companies still simply encrypt batch files, but the contents of the files are still displayed in plain text. This still poses certain risks to the payment industry. In addition, each payment service requires the generation of a corresponding batch file, which significantly increases manpower and time costs. Therefore, the batch file generation method in the related art is poor, resulting in poor batch file generation results.
[0004] With respect to the problem that the generation method of batch files in related technologies is not good, resulting in poor effect of generating batch files, no effective solution has been proposed so far. Summary of the Invention
[0005] The main purpose of this application is to provide a batch file processing method and device, storage medium and electronic device to solve the problem that the generation method of batch files in the related art is not good, resulting in poor effect of generating batch files.
[0006] To achieve the above-mentioned objectives, according to one aspect of the present application, a method for processing batch files is provided. The method comprises: determining multiple types of financial services to be batch processed, and obtaining data for each type of financial service to obtain multiple pieces of service data; assembling the multiple pieces of service data according to target rules to obtain assembled service data, wherein the target rules indicate that the assembled service data at least includes: a file header, a total data length, a total data content length, extended data bits, and valid data content, wherein the file header indicates type information of the service data, the total data length indicates the sum of the length of the extended data bits and the length of the valid data content, the total data content length indicates the length of the valid data content, the extended data bits indicate type information of the service, and the valid data content indicates content information of the service data; and encrypting the assembled service data to obtain a batch file, wherein the batch file is used to process the multiple types of financial services.
[0007] Furthermore, if the multiple types of financial services include a first type of financial service and a second type of financial service, the multiple business data are assembled and processed according to the target rules to obtain the assembled business data, including: classifying the multiple business data to obtain first type of business data and second type of business data, wherein the first type of business data is the data of the first type of financial service, and the second type of business data is the data of the second type of financial service; assembling the first type of business data according to the target rules to obtain assembled first type of business data; assembling the second type of business data according to the target rules to obtain assembled second type of business data; obtaining the assembled business data based on the assembled first type of business data and the assembled second type of business data.
[0008] Furthermore, according to the target rule, the first type of business data is assembled and processed to obtain the assembled first type of business data, including: according to the target rule, obtaining the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data; based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data, the assembled first type of business data is obtained.
[0009] Furthermore, according to the target rule, obtaining the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data includes: according to the target rule, according to the type information of the financial business corresponding to the first type of business data, determining the file header of the first type of business data; assembling the first type of business data to obtain the valid data content of the first type of business data, and obtaining the length information of the valid data content of the first type of business data to obtain the total length of the data content of the first type of business data; determining the extended data bits of the first type of business data based on the first type of financial business and the second type of financial business; determining the total data length of the first type of business data based on the length information of the extended data bits of the first type of business data and the length information of the valid data content of the first type of business data.
[0010] Furthermore, after encrypting the assembled business data to obtain a batch file, the method also includes: decrypting the batch file to obtain a decrypted batch file; parsing the decrypted batch file according to the target rule to obtain the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data; processing the multiple types of financial business based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data.
[0011] Furthermore, based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data, processing the multiple types of financial services includes: processing the first type of financial service based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data and the valid data content of the first type of business data; determining the file header of the second type of business data, the total data length of the second type of business data, the total length of the data content of the second type of business data, the extended data bits of the second type of business data and the valid data content of the second type of business data according to the extended data bits of the first type of business data; processing the second type of financial service based on the file header of the second type of business data, the total data length of the second type of business data, the total length of the data content of the second type of business data, the extended data bits of the second type of business data and the valid data content of the second type of business data.
[0012] Furthermore, based on the file header of the first type of business data, the total data length of the first type of business data, the total data content length of the first type of business data and the valid data content of the first type of business data, processing the first type of financial business includes: determining whether the total data content length of the first type of business data is equal to a preset length; if the total data content length of the first type of business data is not equal to the preset length, it indicates that the parsing of the first type of business data is incorrect, and processing of the first type of financial business is prohibited; if the total data content length of the first type of business data is equal to the preset length, processing of the first type of financial business is allowed based on the file header of the first type of business data, the total data length of the first type of business data and the valid data content of the first type of business data.
[0013] To achieve the above-mentioned object, according to another aspect of the present application, a batch file processing device is provided. The device comprises: a first acquisition unit, configured to determine multiple types of financial services to be batch processed and acquire data for each type of financial service to obtain multiple pieces of service data; a first processing unit, configured to assemble the multiple pieces of service data according to a target rule to obtain assembled service data, wherein the target rule indicates that the assembled service data at least includes: a file header, a total data length, a total data content length, extended data bits, and valid data content, wherein the file header indicates type information of the service data, the total data length indicates the sum of the length of the extended data bits and the length of the valid data content, the total data content length indicates the length of the valid data content, the extended data bits indicate type information of the service, and the valid data content indicates content information of the service data; and a second processing unit, configured to encrypt the assembled service data to obtain a batch file, wherein the batch file is used to process the multiple types of financial services.
[0014] Further, if the multiple types of financial services include a first type of financial service and a second type of financial service, the first processing unit includes: a first processing sub-unit, used to classify and process the multiple business data to obtain first type of business data and second type of business data, wherein the first type of business data is the data of the first type of financial service, and the second type of business data is the data of the second type of financial service; a second processing sub-unit, used to assemble and process the first type of business data according to the target rule to obtain assembled first type of business data; a third processing sub-unit, used to assemble and process the second type of business data according to the target rule to obtain assembled second type of business data; a first determination sub-unit, used to obtain the assembled business data based on the assembled first type of business data and the assembled second type of business data.
[0015] Furthermore, the second processing sub-unit includes: a first acquisition module, used to obtain the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data according to the target rule; a first determination module, used to obtain the assembled first type of business data based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data.
[0016] Furthermore, the first acquisition module includes: a first determination submodule, used to determine the file header of the first type of business data according to the target rule and the type information of the financial business corresponding to the first type of business data; a first processing submodule, used to assemble and process the first type of business data to obtain the valid data content of the first type of business data, and obtain the length information of the valid data content of the first type of business data to obtain the total length of the data content of the first type of business data; a second determination submodule, used to determine the extended data bits of the first type of business data based on the first type of financial business and the second type of financial business; a third determination submodule, used to determine the total data length of the first type of business data based on the length information of the extended data bits of the first type of business data and the length information of the valid data content of the first type of business data.
[0017] Furthermore, the device also includes: a third processing unit, which is used to encrypt the assembled business data to obtain a batch file, and then decrypt the batch file to obtain a decrypted batch file; a fourth processing unit, which is used to parse the decrypted batch file according to the target rule to obtain the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data; and a fifth processing unit, which is used to process the multiple types of financial business based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data.
[0018] Furthermore, the fifth processing unit includes: a fourth processing subunit, used to process the first type of financial business based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data and the valid data content of the first type of business data; a second determination subunit, used to determine the file header of the second type of business data, the total data length of the second type of business data, the total length of the data content of the second type of business data, the extended data bits of the second type of business data and the valid data content of the second type of business data according to the extended data bits of the first type of business data; a fifth processing subunit, used to process the second type of financial business based on the file header of the second type of business data, the total data length of the second type of business data, the total length of the data content of the second type of business data, the extended data bits of the second type of business data and the valid data content of the second type of business data.
[0019] Furthermore, the fourth processing sub-unit includes: a first judgment module, used to determine whether the total length of the data content of the first type of business data is equal to a preset length; a first processing module, used to indicate that the parsing of the first type of business data is incorrect and prohibit the processing of the first type of financial business if the total length of the data content of the first type of business data is not equal to the preset length; a second processing module, used to allow the processing of the first type of financial business based on the file header of the first type of business data, the total data length of the first type of business data and the valid data content of the first type of business data if the total length of the data content of the first type of business data is equal to the preset length.
[0020] In order to achieve the above object, according to another aspect of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a program, wherein the program executes any one of the above-mentioned batch file processing methods.
[0021] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an electronic device is provided, which includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned batch file processing methods.
[0022] Through the present application, the following steps are adopted: determining multiple types of financial services to be batch processed, and obtaining data of each type of financial service to obtain multiple business data; assembling and processing the multiple business data according to target rules to obtain assembled business data, wherein the target rule indicates that the assembled business data at least includes: file header, total data length, total data content length, extended data bits and valid data content, the file header indicates type information of the business data, the total data length indicates the sum of the length of the extended data bits and the length of the valid data content, the total data content length indicates the length of the valid data content, the extended data bits indicate the type information of the business, and the valid data content indicates the content information of the business data; encrypting the assembled business data to obtain a batch file, wherein the batch file is used to process multiple types of financial services, which solves the problem that the generation method of batch files in related technologies is not good, resulting in poor effect of generating batch files. By assembling and processing data of various types of financial businesses according to specific rules (i.e., target rules), assembled business data is obtained, and then the assembled business data is encrypted to obtain a batch file. Compared with the method in which most existing batch files need to generate corresponding business batch files for each business, this solution can assemble specific identifiers according to extended data bits in a single batch file to indicate that a single file has several business types that need to be processed, thereby improving the security and versatility of the batch file, reducing the manpower and time costs brought about by generating batch files for each business, and thus improving the effect of generating batch files. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0024] Figure 1is a flowchart of a method for processing batch files provided in an embodiment of the present application;
[0025] Figure 2 is a flow chart of a batch file parsing method based on special rules in this embodiment;
[0026] Figure 3 This is a schematic diagram of the file data generation rules in this embodiment. Figure 1 ;
[0027] Figure 4 This is a schematic diagram of the file data generation rules in this embodiment. Figure 2 ;
[0028] Figure 5 is a schematic diagram of parsing file data in this embodiment;
[0029] Figure 6 is a flowchart of file parsing in this embodiment;
[0030] Figure 7 is a schematic diagram of file processing interaction in this embodiment;
[0031] Figure 8 is a schematic diagram of a batch file processing device provided according to an embodiment of the present application;
[0032] Figure 9 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0034] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0036] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display and analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information provided by the aforementioned user or organization.
[0037] The present invention will be described below in conjunction with preferred implementation steps. Figure 1 is a flowchart of a batch file processing method provided in accordance with an embodiment of the present application. Figure 1 As shown, the method includes the following steps:
[0038] Step S101 : determining multiple types of financial services to be batch processed, and acquiring data of each type of financial services to obtain multiple pieces of service data.
[0039] For example, the multiple pieces of business data mentioned above may include data of multiple business types.
[0040] Step S102: assemble and process multiple business data according to the target rule to obtain assembled business data, wherein the target rule indicates that the assembled business data at least includes: a file header, a total length of data, a total length of data content, extended data bits, and valid data content; the file header indicates the type information of the business data; the total length of data indicates the sum of the length of the extended data bits and the length of the valid data content; the total length of data content indicates the length of the valid data content; the extended data bits indicate the type information of the business; and the valid data content indicates the content information of the business data.
[0041] For example, the data components of a batch file may include a data header, total data length, total data content length, extended data bits, and valid data content. The data file header may occupy N bytes. The byte header identifies the current service type and is used to define a separate data header for each service. The header is unique across services. The total data length may occupy 4 bytes, representing the valid length of all data bytes excluding the header, and is used to verify the integrity of the total data bytes after parsing. The total data content length may occupy 4 bytes, representing the total number of valid batch data rows, and is used to verify the integrity of the valid batch rows after parsing. The extended data bits may occupy a minimum of 4 bytes, which can be filled as custom bits, with byte definitions based on service needs, such as timestamps, encryption vectors, unique identifiers, and serial numbers. The valid data content may represent the actual content that the batch file needs to process and read.
[0042] Step S103 , encrypting the assembled business data to obtain a batch file, wherein the batch file is used to process various types of financial business.
[0043] For example, after the business data is assembled, the assembled data is encrypted to obtain an encrypted batch file.
[0044] Through the above steps S101 to S103, the data of various types of financial businesses are assembled and processed according to specific rules (i.e., target rules) to obtain assembled business data, and then the assembled business data is encrypted to obtain a batch file. Compared with the method in which most existing batch files need to generate corresponding business batch files for each business, this solution can assemble specific identifiers according to extended data bits in a single batch file to indicate that a single file has several business types that need to be processed, thereby improving the security and versatility of the batch file, reducing the manpower and time costs brought about by generating batch files for each business, and thus improving the effect of generating batch files.
[0045] Optionally, in the batch file processing method provided in the embodiment of the present application, if the multiple types of financial services include a first type of financial service and a second type of financial service, then the multiple business data are assembled and processed according to the target rules to obtain the assembled business data, including: classifying the multiple business data to obtain first type of business data and second type of business data, wherein the first type of business data is the data of the first type of financial service, and the second type of business data is the data of the second type of financial service; assembling the first type of business data according to the target rules to obtain assembled first type of business data; assembling the second type of business data according to the target rules to obtain assembled second type of business data; obtaining assembled business data based on the assembled first type of business data and the assembled second type of business data.
[0046] For example, the first type of business data and the second type of business data can be assembled respectively according to the composition structure of the file, including the data header, total data length, total length of data content, extended data bits and valid data content (corresponding to the above-mentioned target rules), and the final assembled business data can be obtained based on the assembled first type of business data and second type of business data.
[0047] Through the above solution, data can be assembled and processed quickly and accurately according to the composition structure of the file.
[0048] Optionally, in the batch file processing method provided in the embodiment of the present application, the first type of business data is assembled and processed according to the target rules, and the assembled first type of business data includes: obtaining the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data, and the valid data content of the first type of business data according to the target rules; and obtaining the assembled first type of business data based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data, and the valid data content of the first type of business data.
[0049] For example, according to the special rules (corresponding to the above-mentioned target rules) set in the composition structure of the file, including the data header, total data length, total length of data content, extended data bits and valid data content, the data header, total data length, total length of data content, extended data bits and valid data content of the first type of business data are obtained, and then the assembled first type of business data is determined based on the data header, total data length, total length of data content, extended data bits and valid data content of the first type of business data.
[0050] Through the above solution, the first type of business data can be assembled and processed quickly and accurately.
[0051] Optionally, in the batch file processing method provided in the embodiment of the present application, obtaining the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data according to the target rule includes: determining the file header of the first type of business data according to the type information of the financial business corresponding to the first type of business data according to the target rule; assembling the first type of business data to obtain the valid data content of the first type of business data, and obtaining the length information of the valid data content of the first type of business data to obtain the total length of the data content of the first type of business data; determining the extended data bits of the first type of business data based on the first type of financial business and the second type of financial business; determining the total data length of the first type of business data according to the length information of the extended data bits of the first type of business data and the length information of the valid data content of the first type of business data.
[0052] For example, the data file header can occupy N bytes. The byte data header is the identification type of the current business. It is used to define the data header separately for each business, and the data header is not repeated in the business. The total data length can occupy 4 bytes, which is the effective length of the total data bytes excluding the data header, and is used to verify the integrity of the total data bytes after parsing. The total length of the data content can occupy 4 bytes, which is the total number of rows of valid batch data, and is used to verify the integrity of the number of valid batch rows after parsing. The extended data bit can occupy the minimum 4 bytes. This bit can be filled as a custom bit and the bytes can be defined according to business needs, such as timestamp, encryption vector, unique identifier, serial number, etc. The effective data content can represent the actual content that the batch file needs to process and read, and then obtain the data header, total data length, total data content length, extended data bit and effective data content of the first type of business data.
[0053] Through the above solution, the data header, total data length, total data content length, extended data bits and valid data content of the first type of business data can be determined quickly and accurately.
[0054] Optionally, in the batch file processing method provided in the embodiment of the present application, after encrypting the assembled business data to obtain the batch file, the method further includes: decrypting the batch file to obtain a decrypted batch file; parsing the decrypted batch file according to the target rule to obtain the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data, and the valid data content of the first type of business data; based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data, and the valid data content of the first type of business data, multiple types of financial business are processed.
[0055] For example, the batch file can be decrypted first, and then the decrypted batch file can be parsed to obtain the data file header, total data length, total data content length, extended data bits and valid data content of the first type of business data, and the financial business can be processed based on the data file header, total data length, total data content length, extended data bits and valid data content of the first type of business data obtained by parsing.
[0056] Through the above solution, financial business can be processed quickly and accurately based on the parsed file data.
[0057] Optionally, in the batch file processing method provided in the embodiment of the present application, processing multiple types of financial services based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data includes: processing the first type of financial service based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data and the valid data content of the first type of business data; determining the file header of the second type of business data, the total data length of the second type of business data, the total length of the data content of the second type of business data, the extended data bits of the second type of business data and the valid data content of the second type of business data according to the extended data bits of the first type of business data; processing the second type of financial service based on the file header of the second type of business data, the total data length of the second type of business data, the total length of the data content of the second type of business data, the extended data bits of the second type of business data and the valid data content of the second type of business data.
[0058] For example, when processing financial services, the data file header, total data length, total data content length, extended data bits and valid data content of the second type of business data can be determined based on the extended data bits of the first type of business data, and the second type of financial services can be processed based on the data file header, total data length, total data content length, extended data bits and valid data content of the second type of business data.
[0059] Through the above solution, the data structure information of the second type of service data can be easily obtained according to the extended data bits of the first type of service data.
[0060] Optionally, in the batch file processing method provided in the embodiment of the present application, processing the first type of financial business based on the file header of the first type of business data, the total data length of the first type of business data, the total data content length of the first type of business data and the valid data content of the first type of business data includes: determining whether the total data content length of the first type of business data is equal to a preset length; if the total data content length of the first type of business data is not equal to the preset length, it indicates that the parsing of the first type of business data is incorrect, and processing of the first type of financial business is prohibited; if the total data content length of the first type of business data is equal to the preset length, processing of the first type of financial business is allowed based on the file header of the first type of business data, the total data length of the first type of business data and the valid data content of the first type of business data.
[0061] For example, whether the first type of business data is parsed correctly can be determined based on the total length of the data content of the first type of business data. If it is determined that the parsing of the first type of business data is incorrect, the first type of business data can be re-parsed, and the corresponding financial business cannot be processed at this time; if it is determined that the parsing of the first type of business data is correct, the corresponding financial business can be processed.
[0062] Through the above solution, it is possible to quickly and accurately determine whether the data is parsed correctly based on the total length of the data content of the business data.
[0063] In this embodiment, in the enterprise-level file batch processing business, the security and reliability issues such as anti-leakage and anti-tampering, especially for the required batch files, batch files related to financial business or batch files related to sensitive data, business data, etc., as well as the processing flow of the overall batch file versatility are solved. It only needs to modify various business scenarios according to specific encryption rules to adapt to any business scenario, solving the problem that enterprise-level batch files need to perform additional parsing for various different businesses between different businesses.
[0064] This embodiment mainly solves the problem of generating and parsing specific rules in batch file components and file parsing, solving the defects of the actual content of batch files that do not meet the security, versatility, and tamper-proof requirements, and reducing the manpower and time costs of generating batch files for each business. For example, Figure 2 is a flowchart of a batch file parsing method based on special rules in this embodiment, and the batch file parsing method based on special rules is as follows: Figure 2 shown.
[0065] (1) Instructions for batch file assembly:
[0066] The data components of a batch file include the data header, total data length, total data content length, extended data bits, and valid data content.
[0067] 1) Data file header: occupies N bytes. The byte data header is the identification type of the current service. It is used to define the data header separately for each service. The data header is not repeated in the service.
[0068] 2) Total data length: occupies 4 bytes, excluding the effective length of the total data bytes excluding the data header, used to verify the integrity of the total data bytes after parsing.
[0069] 3) Total length of data content: occupies 4 bytes, the total number of rows of valid batch data, used to verify the integrity of the number of valid batch rows after parsing.
[0070] 4) Extended data bit: occupies the minimum 4 bytes. This bit can be filled as a custom bit and the bytes can be defined according to business needs, such as timestamp, encryption vector, unique identifier, serial number, etc.
[0071] 5) Valid data content: The batch file needs to process the actual content read.
[0072] It should be noted that each batch file can contain generation rules for multiple different businesses, and the business is divided and the corresponding parsing rules are determined based on the data header data.
[0073] The byte length of the extended data bits and the valid data content bits is not limited. When grouping files, a special method is used to calculate the number of bytes to ensure that the valid data content bytes are consistent with the total length of the data content and that the total data bytes are consistent with the total data length.
[0074] (2) File composition rules:
[0075] Define the byte length and service header data according to the service type, and finally convert them into hexadecimal. If the bytes are insufficient, fill them with 00.
[0076] 1) Total data length:
[0077] After assembling the total length of the data content, extended data bits, and valid data content excluding the file header, calculate the total bytes and convert the decimal into hexadecimal.
[0078] 2) Total length of data content:
[0079] After the effective data content is assembled, the total number of bytes of the effective content data is calculated, and finally the decimal is converted into hexadecimal.
[0080] 3) Extended data bit:
[0081] This bit is a free extension bit and can be defined according to specific services. If no definition is required, a minimum of 4 bits 00 will be filled in. It can also be used as an identifier for single-file multiple services.
[0082] 4) Effective content data:
[0083] This bit is the valid business data content. The content data is processed according to custom rules. The number of bytes occupied by each valid data bit is strictly defined and conforms to the data type format. The minimum is 4 bytes, and any digits less than the specified number are padded with 00.
[0084] After the overall data is assembled, the hexadecimal bytes are converted into binary data and saved, and finally encryption methods can be used for file encryption and transmission.
[0085] and, Figure 3 This is a schematic diagram of the file data generation rules in this embodiment. Figure 1 , Figure 4 This is a schematic diagram of the file data generation rules in this embodiment. Figure 2 ,like Figure 3 and Figure 4 As shown, the batch file data component includes the data header, total data length, total data content length, extended data bits, and valid data content.
[0086] (3) Batch file parsing rules:
[0087] It involves file decryption, hexadecimal conversion, file header parsing, data total length parsing, data content total length parsing, valid extension bit data parsing, and data content parsing.
[0088] 1) File decryption:
[0089] After obtaining the batch encrypted file, the file is first specially decrypted to obtain the original batch file.
[0090] 2) Convert hexadecimal:
[0091] Since the original batch file performs binary data conversion, you first need to convert the binary data into hexadecimal.
[0092] 3) Parsing the file header:
[0093] The hexadecimal data is parsed according to the rules of the group file. The number of bytes occupied can be defined according to different services. The file header hexadecimal data is converted into the actual file header content. The file header business type is determined and routed to the parsing method of the current business.
[0094] 4) Total length of parsed data:
[0095] According to the assembly rules, the 4-byte total length data is obtained and decimal conversion is performed. This data content will verify the integrity of the overall byte data after the total length of the data content, the extended data bits, and the valid content data are parsed.
[0096] 5) Total length of parsed data content:
[0097] According to the assembly rules, the total length of the parsed data content with a length of 4 bytes is obtained, the hexadecimal is converted to decimal, and the byte data integrity of the valid content data is verified.
[0098] 6) Parsing valid extension bit data:
[0099] Parse the corresponding data according to the assembly definition rules. If there is no special extended data assembly, parse a fixed 4 bytes.
[0100] 7) Analyze data content:
[0101] Parse the actual valid content of the file and parse the corresponding content according to the assembly rules of different businesses.
[0102] For example, Figure 5 This is a schematic diagram of parsing file data in this embodiment. Figure 5 As shown, the file can be parsed.
[0103] It should be noted that after all data contents are parsed, the number of bytes is compared with the total length of the data and the total length of the content data to ensure the integrity of the data bytes.
[0104] For example, Figure 6 This is a flowchart of file parsing in this embodiment. The file parsing process is as follows Figure 6 shown.
[0105] Compared with the prior art, the beneficial effects of this embodiment are as follows:
[0106] (1) This embodiment perfectly solves the problem of batch file content security.
[0107] (2) Compared with the method in which most existing batch files need to generate a corresponding business batch file for each business, this embodiment can assemble a specific identifier based on the extended data bits in a single batch file to indicate that a single file has several business types that need to be processed.
[0108] (3) After the overall data analysis is completed, the byte count of the total data and the valid content data needs to be compared to solve the data verification problem.
[0109] For example, Figure 7 This is a schematic diagram of the file processing interaction in this embodiment, and this embodiment uses the scenario of fund-related batch file delivery and fee deduction as an example. It includes the following process steps:
[0110] 1. The party submitting the deduction will generate a batch file based on the transaction data.
[0111] 2. Upload the assembled batch files to the storage middleware for storage, and notify the service provider to pick up and parse them.
[0112] 3. The service provider downloads the batch file from the designated storage middleware and decrypts the batch file.
[0113] 4. Convert the decrypted batch file contents from binary to hexadecimal.
[0114] 5. Parse the file header according to custom rules to obtain the business type.
[0115] Read 4 bytes according to the fixed parsing length to obtain the total length of the data.
[0116] Fixed parsing length reads 4 bytes to obtain the total length of the data content.
[0117] Parse the extended data bits, and read and process the custom data according to the rules.
[0118] Routed to the corresponding business processing logic to parse the valid data content.
[0119] 6. Check the total length of data bytes and the total length of content.
[0120] For example, suppose the message sender currently needs to send the following data:
[0121] Two types of business data need to be batch processed. The first type of business requires 100 data items to be processed, and the second type of business requires 10 data items to be processed. Table 1 shows the data for the delivery and deduction business, and Table 2 shows the business data for the operating data business.
[0122] Table 1
[0123]
[0124] Table 2
[0125]
[0126] 1. Start the assembly and delivery fee deduction business first
[0127] (1) First classify the service data and define the byte size of the data header. In this embodiment, the data header is defined as 2 bytes, and the service type is 12345, which is converted to hexadecimal as 30 39.
[0128] (2) Assemble the valid content data and define the data byte size. The deduction service is divided into five attributes. The bank card number is defined as 8 bytes, the mobile phone number is defined as 8 bytes, the deduction amount is defined as 8 bytes, and the bank channel is defined as 4 bytes. The corresponding data is converted into corresponding hexadecimal data for splicing.
[0129] All data are connected head to head in this format to obtain the complete effective content data bytes.
[0130] (3) Assemble the valid content data length. For example, if the valid data length is 100 bits, convert it to hexadecimal 00 0000 64.
[0131] (4) Assemble the extended data bits. The current batch file needs to process two different businesses in a single file, so it is necessary to define the judgment compliance. Just convert the number of remaining business types to be processed into hexadecimal. For example, if there is business data business this time, 1 is converted to hexadecimal bit 00 00 00 01.
[0132] (5) Assemble the total data length. The total data length is calculated based on the total number of valid content bytes + the total number of extended data bytes. For example, 104 bits is converted to hexadecimal 00 00 00 68.
[0133] (6) Finally, all the data are spliced together to obtain the delivery data for the delivery and deduction service.
[0134] Since there is a second business that needs to be assembled in this embodiment, just follow the same business process as the first business, splice the data header of the second business to the end of the total data of the first business, and finally convert all hexadecimal data into binary to generate a complete batch file.
[0135] 2. The assembled batch file is encrypted and uploaded to the storage middleware for download by the service provider.
[0136] 3. The service provider downloads the batch file and decrypts it to obtain the original file.
[0137] 4. Convert the decrypted batch file contents from binary to hexadecimal.
[0138] 5. Parse the file from the beginning according to the custom rules to obtain the corresponding data content.
[0139] Read 2 bytes, convert them to decimal, to obtain the service type in the file header. Read 4 bytes to obtain the total data length. Read 4 bytes for the payload data length. Read 4 bytes for the extended data bit (if non-zero, it indicates that there are other service types to read). Finally, read the valid data. According to the disk data grouping rules, the byte reading is performed to define the bank card number (8 bytes), the mobile phone number (8 bytes), the deduction amount (8 bytes), and the bank channel (4 bytes). Since this embodiment has two service types, the first service's payload data length is used to determine whether the first service has been fully read. After reading the first service, the data header of the second service is read and routed to the corresponding service logic.
[0140] 6. After all data is processed, determine whether the business type data is complete based on the total data length, and then end.
[0141] In addition, it should be noted that if a batch file has only a single business type to be processed, the extended data bit can default to 00 00 00 00; if a batch file has multiple business types to be processed, the extended data bit can be defined in a custom way, but it is necessary to clearly state how many business types need to be processed, or it can be directly expressed with numbers.
[0142] For example, in various types of files, business one data can be expressed as: (business one data header + business one data total length + business one data content total length + business one data extension data bits (00 00 00 01 indicates that other businesses are included) + business one valid data content); business two data can be expressed as: (business two data header + business two data total length + business two data content total length + business two data extension data bits (00 00 00 00 indicates no other businesses) + business two valid data content); and after the business one data is spliced together, the business two data is spliced with the byte of business two data after the last byte of business one. If the third, fourth, and other businesses are similar, the third one is spliced after the last byte code of the second one. Moreover, as long as the extended data bits are 00 00 00 01, it means that other service types are spliced after the last byte code of this service. For example, if the third service is included, the extended data bits of the second service are also 00 00 00 01. If there is no fourth service, the extended data bits of the third service are 00 00 00 00.
[0143] In summary, the batch file processing method provided in the embodiment of the present application determines multiple types of financial services to be batch-processed and obtains data for each type of financial service to obtain multiple business data; assembles the multiple business data according to the target rule to obtain assembled business data, wherein the target rule indicates that the assembled business data at least includes: a file header, a total length of data, a total length of data content, an extended data bit, and valid data content, the file header indicates the type information of the business data, the total length of data indicates the sum of the length of the extended data bit and the length of the valid data content, the total length of data content indicates the length of the valid data content, the extended data bit indicates the type information of the business, and the valid data content indicates the content information of the business data; encrypts the assembled business data to obtain a batch file, wherein the batch file is used to process multiple types of financial services, which solves the problem in the related art that the generation method of batch files is poor, resulting in poor effect of generating batch files. By assembling and processing data of various types of financial businesses according to specific rules (i.e., target rules), assembled business data is obtained, and then the assembled business data is encrypted to obtain a batch file. Compared with the method in which most existing batch files need to generate corresponding business batch files for each business, this solution can assemble specific identifiers according to extended data bits in a single batch file to indicate that a single file has several business types that need to be processed, thereby improving the security and versatility of the batch file, reducing the manpower and time costs brought about by generating batch files for each business, and thus improving the effect of generating batch files.
[0144] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0145] The present application also provides a batch file processing device. It should be noted that the batch file processing device of the present application can be used to execute the batch file processing method provided in the present application. The batch file processing device provided in the present application is introduced below.
[0146] Figure 8 Schematic diagram of a batch file processing device according to an embodiment of the present application. Figure 8 As shown, the device includes: a first acquiring unit 801, a first processing unit 802 and a second processing unit 803.
[0147] Specifically, the first acquisition unit 801 is configured to determine multiple types of financial services to be batch processed, and acquire data of each type of financial service to obtain multiple pieces of service data;
[0148] A first processing unit 802 is configured to assemble the plurality of pieces of business data according to a target rule to obtain assembled business data, wherein the target rule indicates that the assembled business data includes at least: a file header, a total data length, a total data content length, an extended data bit, and valid data content; the file header indicates type information of the business data; the total data length indicates the sum of the length of the extended data bit and the length of the valid data content; the total data content length indicates the length of the valid data content; the extended data bit indicates type information of the business; and the valid data content indicates content information of the business data;
[0149] The second processing unit 803 is used to encrypt the assembled business data to obtain a batch file, wherein the batch file is used to process various types of financial business.
[0150] In summary, the batch file processing device provided in the embodiment of the present application determines multiple types of financial services to be batch-processed through the first acquisition unit 801, and obtains data of each type of financial service to obtain multiple business data; the first processing unit 802 assembles and processes the multiple business data according to the target rule to obtain assembled business data, wherein the target rule indicates that the assembled business data at least includes: file header, total data length, total length of data content, extended data bits and valid data content, the file header indicates the type information of the business data, the total data length indicates the sum of the length of the extended data bits and the length of the valid data content, the total length of the data content indicates the length of the valid data content, the extended data bits indicate the type information of the business, and the valid data content indicates the content information of the business data; the second processing unit 803 encrypts the assembled business data to obtain a batch file, wherein the batch file is used to process multiple types of financial services, which solves the problem that the generation method of batch files in the related art is not good, resulting in poor effect of generating batch files. By assembling and processing data of various types of financial businesses according to specific rules (i.e., target rules), assembled business data is obtained, and then the assembled business data is encrypted to obtain a batch file. Compared with the method in which most existing batch files need to generate corresponding business batch files for each business, this solution can assemble specific identifiers according to extended data bits in a single batch file to indicate that a single file has several business types that need to be processed, thereby improving the security and versatility of the batch file, reducing the manpower and time costs brought about by generating batch files for each business, and thus improving the effect of generating batch files.
[0151] Optionally, in the batch file processing device provided in the embodiment of the present application, if the multiple types of financial services include a first type of financial services and a second type of financial services, the first processing unit includes: a first processing sub-unit, used to classify and process multiple business data to obtain first type of business data and second type of business data, wherein the first type of business data is the data of the first type of financial services, and the second type of business data is the data of the second type of financial services; a second processing sub-unit, used to assemble and process the first type of business data according to the target rules to obtain assembled first type of business data; a third processing sub-unit, used to assemble and process the second type of business data according to the target rules to obtain assembled second type of business data; a first determination sub-unit, used to obtain assembled business data based on the assembled first type of business data and the assembled second type of business data.
[0152] Optionally, in the batch file processing device provided in the embodiment of the present application, the second processing sub-unit includes: a first acquisition module, used to obtain the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data according to the target rule; a first determination module, used to obtain the assembled first type of business data based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data.
[0153] Optionally, in the batch file processing device provided in the embodiment of the present application, the first acquisition module includes: a first determination sub-module, used to determine the file header of the first type of business data according to the target rule and the type information of the financial business corresponding to the first type of business data; a first processing sub-module, used to assemble and process the first type of business data to obtain the valid data content of the first type of business data, and obtain the length information of the valid data content of the first type of business data to obtain the total length of the data content of the first type of business data; a second determination sub-module, used to determine the extended data bits of the first type of business data based on the first type of financial business and the second type of financial business; a third determination sub-module, used to determine the total data length of the first type of business data based on the length information of the extended data bits of the first type of business data and the length information of the valid data content of the first type of business data.
[0154] Optionally, in the batch file processing device provided in the embodiment of the present application, the device also includes: a third processing unit, which is used to encrypt the assembled business data to obtain the batch file, and then decrypt the batch file to obtain a decrypted batch file; a fourth processing unit, which is used to parse the decrypted batch file according to the target rule to obtain the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data, and the valid data content of the first type of business data; and a fifth processing unit, which is used to process multiple types of financial business based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data, and the valid data content of the first type of business data.
[0155] Optionally, in the batch file processing device provided in the embodiment of the present application, the fifth processing unit includes: a fourth processing sub-unit, used to process the first type of financial business based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, and the valid data content of the first type of business data; a second determination sub-unit, used to determine the file header of the second type of business data, the total data length of the second type of business data, the total length of the data content of the second type of business data, the extended data bits of the second type of business data, and the valid data content of the second type of business data according to the extended data bits of the first type of business data; and a fifth processing sub-unit, used to process the second type of financial business based on the file header of the second type of business data, the total data length of the second type of business data, the total length of the data content of the second type of business data, the extended data bits of the second type of business data, and the valid data content of the second type of business data.
[0156] Optionally, in the batch file processing device provided in the embodiment of the present application, the fourth processing sub-unit includes: a first judgment module, used to determine whether the total length of the data content of the first type of business data is equal to a preset length; a first processing module, used to indicate that a parsing error of the first type of business data is incorrect and prohibit processing of the first type of financial business if the total length of the data content of the first type of business data is not equal to the preset length; a second processing module, used to allow processing of the first type of financial business based on the file header of the first type of business data, the total data length of the first type of business data and the valid data content of the first type of business data if the total length of the data content of the first type of business data is equal to the preset length.
[0157] The batch file processing device includes a processor and a memory. The first acquisition unit 801, the first processing unit 802 and the second processing unit 803 are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
[0158] The processor contains a kernel, which retrieves the corresponding program unit from the memory. You can set one or more kernels, and adjust the kernel parameters to improve the performance of batch file generation.
[0159] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0160] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the batch file processing method is implemented.
[0161] An embodiment of the present invention provides a processor, which is used to run a program, wherein the batch file processing method is executed when the program is run.
[0162] like Figure 9 As shown, an embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and capable of running on the processor. When the processor executes the program, the following steps are implemented: determining multiple types of financial services to be batch processed, and obtaining data for each type of financial service to obtain multiple business data; assembling the multiple business data according to target rules to obtain assembled business data, wherein the target rule indicates that the assembled business data at least includes: a file header, a total length of data, a total length of data content, extended data bits, and valid data content, the file header indicates type information of the business data, the total length of data indicates the sum of the length of the extended data bits and the length of the valid data content, the total length of data content indicates the length of the valid data content, the extended data bits indicate type information of the business, and the valid data content indicates content information of the business data; encrypting the assembled business data to obtain a batch file, wherein the batch file is used to process multiple types of financial services.
[0163] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0164] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialized program having the following method steps: determining multiple types of financial services to be batch-processed, and obtaining data for each type of financial service to obtain multiple business data; assembling and processing the multiple business data according to target rules to obtain assembled business data, wherein the target rule indicates that the assembled business data at least includes: a file header, a total length of data, a total length of data content, extended data bits, and valid data content, the file header indicates type information of the business data, the total length of data indicates the sum of the length of the extended data bits and the length of the valid data content, the total length of data content indicates the length of the valid data content, the extended data bits indicate type information of the business, and the valid data content indicates content information of the business data; encrypting the assembled business data to obtain a batch file, wherein the batch file is used to process multiple types of financial services.
[0165] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0166] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0167] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0168] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0169] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0170] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0171] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0172] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0173] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0174] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A method for processing batch files, characterized in that: include: Determine multiple types of financial businesses to be batch processed, and obtain data for each type of financial business to obtain multiple pieces of business data; Assembling the plurality of pieces of business data according to a target rule to obtain assembled business data, wherein the target rule indicates that the assembled business data at least includes: a file header, a total data length, a total data content length, an extended data bit, and valid data content, the file header indicating type information of the business data, the total data length indicating the sum of a length of the extended data bit and a length of the valid data content, the total data content length indicating the length of the valid data content, the extended data bit indicating type information of the business, and the valid data content indicating content information of the business data; The assembled business data is encrypted to obtain a batch file, wherein the batch file is used to process the multiple types of financial business.
2. The method according to claim 1, characterized in that If the multiple types of financial services include a first type of financial service and a second type of financial service, then the multiple pieces of service data are assembled according to the target rule, and the assembled service data includes: Classifying the plurality of pieces of business data to obtain first-type business data and second-type business data, wherein the first-type business data is data of the first-type financial business, and the second-type business data is data of the second-type financial business; Assembling the first type of business data according to the target rule to obtain assembled first type of business data; assembling the second type of business data according to the target rule to obtain assembled second type of business data; The assembled business data is obtained based on the assembled business data of the first type and the assembled business data of the second type.
3. The method according to claim 2, characterized in that The first type of business data is assembled according to the target rule, and the assembled first type of business data includes: According to the target rule, obtaining a file header of the first type of service data, a total length of data of the first type of service data, a total length of data content of the first type of service data, an extended data bit of the first type of service data, and valid data content of the first type of service data; The assembled first type of business data is obtained based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data.
4. The method according to claim 3, characterized in that Acquiring, according to the target rule, a file header of the first type of business data, a total length of data of the first type of business data, a total length of data content of the first type of business data, an extended data bit of the first type of business data, and valid data content of the first type of business data includes: determining, according to the target rule and based on type information of the financial business corresponding to the business data of the first type, a file header of the business data of the first type; Performing assembly processing on the first type of service data to obtain valid data content of the first type of service data, and obtaining length information of the valid data content of the first type of service data to obtain a total length of the data content of the first type of service data; determining, according to the first type of financial service and the second type of financial service, extended data bits of the first type of service data; The total data length of the first type of service data is determined according to the length information of the extended data bits of the first type of service data and the length information of the valid data content of the first type of service data.
5. The method according to claim 2, characterized in that After encrypting the assembled business data to obtain a batch file, the method further includes: Decrypting the batch file to obtain a decrypted batch file; Parsing the decrypted batch file according to the target rule to obtain a file header of the first type of business data, a total length of data of the first type of business data, a total length of data content of the first type of business data, extended data bits of the first type of business data, and valid data content of the first type of business data; The multiple types of financial services are processed based on the file header of the first type of business data, the total data length of the first type of business data, the total length of the data content of the first type of business data, the extended data bits of the first type of business data and the valid data content of the first type of business data.
6. The method according to claim 5, characterized in that The processing of the multiple types of financial services based on a file header of the first type of business data, a total data length of the first type of business data, a total data content length of the first type of business data, an extended data bit of the first type of business data, and valid data content of the first type of business data includes: Processing the first type of financial service based on the file header of the first type of service data, the total data length of the first type of service data, the total data content length of the first type of service data, and the valid data content of the first type of service data; determining, based on the extended data bits of the first type of service data, a file header of the second type of service data, a total length of data of the second type of service data, a total length of data content of the second type of service data, the extended data bits of the second type of service data, and valid data content of the second type of service data; The second type of financial business is processed based on the file header of the second type of business data, the total data length of the second type of business data, the total length of the data content of the second type of business data, the extended data bits of the second type of business data and the valid data content of the second type of business data.
7. The method according to claim 6, characterized in that Processing the first type of financial business based on a file header of the first type of business data, a total length of data of the first type of business data, a total length of data content of the first type of business data, and valid data content of the first type of business data includes: Determining whether the total length of the data content of the first type of service data is equal to a preset length; If the total length of the data content of the first type of business data is not equal to the preset length, it indicates that the parsing of the first type of business data is incorrect, and processing of the first type of financial business is prohibited; If the total length of the data content of the first type of business data is equal to the preset length, the first type of financial business is allowed to be processed based on the file header of the first type of business data, the total length of the data of the first type of business data and the valid data content of the first type of business data.
8. A batch file processing device, characterized in that: include: a first acquiring unit, configured to determine multiple types of financial services to be batch processed, and acquire data of each type of financial service to obtain multiple pieces of service data; a first processing unit, configured to assemble the plurality of pieces of business data according to a target rule to obtain assembled business data, wherein the target rule indicates that the assembled business data at least includes: a file header, a total data length, a total data content length, an extended data bit, and valid data content; the file header indicates type information of the business data; the total data length indicates the sum of a length of the extended data bit and a length of the valid data content; the total data content length indicates the length of the valid data content; the extended data bit indicates type information of the business; and the valid data content indicates content information of the business data; The second processing unit is used to encrypt the assembled business data to obtain a batch file, wherein the batch file is used to process the multiple types of financial business.
9. A computer-readable storage medium, characterized in that The storage medium stores a program, wherein the program executes the batch file processing method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The method comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the batch file processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data transmission method, device and equipment and storage medium
CN112491989A
Service processing method and device, equipment and storage medium
CN112860706A