File data importing method and device and electronic equipment

By updating the target task identity and using template files for data format conversion, combined with multi-threaded batch processing technology, the problem of low data import efficiency of airlines is solved, and efficient data import and orderly processing is achieved.

CN119226242APending Publication Date: 2024-12-31TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411363513.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

When airlines import service rule data and transportation price data, the data storage format does not match the database format, resulting in inefficient import of file data.

Method used

By updating the target task identity as the first identity, obtain the file to be imported and parse it into a format that can be recognized by the target database using the template file. Use multiple inbound threads to add, modify and delete operations in batches to ensure that the data is imported. Sequentiality and efficiency.

Benefits of technology

It improves the efficiency of importing data into the target database, avoids repeated data import, and realizes the conversion of data storage formats, solving the problem of low import efficiency caused by mismatch in storage formats.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226242A_ABST
    Figure CN119226242A_ABST
Patent Text Reader

Abstract

The invention discloses a file data importing method and device and electronic equipment, and relates to the technical field of data processing.The method comprises the steps that after a task identifier of a target task is updated to be a first identifier, a to-be-imported file is obtained, then the to-be-imported file is analyzed according to a template file, and L operation lists are obtained, the template file is used for representing a corresponding relation between a data storage format of a to-be-imported file and a data storage format of a target database, and then updating the target database based on the L operation lists through the M storage threads, the M storage threads are at least used for adding, modifying and deleting data in the target database in batches. According to the method and the device, the technical problem of low file data importing efficiency in the prior art under the condition that the data storage format of the to-be-imported file is different from the data storage format of the target data is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device and electronic device for importing file data. Background Art

[0002] When an airline company needs to obtain the latest published service rule data and transportation price data, since the publisher of the service rule data and transportation price data has different data storage standards from the airline company, the data storage format of the service rule data and transportation price data is also different from the data storage format corresponding to the airline company's database, resulting in low efficiency in importing file data during the process of importing the files to be imported from the service rule data and transportation price data into the airline company's database.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The present application provides a method, device and electronic device for importing file data, so as to at least solve the technical problem of low efficiency of importing file data in the prior art when the data storage format of the file to be imported is different from the data storage format of the target data.

[0005] According to one aspect of the present application, a method for importing file data is provided, comprising: after updating the task identifier of a target task to a first identifier, obtaining a file to be imported, wherein the target task is used to import the data in the file to be imported into a target database, the first identifier is used to prohibit the target task from obtaining a new file to be imported, and the file to be imported is used to store service rule data and transportation price data of an airline; parsing the file to be imported according to a template file to obtain L operation lists, wherein L is a positive integer, the template file is used to characterize the correspondence between the data storage format of the file to be imported and the data storage format of a target database, and the data storage format of the L operation lists is the same as the data storage format of the target database; importing the data in the file to be imported into the target database through M warehousing threads and L operation lists, wherein M is a positive integer, and the M warehousing threads are at least used to batch add, modify and delete data in the target database.

[0006] Optionally, in the process of parsing the file to be imported according to the template file to obtain L operation lists, the file data importing method also includes: parsing all data included in the file to be imported line by line according to the template file to obtain N parsed data, where N is a positive integer; loading the N parsed data into the target memory; determining the data primary key of each parsed data in the target memory according to the template file, where the data primary key is used to characterize the file type and file name of the file to be imported to which the parsed data belongs; classifying the N parsed data according to the data primary key of each parsed data to obtain P ordered queues, where P is a positive integer, and the data primary key of any two parsed data stored in each of the P ordered queues is the same; parsing the P ordered queues according to the template file to obtain L operation lists.

[0007] Optionally, in the process of parsing P ordered queues according to the template file to obtain L operation lists, the file data importing method also includes: determining the business primary key of each parsed data in each ordered queue according to the template file, wherein the business primary key is used to characterize the business type represented by the parsed data; determining the preset rule corresponding to each ordered queue according to the business primary key of each parsed data in each ordered queue, wherein the preset rule is at least used to deduplicate the parsed data in the P ordered queues; processing the P ordered queues according to the preset rule corresponding to each ordered queue to obtain L operation lists.

[0008] Optionally, the state of the parsed data is any one of the following first state, second state, third state and fourth state, wherein the first state is used to characterize that the effective end time of the parsed data is earlier than the effective start time; the second state is used to characterize that the effective end time of the parsed data is earlier than the current time; the third state is used to characterize that the effective start time of the parsed data is earlier than the effective end time, and the effective end time of the parsed data is later than the current time; the fourth state is used to characterize that the effective start time of the parsed data is earlier than the effective end time, and the effective start time of the parsed data is later than the current time.

[0009] Optionally, in the process of processing P ordered queues according to the preset rules corresponding to each ordered queue, the file data importing method also includes: when the preset rule corresponding to the i-th ordered queue is the first preset rule, detecting the total number of parsed data in the i-th ordered queue, wherein the first preset rule is used to process the parsed data representing the real parameters in the file to be imported, and i is a positive integer less than or equal to P; when the total number of parsed data in the i-th ordered queue is equal to 1, detecting the state of the first parsed data, wherein the first parsed data is the parsed data in the i-th ordered queue; when the state of the first parsed data is the first state or the second state, adding the first parsed data to the first operation list, wherein the warehousing thread is used to perform batch modification operations on the target database according to the first operation list.

[0010] Optionally, after detecting the status of the first parsed data, the file data importing method also includes: when the status of the first parsed data is the third state or the fourth state, detecting whether there is target parsed data corresponding to the first parsed data in the target database, wherein the target parsed data has the same data primary key as the corresponding parsed data and the status is the third state; when there is target parsed data corresponding to the first parsed data in the target database, adding the first parsed data to the first operation list and the second operation list, wherein the warehousing thread is used to perform batch new operations on the target database according to the second operation list; when there is no target parsed data corresponding to the first parsed data in the target database, adding the first parsed data to the second operation list.

