Order settlement file generation method and device, electronic device, and program product

By combining domain-driven design and message generator, the problems of low accuracy and maintenance difficulties in generating settlement documents for low-cost airline distribution platforms are solved, achieving efficient and accurate generation and transmission of settlement documents.

CN122243605APending Publication Date: 2026-06-19TRAVELSKY TECHNOLOGY LIMITED

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TRAVELSKY TECHNOLOGY LIMITED
Filing Date
2026-03-12
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Low-cost carriers' distribution platforms are unable to generate settlement documents that conform to the DISH standard, leading to interruptions in the settlement process, difficulties in maintenance, and a high risk of errors, which affects the accuracy of settlement.

Method used

The domain-driven design architecture is adopted, which encapsulates the message generation logic in the generator of the domain layer. Multiple independent message generators process and combine order data to generate settlement files that conform to the DISH standard, and automatically retry and compensate when transmission fails.

Benefits of technology

It achieves highly accurate and maintainable settlement document generation, lowers the technical threshold, and improves the settlement document pass rate and settlement stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122243605A_ABST
    Figure CN122243605A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, electronic device, and program product for generating order settlement files, relating to the field of data processing technology. The generation method includes: acquiring order data and constructing an order object based on the order data, wherein the order object includes at least multiple attributes, each attribute corresponding to attribute data; processing all attributes and all attribute data using multiple message generators to generate multiple message data; and combining all message data according to a preset order to generate a target settlement file. This invention solves the technical problem of low accuracy in generating order calculation files in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and more specifically, to a method, apparatus, electronic device, and program product for generating order settlement documents. Background Technology

[0002] In the air passenger sales sector, the Billing and Settlement Plan (BSP) is the cornerstone system for achieving efficient and secure ticket revenue settlement. Ticket sales data is transmitted through the distribution system and automatically incorporated into the BSP's standard settlement process. However, some low-cost carriers (LCCs) choose to distribute their tickets through their own distribution platforms (LCC platforms). Because the sales data on the LCC platform is not directly connected to the distribution system, it cannot enter the subsequent settlement process, causing a break in the settlement flow and preventing reconciliation and settlement from being completed through the standard BSP channels.

[0003] Currently, LCC platforms are required to generate RET (Agent Reporting data, settlement file) files and push them to DPC. However, the DISH (Data Interchange Specifications Handbook) standard is extremely complex and rigorous, involving a large number of data elements, complex message structures, and strict business rules. For developers building LCC platforms, this requires in-depth learning and complete mastery of the complex details of the DISH standard, making the development process prone to errors. Any inconsistency in the format or rules of any data item can lead to the entire settlement file being rejected by the data processing center. Furthermore, because the RET file generation logic is tightly coupled with the platform's core business logic (such as order management), any updates to the DISH standard or changes in business rules require extensive code modifications, making maintenance difficult and prone to introducing new errors that could affect the accuracy of settlement.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This invention provides a method, apparatus, electronic device, and program product for generating order settlement files, to at least solve the technical problem of low accuracy in generating order calculation files in related technologies.

[0006] According to one aspect of the embodiments of this application, a method for generating an order settlement file is provided, comprising: acquiring order data, and constructing an order object based on the order data, wherein the order object includes at least multiple attributes, each attribute corresponding to attribute data; processing all attributes and all attribute data using multiple message generators to generate multiple message data; and combining all message data according to a preset order to generate a target settlement file.

[0007] Furthermore, the steps for constructing an order object based on order data include: cleaning the order data to obtain cleaned order data; transforming the cleaned order data to obtain a transformation result, and repairing the order data to obtain repaired data if the transformation result indicates that the transformation failed; and transforming the repaired data until the transformation result indicates that the transformation was successful, thereby obtaining an order object.

[0008] Furthermore, the step of using multiple message generators to process all attributes and all attribute data to generate multiple message data includes: determining the order type corresponding to the order data, wherein different order types correspond to different set of line numbers, and the set of line numbers is used to determine the content structure of the settlement file; determining the target set of line numbers corresponding to the order data based on the order type; using a first preset message generator to read configuration information and generate file header message data; and for each line number in the target set of line numbers, using a message generator to generate message data based on all attribute data.

[0009] Furthermore, after generating message data using a message generator based on all attribute data, the process also includes: calculating the number of messages based on all message data; and generating file tail message data using a second preset message generator based on the number of messages.

[0010] Furthermore, the step of combining all message data based on a preset order to generate a target settlement file includes: determining the generation order of each message data based on the preset order, wherein the preset order is used to characterize the order used by all message generators; adding the message data to a preset message order list based on the generation order; and concatenating the header message data, all message data in the preset message order list, and the tail message data to obtain the target settlement file.

[0011] Furthermore, after combining all message data according to a preset order to generate the target settlement file, the method further includes: storing the target settlement file in a preset directory and transmitting the target settlement file to the target server through a preset transmission protocol for clearing and settlement of ticket data; if it is detected that the target settlement file has not been successfully transmitted to the target server, writing the preset transmission task identifier corresponding to the transmission into a preset data table, wherein the preset data table includes at least the number of retries for the transmission task indicated by each preset transmission task identifier.

