Method, apparatus and device for processing file

CN116996499BActive Publication Date: 2026-09-22INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310841273.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2026-09-22
Estimated Expiration
2043-07-10

AI Technical Summary

Technical Problem

[0005]本申请提供一种文件的处理方法、装置及设备,用以解决文件下载不及时的技术问题

Benefits of technology

[0041]第四方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现第一方面所述的方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116996499B_ABST
    Figure CN116996499B_ABST
Patent Text Reader

Abstract

The application provides a file processing method, device and equipment, and relates to data processing technology. The method comprises the following steps: obtaining a file download request, and sending the file download request to a server; wherein the file download request comprises a download type identifier and download request information. Based on the file download request, a download mode corresponding to the download type identifier is determined. According to the download mode, the local file and / or the server file are monitored to obtain monitoring information. If the server receives the download request information and determines that there are multiple files to be transmitted according to the download request information, then according to the download mode, the multiple files to be transmitted sent by the server are received, and based on the monitoring information, new files in the multiple files to be transmitted are downloaded to obtain the new files. The method of the application realizes incremental downloading, is simple to deploy and convenient to use, effectively improves the timeliness and convenience of file transmission, and solves the technical problem of untimely file downloading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data processing technology, and more particularly to a method, apparatus, and device for processing documents. Background Technology

[0002] Currently, banks and other enterprises have numerous file transfer scenarios for customers. For example, the Bank Account Electronic Receipt service is designed to meet the needs of enterprises in the process of receiving and recording payments, by outputting account details, electronic receipts, and statements to customers through API interfaces.

[0003] In existing technologies, most small and medium-sized customers need to log in to a designated server download tool to download files in real time from a server.

[0004] However, in existing technologies, customers need to log in to a designated server download tool to download files. Such tools can only achieve simple server connections and file downloads. Users need to manually connect and manually identify the files they need to download. This requires customers to send dedicated personnel to spend a lot of time every day to complete this task, and it is impossible to obtain the latest files in real time, resulting in untimely file downloads. Summary of the Invention

[0005] This application provides a method, apparatus, and device for processing files to solve the technical problem of untimely file downloads.

[0006] Firstly, this application provides a method for processing documents, including:

[0007] A file download request is obtained, and the file download request is sent to the server; wherein, the file download request includes a download type identifier and download request information, and the download request information is used to obtain the file from the server;

[0008] Based on the file download request, a download mode corresponding to the download type identifier is determined; wherein, the download mode represents download rule information under different download types;

[0009] Based on the download mode, monitor the local files and / or the files on the server to obtain monitoring information;

[0010] If the server receives the download request information and determines that there are multiple files to be transferred based on the download request information, then according to the download mode, it receives the multiple files to be transferred sent by the server, and based on the monitoring information, downloads the newly added file among the multiple files to be transferred, and obtains the newly added file.

[0011] Furthermore, the step of monitoring local files and / or files on the server according to the download mode to obtain monitoring information includes:

[0012] If the download mode is determined to be the immediate download mode, then the local files are monitored to obtain monitoring information about the local files.

[0013] Further, the step of receiving multiple files to be transmitted from the server according to the download mode, and downloading newly added files from the multiple files to be transmitted based on the monitoring information, and obtaining the newly added files, includes:

[0014] According to the immediate download mode, the system receives multiple files to be transferred from the server, and determines new files among the multiple files to be transferred based on the existing files on the local machine indicated by the monitoring information.

[0015] Download the newly added file from the plurality of files to be transferred, and obtain the newly added file.

[0016] Furthermore, the step of monitoring local files and / or files on the server according to the download mode to obtain monitoring information includes:

[0017] If the download mode is determined to be real-time synchronization mode, then within a preset time period, the local files and the files on the server are monitored to obtain monitoring information.

[0018] Further, the step of receiving multiple files to be transmitted from the server according to the download mode, and downloading newly added files from the multiple files to be transmitted based on the monitoring information, and obtaining the newly added files, includes:

[0019] Based on the real-time synchronization mode, the existing files on the local machine indicated by the monitoring information, and the files on the server, if a new file is detected on the server within a preset time period, the new file is downloaded and obtained.

[0020] Furthermore, the method also includes:

[0021] Obtain a file push request and send the file push request to the server; wherein, the file push request includes push request information, which is used to obtain unsaved files in the server;

[0022] Based on the file push request, obtain and download the unsaved file from the server.

[0023] Secondly, this application provides a document processing apparatus, comprising:

[0024] The first acquisition unit is used to acquire a file download request and send the file download request to the server; wherein, the file download request includes a download type identifier and download request information, and the download request information is used to acquire the file in the server;

[0025] The determining unit is configured to determine a download mode corresponding to the download type identifier based on the file download request; wherein the download mode represents download rule information under different download types;