[0011] Optionally, after detecting the total number of parsed data in the i-th ordered queue, the file data importing method also includes: when the total number of parsed data in the i-th ordered queue is greater than 1, detecting the state of the second parsed data, wherein the second parsed data is the parsed data with the latest generation time in the i-th ordered queue; when the state of the second parsed data is the first state or the second state, and there is target parsed data corresponding to the second parsed data, deleting the parsed data except the second parsed data in the i-th ordered queue, and adding the second parsed data to the first operation list; when the state of the second parsed data is the third state or the fourth state, and there is target parsed data corresponding to the second parsed data, adding the second parsed data to the first operation list and the second operation list; when the state of the second parsed data is the third state or the fourth state, and there is no target parsed data corresponding to the second parsed data, adding the second parsed data to the second operation list.

[0012] Optionally, in the process of processing P ordered queues according to the preset rules corresponding to each ordered queue, the file data importing method also includes: when the preset rule corresponding to the i-th ordered queue is the second preset rule, judging whether each parsing data in the i-th ordered queue has corresponding target parsing data, wherein the second preset rule is used to process the parsing data representing the correspondence between the real parameters in the file to be imported; when there is corresponding target parsing data for the j-th parsing data in the i-th ordered queue, adding the j-th parsing data to a third operation list, wherein the warehousing thread is used to perform batch deletion operations on the target database according to the third operation list, and j is a positive integer; when there is no corresponding target parsing data for the j-th parsing data, adding the j-th parsing data to the second operation list.

[0013] According to another aspect of the present application, there is also provided a device for importing file data, comprising: an acquisition unit, for acquiring a file to be imported after updating the task identifier of a target task to a first identifier, wherein the target task is used to import the data in the file to be imported into a target database, the first identifier is used to prohibit the target task from acquiring a new file to be imported, the file to be imported is used to store the service rule data and transportation price data of an airline, and the target database is a database of a user of the file to be imported; a parsing unit, for parsing the file to be imported according to a template file to obtain L operation lists, wherein L is a positive integer, the template file is used to characterize the correspondence between the data storage format of the file to be imported and the data storage format of a target database, and the data storage format of the L operation lists is the same as the data storage format of the target database; an updating unit, for updating the target database based on the L operation lists through M warehousing threads, wherein M is a positive integer, and the M warehousing threads are at least used to batch add, modify and delete data in the target database.

[0014] According to another aspect of the present application, a computer program product is provided, in which a computer program is stored, wherein when the computer program is running, the computer program product is controlled to execute any one of the above-mentioned file data importing methods.

[0015] According to another aspect of the present application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned file data importing methods.

[0016] In the present application, after the task identifier of the target task is updated to the first identifier, the file to be imported is first obtained, wherein the target task is used to import the data in the file to be imported into the target database, the first identifier is used to prohibit the target task from obtaining a new file to be imported, and the file to be imported is used to store the service rules data and transportation price data of the airline. Afterwards, the present application parses the file to be imported according to the template file to obtain L operation lists, wherein L is a positive integer, the template file is used to characterize the correspondence between the data storage format of the file to be imported and the data storage format of the target database, and the data storage format of the L operation lists is the same as the data storage format of the target database. Then, the present application imports the data in the file to be imported into the target database through M warehousing threads and L operation lists, wherein M is a positive integer, and the M warehousing threads are at least used to batch add, modify and delete data in the target database.

[0017] From the above content, it can be seen that the present application achieves the purpose of ensuring that the target task does not import new service rule data and transportation price data before the execution of the current target task is completed by updating the identifier of the target task to the first identifier, thereby ensuring the orderliness of the process of importing the data in the file to be imported into the target database and avoiding repeated import of service rule data and transportation price data.

[0018] Furthermore, the present application uses a template file to characterize the correspondence between the data storage format of the file to be imported and the data storage format of the target database. Therefore, the present application can convert the storage format of the data in the file to be imported into a data storage format that can be recognized by the airline's database (i.e., the target database) through the template file. Then, the present application stores the data in the file to be imported after the format conversion into L operation lists, and then updates the data in the target database based on the data in the L operation lists through multiple storage threads, thereby achieving the purpose of importing the data in the file to be imported into the database, and improving the efficiency of importing data into the target database through multi-threaded batch processing operations.

[0019] It can be seen that the present application adopts a method of converting the data storage format through a template file, and importing the data in the file to be imported into the target database based on M storage threads and L operation lists, thereby achieving the technical effect of improving the efficiency of importing the data in the file to be imported into the target database, and further solving the technical problem of low efficiency of importing file data in the prior art when the data storage format of the file to be imported is different from the data storage format of the target data. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0021] Figure 1 is a flowchart of an optional method for importing file data according to an embodiment of the present application;

[0022] Figure 2 is a schematic diagram of an optional file data importing system according to an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of an optional data primary key according to an embodiment of the present application;

[0024] Figure 4 is a flowchart of an optional first preset rule processing process according to an embodiment of the present application;

[0025] Figure 5 is a flowchart of another optional method for importing file data according to an embodiment of the present application;

[0026] Figure 6 is a schematic diagram of an optional file data importing device according to an embodiment of the present application;

[0027] Figure 7 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] It should also be noted that the relevant information (including but not limited to information for display and analysis) and data (including but not limited to data in the file to be imported) involved in this application are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set between this system and the relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0031] In addition, the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant information and data involved in this application comply with the relevant laws, regulations and standards of the relevant regions, and necessary confidentiality measures have been taken and do not violate public order and good morals. In addition, this application provides corresponding operation entrances for users to choose to agree to authorization or refuse authorization. If the user chooses to refuse authorization, he / she will enter the corresponding expert decision-making process.

