Optimization method for improving task stability and terminal

By storing the result data in both the local disk and the distributed system storage file in the distributed system, and switching to reading from the storage file when a reading exception occurs, the problem of increased task execution time caused by disk failure in the distributed system is solved. , improving task stability and read speed.

CN118733201AActive Publication Date: 2024-10-01FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410744309.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-01
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

In a big data scenario, when a disk node fails or reads abnormally in a distributed system, the task execution time will increase significantly, resulting in a decrease in task stability.

Method used

When each root node executes a subtask, the result data is stored in both the local disk and the distributed system storage file, and the data is read from the local disk first. If a reading exception or rate limit occurs, the data is read from the local disk. Reading from distributed system storage files is mainly based on local disks and supplemented by distributed system storage files.

Benefits of technology

It effectively reduces the task time-consuming increase due to disk node failure and other situations, improves the stability of task execution, and reduces the system response time through asynchronous processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733201A_ABST
    Figure CN118733201A_ABST
Patent Text Reader

Abstract

The invention discloses an optimization method and terminal for improving task stability, and the method comprises the steps: presetting a distributed system storage file, and when each root node executes a corresponding sub-task, successively storing execution result data into a local disk corresponding to the root node and the distributed system storage file; s3, reading result data from each root node in sequence, judging whether reading abnormity occurs or not at the same time, and if yes, executing the step S3; and reading the result data of the corresponding root node from the distributed system storage file. When each root node executes the corresponding subtask, the result data is stored in the local disk and also stored in the distributed system storage file, the data of the local disk is preferentially read when the data is read, and the data on the distributed system storage file is read after the reading abnormity occurs, so that the data reading efficiency is improved. Task time consumption increased by disk node faults and the like is effectively reduced, and the stability of task execution is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an optimization method and a terminal for improving task stability. Background Art

[0002] Many current systems have the function of executing tasks for massive big data. In the big data scenario, the system mainly uses the mapperreduce method, that is, the MR method, to improve the execution efficiency of distributed tasks. The main principle is: under the map task, split the map task to each distributed node, and each node reads the data by itself, processes the data, and saves the processing result data in its own node. After that, each reduce node will read the data from the hard disk of the node of the map subtask for subsequent processing. If the map task running on a node fails before the map intermediate result is transmitted to the reduce task, the map task will be re-run on another node to re-build the map intermediate result.

[0003] In this way, the result data stored in each subtask in the map is all in the local disk, with only one copy of the data. When a node fails or the disk is abnormal, all tasks on the disk will be affected, unable to read data and continue the task, and re-running the task will have a great impact on the task execution time. Summary of the invention

[0004] The technical problem to be solved by the present invention is to propose an optimization method and terminal for improving task stability, reduce the task time increased by disk node failure and the like, and improve the stability of task execution.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] An optimization method for improving task stability comprises the following steps:

[0007] S1. Preset a distributed system storage file, and when each root node executes a corresponding subtask, store the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence;

[0008] S2, reading the result data from the local disk corresponding to each of the root nodes in turn, and determining whether a reading exception occurs, and if so, executing step S3;

[0009] S3. Read the result data of the corresponding root node from the distributed system storage file.

[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0011] An optimization terminal for improving task stability includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0012] S1. Preset a distributed system storage file, and when each root node executes a corresponding subtask, store the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence;

[0013] S2, reading the result data from the local disk corresponding to each of the root nodes in turn, and determining whether a reading exception occurs, and if so, executing step S3;

[0014] S3. Read the result data of the corresponding root node from the distributed system storage file.

[0015] The beneficial effects of the present invention are: providing an optimization method and terminal for improving task stability, presetting a distributed system storage file for distributed tasks, so that when each root node executes the corresponding subtask, not only the result data is stored in the local disk, but also the result data is stored in the distributed system storage file, and when reading data, the data on the local disk is read first, and after a reading exception occurs, the data on the distributed system storage file is read instead, the local disk is used as the main method, and the distributed system storage file is used as the auxiliary method, which effectively reduces the task time increased by disk node failure and the like, and improves the stability of task execution. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of the steps of an optimization method for improving task stability of the present invention;