[0012] Furthermore, after writing the preset transmission task identifier corresponding to the transmission into the preset data table, the method further includes: triggering a compensation operation after the writing time reaches the preset time. The compensation operation is used to retransmit the target settlement file to the target server. If the target settlement file is not successfully transmitted to the target server, the number of retries corresponding to the preset transmission task identifier is incremented. If the number of retries exceeds the preset threshold, the transmission is marked as a failure.

[0013] According to another aspect of the embodiments of this application, an order settlement file generation apparatus is also provided, comprising: a first construction unit, configured to acquire order data and construct an order object based on the order data, wherein the order object includes at least multiple attributes, each attribute corresponding to attribute data; a first generation unit, configured to process all attributes and all attribute data using multiple message generators to generate multiple message data; and a second generation unit, configured to combine all message data according to a preset order to generate a target settlement file.

[0014] Furthermore, the first construction unit includes: a first cleaning module, used to clean the order data to obtain cleaned order data; a first transformation module, used to transform the cleaned order data to obtain a transformation result, and to repair the order data to obtain repaired data if the transformation result indicates that the transformation failed; and a second transformation module, used to transform the repaired data until the transformation result indicates that the transformation was successful, thereby obtaining an order object.

[0015] Furthermore, the first generation unit includes: a first determining module, used to determine the order type corresponding to the order data, wherein different order types correspond to different set of line numbers, and the set of line numbers is used to determine the content structure of the settlement file; a second determining module, used to determine the target set of line numbers corresponding to the order data based on the order type; a first generation module, used to read configuration information and generate file header message data using a first preset message generator; and a second generation module, used to generate message data for each line number in the target set of line numbers based on all attribute data using a message generator.

[0016] Furthermore, the order settlement document generation device also includes: a first calculation module, used to calculate the number of messages based on all message data after generating message data using a message generator based on all attribute data; and a third generation module, used to generate file tail message data using a second preset message generator based on the number of messages.

[0017] Furthermore, the second generation unit includes: a third determining module, used to determine the generation order of each message data based on a preset order, wherein the preset order is used to characterize the order used by all message generators; a first adding module, used to add the message data to a preset message order list based on the generation order; and a first splicing module, used to splice the file header message data, all message data in the preset message order list, and file tail message data to obtain the target settlement file.

[0018] Furthermore, the order settlement file generation device also includes: a first transmission module, used to combine all message data according to a preset order to generate a target settlement file, store the target settlement file in a preset directory, and transmit the target settlement file to the target server through a preset transmission protocol for clearing and settlement of ticket data; and a second transmission module, used to write a preset transmission task identifier corresponding to the transmission into a preset data table when it is detected that the target settlement file has not been successfully transmitted to the target server, wherein the preset data table includes at least the number of retries for each transmission task indicated by the preset transmission task identifier.

[0019] Furthermore, the order settlement file generation device also includes: a first triggering module, used to trigger a compensation operation after the preset transmission task identifier corresponding to the transmission is written into a preset data table and the writing time reaches a preset duration, wherein the compensation operation is used to retransmit the target settlement file to the target server, and to accumulate the number of retries corresponding to the preset transmission task identifier if the target settlement file is detected to have failed to be transmitted to the target server; and a first marking module, used to mark the transmission as a failure state if the number of retries exceeds a preset threshold.

[0020] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described methods for generating order settlement documents.

[0021] According to another aspect of the embodiments of this application, an electronic device is also provided, including 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 one or more processors, the one or more processors cause the one or more processors to implement any of the above-described order settlement file generation methods.

[0022] In this invention, order data is acquired, and an order object is constructed based on the order data. The order object includes at least multiple attributes, and each attribute corresponds to attribute data. Multiple message generators are used to process all attributes and all attribute data to generate multiple message data. Based on a preset order, all message data are combined to generate a target settlement file, which solves the technical problem of low accuracy in generating order calculation files in related technologies.

[0023] In this invention, the original order data is first acquired, and a structured order object is constructed based on the original order data. The order object contains at least multiple business attributes, each of which corresponds to relevant attribute data to fully represent the business semantics of the ticketing transaction. Then, multiple independent message generators are invoked to intelligently parse and transform each attribute and its attribute data in the order object, generating message data of the corresponding record type item by item. Afterward, all the generated message data are assembled in an orderly manner according to a preset order to accurately generate the target settlement file. This achieves automated and high-precision conversion from original business data to compliant settlement files, improves the pass rate of settlement files, and thus enhances the stability and continuity of ticket payment clearing. Attached Figure Description

[0024] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0025] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for generating order settlement documents is shown;

[0026] Figure 2 This is a flowchart of the method for generating order settlement documents according to Embodiment 1 of this application;

[0027] Figure 3 This is a flowchart of an optional method for generating an order settlement file according to an embodiment of this application;

[0028] Figure 4 This is a schematic diagram of an optional order settlement document generation apparatus according to an embodiment of this application;

[0029] Figure 5 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] To facilitate understanding of the present invention by those skilled in the art, some terms or nouns involved in the various embodiments of the present invention are explained below:

[0033] Domain-Driven Design: A software design methodology that uses the business domain as the core for software architecture design.

[0034] Distribution system: Connects airlines (product suppliers) with various sales channels for real-time data queries.

[0035] The Business Service Platform (BSP) for airline ticket sales data is responsible for aggregating sales data from various channels in the distribution system and automating reconciliation and fund transfers between airlines and sales agents.

[0036] RET file: is a standard format file used in the BSP settlement process to report sales and refund data.