[0032] According to an embodiment of the present application, an embodiment of a method for importing file data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0033] The present application provides a file data import system (hereinafter referred to as the import system) for executing the file data import method of the present application. Figure 1 is a flowchart of an optional method for importing file data according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0034] Step S101, after the task identifier of the target task is updated to the first identifier, the file to be imported is obtained.

[0035] In step S101, the target task is used to import the data in the file to be imported into the target database, and the first identifier is used to prohibit the target task from acquiring a new file to be imported, and the file to be imported is used to store the service rule data and transportation price data of the airline.

[0036] Optionally, the file to be imported in the present application refers to a file including additional service sales rules and fare data pushed by ATPCO (Airline Tariff Publishing Company), which includes at least RECORDS7, RECORDS6, RECORD5 and TBALE series sub-tables.

[0037] Optionally, the target database is a database of a user of the file to be imported.

[0038] Optionally, the task identifier in the present application is a first identifier or a second identifier, wherein the first identifier is used to prohibit the target task from acquiring new files to be imported, and the second identifier is used to control the target task to acquire new files to be imported.

[0039] Optionally, after the target task is started, the import system determines X files to be imported that need to be imported into the target database based on the needs of the users of the files to be imported, where X is a positive integer. Thereafter, the import system switches the task identifier of the target task from the second identifier to the first identifier, thereby prohibiting the current target task from acquiring new files to be imported before the task is completed, avoiding repeated importing of files to be imported, thereby interfering with the operation of the target task, and ensuring orderly processing of the files to be imported.

[0040] Step S102, parsing the file to be imported according to the template file to obtain L operation lists.

[0041] In step S102, L is a positive integer, the template file is used to characterize the correspondence between the data storage format of the file to be imported and the data storage format of the target database, and the data storage format of the L operation lists is the same as the data storage format of the target database.

[0042] Optionally, the import system can generate a template file based on preset data business standards and template reverse engineering codes. The template file can represent the push data standard of the user of the file to be imported. In the prior art, the airline fare publishing company and the user of the file to be imported have different storage formats and push formats for service rule data and transportation price data. Therefore, the present application achieves the purpose of format conversion of the data in the file to be imported through data files before storing the data in the file to be imported issued by the airline fare publishing company into the target database.

[0043] Optionally, a row of data in the file to be imported may correspond to one data object structure in the target database, or may correspond to multiple data object structures in the target database. The protective gear in the file to be imported can be automatically mapped to the data structure corresponding to the target database through the template file.

[0044] Step S103: import the data in the file to be imported into the target database through M storage threads and L operation lists.

[0045] In step S103, M is a positive integer, and the M storage threads are at least used to perform batch addition, modification and deletion operations on the data in the target database.

[0046] Optionally, the import system first creates L storage threads to import L operation lists, where L is less than or equal to M, and the L storage threads correspond to the L operation lists one-to-one. When the amount of data corresponding to any one of the L operation lists is greater than a preset threshold, the import system then creates at least one additional storage thread corresponding to the operation list based on the amount of data corresponding to the operation list, thereby achieving the purpose of batch processing the operation list with a data amount greater than the preset threshold based on multiple storage threads, thereby improving the efficiency of importing data into the target database.

[0047] From the above content, it can be seen that the present application achieves the purpose of ensuring that the target task does not import new service rule data and transportation price data before the execution of the current target task is completed by updating the identifier of the target task to the first identifier, thereby ensuring the orderliness of the process of importing the data in the file to be imported into the target database and avoiding repeated import of service rule data and transportation price data.

[0048] Furthermore, the present application uses a template file to characterize the correspondence between the data storage format of the file to be imported and the data storage format of the target database. Therefore, the present application can convert the storage format of the data in the file to be imported into a data storage format that can be recognized by the airline's database (i.e., the target database) through the template file. Then, the present application stores the data in the file to be imported after the format conversion into L operation lists, and then updates the data in the target database based on the data in the L operation lists through multiple storage threads, thereby achieving the purpose of importing the data in the file to be imported into the database, and improving the efficiency of importing data into the target database through multi-threaded batch processing operations.

[0049] It can be seen that the present application adopts a method of converting the data storage format through a template file, and importing the data in the file to be imported into the target database based on M storage threads and L operation lists, thereby achieving the technical effect of improving the efficiency of importing the data in the file to be imported into the target database, and further solving the technical problem of low efficiency of importing file data in the prior art when the data storage format of the file to be imported is different from the data storage format of the target data.

[0050] In an optional embodiment, Figure 2 is a schematic diagram of an optional file data import system according to an embodiment of the present application, such as Figure 2 As shown, the import system includes at least a template conversion component, a data parsing component and a data storage component.

[0051] Optionally, a template conversion component is used to generate a template file, wherein the template file is used to convert the format structure of the additional service sales rules freight data; a data parsing component is used to read the additional service sales rules freight data in an orderly manner, and perform corresponding business processing according to the business type corresponding to the additional service sales rules freight data, thereby achieving the purpose of removing redundant data, and the data parsing component can split the additional service sales rules freight data without destroying the logical integrity and orderliness of the business processing corresponding to the additional service sales rules freight data, so that subsequent thread pools can allocate threads for processing, thereby improving data processing efficiency; a data warehousing component is used to uniformly add, delete, and modify data based on batch processing according to the data parsed by the data parsing component.

[0052] In an optional embodiment, the import system first parses all the data included in the file to be imported line by line according to the template file to obtain N parsed data, where N is a positive integer. Thereafter, the import system loads the N parsed data into the target memory. Then, the import system determines the data primary key of each parsed data in the target memory according to the template file, where the data primary key is used to characterize the file type and file name of the file to be imported to which the parsed data belongs. Furthermore, the import system classifies the N parsed data according to the data primary key of each parsed data to obtain P ordered queues, where P is a positive integer, and the data primary key of any two parsed data stored in each of the P ordered queues is the same. Finally, the import system parses the P ordered queues according to the template file to obtain L operation lists.

