A method and system for generating OFD format bank electronic statements
By segmenting the statement data and making multiple server requests, the memory usage problem when generating OFD format statements in the bank reconciliation system was solved, enabling more efficient electronic statement generation and improving system performance and concurrency capabilities.
Patent Information
- Application Number
- CN202511150843.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2045-08-18
AI Technical Summary
Existing bank reconciliation systems consume excessive memory resources when generating OFD format electronic bank statements, impacting system performance and concurrent requests.
By paginating and segmenting the statement data, generating statement segments through multiple server requests, establishing linear relationships at the logical level, and finally merging them into a complete OFD statement file, the generation process is optimized.
It effectively reduced memory usage, shortened generation time, improved system concurrency capabilities, and optimized the electronic statement generation process.
Smart Images

Figure CN121070882B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and specifically relates to a method and system for generating OFD format bank electronic bank statements. Background Technology
[0002] The OFD format used in bank electronic bank statements is a domestically developed document format standard that achieves cross-platform and cross-system compatibility and security control. It features an open format standard, a fixed format that prevents formatting issues, support for domestic environments and electronic signatures, and compliance with national information security requirements. The relevant technical requirements from the financial authorities regarding electronic voucher accounting data standards (bank electronic bank statements) also stipulate that OFD electronic bank statement format files simultaneously encapsulate XBRL structured data.
[0003] OFD format is essentially a ZIP archive whose internal data is organized using XML files. The logical relationships between all elements in OFD are linked through XML nodes, making it non-linear and preventing simple data splitting or chunking. XBRL structured data is a special type of XML file containing all statement data and is also a single, unified entity.
[0004] Currently, the format generation service in bank reconciliation systems mainly generates PDF files. PDF files can be processed linearly, but when generating OFD files, it is often necessary to modify the business system, requiring the reconciliation data to be divided into blocks to generate different files, or to deploy independent services and increase memory space for large batches of reconciliation data.
[0005] Application content
[0006] The purpose of this application is to provide a method and system for generating OFD format bank electronic statements to address the shortcomings of existing technologies that excessively consume memory resources.
[0007] To solve the above-mentioned technical problems, this application is implemented as follows:
[0008] Firstly, a method for generating OFD format electronic bank statements is provided, including the following steps:
[0009] The reconciliation system obtains the reconciliation data to be generated and the total number of its entries, and performs pagination and block division on the reconciliation data based on the template configuration, and constructs a reconciliation context that includes the starting row index, the total number of rows, the maximum object number, and the directory page identifier;
[0010] For each block, the reconciliation system generates a service request message by initializing the layout, and generates the corresponding reconciliation block by the layout generation service. The reconciliation block includes a page object description file conforming to the OFD standard and the corresponding XBRL structured data fragment, and updates the reconciliation context according to the service response result.
[0011] After generating all the reconciliation statement blocks corresponding to the reconciliation statement data, the reconciliation statement system constructs a directory page request message based on the latest reconciliation statement context, and generates a directory page file containing the directory structure, end page and main XBRL data through the layout generation service;
[0012] The reconciliation system decompresses the directory page file and the reconciliation block, replaces the corresponding placeholder file in the directory page with the page object description file in the reconciliation block, and merges all XBRL data fragments into the main XBRL file;
[0013] The statement system recompresses the merged directory page content to generate the final OFD format bank electronic statement file.
[0014] Secondly, a system for generating OFD format bank electronic statements is provided, including:
[0015] The acquisition module is used to acquire the statement data to be generated and the total number of its entries, and to paginate and divide the statement data based on the template configuration, and to construct a statement context that includes the starting row index, the total number of rows, the maximum object number and the directory page identifier;
[0016] The generation module is used to generate service request messages for each block by initializing the layout, and to generate corresponding reconciliation statement blocks by the layout generation service. The reconciliation statement blocks include page object description files conforming to the OFD standard and corresponding XBRL structured data fragments, and update the reconciliation statement context according to the service response results.
[0017] The building module is used to build a directory page request message based on the latest statement context after generating all statement blocks corresponding to the statement data, and generate a directory page file containing the directory structure, end page and main XBRL data through the layout generation service.
[0018] The decompression module is used to decompress the directory page file and the statement block, replace the corresponding placeholder file in the directory page with the page object description file in the statement block, and merge all XBRL data fragments into the main XBRL file;
[0019] The compression module is used to recompress the merged directory page content to generate the final OFD format bank electronic statement file.
[0020] This application embodiment uses multiple server requests to generate multiple statement blocks, and the statement system merges the multiple statement blocks into a complete OFD statement format file, thereby optimizing the electronic statement generation process and solving the problem of excessive memory resource consumption in the prior art. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating a method for generating OFD format electronic bank statements, as provided in an embodiment of this application.
[0022] Figure 2 This is a specific implementation diagram of the method for generating OFD format electronic bank statements provided in the embodiments of this application;
[0023] Figure 3 This is a schematic diagram of the structure of a system for generating OFD format electronic bank statements provided in an embodiment of this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] Electronic bank statements are crucial for banks and businesses to reconcile accounts. Businesses can understand the source and destination of funds, assess their operating status, and auditing firms also use them as important evidence. The relevant technical requirements of the financial authorities regarding electronic accounting data standards (electronic bank statements) clearly stipulate that electronic bank statements should adopt the OFD format and encapsulate XBRL structured data. When designing the electronic bank statement generation service, bank reconciliation systems must fully consider the size of the reconciliation data and the capacity of the format service. For example, when generating electronic bank statement formats from tens of thousands or even hundreds of thousands of statements, even compressed format files can reach hundreds of megabytes or even larger in size. The memory requirements during generation are equally staggering, generally requiring tens of gigabytes or even more of memory space. Considering concurrency and overall system response time, the ability to better design the generation process and optimize memory usage becomes crucial to the success of the system design. This application's embodiments address these issues by optimizing and designing the electronic bank statement generation process.
[0026] Currently, the layout generation service in bank reconciliation systems is not optimized for generating layouts from large volumes of data. Submitting all data to the generation service at once causes it to allocate a large amount of memory, which is only released after final packaging. This results in a single request exhausting significant resources, leading to long generation times and impacting other concurrent requests. This application addresses the problem of excessive memory resource consumption in the layout service of bank reconciliation systems when processing large volumes of data by comprehensively resolving this issue through improvements and optimizations to algorithms and processes.
[0027] Specifically, the overall approach of this application is to linearize the non-linear OFD file at the processing logic level, transforming a single call into multiple stateful server requests. The format generation service generates one OFD fragment at a time, and finally, the reconciliation system merges them into a complete OFD reconciliation statement format file. This application proposes the following concepts:
[0028] Statement Context: A single request message from the layout generation service consists of two parts: statement data and statement context data. The statement context data describes the starting row index (curLine), total number of rows (sumLine), maximum object ID (maxId), and whether it is a catalog page. For the first call, maxId is 0; for subsequent calls, it is the return value of the previous call. Multiple statements context requests are chained together to form a logically complete request.
[0029] Statement Chunks: The catalog page identifier is 0, and the requested data is used to generate statement chunks. A statement chunk consists of two parts: several OFD page object description files and one XBRL fragment data. The OFD page object description file is an XML file that fully conforms to the OFD standard, typically named Content_N.xml, where N is the page index.
[0030] Catalog Page: The catalog page identifier is 1, and the requested data is used to generate the catalog page. The catalog page includes several OFD page object description files, including the last page, corresponding XBRL fragment data, and a complete structure conforming to the OFD format standard.
[0031] Merging: Merging is the process of replacing the OFD object description file in the directory page with the actual description file in the statement chunk. OFD uses ZIP compression, so merging is a process of decompressing and replacing a ZIP file, and XBRL files are a special type of XML.
[0032] The method for generating OFD format electronic bank statements provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0033] like Figure 1 The diagram shown is a flowchart of a method for generating OFD format electronic bank statements according to an embodiment of this application. The method includes the following steps:
[0034] Step 101: The reconciliation system obtains the reconciliation data to be generated and the total number of its entries, and performs pagination and block division on the reconciliation data based on the template configuration, and constructs a reconciliation context including the starting row index, the total number of rows, the maximum object number, and the directory page identifier.
[0035] Specifically, the reconciliation system counts the total number of entries in the reconciliation data, calculates the number of pages and blocks based on the preset number of entries that a single template page can hold, and constructs a reconciliation context for each block. The reconciliation context includes the starting line index curLine, the total number of lines sumLine, the maximum object number maxId, and the catalog page identifier catalog.
[0036] Step 102: For each block, the reconciliation system generates a service request message by initializing the layout, and generates the corresponding reconciliation block by using the layout generation service. The reconciliation block includes a page object description file conforming to the OFD standard and the corresponding XBRL structured data fragment, and updates the reconciliation context according to the service response result.
[0037] Specifically, the billing system initializes a layout generation service request message based on the current block and corresponding context, sets catalog=0, and sends the request message to the layout generation service to trigger the block generation process; it receives the page object description file and XBRL fragment data returned by the service, and extracts the returned maximum object number maxId to update the context; the billing system saves the page object description file and XBRL data fragment as an intermediate result file for the current block.
[0038] Step 103: After generating all the reconciliation statement blocks corresponding to the reconciliation statement data, the reconciliation statement system constructs a directory page request message based on the latest reconciliation statement context, and generates a directory page file containing the directory structure, end page, and main XBRL data through the layout generation service.
[0039] Step 104: The reconciliation system decompresses the directory page file and the reconciliation block, replaces the corresponding placeholder file in the directory page with the page object description file in the reconciliation block, and merges all XBRL data fragments into the main XBRL file.
[0040] Specifically, the statement system decompresses the directory page ZIP file and all statement block ZIP files, and replaces the corresponding placeholder files in the directory page ZIP file with the page object description files in the statement blocks; the statement system sequentially merges all the XBRL structured data segments of the statement blocks into the main XBRL file of the directory page.
[0041] Step 105, the statement system recompresses the merged directory page content to generate the final OFD format bank e-statement file.
[0042] In this embodiment, the statement context is continuously passed and updated in multiple block generation requests, which is used to establish a logically linear association during the generation process of the non-linear structure OFD, enabling the layout generation service to gradually generate block files corresponding to the complete statement through multiple independent calls, and unifying the overall structure through the context data returned in the final directory page generation request.
[0043] The embodiment of the present application uses multiple server requests to generate multiple statement blocks, and the statement system merges the multiple statement blocks into a complete OFD statement layout file, thereby optimizing the e-statement generation process and solving the problem of excessive memory resource occupation in the prior art.
[0044] In the embodiment of the present application, the specific implementation process of generating the OFD format bank e-statement is as Figure 2 shown, including the following steps:
[0045] Statement system evaluation, start distributed generation
[0046] 1. The statement system obtains the number of pre-generated statement data entries Sum, using information such as templates.
[0047] 2. If Sum < M entries (M can be adjusted according to the layout service deployment environment configuration), call the layout generation service to directly generate the statement layout and end the process, otherwise execute step 3.
[0048] 3. Calculate the number of pages and the number of blocks according to the number of entries carried by a single page of the template.
[0049] Generate statement blocks
[0050] 4. Read the next block of data.
[0051] 5. If the current block of data contains the data of the last page, enter step 10, otherwise execute step 6.
[0052] 6. Initialize the format to generate service request messages, set the corresponding entry data and reconciliation statement context for the block, where the catalog page identifier is 0, the maxId for the first call is 0 or the return value of the last call, and set the starting index curLine and the total number of rows sumLine for the current block entry data;
[0053] 7. Call the layout generation service to generate the block interface;
[0054] 8. Save the reconciliation statement block data -N returned by the interface, and update the maxId and curLine fields;
[0055] 9. Proceed to step 4;
[0056] Generate catalog
[0057] 10. Initialize the format to generate service request messages, set the corresponding entry data and reconciliation statement context for the block, where the catalog page identifier is 1, maxId is the return value of the last call, and set the starting index curLine and the total number of rows sumLine for the current block entry data;
[0058] 11. Call the layout generation service to generate the catalog interface;
[0059] 12. Save the reconciliation statement directory page data returned by the interface;
[0060] Combine to generate OFD bank electronic statement format
[0061] 13. Unzip the directory page ZIP file and the statement block-N file;
[0062] 14. Replace the OFD page object description file in the directory page ZIP file with a statement chunk;
[0063] 15. Merge the reconciliation statement block XBRL fragments into the XBRL file in the directory page;
[0064] 16. Recompress the directory page ZIP file to obtain the OFD bank electronic statement format;
[0065] 17. Program exit.
[0066] In summary, the key innovations of this application's embodiments include: using the statement context to logically associate and unify multiple calls to OFD files that cannot be linearized; the method of dividing statement blocks and directories; the organization form of statement blocks and directories; the execution steps of statement blocks and directories; and the method of merging statement blocks and directories.
[0067] This application provides an optimization and improvement solution for generating electronic statement formats from tens of thousands or even hundreds of thousands of large statement data entries. Similar software generates these statements at once, resulting in excessive memory usage and even affecting concurrent service usage. Before optimization, 800,000 statement data entries occupied more than 32 gigabytes of memory and had a response time of more than 30 minutes. After optimization, the memory usage is reduced to 8 gigabytes, and the statements can be generated in 10 minutes without affecting concurrent system usage.
[0068] like Figure 3 The diagram shown is a structural schematic of a system for generating OFD format electronic bank statements according to an embodiment of this application, including:
[0069] The acquisition module 310 is used to acquire the reconciliation statement data to be generated and the total number of its entries, and to perform pagination and block division on the reconciliation statement data based on the template configuration, and to construct a reconciliation statement context including the starting row index, the total number of rows, the maximum object number and the directory page identifier.
[0070] Specifically, the acquisition module 310 is used to count the total number of entries in the statement data, calculate the number of pages and blocks based on the preset number of entries that a single page of the template can hold, and construct a statement context for each block. The statement context includes the starting line index curLine, the total number of lines sumLine, the maximum object number maxId, and the catalog page identifier catalog.
[0071] The generation module 320 is used to generate a service request message for each block by initializing the layout, and to generate the corresponding reconciliation statement block by the layout generation service. The reconciliation statement block includes a page object description file conforming to the OFD standard and the corresponding XBRL structured data fragment, and updates the reconciliation statement context according to the service response result.
[0072] Specifically, the generation module 320 is used to initialize a layout generation service request message based on the current block and the corresponding context, set catalog=0, send the request message to the layout generation service, and trigger the block generation process; receive the page object description file and XBRL fragment data returned by the service, and extract the returned maximum object number maxId to update the context; and save the page object description file and XBRL data fragment as an intermediate result file of the current block.
[0073] The construction module 330 is used to construct a directory page request message based on the latest statement context after generating all statement blocks corresponding to the statement data, and generate a directory page file containing the directory structure, end page and main XBRL data through the layout generation service.
[0074] The decompression module 340 is used to decompress the directory page file and the statement block, replace the corresponding placeholder file in the directory page with the page object description file in the statement block, and merge all XBRL data fragments into the main XBRL file.
[0075] Specifically, the decompression module 340 is used to decompress the directory page ZIP file and all statement block ZIP files, replace the corresponding placeholder files in the directory page ZIP file with the page object description files in the statement blocks, and merge the XBRL structured data fragments of all statement blocks into the main XBRL file of the directory page in sequence.
[0076] Compression module 350 is used to recompress the merged directory page content to generate the final OFD format bank electronic statement file.
[0077] In this embodiment, the statement context is continuously passed and updated in multiple block generation requests. This is used to establish a logical linear relationship in the OFD generation process with a non-linear structure, so that the layout generation service can gradually generate block files corresponding to the complete statement through multiple independent calls, and unify the overall structure in the final directory page generation request through the context data returned last time.
[0078] This application embodiment uses multiple server requests to generate multiple statement blocks, and the statement system merges the multiple statement blocks into a complete OFD statement format file, thereby optimizing the electronic statement generation process and solving the problem of excessive memory resource consumption in the prior art.
[0079] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described method embodiment for generating OFD format bank electronic statements, achieving the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0080] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0081] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0082] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for generating OFD format electronic bank statements, characterized in that, Includes the following steps: The reconciliation system obtains the reconciliation data to be generated and the total number of its entries, and performs pagination and block division on the reconciliation data based on the template configuration, constructing a reconciliation context that includes the starting row index, the total number of rows, the maximum object number, and the directory page identifier; one block is the data requested once, one block contains multiple pages of data, and the last page of data is used to generate the directory page; For each block, the reconciliation system generates a service request message by initializing the layout, and generates the corresponding reconciliation block by the layout generation service. The reconciliation block includes a page object description file conforming to the OFD standard and the corresponding XBRL structured data fragment, and updates the reconciliation context according to the service response result. After generating all the reconciliation statement blocks corresponding to the reconciliation statement data, the reconciliation statement system constructs a directory page request message based on the latest reconciliation statement context, and generates a directory page file containing the directory structure, end page and main XBRL data through the layout generation service; The reconciliation system decompresses the directory page file and the reconciliation block, replaces the corresponding placeholder file in the directory page with the page object description file in the reconciliation block, and merges all XBRL data fragments into the main XBRL file; The statement system recompresses the merged directory page content to generate the final OFD format bank electronic statement file.
2. The method according to claim 1, characterized in that, The reconciliation system obtains the reconciliation data to be generated and the total number of its entries, and performs pagination and block division on the reconciliation data based on the template configuration, constructing a reconciliation context including the starting row index, total number of rows, maximum object number, and directory page identifier, specifically including: The reconciliation system counts the total number of entries in the reconciliation data, calculates the number of pages and blocks based on the preset number of entries that a single page of the template can hold, and constructs a reconciliation context for each block. The reconciliation context includes the starting row index curLine, the total number of rows sumLine, the maximum object number maxId, and the catalog page identifier catalog.
3. The method according to claim 1, characterized in that, The reconciliation system, for each block, generates a service request message by initializing the layout and generates the corresponding reconciliation block through the layout generation service, specifically including: The billing system initializes the layout generation service request message based on the current block and corresponding context, sets catalog=0, sends the request message to the layout generation service, and triggers the block generation process; it receives the page object description file and XBRL fragment data returned by the service, and extracts the returned maximum object number maxId to update the context; The billing system saves the page object description file and XBRL data fragments as intermediate result files for the current block.
4. The method according to claim 1, characterized in that, The reconciliation system decompresses the directory page file and the reconciliation block, replaces the corresponding placeholder file in the directory page with the page object description file in the reconciliation block, and merges all XBRL data fragments into the main XBRL file, specifically including: The reconciliation system decompresses the directory page ZIP file and all reconciliation block ZIP files, and replaces the corresponding placeholder file in the directory page ZIP file with the page object description file in the reconciliation block; The statement system sequentially merges all statement block XBRL structured data fragments into the main XBRL file of the directory page.
5. The method according to claim 1, characterized in that, The statement context is continuously passed and updated in multiple block generation requests to establish a logical linear relationship in the non-linear OFD generation process. This allows the layout generation service to gradually generate block files corresponding to the complete statement through multiple independent calls, and to unify the overall structure in the final directory page generation request using the context data returned last time.
6. A system for generating OFD format electronic bank statements, characterized in that, include: The acquisition module is used to acquire the reconciliation statement data to be generated and the total number of its entries, and to paginate and block the reconciliation statement data based on the template configuration, and to construct a reconciliation statement context that includes the starting row index, the total number of rows, the maximum object number, and the directory page identifier; one block is the data requested once, one block contains multiple pages of data, and the last page of data is used to generate the directory page; The generation module is used to generate service request messages for each block by initializing the layout, and to generate corresponding reconciliation statement blocks by the layout generation service. The reconciliation statement blocks include page object description files conforming to the OFD standard and corresponding XBRL structured data fragments, and update the reconciliation statement context according to the service response results. The building module is used to build a directory page request message based on the latest statement context after generating all statement blocks corresponding to the statement data, and generate a directory page file containing the directory structure, end page and main XBRL data through the layout generation service. The decompression module is used to decompress the directory page file and the statement block, replace the corresponding placeholder file in the directory page with the page object description file in the statement block, and merge all XBRL data fragments into the main XBRL file; The compression module is used to recompress the merged directory page content to generate the final OFD format bank electronic statement file.
7. The system according to claim 6, characterized in that, The acquisition module is specifically used to count the total number of entries in the statement data, calculate the number of pages and blocks based on the preset number of entries that a single page of the template can hold, and construct a statement context for each block. The statement context includes the starting row index curLine, the total number of rows sumLine, the maximum object number maxId, and the catalog page identifier catalog.
8. The system according to claim 6, characterized in that, The generation module is specifically used to initialize the layout generation service request message based on the current block and the corresponding context, set catalog=0, send the request message to the layout generation service, and trigger the block generation process; Receive the page object description file and XBRL fragment data returned by the service, and extract the returned maximum object number maxId to update the context; save the page object description file and XBRL data fragment as an intermediate result file for the current block.
9. The system according to claim 6, characterized in that, The decompression module is specifically used to decompress the directory page ZIP file and all statement block ZIP files, replace the corresponding placeholder files in the directory page ZIP file with the page object description files in the statement blocks, and merge the XBRL structured data fragments of all statement blocks into the main XBRL file of the directory page in sequence.
10. The system according to claim 6, characterized in that, The statement context is continuously passed and updated in multiple block generation requests to establish a logical linear relationship in the non-linear OFD generation process. This allows the layout generation service to gradually generate block files corresponding to the complete statement through multiple independent calls, and to unify the overall structure in the final directory page generation request using the context data returned last time.
Citation Information
Patent Citations
Method for converting and displaying layout files
CN110362793A
Method for merging and carrying semantic indexing information of OFD documents
CN113591434A