[0037] Data Processing Center: Responsible for receiving and processing RET files to complete BSP settlement.

[0038] It should be noted that all related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) collected and involved in this invention are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with the relevant laws, regulations, and standards of the relevant regions, and necessary confidentiality measures have been taken. These measures do not violate public order and good morals, and corresponding operation entry points are provided for users to choose to authorize or refuse. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, a request to obtain the information needs to be sent to the aforementioned user or organization through the interface. After receiving consent from the aforementioned user or organization, the relevant information is obtained. If the user chooses to refuse, the process proceeds to an expert decision-making process.

[0039] Currently, methods such as hard-coding or configuration file-based rule mapping are commonly used to convert non-standard business data within enterprises into settlement files. The former method directly embeds standard rules into the business code, leading to severe system coupling. While the latter method externalizes the rules, its configuration itself relies on the user's deep understanding of the DISH standard, resulting in complex configuration items, difficult debugging, and low performance, making it difficult to meet the business requirements of rapid iteration and zero-error delivery of LCC platforms. In this invention, a domain-driven design architecture is adopted to encapsulate the complex logic of "how to generate standard messages based on business data" in various generators within the domain layer. Each generator strictly adheres to the standard, avoiding the error-prone problems of manual splicing and ensuring the correctness of business logic. External callers do not need to know the specific details of the DISH standard. All logic related to the DISH standard is cohesive within the domain layer, isolated from data sources, file transfers, and other infrastructure. When the DISH standard is updated or new business types need to be supported (e.g., a new message needs to be added), only the corresponding generator needs to be modified or added within the domain layer, without affecting external interfaces and data acquisition. This lowers the technical threshold while achieving high reliability, high accuracy, and high maintainability. The generated RET files have an extremely high pass rate, ensuring the accuracy and timeliness of settlement.

[0040] The present invention will now be described in detail with reference to various embodiments.

[0041] Example 1

[0042] According to an embodiment of this application, an embodiment of a method for generating order settlement documents is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0043] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a method for generating order settlement documents is shown. Figure 1 As shown, computer terminal 10 (or mobile device) may include one or more ( Figure 1 The processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions may also be included. In addition, it may include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera, wherein the network interface can be connected to wired and / or wireless networks. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0044] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0045] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the order settlement document generation method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned order settlement document generation method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0046] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0047] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0048] Under the aforementioned operating environment, this application provides the following: Figure 2 The method for generating order settlement documents is shown. Figure 2 This is a flowchart of the method for generating order settlement documents according to Embodiment 1 of this application, as follows: Figure 2 As shown, the method includes the following steps:

[0049] Step S201: Obtain order data and construct an order object based on the order data. The order object includes at least multiple attributes, and each attribute has corresponding attribute data.

[0050] In this embodiment of the invention, the data acquisition and adaptation module can be triggered by timed events and order update events to read raw sales and refund records from the data source (database, message queue) of the LCC (Low Cost Carrier) platform. This module is decoupled from external systems through a set of standard data interfaces (such as OrderQueryService). It can achieve flexible data source access by providing adapters (such as SpringAirlinesAdapter, JiuYuanAirlinesAdapter) with corresponding interfaces for different LCC platforms. The adapter queries orders from the platform database or obtains order change events by listening to its message queue. Subsequently, the order data can be encapsulated into strongly typed objects such as Java classes through the core business processing module (i.e., the domain layer). The attributes are business fields encapsulated in the order object and mapped to the DISH standard, such as ticket number, passenger name, ticket price, number of flight segments, payment method, etc. Each attribute field holds a specific, cleaned, and transformed value. By transforming the messy, heterogeneous, and raw LCC platform order data into a unified object with a clear structure, explicit semantics, and conforming to the domain model, it can serve as a trusted data source for all subsequent message generation.

[0051] Optionally, the core business processing module is organized as a Java package, which includes a business object model and a message generator cluster. In the core business processing module, the message generation logic can be implemented either through hard coding or using a rule engine + template approach. That is, specific rules of the DISH standard are configured in a database or XML template, and the generator dynamically generates messages by parsing the template and rules. This approach improves flexibility but introduces complexity to the rule engine and results in lower performance.

[0052] Business object models can be implemented using Java classes. For example, the TicketOrder class contains attributes such as orderId, ticketInfoList, flightList, paymentInfo, pnr, and tacn. Among them, ticketInfoList contains multiple TicketInfo objects, each of which includes attributes such as passengerName, ticketNo, taxInfoList, and farePrice. Each object provides corresponding attribute logic conversion methods. For example, the 46th column in record 02 is the check digit, and its value is the remainder of the 13-digit ticket number divided by 7. TicketInfo needs to provide the calCdgt() method to return the check digit value. These attributes and method return values ​​are strictly mapped to the data elements in the DISH standard, so that changes in business rules (such as DISH revisions) only require modification of the methods inside the class, without refactoring the entire file generation process, thus improving maintainability.

[0053] Step S202: Multiple message generators are used to process all attributes and all attribute data to generate multiple message data.