[0053] Optionally, the import system pre-creates P parsing threads, and parses the P operation lists in parallel through the P parsing threads, thereby improving the efficiency of the import system in parsing the P ordered queues.

[0054] Optionally, the data in a file to be imported may correspond to more than a dozen data structures of the target database. Not only are there preset orders between multiple sub-table files in the file to be imported, but there is also a preset order between each row of data in the table. After the import system loads the N parsed data obtained by parsing into the target memory at one time, the import system loads the parsed data that may affect the preset order into the same ordered list (i.e., ordered queue) according to the data type (i.e., data primary key) corresponding to each parsed data. Afterwards, when processing each type of parsed data, it is only necessary to ensure the orderliness of the ordered list data during processing, thereby achieving the purpose of segmenting the target task. The import system subsequently creates a corresponding parsing thread for each ordered list, and processes the P ordered lists in parallel through P parsing threads, thereby improving the execution efficiency of the target task while ensuring the orderliness of the processing of the file to be imported.

[0055] In an optional embodiment, Figure 3 is a schematic diagram of an optional data primary key according to an embodiment of the present application, such as Figure 3 As shown: When the import system loads the data in the file to be imported line by line, the import system uses the combination of the file name and file type of each parsed data as the key, and saves the content line of the parsed data as the value in the target memory.

[0056] In an optional embodiment, the import system first determines the business primary key of each parsed data in each ordered queue based on the template file, wherein the business primary key is used to characterize the business type represented by the parsed data. Then, the import system determines the preset rule corresponding to each ordered queue based on the business primary key of each parsed data in each ordered queue, wherein the preset rule is at least used to deduplicate the parsed data in P ordered queues. Then, the import system processes the P ordered queues according to the preset rules corresponding to each ordered queue to obtain L operation lists.

[0057] Optionally, the data in the file to be imported has a validity period, and the validity period of each freight rate data is represented by the "freight rate status" field in the file to be imported. In order to further improve the execution efficiency of the target task, the import system formulates the corresponding processing logic of the parsed data according to the preset rules corresponding to each parsed data in each ordered queue, avoiding invalid data that is not in the validity period from being imported into the target database, thereby reducing the amount of data that needs to be actually imported into the target database, thereby improving the execution efficiency of the target task.

[0058] In an optional embodiment, the state of the parsed data is any one of the following first state, second state, third state and fourth state, wherein the first state is used to characterize that the effective end time of the parsed data is earlier than the effective start time; the second state is used to characterize that the effective end time of the parsed data is earlier than the current time; the third state is used to characterize that the effective start time of the parsed data is earlier than the effective end time, and the effective end time of the parsed data is later than the current time; the fourth state is used to characterize that the effective start time of the parsed data is earlier than the effective end time, and the effective start time of the parsed data is later than the current time.

[0059] Optionally, the import system regards the parsed data in the first state as inverted data, the parsed data in the second state as expired data, the parsed data in the third state as valid data, and the parsed data in the fourth state as future valid data.

[0060] Optionally, the import system performs different business processing on the parsed data according to different states of the parsed data, thereby avoiding invalid data from being stored in the database, thereby improving the efficiency of importing the data in the file to be imported into the target database.

[0061] In an optional embodiment, when the preset rule corresponding to the i-th ordered queue is the first preset rule, the import system detects the total amount of parsed data in the i-th ordered queue, wherein the first preset rule is used to process the parsed data representing the real parameters in the file to be imported, and i is a positive integer less than or equal to P; when the total amount of parsed data in the i-th ordered queue is equal to 1, the import system detects the state of the first parsed data, wherein the first parsed data is the parsed data in the i-th ordered queue; when the state of the first parsed data is the first state or the second state, the import system adds the first parsed data to the first operation list, wherein the warehousing thread is used to perform batch modification operations on the target database according to the first operation list.

[0062] Optionally, when the file to be imported includes RECORDS7, RECORDS6, RECORD5 and TBALE series sub-tables, the RECORDS7, RECORDS6, RECORD5 series sub-tables are used to record the actual parameters in the service rule data and the transportation price data, and the TBALE series sub-tables are used to record the correspondence between the data in RECORDS7, RECORDS6, RECORD5.

[0063] Optionally, when the parsed data is data in RECORDS7, RECORDS6 and RECORD5 series sub-tables in the file to be imported, the import system determines that the preset rule corresponding to the sequence queue to which the parsed data belongs is the first preset rule.

[0064] In an optional embodiment, when the state of the first parsed data is the third state or the fourth state, the import system detects whether there is target parsed data corresponding to the first parsed data in the target database, wherein the target parsed data has the same data primary key as the corresponding parsed data and the state is the third state; when there is target parsed data corresponding to the first parsed data in the target database, the import system adds the first parsed data to the first operation list and the second operation list, wherein the warehousing thread is used to perform batch new operations on the target database according to the second operation list; when there is no target parsed data corresponding to the first parsed data in the target database, the import system adds the first parsed data to the second operation list.

[0065] Optionally, the first operation list is a list to be closed, and the second operation list is a list to be added. The import system can perform a cut-off and a new-create operation based on the data in the list to be closed and the list to be added, wherein the cut-off and a new-create operation is used to process the data in RECORDS7, RECORDS6 and RECORDD5. Cut-off and a new-create is an operation for processing freight rate data, that is, after importing a new parsed data with the same data primary key as the historical data, the import system sets the effective end time of the historical data to the effective start time of the new parsed data, and inserts the new parsed data, thereby ensuring the continuity of the effective time of the freight rate data.

[0066] Optionally, the data in RECORDS7, RECORDS6 and RECORDD5 are imported into the system in accordance with the principle of first processing the corresponding list to be closed and then processing the list to be added. The import system library uses batch processing to batch modify and add data, and there is no need to follow the order of processing the data in the file to be imported line by line in the prior art.

