File analysis method, device, equipment, medium and program product
By configuring file download and parsing for organizations, the issues of real-time performance and high cost of file parsing are resolved, enabling configurable access and efficient file parsing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING ANT CONSUMER FINANCE CO LTD
- Filing Date
- 2023-08-31
- Publication Date
- 2026-05-15
AI Technical Summary
In existing technologies, the real-time performance of file parsing between platforms and institutions cannot be guaranteed, resulting in high configuration and maintenance costs, and low file parsing efficiency due to offline data synchronization and long links.
By pre-setting file download and parsing configurations for the target organization, real-time file downloads are ensured, and organizational differences are masked through a file parsing strategy configuration table, enabling configurable access and improving parsing efficiency.
It enables configurable and low-cost access to file parsing, supports file query capabilities from different channels, and improves the efficiency and stability of file parsing.
Smart Images

Figure CN117093551B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular to a file parsing method, apparatus, device, medium, and program product. Background Technology
[0002] Currently, platforms and institutions exchange messages and billing documents through front-end servers. However, due to factors such as offline data synchronization and long offline links, the real-time performance of file parsing cannot be guaranteed, resulting in extremely high configuration and maintenance costs. Summary of the Invention
[0003] This specification provides a file parsing method, apparatus, device, medium, and program product. By pre-setting corresponding file download and parsing configurations for the target organization, it ensures the real-time nature of file downloads, masks organizational differences, and achieves configurable and low-cost access to file parsing capabilities. It supports configurable access to files and file query capabilities from different channels, thereby improving file parsing efficiency. The above technical solution is as follows:
[0004] Firstly, embodiments of this specification provide a file parsing method, the method comprising:
[0005] Send a target query request to the front-end machine corresponding to the target organization;
[0006] Based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0007] Based on the file parsing configuration corresponding to the target organization, the target file is parsed to obtain the target parsed text;
[0008] Based on the above target parsing text, the target response data corresponding to the above target query request is determined.
[0009] In one possible implementation, the downloading of the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization includes:
[0010] When the duration of sending the target query request to the aforementioned front-end machine reaches the target duration, the target file corresponding to the target query request is downloaded from the aforementioned front-end machine based on the file download configuration corresponding to the target organization.
[0011] In one possible implementation, after downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, the method further includes:
[0012] If the target file download fails, the above steps based on the file download configuration corresponding to the target organization will be executed again to download the target file corresponding to the target query request from the front-end machine until the target file is successfully downloaded or the number of downloads of the target file exceeds the target number, at which point the download of the target file will end.
[0013] In one possible implementation, after sending the target query request to the front-end machine corresponding to the target organization, and before downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, the method further includes:
[0014] Receive the first target response message returned by the aforementioned front-end machine based on the aforementioned target query request;
[0015] The target response data corresponding to the target query request determined based on the above target parsed text includes:
[0016] The target parsed text is then inserted back into the first target response message to obtain the second target response message;
[0017] According to the target mapping relationship, the target data in the second target response message is mapped to obtain the target response data corresponding to the target query request. The target mapping relationship is used to characterize the correspondence between the data in the response message of each institution and the response data.
[0018] In one possible implementation, after backfeeding the target parsed text into the first target response message to obtain the second target response message, the method further includes:
[0019] Determine whether the second target response message mentioned above needs to undergo multi-field string parsing;
[0020] If so, then perform multi-field string parsing on the second target response message to obtain the third target response message;
[0021] According to the target mapping relationship, the target data in the third target response message is mapped to obtain the target response data corresponding to the target query request.
[0022] In one possible implementation, after receiving the first target response message returned by the front-end machine based on the target query request, and before downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, the method further includes:
[0023] Based on the first target response message mentioned above, determine whether the target query request was successful.
[0024] Based on the file download configuration corresponding to the aforementioned target organization, the target file corresponding to the aforementioned target query request is downloaded from the aforementioned front-end machine, including:
[0025] If so, then based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0026] In one possible implementation, after receiving the first target response message returned by the front-end machine based on the target query request, and before downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, the method further includes:
[0027] Based on the first target response message mentioned above, determine whether file parsing is required;
[0028] Based on the file download configuration corresponding to the aforementioned target organization, the target file corresponding to the aforementioned target query request is downloaded from the aforementioned front-end machine, including:
[0029] If so, then based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0030] In one possible implementation, the aforementioned file download configuration and file parsing configuration are located in a file parsing policy configuration table; the aforementioned file parsing policy configuration table includes file download configurations and file parsing configurations corresponding to multiple organizations.
[0031] Secondly, embodiments of this specification provide a file parsing device, which includes:
[0032] The sending module is used to send target query requests to the front-end machine corresponding to the target organization;
[0033] The file download module is used to download the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution.
[0034] The file parsing module is used to parse the target file based on the file parsing configuration corresponding to the target organization to obtain the target parsing text;
[0035] The determination module is used to determine the target response data corresponding to the target query request based on the target parsed text.
[0036] In one possible implementation, the file download module described above is specifically used for:
[0037] When the duration of sending the target query request to the aforementioned front-end machine reaches the target duration, the target file corresponding to the target query request is downloaded from the aforementioned front-end machine based on the file download configuration corresponding to the target organization.
[0038] In one possible implementation, the aforementioned file parsing device further includes:
[0039] The download retry module is used to re-execute the above steps based on the file download configuration corresponding to the above target organization and download the target file corresponding to the above target query request from the above front-end machine if the above target file fails to download, until the above target file is successfully downloaded or the number of downloads of the above target file exceeds the target number, and then the download of the above target file ends.
[0040] In one possible implementation, the above-mentioned file parsing device further includes:
[0041] The receiving module is used to receive the first target response message returned by the aforementioned front-end machine based on the aforementioned target query request;
[0042] The aforementioned determining module is specifically used for:
[0043] The target parsing text is fed back into the first target response message to obtain the second target response message; the target data in the second target response message is mapped according to the target mapping relationship to obtain the target response data corresponding to the target query request; the target mapping relationship is used to characterize the correspondence between the data in the response messages of each institution and the response data.
[0044] In one possible implementation, the above-mentioned file parsing device further includes:
[0045] The first judgment module is used to determine whether the above-mentioned second target response message needs to be parsed for multiple fields;
[0046] The multi-domain string parsing module is used to perform multi-domain string parsing on the second target response message to obtain the third target response message if the condition is met.
[0047] The mapping module is used to map the target data in the third target response message according to the target mapping relationship to obtain the target response data corresponding to the target query request.
[0048] In one possible implementation, the above-mentioned file parsing device further includes:
[0049] The second judgment module is used to determine whether the above target query request was successfully queried based on the above first target response message;
[0050] The above file download module is specifically used for:
[0051] If so, then based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0052] In one possible implementation, the above-mentioned file parsing device further includes:
[0053] The third judgment module is used to determine whether file parsing is required based on the first target response message mentioned above.
[0054] The above file download module is specifically used for:
[0055] If so, then based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0056] In one possible implementation, the aforementioned file download configuration and file parsing configuration are located in a file parsing policy configuration table; the aforementioned file parsing policy configuration table includes file download configurations and file parsing configurations corresponding to multiple organizations.
[0057] Thirdly, embodiments of this specification provide an electronic device, including: a processor and a memory;
[0058] The processor is connected to the memory.
[0059] The aforementioned memory is used to store executable program code;
[0060] The processor reads the executable program code stored in the memory to run the program corresponding to the executable program code, so as to execute the method provided by the first aspect of the embodiments of this specification or any possible implementation of the first aspect.
[0061] Fourthly, embodiments of this specification provide a computer storage medium storing a plurality of instructions adapted for loading by a processor and executing the method provided by the first aspect of the embodiments of this specification or any possible implementation thereof.
[0062] Fifthly, embodiments of this specification provide a computer program product containing instructions that, when run on a computer or processor, cause the computer or processor to perform the method provided by the first aspect of the embodiments of this specification or any possible implementation thereof.
[0063] In this embodiment, the business terminal can send a target query request to the front-end machine corresponding to the target institution, and download the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution. It can also parse the target file based on the file parsing configuration corresponding to the target institution to obtain target parsed text. Finally, based on the target parsed text, it determines the target response data corresponding to the target query request. This ensures the configurability and real-time nature of file downloads for institutions by pre-setting corresponding file download configurations, and masks institutional differences by pre-setting corresponding file parsing configurations. It achieves configurable and low-cost access to file parsing capabilities, supports configurable access to files and file query capabilities from different channels, and improves file parsing efficiency. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of this specification, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 A schematic diagram of the architecture of a file parsing system provided for an exemplary embodiment of this specification;
[0066] Figure 2 A flowchart illustrating a file parsing method provided as an exemplary embodiment of this specification;
[0067] Figure 3 A schematic diagram of a file parsing strategy configuration table provided as an exemplary embodiment of this specification;
[0068] Figure 4 A schematic diagram illustrating an implementation process for determining target response data, provided as an exemplary embodiment of this specification;
[0069] Figure 5 This specification provides a schematic diagram of another implementation process for determining target response data, as an exemplary embodiment.
[0070] Figure 6 A schematic diagram illustrating the implementation process of a file parsing method provided as an exemplary embodiment of this specification;
[0071] Figure 7 A schematic diagram of a file parsing apparatus provided for an exemplary embodiment of this specification;
[0072] Figure 8 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this specification. Detailed Implementation
[0073] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings.
[0074] The terms "first," "second," "third," etc., used in this specification, claims, and the foregoing drawings are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0075] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in the embodiments of this specification are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the target billing data, file download configuration, and file parsing configuration involved in this specification were all obtained with full authorization.
[0076] Please refer to the following. Figure 1 This is a schematic diagram of the architecture of a file parsing system provided in an exemplary embodiment of this specification. Figure 1 As shown, the file parsing system includes: a business terminal 110, a front-end server 120, and an organizational terminal 130. Among them:
[0077] The business terminal 110 may include one or more terminals or servers corresponding to enterprises or business parties. Business terminal 110 may install business-version software to enable business parties to query data details in files, query bill details, and publish bill subscription events. The business terminal 110 can establish data relationships with the network and, through this network, establish data connections with the organization's corresponding front-end machine 120, such as sending target query requests and receiving the first target response message corresponding to the target query request.
[0078] Specifically, after sending a target query request to the front-end server 120 corresponding to the target organization, the business terminal 110 can also download the target file corresponding to the target query request from the front-end server 120 corresponding to the target organization based on the pre-set file download configuration corresponding to the target organization, and parse the target file based on the pre-set file parsing configuration corresponding to the target organization to obtain the target parsed text. Finally, the business terminal 110 can also determine the target response data corresponding to the target query request based on the target parsed text.
[0079] Understandably, the business-side 110 can be, but is not limited to, devices such as mobile phones, tablets, and laptops with the business version software installed, or, but is not limited to, hardware servers, virtual servers, and cloud servers capable of file parsing.
[0080] Front-end server 120 is a near-end communication device provided by an institution (such as, but not limited to, banks) for trusted interaction between the two parties. It typically integrates capabilities such as message signing, signature verification, and communication logging, and is usually deployed on a server within the domain of the financial institution it interfaces with. Front-end server 120 can receive target query requests sent by business terminal 110 via the network and forward these requests to the corresponding institutional terminal 130. Simultaneously, front-end server 120 can also receive the first target response message from institutional terminal 130 based on the target query request and return this first target response message to front-end server 120. Furthermore, front-end server 120 can also receive the target file generated by institutional terminal 130 based on the target query request and automatically synchronize and store this target file for download by business terminal 110.
[0081] The institution-side 130 may include terminals or servers corresponding to one or more institutions. Upon receiving a target query request sent by the front-end server 120, the institution-side 130 corresponding to the target institution can directly generate a corresponding first target response message and target file based on the target query request, and then send the first target response message and target file back to its corresponding front-end server 120. The institution-side 130 may include, but is not limited to, banks.
[0082] Understandably, the institutional end 130 can be, but is not limited to, the institution's corresponding hardware server, virtual server, cloud server, etc.
[0083] The network can be a medium that provides a communication link between the service terminal 110 and the front-end server 120, or between the front-end server 120 and the organization terminal 130, or it can be the Internet, which includes network equipment and transmission media, and is not limited to these. The transmission media can be a wired link, such as, but not limited to, coaxial cable, fiber optic cable, and digital subscriber line (DSL), or a wireless link, such as, but not limited to, wireless fidelity (WIFI), secure file transfer protocol (SSH File Transfer Protocol, also known as Secret File Transfer Protocol, SFTP), Bluetooth, and mobile device networks.
[0084] Understandably, Figure 1 The number of business terminals 110, front-end machines 120, and institutional terminals 130 in the file parsing system shown is only for example. In a specific implementation, the file parsing system can contain any number of business terminals 110, front-end machines 120, and institutional terminals 130. For example, but not limited to, business terminals 110 can be a business terminal cluster composed of business terminals corresponding to multiple business parties, front-end machines 120 can be a front-end machine cluster composed of front-end machines corresponding to multiple institutions, and institutional terminals 130 can be an institutional terminal cluster composed of institutional terminals corresponding to multiple institutions.
[0085] Next, combine Figure 1 This section introduces the file parsing method provided in the embodiments of this specification. Please refer to [the documentation] for details. Figure 2 This is a flowchart illustrating a file parsing method provided in an exemplary embodiment of this specification. Figure 2 As shown, the file parsing method includes the following steps:
[0086] S202, Send a target query request to the front-end machine corresponding to the target organization.
[0087] Specifically, when a target business party wants to view the target response data of the target organization's corresponding target organization account, it can, but is not limited to, trigger the target business terminal corresponding to the target business party to send the target query request to the front-end server corresponding to the target organization through target operations such as clicking or swiping. The front-end server then sends the target query request to the target organization's corresponding target organization terminal and receives the first target response message returned by the target organization terminal. The aforementioned target query request carries the target organization account for the response data to be queried.
[0088] For example, the target institution includes a target bank, the target query request includes a target bill query request, the target file includes the target bill file corresponding to the target bill query request, and the target response data is the target bill data corresponding to the target bill query request. The target bill data can be understood as the transaction history or detailed data corresponding to the target bank account.
[0089] S204, Based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0090] Specifically, the target business unit may, but is not limited to, pre-store the file download configuration corresponding to the target organization. If the target query request is successfully retrieved at the target organization, the target organization will also return the corresponding target file generated based on the query request to the front-end server. After sending a target query request to the front-end server corresponding to the target organization, the target business unit can first obtain the file download configuration corresponding to that target organization, and then download the corresponding target file from the front-end server based on the pre-set file download configuration. The aforementioned file download configuration includes the file download function interface configuration corresponding to the target organization, such as, but not limited to, file channel configuration and file path configuration.
[0091] Optionally, in S204 above, the process of downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization may include: when the duration for which the target business terminal sends the target query request to the front-end machine reaches the target duration, the target business terminal will automatically trigger the download of the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization. The target duration may be, but is not limited to, 8 seconds, 1 minute, etc.
[0092] In the embodiments of this specification, the time for requesting to download the target file from the front-end machine can be controlled according to the duration of sending the target query request to the front-end machine. For example, but not limited to, after the target business end sends the target query request to the front-end machine for 8 seconds or 1 minute, the target file corresponding to the target query request is automatically triggered to download from the front-end machine based on the file download configuration corresponding to the target organization. This avoids the problem of the target file being too large and the target organization not yet returning to the corresponding front-end machine, causing the target business end to fail to download the target file, thereby improving the success rate of the target business end downloading the target file from the front-end machine.
[0093] In some possible embodiments, after downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization in S204 above, if the target file download fails, S204 is executed again to download the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, until the target file is successfully downloaded and then S208 is executed below, or the download of the target file ends after the number of downloads exceeds the target number, and the result of the target file download failure can be returned to the business back-end corresponding to the target business terminal, but is not limited to. The target number can be 5 times, 10 times, etc., and can be set according to the size of the target file, etc. For example, when the target file is larger than the target value, the target number can be set to 10 times, and when the target file is smaller than the target value, the target number can be set to 5 times, etc. The embodiments in this specification do not limit this.
[0094] In the embodiments of this specification, if the target service fails to download the target file from the front-end server, a retry mechanism can be used to download the target file corresponding to the target query request from the front-end server again based on the file download configuration corresponding to the target organization. This avoids the problem of the target file being too large and the target organization not yet returning to the corresponding front-end server, causing the target service to fail to download the target file, and also avoids the problem of the link between the target service and the front-end server being unstable, thus improving the success rate of the target service downloading the target file from the front-end server. At the same time, to a certain extent, the embodiments of this specification can also test the stability of the link between the target service and the front-end server by the number of target download retries. For example, if the target service fails to download the target file from the front-end server in a target number of retries, it can be said that the link between the target service and the front-end server is unstable.
[0095] Please continue to refer to the following. Figure 2 ,like Figure 2 As shown in S204, after downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, the file parsing method further includes:
[0096] S206, Based on the file parsing configuration corresponding to the target organization, the target file is parsed to obtain the target parsed text.
[0097] Specifically, the target business unit may, but is not limited to, pre-store the file parsing configuration corresponding to the target organization. After downloading the target file corresponding to the target query request from the front-end machine, the target business unit will, based on the file parsing configuration corresponding to the target organization, download and convert the target file name or target file link and other corresponding data in the target file into standard JSON format data to obtain the corresponding target parsing text. The aforementioned file parsing configuration includes the file parsing function interface configuration corresponding to the target organization, such as, but not limited to, file expression configuration, file parsing execution switch expression configuration, etc.
[0098] In some possible embodiments, the file download configuration and the file parsing configuration described above are located in a file parsing policy configuration table. This file parsing policy configuration table includes file download configurations and file parsing configurations corresponding to multiple organizations.
[0099] In the embodiments described in this specification, corresponding functional interface configurations can be set in advance for different organizations. By using the corresponding file parsing strategy configuration table, the business-side SFTP file parsing capabilities can be integrated, the differences between different organizations can be masked, and the file parsing capabilities of different channels (organizations) can be configurably accessed, ensuring the real-time performance and stability of file parsing.
[0100] For example, such as Figure 3 As shown, for the same organization, the above file parsing strategy configuration table can have at least multiple configuration items, such as file_channel, sftp_server_host, sftp_login_name, sftp_login_password, sftp_login_port, sftp_file_direction, file_charset_name, file_name_parse_expression, file_execute_switch_expression, etc., as well as the corresponding configuration descriptions for each of the above configuration items. For example, the file channel includes sftp, sftp server address, sftp login username, sftp login password, sftp login port, sftp file path, file name, file parsing expression, file parsing execution switch expression, etc.
[0101] S208, Determine the target response data corresponding to the target query request based on the target parsed text.
[0102] In this embodiment, the business terminal can send a target query request to the front-end machine corresponding to the target institution, and download the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution. It can also parse the target file based on the file parsing configuration corresponding to the target institution to obtain target parsed text. Finally, based on the target parsed text, it determines the target response data corresponding to the target query request. This ensures the configurability and real-time nature of the institution's billing file download by pre-setting the corresponding file download configuration for the institution. Furthermore, by pre-setting the corresponding file parsing configuration for the institution, institutional differences are masked, enabling configurable and low-cost access to file parsing capabilities. This supports configurable access to files and billing file query capabilities from different channels, improving file parsing efficiency.
[0103] Optionally, the target service terminal sends the target query request to the front-end server corresponding to the target organization. After the front-end server sends the target query request to the target organization's terminal, it will receive a first target response message from the target organization's terminal back to the front-end server based on the target query request. For example... Figure 4 As shown, the implementation process of S208 above, which determines the target response data corresponding to the target query request based on the target parsed text, may include:
[0104] S402, the target parsed text is pushed back into the first target response message to obtain the second target response message.
[0105] Specifically, the target business unit parses the target file based on the file parsing configuration corresponding to the target organization. After obtaining the target parsed text, the target parsed text can be pushed back to the corresponding target position of the first target response message to obtain the corresponding second target response message.
[0106] S404. According to the target mapping relationship, the target data in the second target response message is mapped to obtain the target response data corresponding to the target query request.
[0107] Specifically, the aforementioned target mapping relationship is used to characterize the correspondence between the data in the response messages of each institution and the response data. The target business terminal can map the target data in the second target response message obtained after backing up the target parsed text according to the correspondence between the target data and the target response data in the first target response message corresponding to the target institution, thereby obtaining the target response data corresponding to the target query request.
[0108] For example, the aforementioned target query request may include, but is not limited to, a target bill query request, and the aforementioned target response data may include, but is not limited to, the transaction amount and transaction direction corresponding to the target institution account.
[0109] Optionally, the target service terminal sends the target query request to the front-end server corresponding to the target organization. After the front-end server sends the target query request to the target organization's terminal, it will receive a first target response message from the target organization's terminal back to the front-end server based on the target query request. For example... Figure 5 As shown, the implementation process of S208 above, which determines the target response data corresponding to the target query request based on the target parsed text, may include:
[0110] S502, the target parsed text is pushed back into the first target response message to obtain the second target response message.
[0111] Specifically, S502 is the same as S402, and will not be repeated here.
[0112] S504, determine whether the second target response message needs to be parsed using multi-field string parsing.
[0113] Specifically, a multi-field string refers to a data format in the second target response message that is separated by the "||||" format. The target service can first determine whether the data format in the second target response message obtained after backfeeding the parsed target text is in the "||||" format. If so, it can be determined that the second target response message needs to undergo multi-field string parsing; if not, it can be determined that the second target response message does not need to undergo multi-field string parsing.
[0114] S506, if so, then perform multi-field string parsing on the second target response message to obtain the third target response message.
[0115] Specifically, if the data format in the second target response message is "||||", then the second target response message can be split according to "|" to obtain the third target response message.
[0116] For example, if the data in the second target response message is a multi-field string "a|b|c|aaa|bbb|ccc", it can be split into standard data to obtain the corresponding third target response message "a:aaa, b:bbb, c:ccc".
[0117] S508: According to the target mapping relationship, the target data in the third target response message is mapped to obtain the target response data corresponding to the target query request.
[0118] Specifically, the implementation process of S508 is similar to that of S404 above, and will not be repeated here.
[0119] Please continue to refer to the following. Figure 5 ,like Figure 5As shown, after determining in S504 whether the second target response message needs to undergo multi-field string parsing, the implementation process of S208 above also includes:
[0120] S510, if not, then according to the target mapping relationship, map the target data in the second target response message to obtain the target response data corresponding to the target query request.
[0121] Specifically, S510 is identical to S404, and will not be repeated here.
[0122] In some possible embodiments, after receiving the first target response message returned by the front-end machine based on the target query request, in step S204 above, before downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, the target service terminal can first determine whether the target query request was successfully queried based on the first target response message. For example, but not limited to, it can be determined based on the result status field in the first target response message. If the query corresponding to the target query request is successful, it means that the target organization has completed the target query task corresponding to the target query request, generated the corresponding target file, and sent the target file to the front-end machine. Then, the target service terminal can directly and successfully download the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization.
[0123] In some possible embodiments, after receiving the first target response message returned by the front-end machine based on the target query request, in the above-described S204, before downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, the target service terminal may first determine whether file parsing is required based on the first target response message. For example, but not limited to, it may determine whether the target query request was successfully queried and the query result is not empty based on the first target response message. If the query corresponding to the target query request is successful and the query result is not empty, it means that the target organization has completed the target bill query task corresponding to the target query request, generated the corresponding target file, and sent the target file to the front-end machine. If file parsing is required, the target service terminal can directly download the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization.
[0124] Please refer to the following. Figure 6 This is a schematic diagram illustrating the overall implementation process of a file parsing method provided in an exemplary embodiment of this specification. Figure 6As shown, after the allocation center (backend) corresponding to the target business end initiates a bill subscription, the target business end (payment core) will accept the bill subscription and publish the corresponding bill subscription event. When the current target business end (payment core) executes the bill subscription event, it will initiate the corresponding channel bill query, that is, send the corresponding target bill query request to the front-end machine corresponding to the target bank, and obtain the first target response message returned by the target bank for the target bill query request through the front-end machine communication machine in the front-end machine. If the target bank generates the corresponding target bill file based on the target bill query request and returns it to the front-end machine communication machine, the front-end machine communication machine will also automatically synchronize the target bill file to the front-end machine SFTP server for the target business end to download. The target business end will also perform result status parsing based on the first target response message returned by the front-end machine, that is, determine whether the query was successful, whether there is a query result, and whether file parsing is required. If the query is successful and the query is completed, a query completion message can be sent to the allocation center. If file parsing is required, the corresponding target bill file can be downloaded from the front-end machine. The specific implementation process is as follows. Figure 2 The corresponding process descriptions will not be repeated here. Figure 6 For details on blocking downloads and determining whether to execute a download, please refer to the optional description in S204, which will not be repeated here. Figure 6 For details on the implementation process of assembling billing data, please refer to S404 above; it will not be repeated here. The allocation center (backend) corresponding to the target business end can also process billing messages such as query result messages, query exception messages, or billing data sent by the target business end (payment core), so that the business party corresponding to the target business end (payment core) can view the billing messages corresponding to the bill subscription from the allocation center (backend).
[0125] Please refer to the following. Figure 7 This is a schematic diagram of a file parsing device provided in an exemplary embodiment of this specification. Figure 7 As shown, the file parsing device 700 includes:
[0126] Sending module 710 is used to send a target query request to the front-end machine corresponding to the target organization;
[0127] The file download module 720 is used to download the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization.
[0128] The file parsing module 730 is used to parse the target file based on the file parsing configuration corresponding to the target organization to obtain the target parsing text;
[0129] The determination module 740 is used to determine the target response data corresponding to the target query request based on the target parsed text.
[0130] In one possible implementation, the file download module 720 described above is specifically used for:
[0131] When the duration of sending the target query request to the aforementioned front-end machine reaches the target duration, the target file corresponding to the target query request is downloaded from the aforementioned front-end machine based on the file download configuration corresponding to the target organization.
[0132] In one possible implementation, the aforementioned file parsing device 700 further includes:
[0133] The download retry module is used to re-execute the above steps based on the file download configuration corresponding to the above target organization and download the target file corresponding to the above target query request from the above front-end machine if the above target file fails to download, until the above target file is successfully downloaded or the number of downloads of the above target file exceeds the target number, and then the download of the above target file ends.
[0134] In one possible implementation, the file parsing device 700 further includes:
[0135] The receiving module is used to receive the first target response message returned by the aforementioned front-end machine based on the aforementioned target query request;
[0136] The aforementioned determining module 740 is specifically used for:
[0137] The target parsing text is fed back into the first target response message to obtain the second target response message; the target data in the second target response message is mapped according to the target mapping relationship to obtain the target response data corresponding to the target query request; the target mapping relationship is used to characterize the correspondence between the data in the response messages of each institution and the response data.
[0138] In one possible implementation, the file parsing device 700 further includes:
[0139] The first judgment module is used to determine whether the above-mentioned second target response message needs to be parsed for multiple fields;
[0140] The multi-domain string parsing module is used to perform multi-domain string parsing on the second target response message to obtain the third target response message if the condition is met.
[0141] The mapping module is used to map the target data in the third target response message according to the target mapping relationship to obtain the target response data corresponding to the target query request.
[0142] In one possible implementation, the file parsing device 700 further includes:
[0143] The second judgment module is used to determine whether the above target query request was successfully queried based on the above first target response message;
[0144] The file download module 720 mentioned above is specifically used for:
[0145] If so, then based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0146] In one possible implementation, the file parsing device 700 further includes:
[0147] The third judgment module is used to determine whether file parsing is required based on the first target response message mentioned above.
[0148] The file download module 720 mentioned above is specifically used for:
[0149] If so, then based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0150] In one possible implementation, the aforementioned file download configuration and file parsing configuration are located in a file parsing policy configuration table; the aforementioned file parsing policy configuration table includes file download configurations and file parsing configurations corresponding to multiple organizations.
[0151] The division of modules in the above-described file parsing device is for illustrative purposes only. In other embodiments, the file parsing device can be divided into different modules as needed to complete all or part of the functions of the file parsing device. The implementation of each module in the file parsing device provided in the embodiments of this specification can be in the form of a computer program. This computer program can run on a terminal or server. The program modules constituted by this computer program can be stored in the memory of the terminal or server. When the computer program is executed by a processor, it implements all or part of the steps of the file parsing method described in the embodiments of this specification.
[0152] Please refer to the following. Figure 8 This is a schematic diagram of the structure of an electronic device provided in an exemplary embodiment of this specification. Figure 8 As shown, the electronic device 800 may include: at least one processor 810, at least one communication bus 820, user interface 830, at least one network interface 840, and memory 850.
[0153] The communication bus 820 can be used to realize the connection and communication of the above components.
[0154] The user interface 830 may include a display screen and a camera. Optional user interfaces may also include standard wired interfaces and wireless interfaces.
[0155] The network interface 840 may optionally include a Bluetooth module, a Near Field Communication (NFC) module, a Wireless Fidelity (Wi-Fi) module, etc.
[0156] The processor 810 may include one or more processing cores. The processor 810 connects to various parts within the electronic device 800 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 850, and by calling data stored in the memory 850. Optionally, the processor 810 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 810 may integrate one or a combination of several of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor 810.
[0157] The memory 850 may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory 850 may include a non-transitory computer-readable medium. The memory 850 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 850 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as file download function, file parsing function, determination function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 850 may also be at least one storage device located remotely from the aforementioned processor 810. Figure 8 As shown, the memory 850, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and program instructions.
[0158] In some possible embodiments, the aforementioned electronic device 800 may be the aforementioned file parsing device, and the processor 810 may be used to call program instructions stored in the memory 850 and specifically perform the following operations:
[0159] Send a target query request to the front-end machine corresponding to the target organization.
[0160] Based on the file download configuration corresponding to the aforementioned target organization, the target file corresponding to the aforementioned target query request is downloaded from the aforementioned front-end machine.
[0161] Based on the file parsing configuration corresponding to the target organization, the target file is parsed to obtain the target parsed text.
[0162] Based on the above target parsing text, the target response data corresponding to the above target query request is determined.
[0163] In some possible embodiments, when the processor 810 executes the file download configuration based on the target organization and downloads the target file corresponding to the target query request from the front-end machine, it specifically performs the following:
[0164] When the duration of sending the target query request to the aforementioned front-end machine reaches the target duration, the target file corresponding to the target query request is downloaded from the aforementioned front-end machine based on the file download configuration corresponding to the target organization.
[0165] In some possible embodiments, after the processor 810 executes the file download configuration based on the target organization and downloads the target file corresponding to the target query request from the front-end machine, it is further configured to execute:
[0166] If the target file download fails, the above steps based on the file download configuration corresponding to the target organization will be executed again to download the target file corresponding to the target query request from the front-end machine until the target file is successfully downloaded or the number of downloads of the target file exceeds the target number, at which point the download of the target file will end.
[0167] In some possible embodiments, after the processor 810 executes the above-mentioned sending of the target query request to the front-end machine corresponding to the target institution, and before executing the above-mentioned file download configuration based on the target institution and downloading the target file corresponding to the target query request from the front-end machine, it is further configured to execute:
[0168] Receive the first target response message returned by the aforementioned front-end machine based on the aforementioned target query request.
[0169] When the processor 810 executes the above-mentioned determination of the target response data corresponding to the target query request based on the above-mentioned target parsed text, it specifically performs the following:
[0170] The target parsed text is then fed back into the first target response message to obtain the second target response message.
[0171] According to the target mapping relationship, the target data in the second target response message is mapped to obtain the target response data corresponding to the target query request. The target mapping relationship is used to characterize the correspondence between the data in the response message of each institution and the response data.
[0172] In some possible embodiments, after the processor 810 performs the above-mentioned action of backfeeding the target parsed text into the first target response message to obtain the second target response message, it is further configured to perform:
[0173] Determine whether the second target response message mentioned above needs to undergo multi-field string parsing.
[0174] If so, then perform multi-field string parsing on the second target response message to obtain the third target response message.
[0175] According to the target mapping relationship, the target data in the third target response message is mapped to obtain the target response data corresponding to the target query request.
[0176] In some possible embodiments, after the processor 810 executes the above-mentioned receiving of the first target response message returned by the front-end machine based on the target query request, and before the above-mentioned downloading of the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution, it is further configured to execute:
[0177] Based on the first target response message mentioned above, determine whether the target query request was successful.
[0178] When the processor 810 executes the file download configuration based on the target organization and downloads the target file corresponding to the target query request from the front-end machine, it specifically performs the following:
[0179] If so, then based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0180] In some possible embodiments, after the processor 810 executes the above-mentioned receiving of the first target response message returned by the front-end machine based on the target query request, and before executing the above-mentioned file download configuration based on the target organization and downloading the target file corresponding to the target query request from the front-end machine, it is further configured to execute:
[0181] Based on the first target response message mentioned above, determine whether file parsing is required.
[0182] When the processor 810 executes the file download configuration based on the target organization and downloads the target file corresponding to the target query request from the front-end machine, it specifically performs the following:
[0183] If so, then based on the file download configuration corresponding to the target organization, download the target file corresponding to the target query request from the front-end machine.
[0184] In some possible embodiments, the above-mentioned file download configuration and file parsing configuration are located in the file parsing policy configuration table; the above-mentioned file parsing policy configuration table includes file download configuration and file parsing configuration corresponding to each of multiple organizations.
[0185] This specification also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform one or more steps in the above embodiments. If the constituent modules of the above-described file parsing apparatus are implemented as software functional units and sold or used as independent products, they can be stored in the above-described computer-readable storage medium.
[0186] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this specification are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The aforementioned available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., Solid State Disks (SSDs)).
[0187] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and its implementation can be combined arbitrarily.
[0188] The embodiments described above are merely preferred embodiments of this specification and are not intended to limit the scope of this specification. Any modifications and improvements made by those skilled in the art to the technical solutions of this specification without departing from the spirit of this specification should fall within the protection scope defined by the claims.
[0189] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims and specification may be performed in a different order than in the embodiments described in the specification and still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A file parsing method, the method comprising: Send a target query request to the front-end machine corresponding to the target organization; Based on the file download configuration corresponding to the target institution, download the target file corresponding to the target query request from the front-end machine; The target file is parsed based on the file parsing configuration corresponding to the target organization to obtain the target parsed text; Based on the target parsed text, determine the target response data corresponding to the target query request; After sending the target query request to the front-end machine corresponding to the target institution, and before downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution, the method further includes: Receive the first target response message returned by the front-end machine based on the target query request; The step of determining the target response data corresponding to the target query request based on the target parsed text includes: The target parsed text is then pushed back into the first target response message to obtain the second target response message; According to the target mapping relationship, the target data in the second target response message is mapped to obtain the target response data corresponding to the target query request; the target mapping relationship is used to characterize the correspondence between the data in the response message of each institution and the response data.
2. The method as described in claim 1, wherein downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution includes: When the duration of sending the target query request to the front-end machine reaches the target duration, the target file corresponding to the target query request is downloaded from the front-end machine based on the file download configuration corresponding to the target institution.
3. The method as described in claim 1 or 2, after downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution, the method further includes: If the target file download fails, the step of downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution is executed again until the target file is successfully downloaded or the number of downloads of the target file exceeds the target number, at which point the download of the target file ends.
4. The method as described in claim 1, wherein after backfeeding the target parsed text into the first target response message to obtain the second target response message, the method further includes: Determine whether the second target response message needs to undergo multi-field string parsing; If so, then perform multi-field string parsing on the second target response message to obtain the third target response message; According to the target mapping relationship, the target data in the third target response message is mapped to obtain the target response data corresponding to the target query request.
5. The method as described in claim 1, wherein after receiving the first target response message returned by the front-end machine based on the target query request, and before downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, the method further includes: Based on the first target response message, determine whether the target query request was successful; The step of downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution includes: If so, then based on the file download configuration corresponding to the target organization, the target file corresponding to the target query request is downloaded from the front-end machine.
6. The method as described in claim 1, wherein after receiving the first target response message returned by the front-end machine based on the target query request, and before downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target organization, the method further includes: Determine whether file parsing is required based on the first target response message; The step of downloading the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution includes: If so, then based on the file download configuration corresponding to the target organization, the target file corresponding to the target query request is downloaded from the front-end machine.
7. The method as described in claim 1, wherein the file download configuration and the file parsing configuration are located in the file parsing strategy configuration table; the file parsing strategy configuration table includes file download configurations and file parsing configurations corresponding to multiple organizations.
8. A file parsing apparatus, the apparatus comprising: The sending module is used to send target query requests to the front-end machine corresponding to the target organization; The file download module is used to download the target file corresponding to the target query request from the front-end machine based on the file download configuration corresponding to the target institution. The file parsing module is used to parse the target file based on the file parsing configuration corresponding to the target organization to obtain the target parsed text; The determination module is used to determine the target response data corresponding to the target query request based on the target parsed text; The device further includes: The receiving module is used to receive the first target response message returned by the front-end machine based on the target query request; The determining module is specifically used to: push the target parsed text back into the first target response message to obtain the second target response message; map the target data in the second target response message according to the target mapping relationship to obtain the target response data corresponding to the target query request; the target mapping relationship is used to characterize the correspondence between the data in the response message of each institution and the response data.
9. An electronic device, comprising: Processor and memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code stored in the memory to perform the method as described in any one of claims 1-7.
10. A computer storage medium storing a plurality of instructions adapted for loading by a processor and performing the method steps of any one of claims 1-7.
11. A computer program product comprising instructions that, when run on a computer or processor, cause the computer or processor to perform the method as described in any one of claims 1-7.