[0026] The monitoring unit is used to monitor local files and / or files on the server according to the download mode, and obtain monitoring information;

[0027] The download unit is configured to, if the server receives the download request information and determines that there are multiple files to be transmitted based on the download request information, receive the multiple files to be transmitted sent by the server according to the download mode, and download the newly added file among the multiple files to be transmitted based on the monitoring information, thereby obtaining the newly added file.

[0028] Furthermore, the monitoring unit is specifically used for:

[0029] If the download mode is determined to be the immediate download mode, then the local files are monitored to obtain monitoring information about the local files.

[0030] Furthermore, the download unit includes:

[0031] The determination module is used to receive multiple files to be transmitted sent by the server according to the immediate download mode, and determine the newly added files among the multiple files to be transmitted based on the existing files indicated by the monitoring information on the local machine.

[0032] The download module is used to download new files from the plurality of files to be transmitted, and to obtain the new files.

[0033] Furthermore, the monitoring unit is specifically used for:

[0034] If the download mode is determined to be real-time synchronization mode, then within a preset time period, the local files and the files on the server are monitored to obtain monitoring information.

[0035] Furthermore, the download unit is specifically used for:

[0036] Based on the real-time synchronization mode, the existing files on the local machine indicated by the monitoring information, and the files on the server, if a new file is detected on the server within a preset time period, the new file is downloaded and obtained.

[0037] Furthermore, the device also includes:

[0038] A file push unit is used to obtain a file push request and send the file push request to the server; wherein, the file push request includes push request information, and the push request information is used to obtain unsaved files in the server;

[0039] The second acquisition unit is used to acquire and download unsaved files from the server based on the file push request.

[0040] Thirdly, this application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method described in the first aspect.

[0041] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in the first aspect.

[0042] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect.

[0043] This application provides a file processing method, apparatus, and device. The method involves acquiring a file download request and sending it to a server. The file download request includes a download type identifier and download request information, whereby the download request information is used to acquire files from the server. Based on the file download request, a download mode corresponding to the download type identifier is determined. The download mode represents download rule information under different download types. According to the download mode, local files and / or files on the server are monitored to obtain monitoring information. If the server receives the download request information and determines that multiple files are to be transferred, it receives the multiple files to be transferred from the server according to the download mode, and downloads any newly added files from the multiple files to be transferred based on the monitoring information. In this solution, after acquiring and sending a file download request to the server, a download mode corresponding to the download type identifier is determined based on the file download request. Then, according to the download mode, local files and / or files on the server are monitored to obtain monitoring information. If the server receives a download request and determines that multiple files are to be transferred, it receives the files from the server according to the download mode. Based on the locally downloaded files and / or existing files on the server as indicated by monitoring information, it identifies any new files among the files to be transferred and downloads them. Therefore, for client transfer scenarios involving various types of files on the server, new files can be downloaded synchronously in real time, achieving incremental downloading. This is simple to deploy, easy to use, effectively improves the timeliness and convenience of file transfer, and solves the technical problem of untimely file downloads. Attached Figure Description

[0044] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0045] Figure 1 A flowchart illustrating a document processing method provided in an embodiment of this application;

[0046] Figure 2 A schematic diagram illustrating a file processing method provided in an embodiment of this application;

[0047] Figure 3 A schematic diagram illustrating another file processing method provided in an embodiment of this application;

[0048] Figure 4 A flowchart illustrating another document processing method provided in this application embodiment;

[0049] Figure 5 A schematic diagram illustrating another file processing method provided in this application embodiment;

[0050] Figure 6 A flowchart illustrating the graphical user interface provided in an embodiment of this application;

[0051] Figure 7 This is a schematic diagram of the structure of a document processing apparatus provided in an embodiment of this application;

[0052] Figure 8 A schematic diagram of another document processing apparatus provided in an embodiment of this application;

[0053] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0054] Figure 10 This is a block diagram of an electronic device provided in an embodiment of this application.

[0055] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0056] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure.

[0057] It should be noted that the user information and data involved in this application (including but not limited to data used for analysis, stored data, and displayed data) are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of the relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0058] In other words, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0059] Currently, banks and other enterprises have numerous file transfer scenarios for customers. For example, the Bank Account Electronic Receipt service is designed to meet the needs of enterprises in the process of receiving and recording payments, by outputting account details, electronic receipts, and statements to customers through API interfaces.

[0060] In one example, many small and medium-sized customers need to log in to a designated server download tool to download files in real time from a server. However, these customers often lack the capability to interface with the server's API. To download files in real time, they need to outsource the development of an API interface or use existing server connection and download tools. However, current technology only allows for simple server connections and file downloads; users must manually connect and identify the files to download. This requires customers to dedicate significant time each day to this task, and it doesn't provide real-time access to the latest files.