[0067] Optionally, if the amount of data that the import system needs to process at one time is greater than a preset threshold, the import system starts multi-threaded processing, that is, it only needs to take the list of new items with the same primary key and put it in one transaction and thread each time the list of items to be cut off is processed in batches, thereby ensuring the integrity of each batch of processed data. When the processing fails, the import system records the entire batch and rolls back the entire batch, thereby avoiding the situation where there is no new item after the cut off, thereby ensuring the integrity of the data under the multi-threaded processing process.

[0068] In an optional embodiment, when the total number of parsed data in the i-th ordered queue is greater than 1, the import system detects the state of the second parsed data, wherein the second parsed data is the parsed data with the latest generation time in the i-th ordered queue; when the state of the second parsed data is the first state or the second state, and there is target parsed data corresponding to the second parsed data, the import system deletes the parsed data except the second parsed data in the i-th ordered queue, and adds the second parsed data to the first operation list; when the state of the second parsed data is the third state or the fourth state, and there is target parsed data corresponding to the second parsed data, the import system adds the second parsed data to the first operation list and the second operation list; when the state of the second parsed data is the third state or the fourth state, and there is no target parsed data corresponding to the second parsed data, the import system adds the second parsed data to the second operation list.

[0069] In an optional embodiment, Figure 4 is a flowchart of an optional first preset rule processing process according to an embodiment of the present application, such as Figure 4 As shown: For the parsing threads corresponding to RECORDS7, RECORDS6, and RECORDD5, when loading different data primary keys (corresponding Figure 4 After the parsed data of the "key" in the map is transferred to different maps (corresponding to the ordered queues mentioned above), if there is only one parsed data in the map, the processing flow is as follows:

[0070] (1) If the parsed data is expired or inverted, add it to the pending expiration list;

[0071] (2) If the parsed data is effective data or will-be effective data, query the target database to see whether there is effective data with the same data primary key as the parsed data. If so, add the parsed data to the to-be-expired list and the to-be-added list; if not, only add the parsed data to the to-be-added list;

[0072] Optionally, if there are multiple parsed data in the map, the processing flow is as follows:

[0073] (1) Query the latest parsed data. If the parsed data is expired or inverted, directly delete the historical data before the latest parsed data in the list, take only the latest parsed data and add it to the pending list, and end the processing thread corresponding to the primary key of the data;

[0074] (2) Query the latest parsed data. If the parsed data is effective data or will be effective in the future, add the parsed data to the pending expiration list and the pending addition list, and then take the previous historical data and modify its effective end time to the effective start time corresponding to the latest parsed data;

[0075] (3) Get the next new parsed data for loop processing.

[0076] In an optional embodiment, when the preset rule corresponding to the i-th ordered queue is the second preset rule, the import system determines whether each parsing data in the i-th ordered queue has corresponding target parsing data, wherein the second preset rule is used to process the parsing data that characterizes the correspondence between the real parameters in the file to be imported; when the j-th parsing data in the i-th ordered queue has corresponding target parsing data, the import system adds the j-th parsing data to the third operation list, wherein the warehousing thread is used to perform batch deletion operations on the target database according to the third operation list, and j is a positive integer; when the j-th parsing data does not have corresponding target parsing data, the import system adds the j-th parsing data to the second operation list.

[0077] Optionally, when the parsed data is data in the TBALE series subtable in the file to be imported, the import system determines that the preset rule corresponding to the ordered queue to which the parsed data belongs is the second preset rule.

[0078] Optionally, for the TABLE series sub-tables, the principle of processing the to-be-deleted list first and then the to-be-added list can be adopted. The database uses batch processing to perform batch deletion and batch addition operations. There is no need to follow the order of processing the data in the to-be-imported file line by line in the prior art. When the data volume is greater than the preset threshold and multi-threading is enabled, it is sufficient to ensure that the parsed data in the to-be-deleted list and the to-be-added list with the same data primary key are in the same batch and transaction.

[0079] Optionally, the parsed data will enter the data warehousing component only after it has been completely processed by the data parsing processing component. When operating the warehousing, the data status of the parsed data being operated can be set to the importing status. The data warehousing component can reorganize the database operation statements of the target database corresponding to the parsed data, thereby improving data processing efficiency through unified batch processing.

[0080] Optionally, the parsed data in the importing state will not be pushed to the user until the import system has processed all the parsed data that need to be processed in this batch, and the data state of the parsed data is switched to the import completed state.

[0081] In an optional embodiment, Figure 5 is a flowchart of another optional method for importing file data according to an embodiment of the present application. Figure 5 As shown, the method comprises the following steps:

[0082] (1) Generate template files through data business standards and template reverse engineering codes;

[0083] (2) Trigger the target task and start the import operation;

[0084] (3) The main program of the target task is started, and the files to be imported in this batch are obtained according to the file rules. The task start flag is set to lock the task batch, thereby ensuring that no new ATPCO additional service sales rule files are imported before the import of this target task is completed, ensuring the order of file processing and avoiding interference caused by repeated imports;

[0085] (4) Parse and record file information, read all the row data of the file to be imported in order at one time, and load them into the memory. Then, identify the parsed data in the memory that will affect the order according to the data primary key corresponding to the row data, and load the parsed data with the same data primary key into an ordered queue;

[0086] (5) Start the corresponding parsing thread according to the data primary key of the parsed data, and each data primary key corresponds to a parsing thread;

[0087] (6) The parsing thread will parse the parsed data based on the template file, thereby locating the business primary key of the parsed data, and process the parsed data according to the business requirements corresponding to the business primary key, and then put the processed parsed data into the corresponding operation list;

[0088] (7) Start the warehousing thread, and when the amount of data to be processed is greater than a preset threshold, start multi-thread processing, optimize the way of processing the row data in the import file one by one to batch modification or batch addition operations, and in the process of processing the parsed data, synchronously modify the data status of the parsed data to the importing status, and remove the importing status mark of the parsed data after all the imports are completed;

[0089] (8) After the target task is completed, the target task of this batch is unlocked and the suffix mark of the file to be imported is updated. If the import into the target database is successful, the suffix mark is updated to done; if the import into the target database fails, the suffix mark is updated to error; if the data in some files to be imported are successfully imported into the target database, but the target task fails to run as a whole, an additional file to be imported with the suffix mark todo is generated to mark all data that has not been imported into the target database.

[0090] In the present application, the import system optimizes the business logic after loading line by line so that the APTCO additional service sales rules freight rate file can be processed in fragments and in sequence, thus getting rid of the performance problem caused by having to enter the data line by line, and separating the steps of data processing and data entry, so that it can start multiple threads to process data simultaneously, thereby improving the efficiency of importing the database; and, the import system separates multiple database operations of a piece of data and uses batch processing in a unified manner, thereby improving database efficiency. At the same time, the import system reasonably distributes the batched data by identifying the unique primary key of the data through business, and starts a transaction for each batch, which can flexibly control the transaction size and avoid the problem of incomplete multiple operations on the data; finally, the import system also sets the control identifier of the task and the status identifier of the data, and avoids conflicts in file import by controlling the task, and also avoids incomplete data push, so that the push no longer needs to consider the risk that the task only imports half of the data.

[0091] From the above content, it can be seen that the present application achieves the purpose of ensuring that the target task does not import new service rule data and transportation price data before the execution of the current target task is completed by updating the identifier of the target task to the first identifier, thereby ensuring the orderliness of the process of importing the data in the file to be imported into the target database and avoiding repeated import of service rule data and transportation price data.

[0092] Furthermore, the present application uses a template file to characterize the correspondence between the data storage format of the file to be imported and the data storage format of the target database. Therefore, the present application can convert the storage format of the data in the file to be imported into a data storage format that can be recognized by the airline's database (i.e., the target database) through the template file. Then, the present application stores the data in the file to be imported after the format conversion into L operation lists, and then updates the data in the target database based on the data in the L operation lists through multiple storage threads, thereby achieving the purpose of importing the data in the file to be imported into the database, and improving the efficiency of importing data into the target database through multi-threaded batch processing operations.

[0093] It can be seen that the present application adopts a method of converting the data storage format through a template file, and importing the data in the file to be imported into the target database based on M storage threads and L operation lists, thereby achieving the technical effect of improving the efficiency of importing the data in the file to be imported into the target database, and further solving the technical problem of low efficiency of importing file data in the prior art when the data storage format of the file to be imported is different from the data storage format of the target data.

[0094] According to another aspect of the embodiment of the present application, a device for importing file data is also provided. Figure 6is a schematic diagram of an optional file data importing device according to an embodiment of the present application, such as Figure 6 As shown, the device for importing file data includes: an acquisition unit 601, a parsing unit 602 and an updating unit 603.

[0095] Optionally, an acquisition unit is used to acquire the file to be imported after updating the task identifier of the target task to the first identifier, wherein the target task is used to import the data in the file to be imported into the target database, the first identifier is used to prohibit the target task from acquiring a new file to be imported, the file to be imported is used to store the service rule data and transportation price data of the airline, and the target database is the database of the user of the file to be imported; a parsing unit is used to parse the file to be imported according to the template file to obtain L operation lists, wherein L is a positive integer, the template file is used to characterize the correspondence between the data storage format of the file to be imported and the data storage format of the target database, and the data storage format of the L operation lists is the same as the data storage format of the target database; an updating unit is used to update the target database based on the L operation lists through M warehousing threads, wherein M is a positive integer, and the M warehousing threads are at least used to batch add, modify and delete data in the target database.

[0096] In an optional embodiment, the parsing unit includes: a first parsing subunit, a loading subunit, a determining subunit, a classifying subunit and a second parsing subunit.

[0097] Optionally, a first parsing subunit is used to parse all data included in the file to be imported line by line according to the template file to obtain N parsed data, where N is a positive integer; a loading subunit is used to load the N parsed data into the target memory; a determining subunit is used to determine the data primary key of each parsed data in the target memory according to the template file, where the data primary key is used to characterize the file type and file name of the file to be imported to which the parsed data belongs; a classification subunit is used to classify the N parsed data according to the data primary key of each parsed data to obtain P ordered queues, where P is a positive integer, and the data primary key of any two parsed data stored in each of the P ordered queues is the same; a second parsing subunit is used to parse the P ordered queues according to the template file to obtain L operation lists.

[0098] In an optional embodiment, the second parsing subunit includes: a first determination module, a second determination module and a processing module.

[0099] Optionally, a first determination module is used to determine the business primary key of each parsed data in each ordered queue based on a template file, wherein the business primary key is used to characterize the type of business represented by the parsed data; a second determination module is used to determine the preset rule corresponding to each ordered queue based on the business primary key of each parsed data in each ordered queue, wherein the preset rule is at least used to deduplicate the parsed data in P ordered queues; and a processing module is used to process the P ordered queues according to the preset rules corresponding to each ordered queue to obtain L operation lists.

[0100] In an optional embodiment, the state of the parsed data is any one of the following first state, second state, third state and fourth state, wherein the first state is used to characterize that the effective end time of the parsed data is earlier than the effective start time; the second state is used to characterize that the effective end time of the parsed data is earlier than the current time; the third state is used to characterize that the effective start time of the parsed data is earlier than the effective end time, and the effective end time of the parsed data is later than the current time; the fourth state is used to characterize that the effective start time of the parsed data is earlier than the effective end time, and the effective start time of the parsed data is later than the current time.

[0101] In an optional embodiment, the processing module includes: a first detection submodule, a second detection submodule and a first adding submodule.

[0102] Optionally, a first detection submodule is used to detect the total number of parsed data in the i-th ordered queue when the preset rule corresponding to the i-th ordered queue is the first preset rule, wherein the first preset rule is used to process the parsed data representing the real parameters in the file to be imported, and i is a positive integer less than or equal to P; a second detection submodule is used to detect the state of the first parsed data when the total number of parsed data in the i-th ordered queue is equal to 1, wherein the first parsed data is the parsed data in the i-th ordered queue; a first adding submodule is used to add the first parsed data to the first operation list when the state of the first parsed data is the first state or the second state, wherein the warehousing thread is used to perform batch modification operations on the target database according to the first operation list.

[0103] In an optional embodiment, the processing module further includes: a third detection submodule, a second adding submodule, and a third adding submodule.

[0104] Optionally, a third detection submodule is used to detect whether there is target parsed data corresponding to the first parsed data in the target database when the state of the first parsed data is the third state or the fourth state, wherein the target parsed data has the same data primary key as the corresponding parsed data and the state is the third state; a second adding submodule is used to add the first parsed data to the first operation list and the second operation list when the target parsed data corresponding to the first parsed data exists in the target database, wherein the warehousing thread is used to perform batch new operations on the target database according to the second operation list; a third adding submodule is used to add the first parsed data to the second operation list when the target parsed data corresponding to the first parsed data does not exist in the target database.

[0105] In an optional embodiment, the processing module further includes: a fourth detection submodule, a fourth adding submodule, a fifth adding submodule and a sixth adding submodule.

[0106] Optionally, a fourth detection submodule is used to detect the state of the second parsed data when the total number of parsed data in the i-th ordered queue is greater than 1, wherein the second parsed data is the parsed data with the latest generation time in the i-th ordered queue; a fourth adding submodule is used to delete the parsed data except the second parsed data in the i-th ordered queue when the state of the second parsed data is the first state or the second state and there is target parsed data corresponding to the second parsed data, and add the second parsed data to the first operation list; a fifth adding submodule is used to add the second parsed data to the first operation list and the second operation list when the state of the second parsed data is the third state or the fourth state and there is target parsed data corresponding to the second parsed data; a sixth adding submodule is used to add the second parsed data to the second operation list when the state of the second parsed data is the third state or the fourth state and there is no target parsed data corresponding to the second parsed data.

[0107] In an optional embodiment, the processing module further includes: a determination submodule, a seventh adding submodule and an eighth adding submodule.

[0108] Optionally, a judging submodule is used to judge whether there is corresponding target parsing data for each parsing data in the ith ordered queue when the preset rule corresponding to the ith ordered queue is the second preset rule, wherein the second preset rule is used to process the parsing data representing the correspondence between the real parameters in the file to be imported; a seventh adding submodule is used to add the jth parsing data to the third operation list when there is corresponding target parsing data for the jth parsing data in the ith ordered queue, wherein the warehousing thread is used to perform batch deletion operations on the target database according to the third operation list, and j is a positive integer; an eighth adding submodule is used to add the jth parsing data to the second operation list when there is no corresponding target parsing data for the jth parsing data.

[0109] From the above content, it can be seen that the present application achieves the purpose of ensuring that the target task does not import new service rule data and transportation price data before the execution of the current target task is completed by updating the identifier of the target task to the first identifier, thereby ensuring the orderliness of the process of importing the data in the file to be imported into the target database and avoiding repeated import of service rule data and transportation price data.

[0110] Furthermore, the present application uses a template file to characterize the correspondence between the data storage format of the file to be imported and the data storage format of the target database. Therefore, the present application can convert the storage format of the data in the file to be imported into a data storage format that can be recognized by the airline's database (i.e., the target database) through the template file. Then, the present application stores the data in the file to be imported after the format conversion into L operation lists, and then updates the data in the target database based on the data in the L operation lists through multiple storage threads, thereby achieving the purpose of importing the data in the file to be imported into the database, and improving the efficiency of importing data into the target database through multi-threaded batch processing operations.

[0111] It can be seen that the present application adopts a method of converting the data storage format through a template file, and importing the data in the file to be imported into the target database based on M storage threads and L operation lists, thereby achieving the technical effect of improving the efficiency of importing the data in the file to be imported into the target database, and further solving the technical problem of low efficiency of importing file data in the prior art when the data storage format of the file to be imported is different from the data storage format of the target data.

[0112] According to another aspect of an embodiment of the present application, a computer program product is further provided, the computer program product comprising a stored computer program, wherein when the computer program is running, the computer program product is controlled to execute any one of the above-mentioned file data importing methods.

[0113] According to another aspect of an embodiment of the present application, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any of the above-mentioned file data importing methods by executing the executable instructions.

[0114] Optionally, Figure 7 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 7 As shown, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and implements any of the above-mentioned file data importing methods when the processor executes the program.

[0115] The above-mentioned embodiments or examples disclosed in the present application are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection disclosed in the present application. In the absence of contradiction, each step in a certain embodiment or example in the present application can be implemented as an independent example, and the steps can be combined arbitrarily. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the various embodiments or examples can be combined arbitrarily, for example, some or all steps of different embodiments or examples can be combined arbitrarily, and a certain embodiment or example can be combined arbitrarily with the optional methods or optional examples of other embodiments or examples.

[0116] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0117] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0118] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0119] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0120] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0121] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0122] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0123] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0124] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for importing file data, characterized in that: include: After the task identifier of the target task is updated to the first identifier, a file to be imported is obtained, wherein the target task is used to import the data in the file to be imported into the target database, the first identifier is used to prohibit the target task from obtaining a new file to be imported, and the file to be imported is used to store the service rule data and transportation price data of the airline; Parsing the file to be imported according to the template file to obtain L operation lists, where L is a positive integer, the template file is used to represent the corresponding relationship between the data storage format of the file to be imported and the data storage format of the target database, and the data storage format of the L operation lists is the same as the data storage format of the target database; The data in the file to be imported is imported into the target database through M storage threads and the L operation lists, wherein M is a positive integer, and the M storage threads are at least used to perform batch addition, modification and deletion operations on the data in the target database.