[0054] In this embodiment of the invention, RetTotalGenerator is responsible for scheduling each message generator in the message generator cluster. Internally, it maintains a list of message generators (e.g., [RetHeadGenerator, Ret02Generator, Ret03Generator, ..., RetTailGenerator]), where RetHeadGenerator (the first preset message generator) generates header message data, RetTailGenerator (the second preset message generator) generates footer message data, and the rest are detail message generators. By sequentially calling the detail message generators in the message generator cluster, the data of each attribute in the order object can be converted into independent, standardized message records according to the DISH standard, field by field, position by position, and rule by rule, achieving complete isolation between business logic and standard implementation. Each detail message generator is an independent Java class, and each class corresponds to a record type in the DISH standard (e.g., 02, 03, 05, etc.). For example, Ret02Generator includes a generate(TicketOrder order) method, which internally generates message content bit by bit according to the definition of 02 record in the DISH standard by using string concatenation or StringBuilder.

[0055] Step S203: Based on a preset order, combine all message data to generate the target settlement file.

[0056] In this embodiment of the invention, the preset order is the order in which the message generator is called. The results are concatenated in order, that is, the file header, all detailed records and the file footer are concatenated in order to generate the target settlement file.

[0057] In summary, by constructing standardized order objects, business data and technical standards are decoupled; by employing multiple independent message generators, the attribute data in the order objects is transformed into message data conforming to the DISH standard, line by line and field by field, according to rules, achieving high cohesion and maintainability of the generation logic; and by combining all message data in a preset order, a complete and structurally accurate target settlement file is generated, thereby solving the technical problem of low accuracy in generating order calculation files in related technologies.

[0058] In order to accurately obtain the order object, the order settlement file generation method provided in Embodiment 1 of this application cleans the order data to obtain cleaned order data; transforms the cleaned order data to obtain a transformation result; and repairs the order data to obtain repaired data if the transformation result indicates that the transformation failed; and transforms the repaired data until the transformation result indicates that the transformation was successful, thereby obtaining the order object.

[0059] In this embodiment of the invention, the original order data is cleaned, including data validation, handling of missing values, and format standardization. A transformation operation is then performed on the cleaned order data to obtain a unified and standardized order object. If a key field is missing or the format is abnormal during the transformation, the transformation fails. When the transformation fails, a data repair mechanism is automatically triggered. For example, if the ticket_no of an order is found to be empty, the "ticket number backtracking interface" of the LCC platform will be called to query historical ticketing records through order_id and automatically complete the ticket number; if the validity period of a flight segment is missing, the validity period will be automatically set to the flight departure time according to business rules. The transformation is then re-executed on the repaired data until the transformation result indicates successful, resulting in an order object.

[0060] To accurately generate message data, in the order settlement file generation method provided in Embodiment 1 of this application, the order type corresponding to the order data is determined, wherein different order types correspond to different set of line numbers, and the set of line numbers is used to determine the content structure of the settlement file; based on the order type, the target set of line numbers corresponding to the order data is determined; a first preset message generator is used to read configuration information and generate file header message data; for each line number in the target set of line numbers, message data is generated using the message generator based on all attribute data.

[0061] Optionally, the line number set refers to the set of RET file record numbers included in a certain order (based on ticket number) in the DISH standard. Different business types (i.e., order types, such as ticketing, ticket refund, etc.) correspond to different line number sets. For each line number in the line number set, the message generator to be called is also different (e.g., 02 calls Ret02Generator, 03 calls Ret03Generator, etc.). Each message generator generates one or more detailed records by reading the corresponding information in the order object and according to the position, length and format requirements of the DISH standard.

[0062] In this embodiment of the invention, the target line number set corresponding to the order data can be determined according to the order type corresponding to the order data. The first preset message generator (i.e., RetHeadGenerator) is used to read the global configuration information and generate file header message data. For each line number in the target line number set, the corresponding message generator is used to generate message data based on all attribute data, thereby realizing intelligent adaptation and precise control of the RET file content structure.

[0063] In order to accurately generate file tail message data, in the order settlement file generation method provided in Embodiment 1 of this application, the number of messages is calculated based on all message data; and based on the number of messages, the file tail message data is generated using a second preset message generator.

[0064] Optionally, the file tail needs to include a total detail record, the value of which is equal to the sum of all detail message entries. After the file header and all message data (all detail records generated by each message generator) are generated, the message count (i.e., the sum of all detail message entries) is calculated based on all message data. Based on the message count, the file tail message data is generated using a second preset message generator (i.e., RetTailGenerator). By automatically calculating the message count and dynamically generating the file tail by a dedicated generator, zero-manual intervention and high-accuracy generation of RET file tail check fields are achieved.

[0065] In order to accurately obtain the target settlement file, in the order settlement file generation method provided in Embodiment 1 of this application, the generation order of each message data is determined based on a preset order, wherein the preset order is used to characterize the order used by all message generators; based on the generation order, the message data is added to the preset message order list; the file header message data, all message data in the preset message order list and the file tail message data are concatenated to obtain the target settlement file.

[0066] In this embodiment of the invention, the RET file records the order of each record, such as: file header (01), detailed records (02, 03, 05, 06, 07, 08, 09, etc.), and file tail (Z). Each record is arranged according to a fixed number and cannot be skipped or reversed. A message generator list can be pre-constructed based on the order of the RET file records, and the message generators in the list can be sorted. Then, the message generators can be called in order to generate message data for each line number in the target line number set, thus obtaining the message data generation order. Based on the generation order, the message data is added to a preset message order list to store all generated detailed messages in sequence, avoiding structural errors caused by asynchronous execution or thread misalignment. The target settlement file is obtained by concatenating the file header message data, all message data in the preset message order list, and the file tail message data in that order.