[0061] In one example, because the server only stores files from the last three days, customers who want to download historical data need to go to a branch and manually fill out an application form. This process is extremely inconvenient and increases the workload of the branches, making the file download process quite cumbersome.

[0062] This application provides a document processing method, apparatus, and device, which aims to solve the above-mentioned technical problems of the prior art.

[0063] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0064] Figure 1 A flowchart illustrating a file processing method provided in an embodiment of this application is shown below. Figure 1 As shown, the method includes:

[0065] Step 101: Obtain a file download request and send it to the server; the file download request includes a download type identifier and download request information, which is used to obtain the file from the server.

[0066] For example, the executing entity of this embodiment can be an electronic device, a terminal device, a file processing device, or other device or apparatus capable of executing this embodiment, and there is no limitation thereto. In this embodiment, the executing entity is described as an electronic device.

[0067] First, the electronic device includes a front-end graphical user interface, which is implemented in Python and uses Tkinter to enable user interaction. The graphical user interface provides two tabs, which respectively enable front-end interaction for scenarios such as automatic download of electronic receipts and electronic receipt resubmission. Figure 2 This is a schematic diagram of a file processing method provided in an embodiment of this application, such as... Figure 2As shown, the graphical user interface includes a "Automatic Download of Electronic Receipts" page and a "Refresh of Electronic Receipts" page. Specifically, the "Automatic Download of Electronic Receipts" page includes a server information link (the server refers to the server containing the file to be downloaded, including server address, server port, and server path), a user information link (username, SFTP login key, and a "Select Path" button for the SFTP login key), a local options link (local storage path of the receipt, a "Select Path" button for the local storage path of the receipt, and whether to filter the check.sign file), a "Save Parameters" button, a "Download Now" button, and a "Real-time Synchronization" button. Both the server information link and the user information link are obtained by the user branch when applying for a corporate account. Figure 3 A schematic diagram illustrating another file processing method provided in this application embodiment, such as... Figure 3 As shown, the "Electronic Receipt Re-push" page includes: APPID, Select Key File, "Select Path" button for Select Key File, First-Level Partner ID, Agreement Number, "Get Agreement Number and Account" button for Agreement Number, Account, Re-push Start Date, Re-push End Date, "Save Parameters" button, and "Start Re-push" button. It also displays "Number of Re-push Requests Submitted Today and Remaining Requests." The APPID, Select Key File, Agreement Number, and Account are all obtained from the enterprise account used for the application. The key file in this case is different from the SFTP login key on the "Automatic Download of Electronic Receipts" page. The First-Level Partner ID refers to the user's own ID. The Re-push Start Date and Re-push End Date can be customized by the user. The "Save Parameters" button saves the information on the current page. The "Start Re-push" button re-pushes unsaved files on the server and retrieves the retrieved unsaved files.

[0068] In this step, on the "Automatic Download of Electronic Receipts" page, if the user fills in the relevant information and clicks the "Download Now" button, a file download request is obtained and sent to the server. The file download request includes a download type identifier and download request information. The download type identifier is for the "Download Now" type, and the download request information is used to retrieve the file from the server. Alternatively, if the user clicks the "Real-time Synchronization" button, a file download request is obtained and sent to the server. The file download request includes a download type identifier and download request information. The download type identifier is for the "Real-time Synchronization" type, and the download request information is used to retrieve the file from the server.

[0069] It should be noted that, to ensure successful user connection, the system automatically tests the connection between the electronic device and the server after the user clicks the "Save Parameters" button. If the connection is successful, the download can proceed; if the connection fails, the user will be prompted to modify the relevant information. Furthermore, the front-end graphical interface can be minimized to the system tray and has an auto-start function, ensuring seamless background operation of synchronized downloads; it can save all parameters and options based on the "Save Parameters" button; and it has complete log records to facilitate problem identification for customers.

[0070] Step 102: Based on the file download request, determine the download mode corresponding to the download type identifier; wherein, the download mode represents the download rule information under different download types.

[0071] For example, the download mode represents download rule information under different download types. For instance, download types include immediate download type and real-time synchronization type, and download modes include immediate download mode corresponding to the immediate download type and real-time synchronization mode corresponding to the real-time synchronization type. The electronic device determines the download mode corresponding to the download type identifier based on the file download request.

[0072] Step 103: Based on the download mode, monitor the local files and / or the files on the server to obtain monitoring information.

[0073] For example, if the download mode is determined to be immediate download mode, then local files are monitored to obtain monitoring information about the local files. Alternatively, if the download mode is determined to be real-time synchronization mode, then local files and server files are monitored within a preset time period to obtain monitoring information.