2. The method for importing file data according to claim 1, characterized in that: Parse the file to be imported according to the template file to obtain L operation lists, including: Parsing all data included in the file to be imported line by line according to the template file to obtain N parsed data, where N is a positive integer; Load the N parsed data into the target memory; Determine a data primary key of each parsed data in the target memory according to the template file, wherein the data primary key is used to characterize the file type and file name of the file to be imported to which the parsed data belongs; Classifying the N parsed data according to the data primary key of each parsed data to obtain P ordered queues, where P is a positive integer, and the data primary key of any two parsed data stored in each of the P ordered queues is the same; The P ordered queues are parsed according to the template file to obtain the L operation lists.

3. The method for importing file data according to claim 2, characterized in that: The P ordered queues are parsed according to the template file to obtain the L operation lists, including: Determining a business primary key of each parsed data in each ordered queue according to the template file, wherein the business primary key is used to characterize the business type represented by the parsed data; Determining a preset rule corresponding to each ordered queue according to the business primary key of each parsed data in each ordered queue, wherein the preset rule is at least used to deduplicate the parsed data in the P ordered queues; The P ordered queues are processed according to the preset rule corresponding to each ordered queue to obtain the L operation lists.

4. The method for importing file data according to claim 2, characterized in that: The state of the parsed data is any one of the following first state, second state, third state and fourth state, wherein the first state is used to indicate that the effective end time of the parsed data is earlier than the effective start time; The second state is used to indicate that the validity end time of the parsed data is earlier than the current time; The third state is used to indicate that the effective start time of the parsed data is earlier than the effective end time, and the effective end time of the parsed data is later than the current time; The fourth state is used to represent that the effective start time of the parsed data is earlier than the effective end time, and the effective start time of the parsed data is later than the current time.