[0017] Figure 2 A flowchart of reading result data from a single child node in an optimization method for improving task stability according to an embodiment of the present invention;

[0018] Figure 3 The system block diagram of an optimization terminal for improving task stability according to the present invention.

[0019] Description of labels:

[0020] 1. An optimized terminal for improving task stability; 2. Memory; 3. Processor. DETAILED DESCRIPTION

[0021] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0022] Please refer to Figure 1 and Figure 2 , an optimization method for improving task stability, comprising the following steps:

[0023] S1. Preset a distributed system storage file, and when each root node executes a corresponding subtask, store the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence;

[0024] S2, reading the result data from the local disk corresponding to each of the root nodes in turn, and determining whether a reading exception occurs, and if so, executing step S3;

[0025] S3. Read the result data of the corresponding root node from the distributed system storage file.

[0026] From the above description, it can be seen that the beneficial effects of the present invention are: for distributed tasks, a distributed system storage file is preset, so that when each root node executes the corresponding subtask, not only the result data is stored in the local disk, but also the result data is stored in the distributed system storage file. When reading data, the data on the local disk is read first, and after a reading exception occurs, the data on the distributed system storage file is read instead. The local disk is used as the main method, and the distributed system storage file is used as the auxiliary method. This effectively reduces the task time increased by disk node failure, etc., and improves the stability of task execution.

[0027] Furthermore, the reading anomaly includes a network failure or a local disk failure.

[0028] From the above description, it can be seen that when judging reading anomalies, not only the situations where reading cannot be performed due to network failure, local disk failure, etc. are considered, but also the situation where the reading rate is limited is considered, so as to give full play to the storage function of the preset distributed system storage file and maximize the reading rate.

[0029] Furthermore, the step S2 comprises:

[0030] Set the lower limit of the reading rate;

[0031] It is determined whether the current reading rate of the result data from the root node is equal to or lower than the reading rate lower limit. If so, the step S3 is executed.

[0032] From the above description, we can know that by setting a lower limit for the read rate, when the read rate of the read process with the local disk as the object reaches or is lower than the lower limit for the read rate, it means that the read process has seriously affected the efficiency of the overall task execution, and then the distributed system storage files are read to make timely remedies and reduce time consumption; by setting a reasonable lower limit for the read rate, it is also possible to avoid the reading process from frequently calling the distributed system storage files, reduce system pressure, and avoid affecting the stability of the overall distributed system cluster.

[0033] Furthermore, the step S3 comprises:

[0034] S31. When the reading exception occurs, record the reading progress of the result data of the root node currently read from the local disk;

[0035] S32. Starting from the reading progress, continue to read the remaining data of the result data from the distributed system storage file.

[0036] From the above description, it can be seen that when switching to reading data from a distributed system storage file, the amount of data read on the local disk, that is, the reading progress, can be recorded first, thereby avoiding the need to re-read the distributed system storage file, reducing the amount of data that needs to be read, and improving the reading speed.

[0037] Furthermore, the step of storing the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence includes:

[0038] Writing the result data into the local cache of the root node, and then refreshing the result data to the local disk by asynchronous disk flushing;

[0039] After the refresh is completed, an asynchronous message containing the result data is sent to a preset asynchronous consumer, and the asynchronous consumer writes the result data into the distributed system storage file.

[0040] From the above description, it can be seen that when storing data, refreshing the result data of the local disk to the distributed system storage file through asynchronous processing can effectively reduce the response time of system execution and improve operation efficiency.

[0041] Please refer to Figure 3 , an optimization terminal 1 for improving task stability, comprising a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor, wherein the processor 3 implements the following steps when executing the computer program:

[0042] S1. Preset a distributed system storage file, and when each root node executes a corresponding subtask, store the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence;

[0043] S2, reading the result data from the local disk corresponding to each of the root nodes in turn, and determining whether a reading exception occurs, and if so, executing step S3;

[0044] S3. Read the result data of the corresponding root node from the distributed system storage file.

