Data loading method, device, equipment and storage medium
By judging and skipping the loading of data files whose waiting time exceeds the tolerance in the data warehouse system, the problem of low data loading efficiency is solved and the normal loading of data files is ensured to proceed smoothly.
Patent Information
- Application Number
- CN202110699549.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-23
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-06-23
AI Technical Summary
The problem of low data loading efficiency is mainly due to the unstable generation time of data files generated by the upstream system, which causes the downstream system to continue to wait for ungenerated data files, affecting the loading of subsequent data files.
In the data warehouse system, by obtaining the job plan list, determine whether the data file of the target job plan exists, and judge whether to skip the job plan according to the preset time. If the waiting time is within the tolerance, skip the job plan and select New target job plan, execute other job plans to improve data loading efficiency.
By skipping the loading of certain data files, the data loading efficiency is improved, ensuring the normal loading of subsequent data files without affecting the data loading process.
Smart Images

Figure CN113312357B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to computer technology, and in particular to a data loading method, device, equipment and storage medium. Background Art
[0002] With the development of computers, data is becoming more and more important to enterprises. According to the data flow, the systems used by enterprises can be divided into upstream systems and downstream systems, and data can be exchanged between upstream systems and downstream systems.
[0003] The upstream system is the system that generates data, and the downstream system is the system that uses the data. The upstream system needs to export the data to form a data file and send it to the downstream system, and the downstream system loads the data according to the data file. Generally, the upstream system will send the data file to the downstream system the next day, but due to many factors, the generation time of the data file is unstable. There may be a day when the data file cannot be generated and cannot be sent to the downstream system. If the downstream system does not receive the data file of that day, it will continue to wait for the data file of that day.
[0004] However, if the downstream system continues to wait for data files, even if data files arrive after that day, they cannot be loaded, resulting in low data loading efficiency. Summary of the invention
[0005] The present application provides a data loading method, device, equipment and storage medium to solve the problem of low data loading efficiency.
[0006] In a first aspect, the present application provides a data loading method, which is applied to a data warehouse system, wherein the data warehouse system loads data into a data table according to a data file, and the method comprises: obtaining a job plan list of the data table, the job plan list comprising multiple job plans, each job plan in the multiple job plans corresponding to a data file; determining a target job plan among the multiple job plans; if the data file corresponding to the target job plan does not exist, determining whether the waiting time of the data file corresponding to the target job plan is less than or equal to a preset time; if the waiting time of the data file corresponding to the target job plan is less than or equal to the preset time, then if the preset loading strategy of the data table indicates that the target job plan can be skipped, skipping the target job plan, and determining a new target job plan among the multiple job plans.
[0007] In a second aspect, the present application provides a data loading device, which is applied to a data warehouse system, and the data warehouse system loads data into a data table according to a data file. The device includes: an acquisition module, which is used to acquire a job plan list of the data table, and the job plan list includes multiple job plans, and each job plan in the multiple job plans corresponds to a data file; a determination module, which is used to determine a target job plan among the multiple job plans; the determination module is also used to determine whether the waiting time of the data file corresponding to the target job plan is less than or equal to a preset time if the data file corresponding to the target job plan does not exist; the determination module is also used to skip the target job plan if the waiting time of the data file corresponding to the target job plan is less than or equal to the preset time, and determine a new target job plan among the multiple job plans if the preset loading strategy of the data table indicates that the target job plan can be skipped.
[0008] In a third aspect, the present application provides an electronic device, comprising: a memory, a processor; a memory; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the method described in the first aspect.
[0009] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0010] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0011] The data loading method, device, equipment and storage medium provided by the present application determine whether the waiting time of the data file corresponding to the target operation plan is less than or equal to the preset time when the data file corresponding to the target operation plan does not exist, and skip the target operation plan when the waiting time of the data file corresponding to the target operation plan is less than or equal to the preset time, and the preset loading strategy of the data table indicates that the target operation plan can be skipped, and determine a new target operation plan among multiple operation plans. Since the tolerance judgment is made according to the preset time, and whether the target operation plan can be skipped is determined according to the preset loading strategy, and the target operation plan that can be skipped is skipped within the tolerance range, and other operation plans are executed, it does not affect other subsequent data loading processes, thereby improving the data loading efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0013] Figure 1 An application scenario diagram provided for an embodiment of the present application;
[0014] Figure 2 The process of the data loading method provided in the embodiment of the present application Figure 1 ;
[0015] Figure 3 A schematic diagram of a jump loading strategy provided in an embodiment of the present application;
[0016] Figure 4 A schematic diagram of the latest loading strategy provided in the embodiment of the present application;
[0017] Figure 5 A schematic diagram of a sequential loading strategy provided in an embodiment of the present application;
[0018] Figure 6 The process of the data loading method provided in the embodiment of the present application Figure 2 ;
[0019] Figure 7 The process of the data loading method provided in the embodiment of the present application Figure 3 ;
[0020] Figure 8 A schematic diagram of the structure of a data loading device provided in an embodiment of the present application;
[0021] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0022] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0023] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0024] Before introducing this embodiment, please allow the terminology of this application to be explained:
[0025] Batch application: A computer application used to handle certain types of batch processing business. A batch application can process one or more batch job plans.
[0026] Batch job plan: A job plan used to perform a specific task in a batch application. A job plan includes one or more batch nodes.
[0027] Batch node: A node used to execute a specific step in a batch job plan, specifically to execute a program or transaction. A batch node is the smallest granularity unit in a batch application.
[0028] Figure 1 This is an application scenario diagram provided by the embodiment of the present application. Figure 1 As shown, the application scenario includes: data source, data loading, data warehouse engine and front-end tools;
[0029] The data source may be a business database, such as an Oracle database or a MySQL database; the data source may also be document data, such as an STL file or a TXT file; the data source may also be other data.
[0030] Data loading involves converting the format of data obtained from the data source and storing it in the data warehouse.
[0031] The data warehouse engine includes different servers. Different servers obtain data from the data warehouse and provide different services to front-end users, including data query services, data reporting services, data analysis services and various applications.
[0032] Front-end tools include data query tools, data mining tools, report generation tools, and application development tools based on data warehouses.
[0033] Among them, the data source can be understood as the upstream system, and the data warehouse can be understood as the downstream system.
[0034] The upstream system generates the data required by the downstream system as a data file and sends it to the downstream system. If the downstream system receives the data file, it will load the data according to the data file. The upstream system 11 is affected by various factors, and there may be a situation where the data file cannot be sent to the downstream system at one time. For example, the upstream system and the downstream system agree that the upstream system will generate the data generated every day as a data file and send it to the downstream system. Then on the first day, the upstream system sends the data file to the downstream system. However, on the second day, due to some factors, the upstream system does not send the data file to the downstream system. Even if the downstream system receives the data file on the third day, the downstream system will not load the data according to the data file on the third day, but will continue to receive the data file on the second day until the data file on the second day is received. The data files of the second and third days are loaded. If the data file of the second day is not received continuously, it will affect the loading of the data files arriving on the third day and thereafter, which will affect the data loading efficiency.
[0035] In view of the above technical problems, the inventor of the present application proposes the following technical concept: for some data tables, even if a data file of a certain time is not loaded, it does not affect the loading of the next data file. Therefore, the data table can be divided into different types of data tables according to the characteristics of the data table, and a data loading strategy can be set for different types of data tables. The data loading strategy is used to indicate whether the data file of a certain time can be skipped when the data file of a certain time does not exist, and the data can be loaded according to the next data file, so that when the data file of a certain time does not exist, the subsequent data file can also be loaded, which does not affect the loading of the subsequent data file, thereby improving the data loading efficiency.
[0036] Furthermore, a tolerance may be set for each data table, that is, the maximum delay time that can be tolerated for a data file to arrive after the data file time. If the late arrival time of the data file is within the tolerance range, the data file can still be loaded.
[0037] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0038] Figure 2 The process of the data loading method provided in the embodiment of the present application Figure 1 .like Figure 2 As shown, the data loading method includes the following steps:
[0039] S201. Obtain a job plan list of a data table, where the job plan list includes multiple job plans, and each of the multiple job plans corresponds to a data file.
[0040] The execution subject of the method of this embodiment is a data warehouse system. The data file includes the data to be saved in the data warehouse, which can be Figure 1 Data sources in the illustrated embodiment.
[0041] For example, the upstream system needs to generate daily data into a data file and send it to the downstream system. The time when the upstream system generates the data is the data file date. The data warehouse system receives the data file according to the receiving time, and when the data file is received, it loads the data into the data table according to the data file.
[0042] Normally, since the upstream system usually sends data files to the data warehouse system at the end of the day, the time when the data warehouse system receives the data file will be later than the data file time, that is, the data file received on T+n day is the data file of T day.
[0043] The data file time corresponding to each of the multiple job plans does not exceed the current time, and may be earlier than the current time or equal to the current time.
[0044] The following table introduces the job plan list:
[0045] Table 1 Job plan list
[0046] Work plan Data file date Work Plan 1 June 14, 2021 Work Plan 2 June 15, 2021 Work Plan 3 June 16, 2021
[0047] In this embodiment, the multiple job plans can be understood as batch job plans, and batch applications can be used to perform batch processing on the multiple job plans.
[0048] S202: Determine a target operation plan among multiple operation plans.
[0049] In this embodiment, the data table is configured with a data loading sequence, which includes a first loading sequence and a second loading sequence. The first loading sequence is used to indicate that data is loaded in the order of data file time from earliest to latest. The second loading sequence is used to indicate that data is loaded in the order of the most recently received data file.
[0050] This step is to determine the target operation plan among multiple operation plans according to the data loading sequence configured in the data table. Specifically, if the data loading sequence of the data table is the first type of loading strategy, the operation plan corresponding to the earliest receiving time among the multiple operation plans is used as the target operation plan. If the data loading sequence of the data table is the second type of loading strategy, the operation plan corresponding to the latest receiving time among the multiple operation plans is used as the target operation plan.
[0051] S203: Determine whether a data file corresponding to the target operation plan exists.
[0052] Specifically, it is to determine whether the downstream system has received the data file corresponding to the target operation plan sent by the upstream system. For example, for the operation plan corresponding to the data file date of June 14, 2021, it is to determine whether the data file corresponding to the data file date of June 14, 2021 is received, that is, to determine whether the upstream system sends the data file of June 14, 2021 to the downstream system.
[0053] S204: If the data file corresponding to the target operation plan does not exist, determine whether the waiting time of the data file corresponding to the target operation plan is less than or equal to a preset time.
[0054] The waiting time of the data file corresponding to the target operation plan is the time difference between the current time and the receiving time of the data file corresponding to the target operation plan. The receiving time refers to the time when the downstream system pre-sets the first receiving of the data file. The receiving time is associated with the data file time. For example, the upstream system generates the data of the day as a data file and sends the data file to the data warehouse system on the next day. The corresponding time on the next day is the receiving time.
[0055] In this embodiment, the preset time is the maximum delay time between the arrival time of the data file and the data file time.
[0056] Assume that the preset time is R, R is an integer greater than or equal to 0, the unit is day, the current time is CDATE, and the data file time of the current job plan is RDATE. Then, based on the data file time, the current time, and the preset time, it can be determined whether the data file time corresponding to the target job plan exceeds the tolerance set by the user. Specifically: if CDATE-RDATE>R+n, it is determined to exceed the tolerance; if CDATE-RDATE≤R+n, it is determined to be within the tolerance range.
[0057] The preset time is determined according to the tolerance set by the user and the time difference between the time when the downstream system receives the data file and the time when the data file is generated. Specifically, the preset time = the tolerance set by the user + the time difference between the time when the downstream system receives the data file and the time when the data file is generated.
[0058] The downstream system receives the data file within the receiving time of the data file, and the receiving result includes: receiving the data file and not receiving the data file.
[0059] In some optional implementations, the tolerance can be determined according to the data service corresponding to the data table. For example, if the data table provides a weekly report service, the tolerance of the data table can be set to 7 days.
[0060] If the data table provides monthly report service, the tolerance of the data table can be set to 30 days.
[0061] Among them, n is the time difference between the time when the downstream system receives the data file and the data file time. Since the time when the downstream receives the upstream data is later than the data file time, that is, the data file received on T+n is the data of T day, n is a positive integer greater than 1. For example, the upstream system generally processes the data at the end of the day and sends the data file to the downstream system the next day, then n can be 1.
[0062] S205: If yes, then if the preset loading strategy of the data table indicates that the target operation plan can be skipped, the target operation plan is skipped, and a new target operation plan is determined from among the multiple operation plans.
[0063] In this embodiment, the data table is further configured with a preset loading strategy, and the preset loading strategy is used to indicate whether the job plan can be skipped and other job plans can be executed when the data file corresponding to the job plan does not exist.
[0064] Still taking Table 1 as an example, the current time is June 16, 2021, and the preset time is 3 days. For the job plan corresponding to June 14, 2021, if there is no data file on June 14, 2021, it is determined whether the waiting time for the data file on June 14, 2021 is less than or equal to 3. If it is less than or equal to 3, and the preset loading strategy of the data table indicates that the target job plan can be skipped, the job plan corresponding to June 14, 2021 is skipped, and the job plan corresponding to June 15, 2021 is used as the new target job plan, and return to execute S202.
[0065] S206: If not, record the status of the target operation plan as timeout and send an alarm message.
[0066] S207: If the data file corresponding to the target operation plan exists, data is loaded according to the data file corresponding to the target operation plan, and the status of the target operation plan is recorded as completed.
[0067] Specifically, it refers to importing the data in the data file corresponding to the target operation plan into the data table.
[0068] In this embodiment, the data table is provided with data loading types, and the data loading types include full loading, incremental loading, and the like.
[0069] For full load, this step is to refresh the data table according to the data in the data file corresponding to the target job plan, that is, to rewrite the data table.
[0070] For incremental loading, this step is to add the changed data to the data table based on the data in the data file corresponding to the target job plan.
[0071] This embodiment determines whether the waiting time of the data file corresponding to the target operation plan is less than or equal to the preset time when the data file corresponding to the target operation plan does not exist, and skips the target operation plan when the waiting time of the data file corresponding to the target operation plan is less than or equal to the preset time and the preset loading strategy of the data table indicates that the target operation plan can be skipped, and determines a new target operation plan from multiple operation plans. Since the tolerance is judged according to the preset time, and whether the target operation plan can be skipped is determined according to the preset loading strategy, and the target operation plan that can be skipped is skipped within the tolerance range, and other operation plans are executed, it does not affect other subsequent data loading processes, thereby improving data loading efficiency.
[0072] Based on the above embodiment, the preset loading strategy can be divided into a skip loading strategy, a latest loading strategy and a sequential loading strategy. The skip loading strategy and the latest loading strategy are strategies that indicate that the job plan cannot be skipped to execute other job plans when the job plan is not completed.
[0073] The skip loading strategy is used to indicate that when the current job plan is not completed, the current job plan can be skipped and other job plans can be executed.
[0074] Exemplarily, two data files that are adjacent in data file time are respectively referred to as a first data file and a second data file, wherein the data file time of the first data file is earlier than the data file time of the second data file.
[0075] The jump loading strategy is applicable to the situation where the loading result of the first data file has no impact on the second data file. In this situation, even if the data in the first data file is not loaded, the data in the second data file can be loaded.
[0076] Figure 3 A schematic diagram of a jump loading strategy provided in an embodiment of the present application.
[0077] like Figure 3 As shown, please refer to Table 1, take the operation plan corresponding to the data file time on June 14, 2021 as the target operation plan, and determine whether the data file on June 14, 2021 exists. If the data file on June 14, 2021 does not exist, take the operation plan on June 15, 2021 as the new target operation plan. If the data file on June 15, 2021 exists, the data file on June 15, 2021 can be loaded.
[0078] In an embodiment of the jump loading strategy, a new target operation plan is determined among multiple operation plans, including: determining the operation plan corresponding to the next earliest receiving time among the multiple operation plans as the new target operation plan.
[0079] Among them, the latest loading strategy is used to indicate that for the second type of loading order, if there is no data file with the latest data file time, and the waiting time of the data file corresponding to the target job plan is less than or equal to the preset time, then the job plan corresponding to the next latest data file time is obtained as the new target job plan.
[0080] Figure 4 A schematic diagram of the latest loading strategy provided in an embodiment of the present application.
[0081] like Figure 4 As shown, please refer to Table 1. The latest loading strategy refers to loading data according to the data file with the latest data file time received. Specifically, it means executing each operation plan in the order from back to front in Table 1, that is: taking the operation plan corresponding to the data file time of June 16, 2021 as the target operation plan, and judging whether the data file of June 16, 2021 exists. If not, taking the operation plan of June 15, 2021 as the new target operation plan, if the data file of June 15, 2021 exists, then the data file of June 15, 2021 can be loaded.
[0082] In an embodiment of the latest loading strategy, a new target operation plan is determined among multiple operation plans, including: determining the operation plan corresponding to the latest receiving time among the multiple operation plans as the new target operation plan.
[0083] Among them, the sequential loading strategy is used to indicate that for the first type of loading sequence, if there is no data file corresponding to the target job plan, and the waiting time of the data file corresponding to the target job plan is less than or equal to the preset time, the execution status of the job plan is recorded as not executed and ends.
[0084] Two data files adjacent in data file time are respectively referred to as a first data file and a second data file, wherein the data file time of the first data file is earlier than the data file time of the second data file.
[0085] Sequential loading is applicable to the situation where the loading result of the first data file affects the second data file. In this situation, the data in the first data file needs to be loaded before the data in the second data file can be loaded.
[0086] Figure 5 A schematic diagram of a sequential loading strategy provided for an embodiment of the present application.
[0087] like Figure 5 As shown, please refer to Table 1. Sequential loading means that the data file on June 14, 2021 can be loaded only after the data file on June 14, 2021 is loaded. If the data file on June 14, 2021 does not exist, the data file on June 15, 2021 cannot be loaded even if the data file on June 15, 2021 has been received.
[0088] On the basis of the above embodiment, the preset loading strategy of the data table may also be determined according to the type of the data table. Figure 6 The process of the data loading method provided in the embodiment of the present application Figure 2 .like Figure 6 As shown, the method includes:
[0089] S601. Determine the type of the data table, which includes a master file type and a detail file type.
[0090] In some examples, the master file type includes accounts, and the detail type includes transaction flow.
[0091] S602: If the type of the data table is a primary file type, determine that the preset loading strategy of the data table is such that the target operation plan cannot be skipped.
[0092] S603: If the type of the data table is a detailed type, determine that the preset loading strategy of the data table is capable of skipping the target job plan.
[0093] Based on the above embodiment, the job plan list includes the job plan of the current time and the job plan that has not been completed before the current time. Before this step, it is necessary to generate the job plan list. Figure 7The process of the data loading method provided in the embodiment of the present application Figure 3 .like Figure 7 As shown, a job schedule list needs to be generated, including:
[0094] S701: Whether the current time reaches the receiving time of the data file of the data table.
[0095] This embodiment determines whether it is necessary to generate a job plan based on the receiving time of the data file of the data table.
[0096] S702: If the current time reaches the receiving time of the data file of the data table, a job plan for the current time is generated and added to a pre-established job plan list.
[0097] S703: If the current time does not reach the receiving time of the data file of the data table, then the job plan for the current time is not generated.
[0098] After generating the job plan for the current time, Figure 2 The steps of the illustrated embodiment process the current job plan and record the status of the job plan according to the processing result. Specifically, if the current job plan is not completed, the status of the current job plan is recorded as incomplete; if the current job plan is completed, the current job plan in the job plan list is deleted, or the status of the current job plan in the job plan list is recorded as completed; if the current job plan has timed out, the status of the current job plan in the job plan list is recorded as timed out, and an alarm message is sent.
[0099] It should be understood that Figure 2 The illustrated embodiment processes the job plans in the job plan list that are in an unfinished state.
[0100] For example, if the downstream system needs to receive the data file of data table A every day, then a job plan for the day needs to be generated every day. If the downstream system receives the data file of data table A every 2 days, then a job plan is generated every 2 days, and no job plan is generated during the interval.
[0101] Based on the above method embodiment, Figure 8 This is a schematic diagram of the structure of the data loading device provided in the embodiment of the present application. Figure 8As shown, the data loading device includes: an acquisition module 801 and a determination module 802; the acquisition module 801 is used to acquire a job plan list of a data table, the job plan list includes multiple job plans, and each job plan in the multiple job plans corresponds to a data file; the determination module 802 is used to determine a target job plan among the multiple job plans; the determination module 802 is also used to determine whether the waiting time of the data file corresponding to the target job plan is less than or equal to a preset time if the data file corresponding to the target job plan does not exist; the determination module 802 is also used to skip the target job plan if the waiting time of the data file corresponding to the target job plan is less than or equal to the preset time, and determine a new target job plan among the multiple job plans if the preset loading strategy of the data table indicates that the target job plan can be skipped.
[0102] In some possible designs, the device also includes: a recording module 803, which is used to record the status of the target job plan as incomplete and end if the waiting time of the data file of the target job plan is less than or equal to the preset time, and if the preset loading strategy of the data table indicates that the target job plan cannot be skipped.
[0103] In some possible designs, the determination module 802 is also used to: determine the type of the data table, the type of the data table including a main file type and a detail type; if the type of the data table is a main file type, then determine that the preset loading strategy of the data table is not capable of skipping the target job plan; if the type of the data table is a detail type, then determine that the preset loading strategy of the data table is capable of skipping the target job plan.
[0104] In some possible designs, the data file of the target job plan corresponds to a receiving time, and the receiving time is the time when the data warehouse system first receives the data file. The determination module 802 is specifically used to: if the preset loading strategy of the data table indicates to load data in the order of data file time from early to late, then the job plan corresponding to the earliest receiving time among the multiple job plans is determined as the target job plan; and the job plan corresponding to the second earliest receiving time among the multiple job plans is determined as the new target job plan.
[0105] In some possible designs, the data file of the target job plan corresponds to a receiving time, and the receiving time is the time when the data warehouse system first receives the data file. The determination module 802 is specifically used to: if the preset loading strategy of the data table indicates to load data according to the latest received data file, then the job plan corresponding to the latest receiving time among the multiple job plans is determined as the target job plan; and the job plan corresponding to the next latest receiving time among the multiple job plans is determined as the new target job plan.
[0106] In some possible designs, the device also includes a sending module 804; the recording module 803 is also used to record the status of the target job plan as timeout if the waiting time of the data file corresponding to the target job plan is greater than the preset time; the sending module 804 is used to send an alarm message if the waiting time of the data file corresponding to the target job plan is greater than the preset time.
[0107] The data loading device provided in the embodiment of the present application can be used to execute the technical solution of the data loading method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0108] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the determination module 802 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above determination module 802. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0109] Fig. 9 The electronic device provided in the embodiment of the present application is a schematic diagram of the structure of the electronic device. The electronic device may be the data warehouse system in the above embodiment, such as Fig. 9 As shown, the electronic device may include: a processor 901 , a memory 902 , and a transceiver 903 .
[0110] The processor 901 executes the computer execution instructions stored in the memory, so that the processor 901 executes the scheme in the above embodiment. The processor 901 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0111] The memory 902 is connected to the processor 901 via a system bus and completes communication between them. The memory 902 is used to store computer program instructions.
[0112] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.
[0113] The electronic device provided in the embodiment of the present application can be used to execute the technical solution of the data loading method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0114] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the data loading method of the above embodiment.
[0115] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the data loading method in the above embodiment.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0117] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0118] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A data loading method, characterized in that: Applied to a data warehouse system, the data warehouse system loads data into a data table according to a data file, and the method comprises: Obtaining a job plan list of the data table, wherein the job plan list includes a plurality of job plans, each of the plurality of job plans corresponding to a data file; Determining a target operation plan among the multiple operation plans; If the data file corresponding to the target operation plan does not exist, determining whether the waiting time of the data file corresponding to the target operation plan is less than or equal to a preset time; If the waiting time of the data file corresponding to the target operation plan is less than or equal to the preset time, then if the preset loading strategy of the data table indicates that the target operation plan can be skipped, skip the target operation plan, and determine a new target operation plan from the multiple operation plans; If the waiting time of the data file of the target operation plan is less than or equal to the preset time, then if the preset loading strategy of the data table indicates that the target operation plan cannot be skipped, the status of the target operation plan is recorded as incomplete and the operation ends; Determine the type of the data table, the type of the data table includes a master file type and a detail file type; If the type of the data table is a primary file type, determining that the preset loading strategy of the data table is such that the target operation plan cannot be skipped; If the type of the data table is a detailed type, determining that the preset loading strategy of the data table is capable of skipping the target job plan; The data file of the target operation plan corresponds to a receiving time, and the receiving time is the time when the data warehouse system first receives the data file. Then, determining the target operation plan among the multiple operation plans includes: If the preset loading strategy of the data table indicates that data is loaded in the order of data file time from earliest to latest, the operation plan corresponding to the earliest receiving time among the multiple operation plans is determined as the target operation plan; Accordingly, determining a new target operation plan from among the multiple operation plans includes: Determine the operation plan corresponding to the earliest receiving time among the multiple operation plans as a new target operation plan; The data file of the target operation plan corresponds to a receiving time, and the receiving time is the time when the data warehouse system first receives the data file. Then, determining the target operation plan among the multiple operation plans includes: If the preset loading strategy of the data table indicates to load data according to the latest received data file, then the operation plan corresponding to the latest receiving time among the multiple operation plans is determined as the target operation plan; Accordingly, determining a new target operation plan from among the multiple operation plans includes: Determine the operation plan corresponding to the latest received time among the multiple operation plans as a new target operation plan; If the waiting time of the data file corresponding to the target operation plan is greater than the preset time, the state of the target operation plan is recorded as timeout, and an alarm message is sent.
2. A data loading device, characterized in that: Applied to a data warehouse system, the data warehouse system loads data into a data table according to a data file, and the device comprises: An acquisition module, used for acquiring a job plan list of a data table, wherein the job plan list includes a plurality of job plans, and each of the plurality of job plans corresponds to a data file; A determination module, used for determining a target operation plan among the multiple operation plans; The determination module is further used to determine whether the waiting time of the data file corresponding to the target operation plan is less than or equal to a preset time if the data file corresponding to the target operation plan does not exist; The determination module is further configured to skip the target operation plan if the waiting time of the data file corresponding to the target operation plan is less than or equal to the preset time, and determine a new target operation plan from among the multiple operation plans if the preset loading strategy of the data table indicates that the target operation plan can be skipped; A recording module, configured to record the state of the target operation plan as incomplete and end the operation if the waiting time of the data file of the target operation plan is less than or equal to the preset time and the preset loading strategy of the data table indicates that the target operation plan cannot be skipped; The determining module is also used for: Determine the type of the data table, the type of the data table includes a master file type and a detail file type; If the type of the data table is a primary file type, determining that the preset loading strategy of the data table is such that the target operation plan cannot be skipped; If the type of the data table is a detailed type, determining that the preset loading strategy of the data table is capable of skipping the target job plan; The data file of the target operation plan corresponds to a receiving time, and the receiving time is the time when the data warehouse system first receives the data file. The determining module is specifically used to: If the preset loading strategy of the data table indicates that data is loaded in the order of data file time from earliest to latest, the operation plan corresponding to the earliest receiving time among the multiple operation plans is determined as the target operation plan; Determine the operation plan corresponding to the earliest receiving time among the multiple operation plans as a new target operation plan; The data file of the target operation plan corresponds to a receiving time, and the receiving time is the time when the data warehouse system first receives the data file. The determining module is specifically used to: If the preset loading strategy of the data table indicates to load data according to the latest received data file, then the operation plan corresponding to the latest receiving time among the multiple operation plans is determined as the target operation plan; Determine the operation plan corresponding to the latest received time among the multiple operation plans as a new target operation plan; The recording module is further configured to record the state of the target operation plan as timeout if the waiting time of the data file corresponding to the target operation plan is greater than a preset time; The sending module is used to send an alarm message if the waiting time of the data file corresponding to the target operation plan is greater than a preset time.
3. An electronic device, characterized in that: include: Memory, processor; Memory; a memory for storing instructions executable by the processor; Wherein, the processor is configured to implement the method of claim 1.
4. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to claim 1 when executed by a processor.
5. A computer program product, characterized in that The invention comprises a computer program, which implements the method of claim 1 when being executed by a processor.
Citation Information
Patent Citations
Intelligent implementation method and system for data missing supplementation
CN104794124A