[0074] Step 104: If the server receives the download request information and determines that there are multiple files to be transferred based on the download request information, then according to the download mode, it receives the multiple files to be transferred sent by the server, and based on the monitoring information, downloads the newly added files among the multiple files to be transferred, and obtains the newly added files.

[0075] For example, the download mode is the immediate download mode. If the server receives a download request and determines that there are multiple files to be transferred based on the download request, then it receives the multiple files to be transferred sent by the server according to the immediate download mode. Based on the existing files indicated by the monitoring information, it identifies identical files among the multiple files to be transferred, and identifies files other than identical files as newly added files. It then downloads the newly added files among the multiple files to be transferred, thus obtaining the newly added files.

[0076] Alternatively, the download mode can be real-time synchronization. Based on real-time synchronization, monitoring information indicating local files and files on the server, if a new file is detected on the server within a preset time period, the new file will be downloaded. Therefore, both download modes perform incremental downloads, meaning only files not yet available on the user's local machine are downloaded.

[0077] In this embodiment, a file download request is obtained and sent to the server. The file download request includes a download type identifier and download request information, the latter used to retrieve files from the server. Based on the file download request, a download mode corresponding to the download type identifier is determined. The download mode represents download rule information under different download types. According to the download mode, local files and / or server files are monitored to obtain monitoring information. If the server receives the download request information and determines that multiple files are to be transferred, it receives the multiple files to be transferred from the server according to the download mode, and downloads any newly added files based on the monitoring information. In this scheme, after obtaining and sending a file download request to the server, a download mode corresponding to the download type identifier is determined based on the file download request. Then, according to the download mode, local files and / or server files are monitored to obtain monitoring information. If the server receives a download request and determines that multiple files are to be transferred, it receives the files from the server according to the download mode. Based on the locally downloaded files and / or existing files on the server as indicated by monitoring information, it identifies any new files among the files to be transferred and downloads them. Therefore, for client transfer scenarios involving various types of files on the server, new files can be downloaded synchronously in real time, achieving incremental downloading. This is simple to deploy, easy to use, effectively improves the timeliness and convenience of file transfer, and solves the technical problem of untimely file downloads.

[0078] Figure 4 A flowchart illustrating another document processing method provided in this application embodiment is shown below. Figure 4 As shown, the method includes:

[0079] Step 201: Obtain a file download request and send the file download request to the server; wherein, the file download request includes a download type identifier and download request information, and the download request information is used to obtain the file from the server.

[0080] For example, this step can be referred to Figure 1 Step 101 in the text will not be repeated here.

[0081] Step 202: Based on the file download request, determine the download mode corresponding to the download type identifier; wherein, the download mode represents the download rule information under different download types.

[0082] For example, the download mode represents download rule information under different download types. For instance, download types include immediate download type and real-time synchronization type, and download modes include immediate download mode corresponding to the immediate download type and real-time synchronization mode corresponding to the real-time synchronization type. The electronic device determines the download mode corresponding to the download type identifier based on the file download request.

[0083] Step 203: Based on the download mode, monitor the local files and / or the files on the server to obtain monitoring information.

[0084] Step 203 includes the following two implementation methods:

[0085] The first implementation of step 203: If the download mode is determined to be the immediate download mode, then monitor the local files and obtain monitoring information about the local files.

[0086] The second implementation method of step 203: If the download mode is determined to be real-time synchronization mode, then within a preset time period, the local files are monitored and the files on the server are monitored to obtain monitoring information.

[0087] For example, if the download mode is determined to be immediate download mode, the electronic device monitors the local files and obtains monitoring information about them. Alternatively, if the download mode is determined to be real-time synchronization mode, the local files and the server files are monitored within a preset time period, and monitoring information is obtained. The preset time period can be user-defined or a default setting; there is no limitation on its specific setting.

[0088] Step 204: If the server receives the download request information and determines that there are multiple files to be transferred based on the download request information, then according to the download mode, it receives the multiple files to be transferred sent by the server, and based on the monitoring information, downloads the newly added files among the multiple files to be transferred, and obtains the newly added files.

[0089] Step 204 includes the following two implementation methods:

[0090] The first implementation of step 204 is as follows: According to the immediate download mode, receive multiple files to be transferred sent by the server, and determine the new file among the multiple files to be transferred based on the existing files indicated by the monitoring information; download the new file among the multiple files to be transferred to obtain the new file.

[0091] The second implementation method of step 204: Based on the real-time synchronization mode, the local files indicated by the monitoring information and the files in the server, if a new file is detected on the server within a preset time period, the new file is downloaded and obtained.

[0092] For example, if the server receives a download request and determines that there are multiple files to be transferred, the server will send the multiple files to the electronic device. The electronic device, according to the download mode, receives the multiple files to be transferred sent by the server, and based on the downloaded files indicated by monitoring information, identifies duplicate files among the multiple files to be transferred that are identical to the already downloaded files. It then downloads the newly added files among the multiple files to be transferred, thus obtaining the new files.

