File merging method, device, electronic device and storage medium
By receiving sub-financial files from different storage systems, determining file type information, extracting target table headers and performing data change processing, the inefficient conversion efficiency caused by inconsistent file types is solved, and efficient file merging is achieved.
Patent Information
- Application Number
- CN202310760276.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-26
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2043-06-26
AI Technical Summary
In the prior art, due to different data sources, file types are inconsistent, resulting in low data conversion efficiency and error-prone.
By receiving sub-financial files from different storage systems, determining file type information, extracting target table headers, performing data change processing and merging, and realizing data format conversion of different file types.
Improves file conversion efficiency of different file types and reduces merge errors caused by manual operation errors.
Smart Images

Figure CN116775575B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a file merging method, device, electronic device, and storage medium. Background Art
[0002] Currently, when processing data, there may be a situation where the file types of the files storing the data are inconsistent due to different data sources. In this way, the files storing the data need to be converted into files of a fixed type in order to process the data.
[0003] However, in the prior art, when processing data, the data is generally manually sorted first, and then the sorted data is input into a file of the same format to obtain a final data set. This method has low data conversion efficiency. Summary of the Invention
[0004] The purpose of the embodiments of the present invention is to provide a file merging method, device, electronic device and storage medium, so as to improve the efficiency of data conversion.
[0005] In a first aspect, an embodiment of the present invention provides a file merging method, the method comprising:
[0006] Receive multiple sub-financial files from different storage systems and determine file type information corresponding to each sub-financial file;
[0007] extracting initial data corresponding to the multiple target headers in each of the sub-financial files based on field extraction rules corresponding to the obtained file type information and multiple target headers; the target headers include fund source, storage type, held assets, monthly and daily average assets, and customer data;
[0008] Performing data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header; the data change processing is used to convert the data format of the initial data into a data format corresponding to the target file type;
[0009] The target data corresponding to each of the target headers are merged to obtain a target file.
[0010] In a possible implementation, extracting initial data corresponding to the multiple target headers in each of the sub-financial files according to a field extraction rule corresponding to the obtained file type information and the multiple target headers includes:
[0011] determining, from the plurality of sub-financial files, a plurality of candidate sub-financial files having the same file type information;
[0012] If a header of a first sub-financial file among the multiple candidate sub-financial files is inconsistent with headers of other sub-financial files among the multiple candidate sub-financial files, data of the first sub-financial file is eliminated;
[0013] A plurality of headers existing in the plurality of candidate sub-financial files are used as a plurality of target headers, and initial data corresponding to the plurality of target headers in each of the candidate sub-financial files are extracted respectively.
[0014] In a possible implementation, extracting initial data corresponding to the multiple target headers in each of the sub-financial files according to a field extraction rule corresponding to the obtained file type information and the multiple target headers includes:
[0015] According to the multiple target headers, configuring a connection string including the multiple target headers;
[0016] An extraction statement is set according to the connection string, and initial data corresponding to each of the plurality of target headers is extracted from each of the sub-financial files based on the extraction statement.
[0017] In a possible implementation, performing data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header includes:
[0018] For the initial data corresponding to each target header, perform the following operations:
[0019] If the initial data corresponding to the target header does not include a value, setting the initial data corresponding to the target header to a fixed value;
[0020] The numerical enumeration in the initial data corresponding to the target header is converted into a data format corresponding to the target file type to obtain the target data.
[0021] In a second aspect, an embodiment of the present invention provides a file merging device, the device comprising:
[0022] a receiving unit, configured to receive a plurality of sub-financial files from different storage systems and determine file type information corresponding to each sub-financial file;
[0023] an extraction unit, configured to extract initial data corresponding to the plurality of target headers in each of the sub-financial files according to a field extraction rule corresponding to the obtained file type information and a plurality of target headers; the target headers including a source of funds, a storage type, held assets, monthly and daily average assets, and customer data;
[0024] a processing unit, configured to perform data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header; the data change processing is configured to convert the data format of the initial data into a data format corresponding to the target file type;
[0025] The obtaining unit is used to merge the target data corresponding to each of the obtained target headers to obtain a target file.
[0026] In a possible implementation, the extraction unit is specifically configured to:
[0027] determining, from the plurality of sub-financial files, a plurality of candidate sub-financial files having the same file type information;
[0028] If a header of a first sub-financial file among the multiple candidate sub-financial files is inconsistent with headers of other sub-financial files among the multiple candidate sub-financial files, data of the first sub-financial file is eliminated;
[0029] A plurality of headers existing in the plurality of candidate sub-financial files are used as a plurality of target headers, and initial data corresponding to the plurality of target headers in each of the candidate sub-financial files are extracted respectively.
[0030] In a possible implementation, the extraction unit is specifically configured to:
[0031] According to the multiple target headers, configuring a connection string including the multiple target headers;
[0032] An extraction statement is set according to the connection string, and initial data corresponding to each of the plurality of target headers is extracted from each of the sub-financial files based on the extraction statement.
[0033] In a possible implementation, the processing unit is specifically configured to:
[0034] For the initial data corresponding to each target header, perform the following operations:
[0035] If the initial data corresponding to the target header does not include a value, setting the initial data corresponding to the target header to a fixed value;
[0036] The numerical enumeration in the initial data corresponding to the target header is converted into a data format corresponding to the target file type to obtain the target data.
[0037] In a third aspect, an embodiment of the present invention provides an electronic device comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method provided in the embodiment of the first aspect of the present invention.
[0038] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute any method provided by the embodiment of the first aspect of the present invention.
[0039] In a fifth aspect, an embodiment of the present invention provides a computer program product, comprising: a computer program code, which, when executed on a computer, enables the computer to execute any one of the methods provided in the embodiment of the first aspect.
[0040] The beneficial effects of the present invention are as follows:
[0041] In an embodiment of the present invention, an electronic device can receive multiple sub-financial files from different storage systems and determine the file type information corresponding to each sub-financial file; extract initial data corresponding to multiple target headers in each sub-financial file based on field extraction rules corresponding to the obtained file type information and multiple target headers; the target headers include the source of funds, storage type, held assets, monthly and daily average assets, and customer data; perform data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header; the data change processing is used to convert the data format of the initial data into a data format corresponding to the target file type; and merge the obtained target data corresponding to each target header to obtain a target file. In this way, the electronic device can merge multiple financial sub-files of different file types by extracting the initial data corresponding to the target headers and performing data format conversion processing on the initial data, thereby improving the conversion efficiency of files of different file types.
[0042] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings introduced below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 A schematic diagram of an application scenario in an embodiment of the present invention;
[0045] Figure 2 This is a flowchart of a file merging method according to an embodiment of the present invention;
[0046] Figure 3 Schematic diagram of the structure of a file merging device according to an embodiment of the present invention;
[0047] Figure 4 The figure is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. In the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in an order different from that here.
[0049] The term "comprises" and any variations thereof in the description and claims of the present invention are intended to cover non-exclusive protection. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0050] In the embodiment of the present invention, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0051] Furthermore, unless otherwise specified, ordinal numbers such as "first" and "second" in embodiments of the present invention are used to distinguish between multiple objects and are not used to limit the size, content, sequence, timing, priority, or importance of the multiple objects. For example, a first file type and a second file type are used only to distinguish the file types and do not indicate a difference in content, size, priority, or importance between the two file types.
[0052] In the technical solution of the present invention, the collection, dissemination, and use of data are in compliance with the requirements of relevant national laws and regulations.
[0053] As previously mentioned, in related art, when merging files of different file types, operators manually organize the data and then input the organized data into an empty file of the target file type to achieve the merging of files of different file types. This approach is not only inefficient but also prone to errors in the merged data due to manual operation, resulting in low efficiency in merging different file types.
[0054] In view of this, the present invention provides a file merging method, through which an electronic device can receive multiple sub-financial files from different storage systems and determine the file type information corresponding to each sub-financial file; based on the field extraction rules corresponding to the obtained file type information and multiple target headers, respectively extract the initial data corresponding to multiple target headers in each sub-financial file; the target headers include the source of funds, storage type, held assets, monthly and daily average assets, and customer data; perform data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header; the data change processing is used to convert the data format of the initial data into the data format corresponding to the target file type; and merge the obtained target data corresponding to each target header to obtain a target file. In this way, the electronic device can realize the merging of multiple financial sub-files of different file types by extracting the initial data corresponding to the target headers and performing data format conversion processing on the initial data, thereby improving the conversion efficiency of files of different file types.
[0055] After introducing the design concepts of the embodiments of the present invention, the following briefly describes the application scenarios to which the technical solutions of the embodiments of the present invention can be applied. It should be noted that the application scenarios described below are only for the purpose of illustrating the embodiments of the present invention and are not intended to be limiting. During implementation, the technical solutions provided by the embodiments of the present invention can be flexibly applied according to actual needs.
[0056] The solution provided by the embodiment of the present invention can be applied to all kinds of business scenarios that require different types of file merging processing, such as financial business scenarios, testing business scenarios, etc.
[0057] See Figure 1 FIG. 1 is a schematic diagram of a scenario provided by an embodiment of the present invention. This scenario may include multiple terminal devices 101 and a server 102. Terminal devices 101-1, 101-2, ..., and 101-n may be used by different users, and each terminal device is equipped with its own financial data processing system. Optionally, the financial files stored in each terminal device 101 may be of the same or different file types.
[0058] In an embodiment of the present invention, a user may log in to the corresponding financial data processing system on the terminal device 101, and after logging in, establish communication between the terminal device 101 and the server 102, so that the server 102 provides services for the financial data processing system.
[0059] In the embodiment of the present invention, the terminal device 101 can be, for example, a mobile phone, a tablet computer (PAD), a personal computer (PC), a smart TV, a smart car device, a wearable device, etc., which is not limited in the embodiment of the present invention.
[0060] In an embodiment of the present invention, server 102 can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or it can be a physical server, but is not limited to this.
[0061] The terminal device 101 and the server 102, as well as each terminal device 101, can be directly or indirectly connected to each other through one or more networks 103. The network 103 can be a wired network or a wireless network, for example, a mobile cellular network or a Wireless Fidelity (WIFI) network. Of course, other possible networks are also possible, and the embodiment of the present invention does not limit this.
[0062] Of course, the method provided in the embodiment of the present invention is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present invention are not limited thereto. Figure 1 The functions that can be implemented by each device in the application scenario shown will be described in subsequent method embodiments and will not be described in detail here.
[0063] To further illustrate the technical solutions provided by the embodiments of the present invention, the following is a detailed description of the technical solutions in conjunction with the accompanying drawings and specific implementation methods. Although the embodiments of the present invention provide the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiments of the present invention. In the actual processing process or when the device is executed, the method may be executed in the order of the methods shown in the embodiments or drawings or in parallel.
[0064] See Figure 2 , Figure 2 FIG. 1 is a flowchart of a method for merging files in an embodiment of the present invention. The method can be executed by an electronic device, which can be Figure 1 The specific implementation process of the method for the server 102 is as follows:
[0065] Step 201: Receive multiple sub-financial files from different storage systems, and determine file type information corresponding to each sub-financial file.
[0066] In an embodiment of the present invention, an electronic device may receive multiple sub-financial files from different storage systems. Each storage system may be provided in a terminal device, and the sub-financial files stored in each storage system may have different file type information from the sub-financial files stored in other storage systems.
[0067] For example, the electronic device receives sub-financial file 1 from storage system 1, sub-financial file 2 from storage system 2, sub-financial file 3 from storage system 3, and sub-financial file 4 from storage system 4. The electronic device can then analyze sub-financial file 1, sub-financial file 2, sub-financial file 3, and sub-financial file 4 to determine that the file type information corresponding to sub-financial file 1 is dat, the file type information corresponding to sub-financial file 2 is txt, the file type information corresponding to sub-financial file 3 is json, and the file type information corresponding to sub-financial file 4 is xlsx.
[0068] Optionally, the file type information of the sub-financial file may be dat, txt, csv, xlsx, xls, json, etc., which is not limited in the embodiment of the present invention.
[0069] Step 202: extracting initial data corresponding to the multiple target headers in each sub-financial file respectively according to the field extraction rules corresponding to the obtained file type information and the multiple target headers.
[0070] In an embodiment of the present invention, the electronic device may determine, from multiple sub-financial files, multiple candidate sub-financial files having the same file type information. If the header of a first sub-financial file among the multiple candidate sub-financial files is inconsistent with the headers of other sub-financial files in the multiple candidate sub-financial files, the electronic device may discard the data of the first sub-financial file. The electronic device may also use the multiple headers present in the multiple candidate sub-financial files as multiple target headers, and extract the initial data corresponding to each of the multiple target headers in each candidate sub-financial file.
[0071] For example, suppose Sub-Financial File 1 is in Excel format, and Sub-Financial File 2 is in DAT format. Sub-Financial File 1 contains the following table headers: Source of Funds, Storage Type, Purchase, Holding, Time Point, Monthly / Daily Average, and Customer Information. Sub-Financial File 2, in order of position, contains the following table headers: Customer Information, Source of Funds, Storage Type, Purchase, Holding, Time Point, and Monthly / Daily Average. The electronic device determines the target table headers as: Source, Type, Purchase, Holding, and Monthly / Daily Average.
[0072] In an embodiment of the present invention, the electronic device efficiently and quickly determines the target header of the candidate sub-financial files and obtains the initial data corresponding to the target header by first determining candidate sub-financial files of the same type and then eliminating sub-financial files that do not meet the requirements.
[0073] In an embodiment of the present invention, the electronic device can also read the contents of multiple sub-financial files based on pandas to obtain multiple target headers. Among them, pandas can be understood as an open source numerical calculation extension tool based on Python, which is created to solve data analysis tasks. The tool includes functions and methods for processing data. For example, the method for reading data is the reading method read_csv, the reading method read_excel, the reading method read_json, etc. Specifically, the aforementioned multiple target headers include the source of funds, storage type, held assets, monthly and daily average assets, and customer data. Among them, the source of funds is, for example, a loan or deposit, the storage type is, for example, a time deposit, a large deposit, or a current deposit, etc., and the customer data is, for example, data including customer identity information, customer contact number, etc.
[0074] In an embodiment of the present invention, after the electronic device determines multiple target headers, that is, the data items to be merged, it can configure a connection string containing the multiple target headers based on the multiple target headers. An extraction statement is set based on the connection string, and initial data corresponding to each of the multiple target headers is extracted from each sub-financial file based on the extraction statement. The connection string may be, for example, (source of funds | storage type | held assets | monthly and daily average assets | customer data). The extraction statement may be, for example, a structured query language (SQL) statement configured based on the connection string.
[0075] In this way, in the embodiment of the present invention, based on the extraction statement, the operation of extracting the target header can be performed for sub-financial files of different file types to obtain the initial data corresponding to the target header, thereby accurately and efficiently obtaining the data to be merged.
[0076] Optionally, if a certain type of sub-financial file does not have a header, the electronic device can determine the header to which each data in the sub-financial file belongs, mapped according to the position order when reading the data, and extract the initial data corresponding to the target header in the sub-financial file according to the position order corresponding to the target header, thereby obtaining the initial data.
[0077] Step 203: performing data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header; the data change processing is used to convert the data format of the initial data into a data format corresponding to the target file type.
[0078] In the embodiment of the present invention, after the electronic device obtains the initial data corresponding to the target header, it may further perform data change processing on the initial data corresponding to each target header to obtain the target data corresponding to each target header.
[0079] In an embodiment of the present invention, the electronic device can perform the following operations for the initial data corresponding to each target header: if the initial data corresponding to the target header does not include a numerical value, the initial data corresponding to the target header is set to a fixed numerical value; the numerical enumeration in the initial data corresponding to the target header is converted into a data format corresponding to the target file type to obtain the target data.
[0080] Specifically, if the electronic device determines that some sub-data in the initial data corresponding to the target header do not have specific values, the value at the sub-data position can be set to other fixed values that do not have corresponding meanings, such as 0000000. In this way, the problem of merging errors when merging subsequent data can be avoided. Optionally, the electronic device can set the data change method df.loc[df['field name'].insn([list]) based on pandas, 'field name'] = 'mapping result value' to map the fields to obtain the target data.
[0081] Step 204: Merge the target data corresponding to each target header to obtain a target file.
[0082] In an embodiment of the present invention, the electronic device can merge the target data extracted from each sub-financial file and obtained after data change processing according to the target header, obtain multiple target headers containing the target data, and sequentially arrange and process the multiple target headers containing the target data to obtain the target file. Optionally, the electronic device uses a pandas write method (such as to_csv, to_excel, tojson, to_sql, etc.) to write the target data to a configured executable file type or data table. In this way, the electronic device can obtain a file after merging multiple file types and perform subsequent processing based on it.
[0083] Based on the same inventive concept, an embodiment of the present invention also provides a file merging device. Figure 3 As shown, it is a schematic structural diagram of a file merging device 300, which may include:
[0084] A receiving unit 301 is configured to receive multiple sub-financial files from different storage systems and determine file type information corresponding to each sub-financial file;
[0085] An extraction unit 302 is configured to extract initial data corresponding to the target headers in each of the sub-financial files based on a field extraction rule corresponding to the obtained file type information and a plurality of target headers; the target headers include fund source, storage type, held assets, monthly and daily average assets, and customer data;
[0086] The processing unit 303 is configured to perform data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header; the data change processing is configured to convert the data format of the initial data into a data format corresponding to the target file type;
[0087] The obtaining unit 304 is configured to merge the obtained target data corresponding to each target header to obtain a target file.
[0088] In a possible implementation, the extraction unit 302 is specifically configured to:
[0089] determining, from the plurality of sub-financial files, a plurality of candidate sub-financial files having the same file type information;
[0090] If a header of a first sub-financial file among the multiple candidate sub-financial files is inconsistent with headers of other sub-financial files among the multiple candidate sub-financial files, data of the first sub-financial file is eliminated;
[0091] A plurality of headers existing in the plurality of candidate sub-financial files are used as a plurality of target headers, and initial data corresponding to the plurality of target headers in each of the candidate sub-financial files are extracted respectively.
[0092] In a possible implementation, the extraction unit 302 is specifically configured to:
[0093] According to the multiple target headers, configuring a connection string including the multiple target headers;
[0094] An extraction statement is set according to the connection string, and initial data corresponding to each of the plurality of target headers is extracted from each of the sub-financial files based on the extraction statement.
[0095] In a possible implementation, the processing unit 303 is specifically configured to:
[0096] For the initial data corresponding to each target header, perform the following operations:
[0097] If the initial data corresponding to the target header does not include a value, setting the initial data corresponding to the target header to a fixed value;
[0098] The numerical enumeration in the initial data corresponding to the target header is converted into a data format corresponding to the target file type to obtain the target data.
[0099] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing the present invention, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0100] After introducing the file merging method and apparatus according to the exemplary embodiment of the present invention, next, an electronic device according to another exemplary embodiment of the present invention is introduced.
[0101] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Therefore, various aspects of the present invention may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0102] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present invention. In this embodiment, the structure of the electronic device can be as follows Figure 4 As shown, the electronic device is, for example, the aforementioned Figure 1 The server 102 in Figure 4 As shown, the electronic device in the embodiment of the present invention includes at least one processor 401, and a memory 402 and a communication interface 403 connected to the at least one processor 401. The embodiment of the present invention does not limit the specific connection medium between the processor 401 and the memory 402. Figure 4 In the example, the processor 401 and the memory 402 are connected via the system bus 400. Figure 4 The system bus 400 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0103] In the embodiment of the present invention, the memory 402 stores instructions that can be executed by at least one processor 401. The at least one processor 401 can execute the steps included in the aforementioned file merging method by executing the instructions stored in the memory 402.
[0104] The processor 401 is the control center of the electronic device and can connect various parts of the entire fault detection device using various interfaces and lines. By running or executing instructions stored in the memory 402 and calling data stored in the memory 402, various functions of the electronic device can be realized. Optionally, the processor 401 may include one or more processing units. The processor 401 may integrate an application processor and a modem processor. The processor 401 mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understood that the modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip. In some embodiments, they may also be implemented on separate chips.
[0105] The processor 401 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in conjunction with the embodiments of the present invention can be directly implemented as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0106] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (RAM), a static random access memory (SRAM), a programmable read-only memory (PROM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 402 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 402 in the embodiment of the present invention can also be a circuit or any other device that can implement a storage function, for storing program instructions and / or data.
[0107] The communication interface 403 is a transmission interface that can be used for communication, and data can be received or sent through the communication interface 403 .
[0108] In addition, the electronic device also includes a basic input / output system (I / O system) 404 for facilitating information transmission between various components within the electronic device, and a large-capacity storage device 408 for storing an operating system 405, application programs 406, and other program modules 407.
[0109] The basic input / output system 404 includes a display 409 for displaying information and an input device 410, such as a mouse and keyboard, for user input. Both the display 409 and the input device 410 are connected to the processor 401 via the basic input / output system 404, which is connected to the system bus 400. The basic input / output system 404 may also include an input / output controller for receiving and processing input from a variety of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller also provides output to a display screen, printer, or other types of output devices.
[0110] Specifically, the mass storage device 408 is connected to the processor 401 via a mass storage controller (not shown) connected to the system bus 400. The mass storage device 408 and its associated computer-readable media provide non-volatile storage for the server package. In other words, the mass storage device 408 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM drive.
[0111] According to various embodiments of the present invention, the electronic device can also be connected to a remote computer on a network such as the Internet for operation. In other words, the electronic device can be connected to the network 411 via the communication interface 403 connected to the system bus 400, or the communication interface 403 can be used to connect to other types of networks or remote computer systems (not shown).
[0112] An embodiment of the present invention further provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute the technical solution of the file merging method of the above embodiment.
[0113] An embodiment of the present invention further provides a computer program product, which includes: computer program code, which, when run on a computer, enables the computer to implement the technical solution of the file merging method in the above embodiment when executing the computer program.
[0114] Those skilled in the art will appreciate that all or part of the steps of the above-described method embodiments may be implemented by hardware associated with program instructions. The aforementioned program instructions are computer programs, which may be stored in a computer-readable storage medium. When the computer program is executed, it performs the steps of the above-described method embodiments. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0115] The program product of an embodiment of the present invention may be a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a computing device. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with a command execution system, device, or apparatus.
[0116] A readable signal medium may include a data signal transmitted in baseband or as part of a carrier wave, which carries readable program code. Such a transmitted data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with a command execution system, apparatus, or device.
[0117] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0118] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0119] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0120] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A file merging method, characterized in that: The method comprises: Receive multiple sub-financial files from different storage systems and determine file type information corresponding to each sub-financial file; extracting initial data corresponding to the multiple target headers in each of the sub-financial files based on field extraction rules corresponding to the obtained file type information and multiple target headers; the target headers include fund source, storage type, held assets, monthly and daily average assets, and customer data; Performing data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header; the data change processing is used to convert the data format of the initial data into a data format corresponding to the target file type; Merging the target data corresponding to each of the target headers to obtain a target file; The extracting of the initial data corresponding to the multiple target headers in each of the sub-financial files according to the field extraction rules corresponding to the obtained file type information and the multiple target headers includes: determining, from the plurality of sub-financial files, a plurality of candidate sub-financial files having the same file type information; If a header of a first sub-financial file among the multiple candidate sub-financial files is inconsistent with headers of other sub-financial files among the multiple candidate sub-financial files, data of the first sub-financial file is eliminated; using multiple headers existing in the multiple candidate sub-financial files as multiple target headers, and extracting initial data corresponding to the multiple target headers in each of the candidate sub-financial files; The performing data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header includes: For the initial data corresponding to each target header, perform the following operations: If the initial data corresponding to the target header does not include a value, setting the initial data corresponding to the target header to a fixed value; The numerical enumeration in the initial data corresponding to the target header is converted into a data format corresponding to the target file type to obtain the target data.
2. The method according to claim 1, wherein Extracting initial data corresponding to the multiple target headers in each of the sub-financial files according to a field extraction rule corresponding to the obtained file type information and the multiple target headers, including: According to the multiple target headers, configuring a connection string including the multiple target headers; An extraction statement is set according to the connection string, and initial data corresponding to each of the plurality of target headers is extracted from each of the sub-financial files based on the extraction statement.
3. A file merging device, characterized in that: The device comprises: a receiving unit, configured to receive a plurality of sub-financial files from different storage systems and determine file type information corresponding to each sub-financial file; an extraction unit, configured to extract initial data corresponding to the plurality of target headers in each of the sub-financial files according to a field extraction rule corresponding to the obtained file type information and a plurality of target headers; the target headers including a source of funds, a storage type, held assets, monthly and daily average assets, and customer data; a processing unit, configured to perform data change processing on the initial data corresponding to each target header to obtain target data corresponding to each target header; the data change processing is configured to convert the data format of the initial data into a data format corresponding to the target file type; an obtaining unit, configured to merge the obtained target data corresponding to each target header to obtain a target file; Wherein, the extraction unit is specifically used for: determining, from the plurality of sub-financial files, a plurality of candidate sub-financial files having the same file type information; If a header of a first sub-financial file among the multiple candidate sub-financial files is inconsistent with headers of other sub-financial files among the multiple candidate sub-financial files, data of the first sub-financial file is eliminated; using multiple headers existing in the multiple candidate sub-financial files as multiple target headers, and extracting initial data corresponding to the multiple target headers in each of the candidate sub-financial files; The processing unit is specifically configured to: perform the following operations on the initial data corresponding to each target header: If the initial data corresponding to the target header does not include a value, setting the initial data corresponding to the target header to a fixed value; The numerical enumeration in the initial data corresponding to the target header is converted into a data format corresponding to the target file type to obtain the target data.
4. The device according to claim 3, characterized in that The extraction unit is specifically used for: According to the multiple target headers, configuring a connection string including the multiple target headers; An extraction statement is set according to the connection string, and initial data corresponding to each of the plurality of target headers is extracted from each of the sub-financial files based on the extraction statement.
5. An electronic device, characterized in that: The method comprises at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the method according to claim 1 or 2.
6. A computer storage medium, characterized in that The computer storage medium stores a computer program, and the computer program is used to enable a computer to execute the method according to claim 1 or 2.
7. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is caused to execute the method according to claim 1 or 2.
Citation Information
Patent Citations
Data import method and device
CN111367988A
BOM file analysis method and device and terminal equipment
CN114461583A