[0067] In order to accurately transmit the target settlement file to the target server, in the order settlement file generation method provided in Embodiment 1 of this application, the target settlement file is stored in a preset directory and transmitted to the target server through a preset transmission protocol for clearing and settlement of ticket data; if it is detected that the target settlement file has not been successfully transmitted to the target server, the preset transmission task identifier corresponding to the transmission is written into a preset data table, wherein the preset data table includes at least the number of retries for the transmission task indicated by each preset transmission task identifier.

[0068] Optionally, a file management and push module can utilize the JSch library (a Java-based protocol library) to implement an SFTP (SSH File Transfer Protocol) client function. After receiving the RET file content (i.e., the target settlement file) generated by the core business processing module, it can write it to a local temporary directory on the server (e.g., / tmp / ret_files / ), and then upload it to the remote directory specified by the DPC (Data Processing Center, i.e., the target server) via the SFTP protocol. After successful upload, the status, timestamp, and file path can be recorded in the file_transfer_log table of the database. If the upload of the target settlement file fails due to a network interruption, a record is inserted into the compensate_task table (i.e., the preset data table), such as recording the task ID (i.e., the preset transmission task identifier corresponding to the transmission), and the initial number of retries for the corresponding task is 0.

[0069] To achieve automatic repair of file transfer failures and improve file transfer efficiency, in the order settlement file generation method provided in Embodiment 1 of this application, a compensation job is triggered after the writing time reaches a preset time. The compensation job is used to retransmit the target settlement file to the target server. If the target settlement file is not successfully transmitted to the target server, the number of retries corresponding to the preset transmission task identifier is accumulated. If the number of retries exceeds the preset threshold, the transmission is marked as a failure.