[0093] In the first method of downloading newly added files, the electronic device can receive multiple files to be transferred from the server in an immediate download mode. Based on the locally downloaded files indicated by monitoring information, it identifies duplicate files that are identical to the already downloaded files among the multiple files to be transferred. Then, it identifies the files other than the duplicate files as newly added files. Finally, it automatically downloads the newly added files from the multiple files to be transferred, thus obtaining the newly added files.

[0094] For example, if monitoring information indicates that a receipt file from the 18th exists locally, the electronic device will receive receipt files from the server for the 18th, 19th, and 20th. Based on the monitoring information indicating the existence of the receipt file from the 18th, it will determine that the receipt files from the 19th and 20th are newly added files and will only download those. Finally, after the download is complete, the system can also prompt the user whether the download was successful, as well as the number of files successfully downloaded and a list of successfully downloaded files.

[0095] In the second method of downloading newly added files, the electronic device, based on the real-time synchronization mode, the local files indicated by the monitoring information, and the files on the server, if a newly generated file is detected on the server within a preset time period that is different from the local files and different from the files on the server, then the newly generated file is determined to be a newly added file, and the newly added file is automatically downloaded to obtain the newly added file.

[0096] For example, monitoring information indicates that there are receipt files for the 18th locally, and receipt files for the 18th, 19th, and 20th on the server. If a newly generated file for the 21st is detected on the server within a preset time period, since the newly generated file on the 21st is different from both the local and server files, it is determined to be a newly added file, and only the newly generated file on the 21st will be downloaded. Finally, after the download is complete, the system can also prompt the user whether the download was successful, as well as the number of files successfully downloaded and a list of successfully downloaded files.

[0097] Step 205: Obtain a file push request and send the file push request to the server; wherein, the file push request includes push request information, which is used to obtain unsaved files in the server.

[0098] For example, such as Figure 3 As shown, the "Electronic Receipt Re-push" page allows you to initiate a re-push. Re-push refers to retrieving data that has disappeared before the preset number of days, since the server only stores data for the most recent preset number of days.

[0099] In this step, if the user fills in the relevant information on the "Electronic Receipt Re-push" page and clicks the "Start Re-push" button, the electronic device obtains the file re-push request and sends the file re-push request to the server. The file re-push request includes re-push request information, including the re-push start date and the re-push end date.

[0100] Step 206: Based on the file push request, obtain and download the unsaved file from the server.

[0101] For example, after an electronic device initiates a file push request, no further action is required; the file pushed by the server is automatically downloaded to the local device as soon as it arrives. Alternatively, as... Figure 2 As shown, users can manually download the files on the "Automatic Download of Electronic Receipts" page. For example, users can download the supplementary files using the "Download Now" mode or the "Real-time Synchronization" mode; there are no restrictions on the method of obtaining the supplementary files. Meanwhile, to conserve server resources, there is a daily limit on the number of supplementary downloads for this interface. The "Electronic Receipt Supplementary Download" page clearly displays the remaining number of downloads for the user's current account for the day and updates in real time after each successful supplementary download.

[0102] In this embodiment, a file download request is obtained and sent to the server. The file download request includes a download type identifier and download request information, which is used to retrieve files from the server. Based on the file download request, a download mode corresponding to the download type identifier is determined. The download mode represents download rule information under different download types. According to the download mode, local files and / or files on the server are monitored to obtain monitoring information. If the server receives the download request information and determines that multiple files are to be transferred, it receives the multiple files to be transferred from the server according to the download mode, and downloads any newly added files from the multiple files to be transferred based on the monitoring information. A file re-push request is obtained and sent to the server. The file re-push request includes re-push request information, which is used to retrieve unsaved files from the server. According to the file re-push request, the unsaved files from the server are retrieved and downloaded. Therefore, for client-side file transfer scenarios involving various types of files on a server under the SFTP protocol, new files can be downloaded synchronously in real time, achieving incremental downloading. This is simple to deploy, easy to use, and effectively improves the timeliness and convenience of file transfer, solving the technical problem of untimely file downloads. Furthermore, it implements a complete process including real-time synchronous download, historical file re-uploading, and various scenario switching, significantly reducing the difficulty of interface integration and improving the development process for expanding use cases, achieving minimal development, minimal promotion, and minimal maintenance costs. It improves upon the traditional method of simply connecting to a server based on the SFTP protocol for downloading, incorporating technologies such as Paramiko and Watchdog, and implementing server-side response to user file re-uploading requests, thus forming a complete server file synchronous download process to meet users' needs for seamless operation, timely access, and convenient re-uploading.