[0045] From the above description, it can be seen that the beneficial effects of the present invention are: for distributed tasks, a distributed system storage file is preset, so that when each root node executes the corresponding subtask, not only the result data is stored in the local disk, but also the result data is stored in the distributed system storage file. When reading data, the data on the local disk is read first, and after a reading exception occurs, the data on the distributed system storage file is read instead. The local disk is used as the main method, and the distributed system storage file is used as the auxiliary method. This effectively reduces the task time increased by disk node failure, etc., and improves the stability of task execution.

[0046] Furthermore, the reading anomaly includes a network failure or a local disk failure.

[0047] From the above description, it can be seen that when judging reading anomalies, not only the situations where reading cannot be performed due to network failure, local disk failure, etc. are considered, but also the situation where the reading rate is limited is considered, so as to give full play to the storage function of the preset distributed system storage file and maximize the reading rate.

[0048] Furthermore, the step S2 comprises:

[0049] Set the lower limit of the reading rate;

[0050] It is determined whether the current reading rate of the result data from the root node is equal to or lower than the reading rate lower limit. If so, the step S3 is executed.

[0051] From the above description, we can know that by setting a lower limit for the read rate, when the read rate of the read process with the local disk as the object reaches or is lower than the lower limit for the read rate, it means that the read process has seriously affected the efficiency of the overall task execution, and then the distributed system storage files are read to make timely remedies and reduce time consumption; by setting a reasonable lower limit for the read rate, it is also possible to avoid the reading process from frequently calling the distributed system storage files, reduce system pressure, and avoid affecting the stability of the overall distributed system cluster.

[0052] Furthermore, the step S3 comprises:

[0053] S31. When the reading exception occurs, record the reading progress of the result data of the root node currently read from the local disk;

[0054] S32. Starting from the reading progress, continue to read the remaining data of the result data from the distributed system storage file.

[0055] From the above description, it can be seen that when switching to reading data from a distributed system storage file, the amount of data read on the local disk, that is, the reading progress, can be recorded first, thereby avoiding the need to re-read the distributed system storage file, reducing the amount of data that needs to be read, and improving the reading speed.

[0056] Furthermore, the step of storing the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence includes:

[0057] Writing the result data into the local cache of the root node, and then refreshing the result data to the local disk by asynchronous disk flushing;

[0058] After the refresh is completed, an asynchronous message containing the result data is sent to a preset asynchronous consumer, and the asynchronous consumer writes the result data into the distributed system storage file.

[0059] From the above description, it can be seen that when storing data, refreshing the result data of the local disk to the distributed system storage file through asynchronous processing can effectively reduce the response time of system execution and improve operation efficiency.

[0060] Please refer to Figure 1 and Figure 2 , Embodiment 1 of the present invention is:

[0061] An optimization method for improving task stability comprises the following steps:

[0062] S1. Preset the distributed system storage file. When each root node executes the corresponding subtask, the execution result data is stored in the local disk corresponding to the root node and the distributed system storage file in sequence;

[0063] In this embodiment, taking the distributed system storage file selection of the underlying HDFS under Hadoop as an example, HDFS is used to temporarily store data. Under the MR architecture, when the mapper completes the task, each node still writes the data to the local, but records the result data to HDFS in an asynchronous manner. Specifically, the result data is written to the local cache of the root node, and then the result data is refreshed to the local disk by asynchronous disk flushing; when each local disk flushing action is completed, an asynchronous message will be sent, and the message content is the content of this disk flushing. The message is consumed by a special asynchronous consumer and written to the HDFS file in the Hadoop cluster. This process needs to ensure that the file format and data stored in the local disk are consistent with those in HDFS.

[0064] S2, read the result data from the local disk corresponding to each root node in turn, and determine whether a read exception occurs. If so, execute step S3;

[0065] In this embodiment, when Reduce needs to read data from each mapper node, it preferentially reads data from the local disk where the mapper node is located. Specifically, during the reading process, if a network failure or a mapper disk node failure occurs, or the reading data rate drops to the lower limit of the reading rate, step S3 is executed.

[0066] S3. Read the result data of the corresponding root node from the distributed system storage file.

[0067] In this process, step S3 includes:

[0068] S31. When a read exception occurs, record the reading progress of the result data of the root node currently read from the local disk;

[0069] S32. Starting from the reading progress, continue to read the remaining data of the result data from the distributed system storage file.

