Data processing method and related device
By obtaining system resource load information and task scheduling plans, we optimize task priorities and resource allocation, solve real-time problems in data extraction and loading, realize timely processing of tasks and optimal time execution, and meet the real-time needs of business data. need.
Patent Information
- Application Number
- CN202410800827.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-08
AI Technical Summary
The existing technology lacks real-time optimization in the data extraction and loading process, resulting in untimely task execution and inability to meet the real-time requirements of the business for data.
By obtaining the current system resource load information and task scheduling plan, determine the task priority based on the preset task priority list, allocate resources from high to low according to the priority, execute the data extraction and loading process, and predict the best results based on the random forest algorithm. Optimize execution time and resource requirements, and dynamically adjust scheduling plans and resource allocation plans.
Ensure that tasks during the data extraction and loading process are processed in a timely manner and executed at the best time, meeting the real-time requirements of the business for data, and improving the efficiency and reliability of task execution.
Smart Images

Figure CN118747119A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method and related devices. Background Art
[0002] With the continuous development of information technology, data is generated and accumulated more and more rapidly. Many companies (such as banks) need to process large amounts of data in real time or near real time. This requires the data extraction and loading process to meet the real-time requirements of the business for data to ensure that tasks can be executed at the optimal time.
[0003] However, the existing technology lacks optimization for real-time requirements when extracting and loading data, which easily leads to untimely execution of tasks and thus fails to meet the real-time requirements of the business for data. Summary of the invention
[0004] In view of the above problems, this application provides a data processing method and related devices to meet the real-time requirements of the business on data during data extraction and loading, ensure timely processing of tasks, and ensure that tasks can be executed at the best time. The specific plan is as follows:
[0005] A data processing method, comprising:
[0006] Obtaining current system resource load information and a task scheduling plan for each task to be executed, wherein the task scheduling plan includes: task name, optimal execution time, task resource requirements, and estimated task completion time;
[0007] Determining the task priority of each of the tasks to be executed based on a preset task priority list;
[0008] According to the order of the task priorities from high to low, and based on the current system resource load information and the task scheduling plan, resources are allocated to each of the tasks to be executed one by one to obtain a task resource allocation plan;
[0009] According to the task resource allocation plan, the data extraction and loading process is executed.
[0010] Optionally, the process of determining the task priority list includes:
[0011] Based on the real-time requirements of each task, obtaining task execution data corresponding to each task;
[0012] According to the task execution data, the corresponding task is scored in multiple dimensions to obtain a total task score;
[0013] The priority of each task is set according to the total score of each task to obtain the task priority list.
[0014] Optionally, the process of determining the task scheduling plan includes:
[0015] Obtaining the task priority list and historical task execution data;
[0016] Preprocessing the historical task execution data to obtain target historical task execution data;
[0017] Extracting key feature data from the target historical task execution data;
[0018] A random forest algorithm is used on the key feature data to predict the optimal execution time, task resource requirements and estimated task completion time of each task corresponding to the historical task execution data;
[0019] Based on the task name, the optimal execution time, the task resource requirement and the estimated task completion time of each task, a task scheduling plan for each task is obtained.
[0020] Optionally, executing the data extraction and loading process according to the task resource allocation scheme includes:
[0021] Extracting task data from a data source according to the task resource allocation scheme and the task scheduling plan;
[0022] Cleaning and formatting the task data to obtain target task data;
[0023] The target task data is loaded into a target database.
[0024] Optionally, it also includes:
[0025] Acquire the target task data and task execution status information corresponding to the target task data;
[0026] Determine whether an abnormality in task execution occurs based on the task execution status information;
[0027] If so, a monitoring report is generated and an abnormal task alarm is issued.
[0028] Optionally, it also includes:
[0029] Acquiring the target task data and the monitoring report;
[0030] Using a genetic algorithm to comprehensively analyze the target task data and the monitoring report to determine current performance indicators;
[0031] Based on the current performance index and historical task execution data, the task scheduling plan and the task resource allocation scheme are adjusted to obtain a target task scheduling plan and a target task resource allocation scheme.
[0032] A data processing device, comprising:
[0033] An acquisition unit, used to acquire current system resource load information and a task scheduling plan for each task to be executed, wherein the task scheduling plan includes: task name, optimal execution time, task resource requirement and estimated task completion time;
[0034] A priority determination unit, used to determine the task priority of each of the tasks to be executed based on a preset task priority list;
[0035] An allocation scheme determining unit, configured to allocate resources to each of the tasks to be executed one by one in the order of the task priorities from high to low, according to the current system resource load information and the task scheduling plan, to obtain a task resource allocation scheme;
[0036] The execution unit is used to execute the data extraction and loading process according to the task resource allocation plan.
[0037] A computer program product includes computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the above-mentioned data processing method.
[0038] An electronic device comprises at least one processor and a memory connected to the processor, wherein:
[0039] The memory is used to store computer programs;
[0040] The processor is used to execute the computer program so that the electronic device can implement the data processing method described above.
[0041] A computer storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the data processing method described above.
[0042] From the above technical solution, it can be known that the present invention discloses a data processing method and related devices, which obtain the current system resource load information and the task scheduling plan of each task to be executed, the task scheduling plan includes the task name, the optimal execution time, the task resource requirement and the estimated task completion time, and the task priority of each task to be executed is determined based on the preset task priority list, and in the order of task priority from high to low, according to the current system resource load information and the task scheduling plan, resources are allocated to each task to be executed one by one to obtain a task resource allocation plan, and the data extraction and loading process is executed according to the task resource allocation plan. When allocating resources to each task to be executed, the present invention combines the current system resource load information, task priority, optimal execution time, task resource requirement and estimated task completion time and other information at the same time, which not only meets the real-time requirements of the business for data in the process of data extraction and loading, and ensures timely processing of tasks, but also ensures that tasks can be executed at the best time. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0044] Figure 1 A schematic diagram of a system architecture provided for this application;
[0045] Figure 2 A schematic diagram of an optional hardware structure of a terminal 100 provided in this application;
[0046] Figure 3 A schematic diagram of the structure of a server 200 provided in this application;
[0047] Figure 4 A flowchart of a data processing method provided in an embodiment of the present application;
[0048] Figure 5 A flow chart of a method for determining a task priority list provided in an embodiment of the present application;
[0049] Figure 6 A flowchart of a method for obtaining a task scheduling plan provided in an embodiment of the present application;
[0050] Figure 7 A schematic diagram of executing a data extraction and loading process according to a task resource allocation scheme provided in an embodiment of the present application;
[0051] Figure 8 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0052] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] It should be noted that the data processing method and related devices provided by the present invention can be used in the field of big data or finance. The above is only an example and does not limit the application field of the data processing method and related devices provided by the present invention.
[0054] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0055] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0056] 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 need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0057] See also Figure 1 , Figure 1 1 shows a schematic diagram of a system architecture. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1 In the example, a server is included, and the server 200 can provide the method provided in the embodiment of the present application for one or more terminals.
[0058] Among them, an application corresponding to the third-party system can be installed on the terminal 100. The above application and web page can provide an interface. The terminal 100 can receive relevant parameters entered by the user on the interface and send the above parameters to the server 200. The server 200 can obtain processing results based on the received parameters and return the processing results to the terminal 100.
[0059] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters by itself without the cooperation of the server, and the embodiments of the present application are not limited to this.
[0060] Next describe Figure 1 The product form of the mid-terminal 100;
[0061] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any limitation on this.
[0062] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.
[0063] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 These are merely examples of terminals or multi-function devices and do not constitute limitations on the terminals or multi-function devices, which may include more or fewer components than those shown in the figures, or combinations of certain components, or different components.
[0064] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the portable multifunctional device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0065] Among them, the input device 132 can receive input data and the like.
[0066] The display unit 140 may be used to display information input by a user or provided to a user, various menus of the terminal 100, an interactive interface, file display, and / or playback of any multimedia file.
[0067] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.
[0068] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.
[0069] The memory 120 may be used to store relevant software codes, the processor 170 may execute the steps of the relevant method, and may also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to implement corresponding functions.
[0070] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0071] In this embodiment of the present application, the RF unit 110 can send data to the server 200 and receive processing results sent by the server 200.
[0072] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0073] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.
[0074] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .
[0075] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.
[0076] Next describe Figure 1 The product form of the server 200;
[0077] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0078] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0079] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0080] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard drive (HDD), or a solid state drive (SSD).
[0081] The memory 204 may be used to store relevant software codes, the processor 202 may execute steps of relevant chip methods, and may also schedule other units to implement corresponding functions.
[0082] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0083] The present invention provides a data processing method, which is applied to Figure 1 The computer device in the embodiment is used as an example, and the computer device can be the terminal 100 in the above figure or a system composed of the terminal 100 and the server 200. The data processing method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0084] Reference Figure 4 , Figure 4 A flowchart of a data processing method provided in an embodiment of the present application, the method comprising:
[0085] Step S401: Obtain current system resource load information and task scheduling plans for each task to be executed.
[0086] In actual applications, the current system resource load information can be obtained through system monitoring tools (such as Prometheus, Grafana), for example, the current system resource load information, such as the bank system resource load information.
[0087] The current system resource load information mainly includes CPU (Central Processing Unit) usage, the CPU usage of each node in the current system; memory usage, the memory usage of each node in the current system; I / O load, the I / O load of each storage device in the system; network load, the network usage of the current system.
[0088] The task scheduling plan may include: task name, optimal execution time, task resource requirements and estimated task completion time.
[0089] Step S402: Determine the task priority of each task to be executed based on a preset task priority list.
[0090] Specifically, each task to be executed is matched with each task in the task priority list, and the priority corresponding to the matched target task is used as the task priority of the task to be executed.
[0091] The task priority list includes, but is not limited to, information such as task name, task type, data source, processing frequency, task priority, resource requirements, dependencies, completion deadline, and business impact.
[0092] Step S403 , in descending order of task priority, according to the current system resource load information and the task scheduling plan, resources are allocated to each of the tasks to be executed one by one to obtain a task resource allocation plan.
[0093] It should be noted that when allocating resources to each task to be executed one by one, it is necessary to ensure that high-priority tasks are supported by sufficient task resources, and at the same time consider the load balance of the system. Based on this, when allocating resources to each task to be executed one by one, this embodiment gives priority to the priority resource allocation algorithm. When there is a situation of system resource shortage and sudden increase of tasks, a load balancing algorithm based on resource utilization or a dynamic allocation algorithm based on prediction can also be used.
[0094] The task resource allocation scheme may include: task name, task priority, allocated CPU resources, allocated memory resources, allocated I / O resources, allocated network resources and task execution nodes.
[0095] Step S404: Execute data extraction and loading process according to the task resource allocation plan.
[0096] To facilitate understanding of the data processing method disclosed in this embodiment, the present invention also provides a specific embodiment as follows:
[0097] Assume that the current system resource load information obtained is:
[0098] Node 1: 8 CPU cores in total, 16 GB memory (4 CPU cores and 8 GB memory are currently idle).
[0099] Node 2: 8 CPU cores in total, 16 GB memory (currently 6 CPU cores idle, 10 GB memory).
[0100] The obtained task scheduling plan is:
[0101] Task 1: High priority, requires 2 CPU cores, 4GB of memory.
[0102] Task 2: Medium priority, requires 1 CPU core, 2GB of memory.
[0103] Task 3: Low priority, requires 1 CPU core, 1GB of memory.
[0104] The final task resource allocation scheme is:
[0105] High priority task 1 is allocated 2 CPU cores and 4GB memory on node 1.
[0106] Medium priority task 2 is allocated 1 CPU core and 2GB of memory on node 2.
[0107] Low priority task 3 is allocated 1 CPU core and 1GB memory on node 1.
[0108] According to the obtained task resource allocation plan, execute the data extraction and recording process.
[0109] In summary, the present invention discloses a data processing method, which obtains the current system resource load information and the task scheduling plan of each task to be executed, wherein the task scheduling plan includes the task name, the optimal execution time, the task resource requirement and the estimated task completion time, and determines the task priority of each task to be executed based on the preset task priority list, and allocates resources to each task to be executed one by one in the order of the task priority from high to low, according to the current system resource load information and the task scheduling plan, to obtain a task resource allocation plan, and executes the data extraction and loading process according to the task resource allocation plan. When allocating resources to each task to be executed, the present invention combines the current system resource load information, task priority, optimal execution time, task resource requirement and estimated task completion time and other information at the same time, which not only meets the real-time requirements of the business for data in the process of data extraction and loading, and ensures timely processing of tasks, but also ensures that tasks can be executed at the best time.
[0110] To further optimize the above embodiment, see Figure 5 , a flow chart of a method for determining a task priority list disclosed in an embodiment of the present invention, the method comprising:
[0111] Step S501: based on the real-time requirements of each task, obtain the task execution data corresponding to each task;
[0112] Examples of real-time requirements are as follows:
[0113] (1) Transaction data processing: Transaction data is processed every first preset time period (e.g., every minute) to ensure that transaction records are updated in real time.
[0114] (2) Risk control data processing: Perform risk analysis every second preset time period (e.g., 5 minutes) to ensure timely detection of risks.
[0115] (3) Customer behavior analysis: Analyze customer behavior every third preset time period (e.g., every hour) to ensure timely adjustment of marketing strategies.
[0116] The following is an example of the information contained in the task execution data:
[0117] (1)Task name: transaction data processing, risk control data processing, customer behavior analysis, etc.
[0118] (2) Task type: real-time processing, real-time monitoring, analysis tasks, etc.
[0119] (3) Data source: database, file system, API (Application Programming Interface), etc.
[0120] (4) Processing frequency: every minute, every 5 minutes, every hour, etc.
[0121] (5) Resource requirements: high CPU (Central Processing Unit), large memory, medium resources, etc.
[0122] (6) Dependencies: None, transaction data processing completed, all data processing completed, etc.
[0123] (7) Completion time limit: 2 minutes, 5 minutes, 10 minutes, etc.
[0124] (8) Business impact: high, medium, low.
[0125] Step S502: According to the task execution data, the corresponding task is scored in multiple dimensions to obtain a total task score;
[0126] The scoring criteria may be a 1-10 point system.
[0127] An example of multi-dimensional scoring of a task is as follows:
[0128] (1) Importance: The degree to which the task affects the business.
[0129] (2) Urgency: the time limit for completing the task.
[0130] (3) Resource requirements: resources required to execute the task.
[0131] (4) Dependency: The dependent conditions of the task.
[0132] (5) Business impact: The actual impact of the task on the business.
[0133] Step S503: setting the priority of each task according to the total score of each task to obtain a task priority list.
[0134] The task priority list includes, but is not limited to, information such as task name, task type, data source, processing frequency, priority, resource requirements, dependencies, completion deadline, and business impact.
[0135] To further optimize the above embodiment, see Figure 6 , a flow chart of a method for obtaining a task scheduling plan disclosed in an embodiment of the present invention, the method comprising:
[0136] Step S601, obtaining a task priority list and historical task execution data;
[0137] Among them, historical task execution data may include: historical execution time of the task, task resource usage (CPU, memory, I / O, etc.), execution status (success, failure, delay, etc.), bottlenecks encountered (such as performance bottlenecks) and abnormal situations (such as time-consuming operations), etc.
[0138] Step S602: pre-process the historical task execution data to obtain target historical task execution data;
[0139] The process of preprocessing historical task execution data includes but is not limited to removing outliers and filling missing values.
[0140] Step S603: extracting key feature data from the target historical task execution data;
[0141] Key characteristic data such as task type, data source, processing frequency, resource usage, etc.
[0142] Step S604: using a random forest algorithm on the key feature data, predicting the optimal execution time, task resource requirements and estimated task completion time of each task corresponding to the historical task execution data;
[0143] The random forest algorithm is a classification algorithm that uses multiple trees to train and predict samples. The advantage of the random forest algorithm is that it has strong adaptability to the disturbance of the data set and is highly robust to adverse facts in many ways.
[0144] Among them, the task resource requirements can be CPU usage, memory usage, storage requirements, network bandwidth, I / O operation requirements, and time window, that is, the time period required for the task.
[0145] Step S605: obtaining a task scheduling plan for each of the tasks based on the task name, optimal execution time, task resource requirement and estimated task completion time of each of the tasks.
[0146] To further optimize the above embodiment, see Figure 7 , a schematic diagram of executing a data extraction and loading process according to a task resource allocation scheme disclosed in an embodiment of the present invention, the method comprising:
[0147] Step S701, extracting task data from a data source according to a task resource allocation scheme and a task scheduling plan;
[0148] In actual applications, a connection can be established based on the data source information (such as database connection, file path) in the task description. According to the task resource requirements in the task scheduling plan, data query or read operations are performed, for example, extracting transaction records from the database, obtaining real-time data from the API, or reading log files from the file system. The extracted task data is stored as an intermediate file. The storage path and format of the intermediate file are specified in the task scheduling plan for subsequent processing.
[0149] The intermediate files can be: CSV (Comma-Separated Values) files, JSON (JavaScript Object Notation) files, and Parquet files.
[0150] Parquet files include row groups. The data for each column is stored together in the same row group. Each row group contains one or more data blocks. Parquet files include metadata that describes the set of rows found in each block.
[0151] Step S702: Clean and format the task data to obtain target task data;
[0152] Cleaning task data mainly involves removing empty values, duplicate values, and abnormal values from the data. For example, deleting all empty rows in the records and removing duplicate transaction records.
[0153] Convert the cleaned task data into a different format, for example, from JSON to CSV or from CSV to Parquet.
[0154] Among them, all target task data are in a unified data format and unit. For example, the date format is unified as "YYYY-MM-DD" and the currency unit is unified as RMB.
[0155] Step S703: Load the target task data into the target database.
[0156] The target database may be a PostgreSQL database. PostgreSQL is a free software object-relational database management system with a very complete set of features.
[0157] Target databases include: Data warehouse.
[0158] The loading process is specifically as follows: according to the task resource allocation plan and the target database information in the task description, a connection relationship is established with the target database, the target task data is loaded into the target database, and after the loading is completed, it is checked whether the target task data has been correctly loaded into the target database, for example, the quantity and format of the target task data are checked to ensure that the target task data is the same as the task data loaded into the target database.
[0159] To further optimize the above embodiment, after step S703, the following may also be included:
[0160] Obtain target task data and task execution status information corresponding to the target task data;
[0161] Determine whether an abnormality in task execution occurs based on the task execution status information;
[0162] If so, a monitoring report is generated and an abnormal task alarm is issued.
[0163] The task execution status may include: the execution progress of each task, the resource utilization of each task (CPU, memory, I / O, network, etc.), execution logs and historical records, etc.
[0164] In actual applications, the process of monitoring task execution status information may specifically include:
[0165] Task progress monitoring: Monitor the execution progress of each task to ensure that the task is completed on time. For example, regularly check the current progress of the task and compare it with the expected completion time.
[0166] Resource utilization monitoring: Monitor the resource utilization of each task to ensure that resources are used within a reasonable range. For example, monitor the utilization of CPU, memory, I / O, and network to ensure that there is no resource overload.
[0167] Performance monitoring: Monitor the execution performance of tasks to ensure that they are running efficiently. For example, monitor the execution time of each task to ensure that it is completed within the expected time.
[0168] The monitoring report generated in this embodiment may include: the execution progress and completion time of each task, the resource utilization of each task (CPU, memory, I / O, network, etc.), problems encountered during execution and solutions, and performance indicators (such as the execution time of each task, resource usage, etc.).
[0169] If abnormal situations such as task delays and resource bottlenecks are detected during the monitoring process, an abnormal task alarm will be issued immediately and abnormal alarm information will be generated, including:
[0170] Anomaly detection: Uses preset thresholds and rules to detect anomalies in task execution, such as when a task execution time exceeds 10% of the expected time, or when resource utilization exceeds 80%.
[0171] Alert generation: Once an anomaly is detected, an alert message is immediately generated, including the anomaly type, task name, detection time, and recommended solutions. For example, if the execution time of Task 1 exceeds the limit, an alert message is generated, suggesting adding computing resources or adjusting the execution plan.
[0172] Alarm notification: Send the generated alarm information to relevant personnel or systems so that timely measures can be taken. For example, alarm information is sent via email, SMS or system notification.
[0173] Task 1: Detect that the execution time exceeds the expected time by 15%, generate an alarm message, and recommend increasing computing resources.
[0174] Task 2: When the CPU utilization exceeds 85%, an alarm message is generated, suggesting that the task code be optimized or the execution plan be adjusted.
[0175] In actual applications, the abnormal alarm information will be received by the intelligent scheduling module, which will analyze the cause and impact of the abnormality, adjust the task scheduling plan, generate a new task scheduling plan, and reallocate computing resources to generate a new task resource allocation plan.
[0176] To further optimize the above embodiment, after step S703, the following may also be included:
[0177] Obtain target task data and monitoring reports;
[0178] Using a genetic algorithm to comprehensively analyze the target task data and the monitoring report to determine current performance indicators;
[0179] Based on the current performance indicators and historical task execution data, the task scheduling plan and task resource allocation scheme are adjusted to obtain the target task scheduling plan and target task resource allocation scheme.
[0180] When analyzing monitoring reports, the main focus is to identify optimization needs, which can include:
[0181] Task execution analysis: Identify performance bottlenecks in the execution process, such as long execution times or inefficient resource usage.
[0182] Resource utilization analysis: Identify resource misallocations, such as over- or under-utilization of resources.
[0183] Anomaly analysis: Identify anomalies and root causes in task execution, such as task delays or frequent errors.
[0184] This embodiment can also perform bottleneck identification, optimization strategy formulation, and optimization result generation, as follows:
[0185] (1) Bottleneck identification
[0186] Data analysis: By comprehensively analyzing the target task data and monitoring reports, determine which steps have performance bottlenecks. For example, by monitoring the resource utilization and task execution time in the report, identify which tasks or operations take the longest time or consume the most resources.
[0187] Indicator calculation: Calculate key performance indicators (KPIs), such as data processing throughput, task delay time, resource utilization efficiency, etc.
[0188] (2) Optimization strategy formulation
[0189] Task scheduling optimization: Adjust the task scheduling strategy based on historical task execution data and current performance indicators. For example, adjust the task execution order to avoid executing high-resource consumption tasks during high-load periods.
[0190] Resource allocation optimization: Re-evaluate the resources required for tasks and dynamically adjust resource allocation. For example, increase computing resources for high-priority tasks or reduce resource allocation when low-priority tasks are executed.
[0191] Data processing optimization: Optimize data processing operations, including data extraction, cleaning, and conversion processes. For example, adopt more efficient data processing algorithms, reduce data processing steps, or perform parallel processing.
[0192] In practical applications, after obtaining the target task scheduling plan and target task resource allocation plan, an optimization report can be generated based on the optimized task execution time, resource utilization and other information, and the optimization report can be fed back to the intelligent scheduling module to adjust the subsequent task scheduling plan and task resource allocation plan.
[0193] A data processing method provided in an embodiment of the present application is introduced above, and a device for executing the above data processing method will be introduced below.
[0194] See also Figure 8 , Figure 8 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application, the device comprising:
[0195] The acquisition unit 801 is used to acquire the current system resource load information and the task scheduling plan of each task to be executed, wherein the task scheduling plan includes: task name, optimal execution time, task resource requirement and estimated task completion time;
[0196] The current system resource load information mainly includes CPU (Central Processing Unit) usage, the CPU usage of each node in the current system; memory usage, the memory usage of each node in the current system; I / O load, the I / O load of each storage device in the system; network load, the network usage of the current system.
[0197] The priority determination unit 802 is used to determine the task priority of each task to be executed based on a preset task priority list;
[0198] The task priority list includes, but is not limited to, information such as task name, task type, data source, processing frequency, task priority, resource requirements, dependencies, completion deadline, and business impact.
[0199] The allocation scheme determining unit 803 is used to allocate resources to each of the tasks to be executed one by one in the order of task priority from high to low, according to the current system resource load information and the task scheduling plan, to obtain a task resource allocation scheme;
[0200] It should be noted that when allocating resources to each task to be executed one by one, it is necessary to ensure that high-priority tasks are supported by sufficient task resources, and at the same time consider the load balance of the system. Based on this, when allocating resources to each task to be executed one by one, this embodiment gives priority to the priority resource allocation algorithm. When there is a situation of system resource shortage and sudden increase of tasks, a load balancing algorithm based on resource utilization or a dynamic allocation algorithm based on prediction can also be used.
[0201] The resource allocation scheme may include: task name, task priority, allocated CPU resources, allocated memory resources, allocated I / O resources, allocated network resources and task execution nodes.
[0202] The execution unit 804 is used to execute the data extraction and loading process according to the task resource allocation plan.
[0203] In summary, the present invention discloses a data processing device, which obtains the current system resource load information and the task scheduling plan of each task to be executed, wherein the task scheduling plan includes the task name, the optimal execution time, the task resource requirement and the estimated task completion time, and determines the task priority of each task to be executed based on the preset task priority list, and allocates resources to each task to be executed one by one in the order of the task priority from high to low, according to the current system resource load information and the task scheduling plan, to obtain a task resource allocation plan, and executes the data extraction and loading process according to the task resource allocation plan. When allocating resources to each task to be executed, the present invention combines the current system resource load information, task priority, optimal execution time, task resource requirement and estimated task completion time and other information at the same time, which not only meets the real-time requirements of the business for data in the process of data extraction and loading, and ensures timely processing of tasks, but also ensures that tasks can be executed at the optimal time.
[0204] To further optimize the above embodiment, the data processing device may further include:
[0205] A list determination unit is used to determine a task priority list.
[0206] The list determination unit can be used specifically for:
[0207] Based on the real-time requirements of each task, obtaining task execution data corresponding to each task;
[0208] According to the task execution data, the corresponding task is scored in multiple dimensions to obtain a total task score;
[0209] The priority of each task is set according to the total score of each task to obtain the task priority list.
[0210] To further optimize the above embodiment, the data processing device may further include:
[0211] The plan determination unit is used to determine the task scheduling plan.
[0212] The plan determination unit can be specifically used for:
[0213] Obtaining the task priority list and historical task execution data;
[0214] Preprocessing the historical task execution data to obtain target historical task execution data;
[0215] Extracting key feature data from the target historical task execution data;
[0216] A random forest algorithm is used on the key feature data to predict the optimal execution time, task resource requirements and estimated task completion time of each task corresponding to the historical task execution data;
[0217] Based on the task name, the optimal execution time, the task resource requirement and the estimated task completion time of each task, a task scheduling plan for each task is obtained.
[0218] To further optimize the above embodiment, the execution unit 804 may be specifically used for:
[0219] Extracting task data from a data source according to the task resource allocation scheme and the task scheduling plan;
[0220] Cleaning and formatting the task data to obtain target task data;
[0221] The target task data is loaded into a target database.
[0222] To further optimize the above embodiment, the execution unit 804 may also be used to:
[0223] Acquire the target task data and task execution status information corresponding to the target task data;
[0224] Determine whether an abnormality in task execution occurs based on the task execution status information;
[0225] If so, a monitoring report is generated and an abnormal task alarm is issued.
[0226] To further optimize the above embodiment, the execution unit 804 may also be used to:
[0227] Acquiring the target task data and the monitoring report;
[0228] Using a genetic algorithm to comprehensively analyze the target task data and the monitoring report to determine current performance indicators;
[0229] Based on the current performance index and historical task execution data, the task scheduling plan and the task resource allocation scheme are adjusted to obtain a target task scheduling plan and a target task resource allocation scheme.
[0230] It should be noted that, for the specific working principles of each component in the device embodiment, please refer to the corresponding part of the method embodiment, which will not be repeated here.
[0231] The present application also provides an electronic device in an embodiment. Fig. 9As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include but is not limited to fixed terminals such as mobile phones, notebook computers, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Fig. 9 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0232] like Fig. 9 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0233] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Fig. 9 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0234] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any data processing method provided in the embodiment of the present application.
[0235] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any data processing method provided in the embodiment of the present application.
[0236] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0237] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0238] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0239] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
Claims
1. A data processing method, characterized in that: include: Obtaining current system resource load information and a task scheduling plan for each task to be executed, wherein the task scheduling plan includes: task name, optimal execution time, task resource requirements, and estimated task completion time; Determining the task priority of each of the tasks to be executed based on a preset task priority list; According to the order of the task priorities from high to low, and based on the current system resource load information and the task scheduling plan, resources are allocated to each of the tasks to be executed one by one to obtain a task resource allocation plan; According to the task resource allocation plan, the data extraction and loading process is executed.
2. The data processing method according to claim 1, characterized in that: The process of determining the task priority list includes: Based on the real-time requirements of each task, obtaining task execution data corresponding to each task; According to the task execution data, the corresponding task is scored in multiple dimensions to obtain a total task score; The priority of each task is set according to the total score of each task to obtain the task priority list.
3. The data processing method according to claim 1 or 2, characterized in that: The process of determining the task scheduling plan includes: Obtaining the task priority list and historical task execution data; Preprocessing the historical task execution data to obtain target historical task execution data; Extracting key feature data from the target historical task execution data; A random forest algorithm is used on the key feature data to predict the optimal execution time, task resource requirements and estimated task completion time of each task corresponding to the historical task execution data; Based on the task name, the optimal execution time, the task resource requirement and the estimated task completion time of each task, a task scheduling plan for each task is obtained.
4. The data processing method according to claim 1, characterized in that: The step of executing the data extraction and loading process according to the task resource allocation scheme includes: Extracting task data from a data source according to the task resource allocation scheme and the task scheduling plan; Cleaning and formatting the task data to obtain target task data; The target task data is loaded into a target database.
5. The data processing method according to claim 4, characterized in that: Also includes: Acquire the target task data and task execution status information corresponding to the target task data; Determine whether an abnormality in task execution occurs based on the task execution status information; If so, a monitoring report is generated and an abnormal task alarm is issued.
6. The data processing method according to claim 4, characterized in that: Also includes: Acquiring the target task data and the monitoring report; Using a genetic algorithm to comprehensively analyze the target task data and the monitoring report to determine current performance indicators; Based on the current performance index and historical task execution data, the task scheduling plan and the task resource allocation scheme are adjusted to obtain a target task scheduling plan and a target task resource allocation scheme.
7. A data processing device, characterized in that: include: An acquisition unit, used to acquire current system resource load information and a task scheduling plan for each task to be executed, wherein the task scheduling plan includes: task name, optimal execution time, task resource requirement and estimated task completion time; A priority determination unit, used to determine the task priority of each of the tasks to be executed based on a preset task priority list; An allocation scheme determining unit, configured to allocate resources to each of the tasks to be executed one by one in the order of the task priorities from high to low, according to the current system resource load information and the task scheduling plan, to obtain a task resource allocation scheme; The execution unit is used to execute the data extraction and loading process according to the task resource allocation plan.
8. A computer program product, characterized in that The method comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the data processing method according to any one of claims 1 to 6.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the data processing method as described in any one of claims 1 to 6.
10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the data processing method as described in any one of claims 1 to 6.
Citation Information
Cited By
Task processing method and device, computer equipment, storage medium and computer program product
CN119356833A
Multi-satellite multi-task parallel scheduling processing method, device, equipment, medium and product
CN119440767A