[0103] Based on the above embodiments, this application provides an architecture for a file processing method, which includes: a synchronous transmission module, a server API response module, a persistent bidirectional monitoring module, and a scene invocation module. Specifically, the functions of each module are as follows:

[0104] (I) Synchronous Transmission Module:

[0105] The synchronous transfer module, deployed on the electronic device, serves as the connection layer between the front-end graphical user interface and the server. It uses Paramiko to implement server connections and file transfers under the SFTP protocol. It implements the following functions:

[0106] Perform connection tests using parameters input by the user;

[0107] 1. Parse user RSA keys based on the SFTP protocol to achieve authentication and one-way file transfer under SFTP;

[0108] 2. Transmit the client's request parameters to the server via HTTP requests, such as protocol queries and push requests. For details on protocol queries, please refer to [link / reference]. Figure 3 On the "Electronic Receipt Reissue" page, there is a "Get Agreement Number and Account" button for the agreement number. If the user clicks this button, they can query the agreement number and account, which realizes the automatic retrieval of the agreement number and account to reduce user input.

[0109] 3. If the user clicks the "Download Now" button, the synchronization transfer module will be invoked immediately to download the file. If the user clicks the "Real-time Synchronization" button, the synchronization transfer module will be invoked to download the file in real time.

[0110] Compared to traditional SFTP file transfer tools, the synchronous transfer module in this application primarily improves the file transfer invocation mode, changing from "client-initiated, manual single-execution, indiscriminate download" to "automatically triggered download, real-time synchronous execution, incremental and filtered download." Specifically, the synchronous transfer module links the front-end graphical interface and the persistent bidirectional monitoring module. On the one hand, in real-time synchronization mode, a thread is created based on user-set time parameters to automatically maintain download tasks in the background. For example, if the user sets the daily automatic download period to 8:00 AM to 10:00 PM, an automatic download thread is created and remains active during that period, ready to trigger the download process at any time. On the other hand, the persistent bidirectional monitoring module monitors local and server files and, based on the comparison results of newly added files on the server and local files, triggers the download task as soon as a new file is created, achieving incremental download. Furthermore, it filters specific file types according to user needs, aiming to improve the convenience, real-time performance, and intelligence of file downloads.

[0111] (II) Server API Response Module:

[0112] The server API response module is deployed on the server side, implementing multiple Open API interfaces and providing external network access specifications. The interfaces use the HTTP protocol to receive requests from clients and return datasets or operation execution results, enabling the supplementary push of electronic receipts. Specifically, this includes:

[0113] 1. Verification and download interface for electronic receipts;

[0114] After receiving a user's file download request, the electronic receipt file verification and download interface checks whether the receipt file exists in the server path. If the receipt file exists, it is then transmitted to the next user.

[0115] Example of a file download request:

[0116] (The input fields are server address 'url', username 'user_name', key 'sign', and server path 'service_address'.)

[0117] Example of return:

[0118] (The returned fields are task number 'task_id', return message 'retmsg', return code 'retcode', filename 'filename', and transfer time 'datetime'). The return code indicates whether the execution was completed successfully.

[0119] 2. Customer agreement and account information query interface;

[0120] refer to Figure 3 On the "Electronic Receipt Reissue" page, there is a "Get Agreement Number and Account" button for the agreement number. The "Get Agreement Number and Account" button corresponds to a customer agreement and account information query interface. The customer agreement and account information query interface receives information such as the user's APPID and returns a JSON string of agreement and account information under the user's name.

[0121] Request example:

[0122] (Input fields are server address 'url', APPID 'app_id', key 'sign', and primary partner number 'corpno') Example returned:

[0123] (The returned fields are: first-level partner ID 'corpno', agreement number 'cino', account 'account', message code 'msgid', returned information 'retmsg', and returned code 'retcode').

[0124] 3. File push response interface.

[0125] The file push response interface receives the user's file push request, queries the corresponding historical data in the main data set on the server, and copies it to the server's transmission path to complete the push.

[0126] Request example:

[0127] (Input fields are server address 'url', APPID 'app_id', key 'sign', first-level partner number 'corpno', agreement number 'cino', account 'account', and start / end date of the supplementary push 'startdate / enddate').

[0128] Example of return:

[0129] (The returned fields are request number 'orderid', returned message 'retmsg', and returned code 'retcode')

[0130] The expression `{'orderid':'202303***','retmsg':'Submission successful. Please search for the receipt file in the shared directory based on the orderid','retcode':'0'}` indicates that the submission was successful and the process was completed correctly.

[0131] (III) Persistent Two-Way Monitoring Module

[0132] The persistent bidirectional monitoring module is built on top of the synchronous transmission module. It deploys bidirectional monitoring at the connection layer between the front-end interface and the server through a watchdog mechanism to monitor changes.