5. The method for importing file data according to claim 4, characterized in that: In the process of processing the P ordered queues according to the preset rule corresponding to each ordered queue, the file data importing method further includes: In a case where the preset rule corresponding to the i-th ordered queue is the first preset rule, detecting the total amount of parsed data in the i-th ordered queue, wherein the first preset rule is used to process the parsed data representing the real parameters in the file to be imported, and i is a positive integer less than or equal to P; When the total number of parsed data in the i-th ordered queue is equal to 1, detecting the state of first parsed data, wherein the first parsed data is the parsed data in the i-th ordered queue; When the state of the first parsed data is the first state or the second state, the first parsed data is added to a first operation list, wherein the warehousing thread is used to perform batch modification operations on the target database according to the first operation list.

6. The method for importing file data according to claim 5, characterized in that: After detecting the state of the first parsed data, the file data importing method further includes: When the state of the first parsed data is the third state or the fourth state, detecting whether there is target parsed data corresponding to the first parsed data in the target database, wherein the target parsed data has the same data primary key as the corresponding parsed data and the state is the third state; If target parsed data corresponding to the first parsed data exists in the target database, the first parsed data is added to the first operation list and the second operation list, wherein the warehousing thread is used to perform batch adding operations on the target database according to the second operation list; When there is no target parsed data corresponding to the first parsed data in the target database, the first parsed data is added to the second operation list.