[0070] In this embodiment of the invention, the entire RET file generation task can be scheduled through a task scheduling and compensation module, for example, by timed triggering or event-driven methods. A compensation mechanism can also be provided. When file generation or push fails, this module can capture the exception and execute predefined compensation logic (i.e., triggering a compensation job after the writing time reaches a preset duration (e.g., 5 minutes), retransmitting the target settlement file to the target server. If successful, the compensation task is marked as complete. If it fails again, the retry count is incremented by 1. If the retry count does not exceed a preset threshold (e.g., 3 times), it waits for the next retry. If it exceeds the threshold, it is marked as a final failure, and a serious alarm is issued, requiring manual intervention. This mechanism improves the data consistency of the settlement task.

[0071] Figure 3 This is a flowchart of an optional method for generating an order settlement file according to an embodiment of this application, such as... Figure 3As shown, the process includes four steps: S101: Triggering and Data Input. This step of obtaining raw order data from the LCC platform can be triggered by a scheduled task or order update event; S102: Data Cleaning and Transformation. The data acquisition and adaptation module converts the raw data into domain order objects. This process includes data validation, handling missing values, and format standardization; S103: Data Repair and Alarm. If the data conversion fails due to data problems during S102, an alarm is triggered to notify relevant maintenance personnel. Based on the failure situation, automatic data repair and retry are triggered. For example, if the failure in generating the refund RET file is found to be due to refund amount data, the repair program will call the refund details query interface to retrieve data and automatically repair the data source; S104: Domain Model-Driven Message Generator. This can drive the corresponding message generator based on the state and attributes of domain objects; S105: File Assembly. The RetTotalGenerator assembles the file header, all detailed records, and file footer in sequence into a complete RET file conforming to the DISH standard text format. S106: File Management and Push. The final generated RET file is sent to DPC via a secure channel, marking the formal integration of relevant data into the BSP settlement process and updating the task status to "Success". S107: Exception Handling and Compensation. If an error occurs at any step from S102 to S106, the task scheduling and compensation module will intervene, record the error log, and retry or mark the task as "Failed" according to the strategy, pending manual intervention or subsequent automatic compensation, ensuring the robustness of the process. Specifically, in S1041, the RetHeadGenerator generates a file header message based on system information, generation date, etc. In S1042, the corresponding detail generator (such as Ret02Generator) is called to generate a message with line number 02. The generator reads information such as agent information, flight segment, ticket number, and passenger type from the order object and generates one or more detail records according to the position, length, and format requirements of the DISH standard. In S1043, a corresponding detail generator (such as Ret03Generator) can be invoked to generate a message with line number 03. The generator reads refund-related information from the order object and generates one or more detail records strictly according to the position, length, and format requirements of the DISH standard. Consistent with steps S1042 and S1043, messages with line numbers 05, 06, 07, 08, and 09 can also be generated from relevant information in the order object, again strictly adhering to the position, length, and format requirements of the DISH standard to generate one or more detail records. In S104n, the RetTailGenerator can generate a file tail message based on the number of generated records.

[0072] The method for generating an order settlement document provided by the embodiment of the present application can encapsulate complex message rules into independent message generators, dynamically match the target line number set based on the order type, achieve precise customization of the RET file structure, ensure the sequential assembly of the file header, details, and file tail by sequentially scheduling each generator, combine with automatically calculating the message quantity to generate a compliant file tail, store the generated target settlement document in a preset directory, and transmit it to the target server through the SFTP protocol. When the transmission fails, automatically record the preset transmission task identifier and the retry count, trigger a compensation job for intelligent retry based on a preset duration, mark it as finally failed and alarm after exceeding the threshold, and realize the full-link automation of automatically generating, assembling, transmitting, and recovering highly compliant settlement documents.

[0073] The following is a detailed description in combination with another optional specific implementation manner.

[0074] In the embodiment of the present invention, assuming that a RET file is to be generated for a domestic air ticket sales order, the following steps may be included:

[0075] S101: Trigger and data input. At 2:00 am every day, the task scheduling module triggers the DailySettlementJob task, and this task calls the OrderQueryService task of the data acquisition and adaptation module to initiate a query to the database of the LCC platform to obtain all orders with the status of "ticketed" on the previous day. The original data of one order is: {order_id: "202512120900512131", airline: "9C", passenger_name: "张三", flight_no: "9C1234", ticket_no: "7841234567890", ticket_price: 1000.00, tax: 150.00}.

[0076] S102: Data cleaning and conversion. The data acquisition and adaptation module receives this original data and starts the conversion. Map the airline code "9C" to the two-character code "9C" specified by the DISH standard; if the passenger_name "张三" is in Chinese, convert the Chinese to English: ZHANGSAN; convert the amounts of ticket_price and tax from yuan to cents (100000 and 15000). Finally, construct a TicketingOrder domain object (i.e., an order object), and multiple methods are built under this object.

[0077] S103: Data Repair and Alarm. Perform a deep verification on the converted TicketingOrder object. Assume that the ticket_no (ticket number) field in the original data is empty. Since the ticket number is a mandatory field in the RET file and cannot be automatically repaired, the processing of this order can be immediately interrupted. Log an error in the log "ERROR: The ticket number of order 202512120900512131 is empty and the RET file cannot be generated", and trigger the alarm mechanism to send an alarm message to the operation and maintenance personnel via email and SMS. Assume that there is no flight segment validity period for a certain airline in the original data. When it is detected that the RET file requires the flight segment validity period attribute, the flight segment validity period can be set to the flight departure time according to the airline's business situation, and the process can continue.

[0078] S104: Domain Model-Driven Message Generation. After passing the verification, the application service RetHandAppService can determine the RET records to be generated according to the order type (domestic ticket issuance).

[0079] S1041: Generate the file header. Call RetHeadGenerator, which reads the system configuration (code = "CN", ticket issuance date = "240409", file serial number = "1") and generates a 128-byte record, such as: 1250709MINS230PROD2507100218CN03…, with the omitted part being other padding information.

[0080] S1042: Generate the detailed record for line number 02. Call Ret02Generator, which takes the TicketingOrder object as input. By calling order.getTicketNo(), it gets "7841234567890" and fills it in the starting position specified by the standard. And by calling order.toPassengerName(), it gets "张三", left-aligns it and fills it with spaces to a length of 49 characters. If it is in Chinese, it is converted to English, becoming "ZHANGSAN (followed by 41 spaces)", and fills it in the specified position. At the same time, by calling order.toCui(), it gets the flight segment usage identifier, such as FVVV, and fills it in the specified position. Finally, a 02 record is generated.

[0081] S1043: Generate the file tail. After generating all the detailed records (in this example, only one 02 record), call RetTailGenerator to count the total number of records, such as 476, and generate the file tail record, such as Z00000000476.

[0082] S105: File Assembly. The RetTotalGenerator is called to concatenate the records generated in steps S1041, S1042, and S1043 into a complete text string in sequence. The content of this text string is the RET file content conforming to the DISH standard.

[0083] S106: File Push and Status Update. The file management module saves the assembled file content as a physical file GP_20250710_RET_D_ISS.RET, and then uploads it to the DPC server via a configured SFTP connection (hostname, port, username, key). After successful upload, the task log status is updated to "Success".

[0084] S107: Exception Handling and Compensation. Assuming that an SFTP upload fails due to a network interruption in step S106, an `SftpException` can be thrown. The task scheduling and compensation module will catch this exception and perform the following operations: Insert a record into the `compensate_task` table with the original task ID and an initial retry count of 0. After waiting 5 minutes, trigger the compensation job to read the failed record from the `compensate_task` table. The compensation job will re-execute the file push logic (i.e., step S106). If successful, mark the compensation task as complete; if it fails again, increment the retry count by 1. If the retry count does not exceed a preset threshold (e.g., 3 times), wait for the next retry; if it exceeds the threshold, mark it as "final failure" and issue a critical alarm, requiring manual intervention.

[0085] In this embodiment of the invention, by fully encapsulating the complex DISH standard within the domain layer, developers of the LCC platform do not need to be settlement experts. They can generate compliant RET files simply by calling a simple interface and providing general order data, thus shortening the development and testing cycle and greatly saving manpower costs.

[0086] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0087] Example 2

[0088] This application also provides an apparatus for generating order settlement documents. It should be noted that this apparatus can be used to execute the method for generating order settlement documents provided in this application. The following describes the apparatus for generating order settlement documents provided in this application.

[0089] According to an embodiment of this application, an apparatus for implementing the above-described method for generating order settlement documents is also provided. Figure 4 This is a schematic diagram of an optional order settlement document generation apparatus according to an embodiment of this application, such as... Figure 4 As shown, the device for generating the order settlement document may include: a first construction unit 40, a first generation unit 41, and a second generation unit 42.