[0133] 1. Monitor the time and file information of the client (i.e., electronic device). Automatically restore the remaining push notification attempts at midnight each day; monitor downloaded files on the client and control the server to delete downloaded files in the specified path after a predetermined time delay to save space. For electronic receipt download scenarios, the corresponding file on the server will be deleted 24 hours after each successful download task. This is configured considering that users typically download receipt files once a day. Different deletion delay times can be configured for different business needs, and can be customized in the scenario call module database side mentioned later.

[0134] 2. Monitor the server-side upload path. Whenever a new file is added to the path, control the client's "real-time synchronization" mode to call the file transfer once, thereby achieving real-time download of the required files and greatly improving the timeliness of file download.

[0135] It should be noted that the persistent bidirectional monitoring module runs in a dedicated thread and does not affect the operation response of the graphical user interface in the main thread. The automatic download and push functions can be initiated simultaneously.

[0136] (iv) Scene Invocation Module

[0137] This server file download solution is based on the electronic receipt transmission business process, but it is not limited to this application scenario. It can be switched to various scenarios, including electronic account statements, ticket data transmission, voucher transmission, etc. This function is implemented through the scenario calling module.

[0138] The scenario invocation module integrates server parameters for various environments, including server address, port, path, API interface type, and address. This information is stored in the database for use by both the development and client sides. Any changes to data items can be synchronized in real time, eliminating the need for complex version updates and redistribution.

[0139] For the development process, this module provides a standardized reusable logic. Simply define the required API interfaces for new scenarios and maintain the scenario information in the database to add a new application scenario to this application. For the user experience, the solution is more convenient. Whether adding a new scenario or adjusting existing scenario parameters, there is no need to update the client version or distribute different customized versions to different users. The scenario database achieves unified and synchronized management of version parameters. Therefore, this application enables automatic switching between multiple sets of business scenario parameters, which can be easily applied to various types of file download scenarios, demonstrating high versatility.

[0140] For example, Figure 5 A schematic diagram illustrating another file processing method provided in this application embodiment; Figure 6 This is a flowchart illustrating the graphical user interface provided in an embodiment of this application.

[0141] Figure 7 This is a schematic diagram of the structure of a file processing device provided in an embodiment of this application, as shown below. Figure 7 As shown, the device includes:

[0142] The first acquisition unit 31 is used to acquire a file download request and send the file download request to the server; wherein, the file download request includes a download type identifier and download request information, and the download request information is used to acquire the file in the server.

[0143] The determining unit 32 is used to determine the download mode corresponding to the download type identifier based on the file download request; wherein, the download mode represents the download rule information under different download types.

[0144] The monitoring unit 33 is used to monitor local files and / or server files according to the download mode and obtain monitoring information.

[0145] Download unit 34 is used to receive multiple files to be transmitted from the server according to the download mode if the server receives download request information and determines that there are multiple files to be transmitted based on the download request information, and downloads the newly added file from the multiple files to be transmitted based on monitoring information.

[0146] The apparatus in this embodiment can execute the technical solutions in the above method. Its specific implementation process and technical principles are the same, and will not be repeated here.

[0147] Figure 8 This is a schematic diagram of the structure of another document processing apparatus provided in an embodiment of this application. Figure 7 Based on the illustrated embodiments, as Figure 8 As shown, monitoring unit 33 is specifically used for:

[0148] If the download mode is determined to be "immediate download mode", then the local files will be monitored to obtain monitoring information about the local files.

[0149] In one example, download unit 34 includes:

[0150] The determination module 341 is used to receive multiple files to be transferred sent by the server according to the immediate download mode, and to determine the new files among the multiple files to be transferred based on the existing files indicated by the monitoring information.

[0151] Download module 342 is used to download newly added files from multiple files to be transferred, and to obtain the newly added files.

[0152] In one example, monitoring unit 33 is specifically used for:

[0153] If the download mode is determined to be real-time synchronization mode, then within a preset time period, local files and server files will be monitored to obtain monitoring information.

[0154] In one example, download unit 34 is specifically used for:

[0155] Based on real-time synchronization mode and monitoring information indicating existing files locally and files on the server, if a new file is detected on the server within a preset time period, the new file will be downloaded and obtained.

[0156] In one example, the device also includes:

[0157] The file push unit 41 is used to obtain a file push request and send the file push request to the server; wherein, the file push request includes push request information, which is used to obtain unsaved files in the server.

[0158] The second acquisition unit 42 is used to acquire and download unsaved files from the server based on the file push request.

[0159] The apparatus in this embodiment can execute the technical solutions in the above method. Its specific implementation process and technical principles are the same, and will not be repeated here.

[0160] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 9As shown, the electronic device includes: a memory 51 and a processor 52.