7. The method for importing file data according to claim 5, characterized in that: After detecting the total amount of parsed data in the i-th ordered queue, the file data importing method further includes: When the total number of parsed data in the i-th ordered queue is greater than 1, detecting the state of second parsed data, wherein the second parsed data is the parsed data with the latest generation time in the i-th ordered queue; When the state of the second parsed data is the first state or the second state, and there is target parsed data corresponding to the second parsed data, deleting the parsed data except the second parsed data in the i-th ordered queue, and adding the second parsed data to the first operation list; When the state of the second parsed data is the third state or the fourth state and there is target parsed data corresponding to the second parsed data, adding the second parsed data to the first operation list and the second operation list; When the state of the second parsed data is the third state or the fourth state and there is no target parsed data corresponding to the second parsed data, the second parsed data is added to the second operation list.

8. The method for importing file data according to claim 4, characterized in that: In the process of processing the P ordered queues according to the preset rule corresponding to each ordered queue, the file data importing method further includes: In a case where the preset rule corresponding to the i-th ordered queue is the second preset rule, determining whether each parsed data in the i-th ordered queue has corresponding target parsed data, wherein the second preset rule is used to process the parsed data representing the corresponding relationship between the real parameters in the file to be imported; If the j-th parsed data in the i-th ordered queue has corresponding target parsed data, the j-th parsed data is added to a third operation list, wherein the warehousing thread is used to perform a batch deletion operation on the target database according to the third operation list, and j is a positive integer; In a case where the j-th parsed data does not have corresponding target parsed data, the j-th parsed data is added to the second operation list.

9. A device for importing file data, characterized in that: include: an acquisition unit, configured to acquire a file to be imported after updating the task identifier of a target task to a first identifier, wherein the target task is used to import data in the file to be imported into a target database, the first identifier is used to prohibit the target task from acquiring a new file to be imported, the file to be imported is used to store service rule data and transportation price data of an airline, and the target database is a database of a user of the file to be imported; a parsing unit, configured to parse the file to be imported according to a template file to obtain L operation lists, wherein L is a positive integer, the template file is used to represent the corresponding relationship between the data storage format of the file to be imported and the data storage format of the target database, and the data storage format of the L operation lists is the same as the data storage format of the target database; An updating unit is used to update the target database based on the L operation lists through M storage threads, wherein M is a positive integer, and the M storage threads are at least used to perform batch addition, modification and deletion operations on data in the target database.

10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the file data importing method described in any one of claims 1 to 9.