[0070] That is to say, the Reduce node will use the amount of data that has been read from the mapper's local disk as a calculation point, that is, the reading progress. When reading data from HDFS, it will only read data after this calculation point, which can effectively reduce the amount of data read. At the same time, when the mapper node fails, it can still read data normally without affecting the overall task.

[0071] Please refer to Figure 3 , Embodiment 2 of the present invention is:

[0072] An optimization terminal 1 for improving task stability includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, an optimization method for improving task stability as described in Example 1 is implemented.

[0073] To sum up, the present invention provides a method and terminal for improving task stability. For distributed tasks, a distributed system storage file is preset, so that when each root node executes the corresponding subtask, not only the result data is stored in the local disk, but also the result data is stored in the distributed system storage file. When reading data, the data on the local disk is read first, and when a reading exception occurs, the data on the distributed system storage file is read instead. The local disk is used as the main method, and the distributed system storage file is used as the auxiliary method. This effectively reduces the task time increased by disk node failure, etc., and improves the stability of task execution.

[0074] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. An optimization method for improving task stability, characterized in that: The steps include: S1. Preset a distributed system storage file, and when each root node executes a corresponding subtask, store the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence; S2, reading the result data from the local disk corresponding to each of the root nodes in turn, and determining whether a reading exception occurs, if so, executing step S3; S3. Read the result data of the corresponding root node from the distributed system storage file.

2. The optimization method for improving task stability according to claim 1, characterized in that: The read anomaly includes a network failure or a local disk failure.

3. The optimization method for improving task stability according to claim 2, characterized in that: The step S2 comprises: Set the lower limit of the reading rate; It is determined whether the current reading rate of the result data from the root node is equal to or lower than the reading rate lower limit. If so, the step S3 is executed.

4. The optimization method for improving task stability according to claim 1, characterized in that: The step S3 comprises: S31. When the reading exception occurs, record the reading progress of the result data of the root node currently read from the local disk; S32. Starting from the reading progress, continue to read the remaining data of the result data from the distributed system storage file.

5. The optimization method for improving task stability according to claim 1, characterized in that: The step of storing the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence includes: Writing the result data into the local cache of the root node, and then refreshing the result data to the local disk by asynchronous disk flushing; After the refresh is completed, an asynchronous message containing the result data is sent to a preset asynchronous consumer, and the asynchronous consumer writes the result data into the distributed system storage file.

6. An optimization terminal for improving task stability, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: S1. Preset a distributed system storage file, and when each root node executes a corresponding subtask, store the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence; S2, reading the result data from the local disk corresponding to each of the root nodes in turn, and determining whether a reading exception occurs, and if so, executing step S3; S3. Read the result data of the corresponding root node from the distributed system storage file.

7. The optimization terminal for improving task stability according to claim 6, characterized in that: The read anomaly includes a network failure or a local disk failure.

8. The optimization terminal for improving task stability according to claim 7, characterized in that: The step S2 comprises: Set the lower limit of the reading rate; It is determined whether the current reading rate of the result data from the root node is equal to or lower than the reading rate lower limit. If so, the step S3 is executed.

9. The optimization terminal for improving task stability according to claim 6, characterized in that: The step S3 comprises: S31. When the reading exception occurs, record the reading progress of the result data of the root node currently read from the local disk; S32. Starting from the reading progress, continue to read the remaining data of the result data from the distributed system storage file.

10. The optimization terminal for improving task stability according to claim 6, characterized in that: The step of storing the execution result data in the local disk corresponding to the root node and the distributed system storage file in sequence includes: Writing the result data into the local cache of the root node, and then refreshing the result data to the local disk by asynchronous disk flushing; After the refresh is completed, an asynchronous message containing the result data is sent to a preset asynchronous consumer, and the asynchronous consumer writes the result data into the distributed system storage file.

Citation Information

Patent Citations

  • Data synchronization method in distributive system, and distributive system

    CN102760126A

  • File copy asynchronous writing method applied to distributed file system

    CN103546580A

  • Data reading method, system and device and medium

    CN112199048A

  • Disk fault processing method and device for distributed storage system

    CN113672437A

  • Systems and methods of distributed data storage using multi-layers consistent hashing

    US20210208987A1