[0161] The memory 51 stores a computer program that can run on the processor 52.

[0162] Processor 52 is configured to perform the methods provided in the embodiments described above.

[0163] The electronic device also includes a receiver 53 and a transmitter 54. The receiver 53 is used to receive instructions and data sent by an external device, and the transmitter 54 is used to send instructions and data to an external device.

[0164] Figure 10 This is a block diagram of an electronic device provided in an embodiment of this application. The electronic device may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0165] The device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.

[0166] Processing component 602 typically controls the overall operation of device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.

[0167] Memory 604 is configured to store various types of data to support the operation of device 600. Examples of such data include instructions for any application or method operating on device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0168] Power supply component 606 provides power to the various components of device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 600.

[0169] Multimedia component 608 includes a screen that provides an output interface between device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When device 600 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0170] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.

[0171] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0172] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of device 600. For example, sensor assembly 614 may detect the on / off state of device 600, the relative positioning of components such as the display and keypad of device 600, changes in the position of device 600 or a component of device 600, the presence or absence of user contact with device 600, the orientation or acceleration / deceleration of device 600, and temperature changes of device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0173] Communication component 616 is configured to facilitate wired or wireless communication between device 600 and other devices. Device 600 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0174] In an exemplary embodiment, the apparatus 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0175] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of the device 600 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0176] This application also provides a non-transitory computer-readable storage medium, which, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the methods provided in the above embodiments.

[0177] This application also provides a computer program product, which includes: a computer program stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to perform the solution provided in any of the above embodiments.

[0178] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0179] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for processing files, characterized in that, include: A file download request is obtained, and the file download request is sent to the server; wherein, the file download request includes a download type identifier and download request information, and the download request information is used to obtain the file from the server; Based on the file download request, a download mode corresponding to the download type identifier is determined; wherein, the download mode represents download rule information under different download types; the download mode includes an immediate download mode or a real-time synchronization mode; Based on the download mode, monitor the local files and / or the files on the server to obtain monitoring information; If the download mode is immediate download mode, the local files are monitored to obtain monitoring information about the existing local files; if the download mode is real-time synchronization mode, the local files and the files on the server are monitored within a preset time period to obtain monitoring information. If the server receives the download request information and determines that there are multiple files to be transferred based on the download request information, then according to the download mode, it receives the multiple files to be transferred sent by the server, and based on the monitoring information, downloads the newly added file among the multiple files to be transferred, and obtains the newly added file.

2. The method according to claim 1, characterized in that, The step of receiving multiple files to be transmitted from the server according to the download mode, and downloading newly added files from the multiple files to be transmitted based on the monitoring information, and obtaining the newly added files, includes: According to the immediate download mode, the system receives multiple files to be transferred from the server, and determines new files among the multiple files to be transferred based on the existing files on the local machine indicated by the monitoring information. Download the newly added file from the plurality of files to be transferred, and obtain the newly added file.

3. The method according to claim 1, characterized in that, The step of receiving multiple files to be transmitted from the server according to the download mode, and downloading newly added files from the multiple files to be transmitted based on the monitoring information, and obtaining the newly added files, includes: Based on the real-time synchronization mode, the existing files on the local machine indicated by the monitoring information, and the files on the server, if a new file is detected on the server within a preset time period, the new file is downloaded and obtained.

4. The method according to any one of claims 1-3, characterized in that, The method further includes: Obtain a file push request and send the file push request to the server; wherein, the file push request includes push request information, which is used to obtain unsaved files in the server; Based on the file push request, obtain and download the unsaved file from the server.

5. A document processing apparatus, characterized in that, include: The first acquisition unit is used to acquire a file download request and send the file download request to the server; wherein, the file download request includes a download type identifier and download request information, and the download request information is used to acquire the file in the server; The determining unit is configured to determine a download mode corresponding to the download type identifier based on the file download request; wherein the download mode represents download rule information under different download types; the download mode includes an immediate download mode or a real-time synchronization mode; The monitoring unit is used to monitor local files and / or files on the server according to the download mode, and obtain monitoring information; if the download mode is an immediate download mode, it monitors local files and obtains monitoring information about existing local files; if the download mode is a real-time synchronization mode, it monitors local files and files on the server within a preset time period and obtains monitoring information. The download unit is configured to, if the server receives the download request information and determines that there are multiple files to be transmitted based on the download request information, receive the multiple files to be transmitted sent by the server according to the download mode, and download the newly added file among the multiple files to be transmitted based on the monitoring information, thereby obtaining the newly added file.

6. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method of any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-4.

8. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-4.

Citation Information

Patent Citations

  • Method and system for downloading webpage contents

    CN102904912A

  • Method for regularly detecting newly-added file of FTP server under linux

    CN104461563A