[0090] The first construction unit 40 is used to acquire order data and construct an order object based on the order data. The order object includes at least multiple attributes, and each attribute corresponds to attribute data.

[0091] The first generation unit 41 is used to process all attributes and all attribute data using multiple message generators to generate multiple message data.

[0092] The second generation unit 42 is used to combine all message data according to a preset order to generate a target settlement file.

[0093] The order settlement file generation device provided in this application embodiment can obtain order data through the first construction unit 40 and construct an order object based on the order data. It can also use the first generation unit 41 to process all attributes and all attribute data using multiple message generators to generate multiple message data. Finally, it can use the second generation unit 42 to combine all message data according to a preset order to generate a target settlement file.

[0094] Optionally, the first construction unit 40 includes: a first cleaning module for cleaning the order data to obtain cleaned order data; a first conversion module for converting the cleaned order data to obtain a conversion result, and repairing the order data to obtain repaired data if the conversion result indicates that the conversion failed; and a second conversion module for converting the repaired data until the conversion result indicates that the conversion was successful, thereby obtaining an order object.

[0095] Optionally, the first generation unit 41 includes: a first determining module, used to determine the order type corresponding to the order data, wherein different order types correspond to different set of line numbers, and the set of line numbers is used to determine the content structure of the settlement file; a second determining module, used to determine the target set of line numbers corresponding to the order data based on the order type; a first generation module, used to read configuration information and generate file header message data using a first preset message generator; and a second generation module, used to generate message data for each line number in the target set of line numbers based on all attribute data using a message generator.

[0096] Optionally, the order settlement document generation device further includes: a first calculation module, used to calculate the number of messages based on all message data after generating message data using a message generator based on all attribute data; and a third generation module, used to generate file tail message data using a second preset message generator based on the number of messages.

[0097] Optionally, the second generation unit 42 includes: a third determining module, used to determine the generation order of each message data based on a preset order, wherein the preset order is used to characterize the order used by all message generators; a first adding module, used to add the message data to a preset message order list based on the generation order; and a first splicing module, used to splice the header message data, all message data in the preset message order list, and the tail message data to obtain the target settlement file.

[0098] Optionally, the order settlement file generation device further includes: a first transmission module, used to combine all message data according to a preset order to generate a target settlement file, store the target settlement file in a preset directory, and transmit the target settlement file to a target server through a preset transmission protocol for clearing and settlement of ticket data; and a second transmission module, used to write a preset transmission task identifier corresponding to the transmission into a preset data table when it is detected that the target settlement file has not been successfully transmitted to the target server, wherein the preset data table includes at least the number of retries for each transmission task indicated by the preset transmission task identifier.

[0099] Optionally, the order settlement file generation device further includes: a first triggering module, used to trigger a compensation operation after the preset transmission task identifier corresponding to the transmission is written into a preset data table and the writing time reaches a preset duration, wherein the compensation operation is used to retransmit the target settlement file to the target server, and to accumulate the number of retries corresponding to the preset transmission task identifier if the target settlement file is detected to have failed to be transmitted to the target server; and a first marking module, used to mark the transmission as a failure state if the number of retries exceeds a preset threshold.

[0100] The aforementioned order settlement document generation device may further include a processor and a memory. The first building unit 40, the first generation unit 41, the second generation unit 42, etc., are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.

[0101] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and by adjusting kernel parameters, all message data can be combined in a preset order to generate the target settlement file.

[0102] The aforementioned memory may include non-permanent memory in computer-readable media, such as 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.

[0103] It should be noted that the first construction unit 40, the first generation unit 41, and the second generation unit 42 mentioned above correspond to steps S201 to S203 in Embodiment 1. The instances and application scenarios implemented by the above units and the corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above units can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.

[0104] Example 3

[0105] Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.

[0106] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.

[0107] In this embodiment, the computer terminal described above can execute the program code for the following steps in the method for generating an order settlement file: obtaining order data and constructing an order object based on the order data, wherein the order object includes at least multiple attributes, each attribute corresponding to attribute data; using multiple message generators to process all attributes and all attribute data to generate multiple message data; and combining all message data according to a preset order to generate a target settlement file.

[0108] Optionally, the computer terminal described above can execute the program code for the following steps in the method for generating order settlement files: cleaning the order data to obtain cleaned order data; converting the cleaned order data to obtain a conversion result, and repairing the order data to obtain repaired data if the conversion result indicates that the conversion failed; converting the repaired data until the conversion result indicates that the conversion was successful, and obtaining an order object.

[0109] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the method for generating an order settlement file: determining the order type corresponding to the order data, wherein different order types correspond to different sets of line numbers, and the set of line numbers is used to determine the content structure of the settlement file; determining the target set of line numbers corresponding to the order data based on the order type; using a first preset message generator to read configuration information and generate file header message data; and for each line number in the target set of line numbers, generating message data based on all attribute data using the message generator.

[0110] Optionally, the computer terminal described above can execute the program code for the following steps in the method for generating order settlement files: calculating the number of messages based on all message data; and generating file tail message data using a second preset message generator based on the number of messages.

[0111] Optionally, the aforementioned computer terminal can execute program code for the following steps in the order settlement file generation method: determining the generation order of each message data based on a preset order, wherein the preset order is used to characterize the order used by all message generators; adding the message data to the preset message order list based on the generation order; and concatenating the file header message data, all message data in the preset message order list, and file tail message data to obtain the target settlement file.

[0112] Optionally, the aforementioned computer terminal can execute the program code for the following steps in the order settlement file generation method: storing the target settlement file in a preset directory and transmitting the target settlement file to the target server via a preset transmission protocol for clearing and settlement of ticket data; if it is detected that the target settlement file has not been successfully transmitted to the target server, writing the preset transmission task identifier corresponding to the transmission into a preset data table, wherein the preset data table includes at least: the number of retries for the transmission task indicated by each preset transmission task identifier.

[0113] Optionally, the computer terminal described above can execute the program code for the following steps in the method for generating order settlement files: after the writing time reaches a preset time, a compensation job is triggered, wherein the compensation job is used to retransmit the target settlement file to the target server, and if it is detected that the target settlement file has not been successfully transmitted to the target server, the number of retries corresponding to the preset transmission task identifier is incremented; if the number of retries exceeds the preset threshold, the transmission is marked as a failure.

[0114] Optionally, Figure 5 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5(Only one is shown) processor 502, memory 504, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0115] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the order settlement file generation method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned order settlement file generation method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0116] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the method for generating the order settlement file.

[0117] The embodiments of this application provide a scheme for generating order settlement files. By encapsulating the complex message generation logic of the DISH standard in an independent message generator cluster and driving message construction based on a unified object model, the scheme achieves automated mapping between business data and standard specifications. It can automatically generate fully compliant RET files by only inputting general order data, thereby solving the technical problem of low accuracy in generating order calculation files in related technologies.

[0118] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only. Electronic devices can also be terminal devices such as smartphones, tablets, PDAs, and mobile internet devices (MIDs). Figure 5 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 5 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 5 The different configurations shown.

[0119] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0120] Example 4

[0121] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the order settlement file generation method provided in Embodiment 1.

[0122] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0123] This application also provides a computer program product, which, when executed on a data processing device, is suitable for performing the steps of a method for generating an order settlement document.

[0124] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0125] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0126] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0127] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0128] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0129] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0130] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for generating an order settlement document, characterized in that, include: Obtain order data and construct an order object based on the order data, wherein the order object includes at least multiple attributes, and each attribute corresponds to attribute data; Multiple message generators are used to process all the attributes and all the attribute data to generate multiple message data. Based on a preset order, all the message data are combined to generate a target settlement file.

2. The method for generating order settlement documents according to claim 1, characterized in that, The steps for constructing an order object based on the order data include: The order data is cleaned to obtain cleaned order data; The cleaned order data is transformed to obtain a transformation result. If the transformation result indicates that the transformation has failed, the order data is repaired to obtain repaired data. The repaired data is transformed until the transformation result indicates successful transformation, thus obtaining the order object.

3. The method for generating order settlement documents according to claim 1, characterized in that, The step of processing all the attributes and all the attribute data using multiple message generators to generate multiple message data includes: The order type corresponding to the order data is determined, wherein different order types correspond to different set of line numbers, and the set of line numbers is used to determine the content structure of the settlement file; Based on the order type, determine the target row number set corresponding to the order data; The first preset message generator is used to read the configuration information and generate file header message data; For each row number in the target row number set, the message data is generated by the message generator based on all the attribute data.

4. The method for generating order settlement documents according to claim 3, characterized in that, After generating the message data using the message generator based on all the aforementioned attribute data, the process further includes: Calculate the number of messages based on all the aforementioned message data; Based on the number of messages, the file tail message data is generated using the second preset message generator.

5. The method for generating order settlement documents according to claim 1, characterized in that, The step of combining all the message data according to a preset order to generate a target settlement file includes: Based on the preset order, the generation order of each message data is determined, wherein the preset order is used to characterize the order used by all the message generators; Based on the generation order, the message data is added to the preset message order list; The target settlement file is obtained by concatenating the header message data, all the message data in the preset message order list, and the tail message data.

6. The method for generating order settlement documents according to claim 1, characterized in that, After combining all the message data according to a preset order to generate the target settlement file, the process further includes: The target settlement file is stored in a preset directory and transmitted to the target server via a preset transmission protocol for the clearing and settlement of ticket data. If it is detected that the target settlement file has not been successfully transmitted to the target server, the preset transmission task identifier corresponding to the transmission is written into a preset data table, wherein the preset data table includes at least the number of retries for the transmission task indicated by each preset transmission task identifier.

7. The method for generating order settlement documents according to claim 6, characterized in that, After writing the preset transmission task identifier corresponding to the transmission into the preset data table, the method further includes: After the writing time reaches the preset time, a compensation job is triggered. The compensation job is used to retransmit the target settlement file to the target server. If the target settlement file is not successfully transmitted to the target server, the number of retries corresponding to the preset transmission task identifier is incremented. If the number of retries exceeds a preset threshold, the transmission will be marked as a failure.

8. An apparatus for generating order settlement documents, characterized in that, include: The first construction unit is used to acquire order data and construct an order object based on the order data, wherein the order object includes at least a plurality of attributes, and each attribute corresponds to attribute data; The first generation unit is used to process all the attributes and all the attribute data using multiple message generators to generate multiple message data. The second generation unit is used to combine all the message data according to a preset order to generate a target settlement file.

9. A computer program product, characterized in that, The method includes a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for generating an order settlement document as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being 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 cause the one or more processors to implement the order settlement file generation method according to any one of claims 1 to 7.