Search

CN-122018815-A - Data processing method, device, program product and storage medium

CN122018815ACN 122018815 ACN122018815 ACN 122018815ACN-122018815-A

Abstract

The application provides a data processing method, device, program product and storage medium, wherein the method comprises the steps of receiving a first service request, wherein the first service request comprises a read request and/or a write request, the read request is used for reading data of a first data block, and the write request is used for writing data into the first data block; the method comprises the steps of obtaining a first status code of a first data block, wherein the first status code represents status information of the first data block, and determining a data processing strategy corresponding to a first service request according to the first status code and the first service request.

Inventors

  • Tao Yukang

Assignees

  • 中移(苏州)软件技术有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260512
Application Date
20260409

Claims (10)

  1. 1. A method of data processing, the method comprising: Receiving a first service request, wherein the first service request comprises a read request and/or a write request, the read request is used for reading data of a first data block, and the write request is used for writing data into the first data block; Acquiring a first status code of the first data block, wherein the first status code represents status information of the first data block; and determining a data processing strategy corresponding to the first service request according to the first status code and the first service request.
  2. 2. The method of claim 1, wherein the obtaining the first status code of the first data block comprises: Dividing the first data block into a plurality of data slices; acquiring state information of each data slice in the plurality of data slices; A first status code of the first data block is determined based on status information of each of the plurality of data slices.
  3. 3. The method of claim 1, wherein the determining a data processing policy corresponding to the first service request according to the first status code and the first service request comprises: acquiring fault information of a first node where the first data block is located; and determining a data processing strategy corresponding to the first service request according to the fault information of the first node, the first status code and the first service request.
  4. 4. A method according to claim 3, wherein said determining a data processing policy corresponding to the first service request according to the failure information of the first node, the first status code and the first service request comprises: When the fault information indicates that the first node is a non-fault node and the first service request is a write request, executing a first data processing strategy, wherein the first data processing strategy comprises writing data corresponding to the first service request into the first data block and updating a first state code of the first data block; when the fault information indicates that the first node is a fault node and the first service request is a write request, executing a second data processing strategy, wherein the second data processing strategy comprises updating a first state code of the first data block; And when the fault information indicates that the first node is a fault node and the first service request is a read request, executing a third data processing strategy, wherein the third data processing strategy comprises reading data corresponding to the first service request from the first data block and a second data block corresponding to the first data block, and a plurality of nodes where the plurality of second data blocks are located are non-fault nodes.
  5. 5. The method of claim 4, wherein the executing the first data processing policy comprises: acquiring a second state code of data corresponding to the first service request; Updating a first state code of the first data block according to the second state code; writing data corresponding to the first service request into the first data block; The executing the second data processing policy includes: acquiring a third status code of data corresponding to the first service request; updating a first state code of the first data block according to the third state code; the executing the third data processing policy includes: Determining change condition information of a plurality of data slices corresponding to the first data block according to the first status code; determining an unchanged data slice in a plurality of data slices corresponding to the first data block according to the change condition information, and acquiring a first data set from the unchanged data slice; determining a changed data slice in a plurality of data slices corresponding to the first data block according to the change condition information, and acquiring a second data set from the data slices corresponding to the changed data slice in a second data block; and constructing data corresponding to the first service request according to the first data set and the second data set.
  6. 6. The method according to any one of claims 1 to 5, further comprising: and when the first node where the first data block is located is a fault node, executing a data restoration strategy according to the first state code of the first data block, wherein the data restoration strategy is used for restoring the first data block.
  7. 7. The method of claim 6, wherein the performing a data repair policy comprises: acquiring state codes of a plurality of second data blocks corresponding to the first data blocks, wherein the plurality of second data blocks correspond to a plurality of second nodes; determining a fourth state code according to the state codes of the second data blocks and the first state codes of the first data blocks, wherein the fourth state code represents state information of the first data blocks and the second data blocks; acquiring a first data slice set required for repairing the first data block from the plurality of second data blocks according to the fourth status code; Repairing the first data block according to the first data slice set.
  8. 8. A data processing apparatus comprising a processor and a memory for storing a computer program, the processor being arranged to invoke and execute the computer program stored in the memory to perform the data processing method according to any of claims 1 to 7.
  9. 9. Computer program product, characterized in that it comprises a computer program which, when executed by a processor, implements the data processing method according to any of claims 1 to 7.
  10. 10. A computer-readable storage medium storing a computer program for causing a computer to execute the data processing method according to any one of claims 1 to 7.

Description

Data processing method, device, program product and storage medium Technical Field The present application relates to the field of data processing technologies, and in particular, to a data processing method, apparatus, program product, and storage medium. Background In the wave of big data and cloud computing today, a distributed storage system is used as a core infrastructure supporting mass data processing and efficient access, and the stability and reliability of the distributed storage system are directly related to continuous operation and data security of a service system. The distributed storage realizes redundant backup and load balancing of data by storing the data on a plurality of independent nodes in a scattered way, and greatly improves the expandability and fault tolerance of the system. However, although various strategies have been widely adopted to ensure high availability and fault tolerance of data, a distributed storage system inevitably triggers a data repairing mechanism when facing node or disk faults, the existing data repairing machine still has the problems that data consistency is difficult to guarantee, service delay is caused by fault recovery, huge network overhead is caused by a repairing process, and the like. Disclosure of Invention In order to solve the above technical problems, embodiments of the present application provide a data processing method, apparatus, program product, and storage medium, which can improve data processing efficiency. The application provides a data processing method, which comprises the following steps: receiving a first service request, wherein the first service request comprises a read request and/or a write request, the read request is used for reading data of a first data block, and the write request is used for writing data into the first data block; Acquiring a first status code of a first data block, wherein the first status code represents status information of the first data block; and determining a data processing strategy corresponding to the first service request according to the first status code and the first service request. The data processing device comprises a processor and a memory, wherein the memory is used for storing a computer program, and the processor is used for calling and running the computer program stored in the memory to execute the data processing method. The present application provides a computer program product comprising a computer program which, when executed by a processor, implements the data processing method described above. The present application provides a computer-readable storage medium storing a computer program that causes a computer to execute the above-described data processing method. In the technical scheme, a first service request is received, the first service request comprises a read request and/or a write request, the read request is used for reading data of a first data block, the write request is used for writing data into the first data block, a first state code of the first data block is obtained, the first state code represents state information of the first data block, and a data processing strategy corresponding to the first service request is determined according to the first state code and the first service request. Therefore, the state information of a plurality of data slices in the first data block is represented by the first state code, the data slices to be processed are determined according to the first service request, the data processing strategy corresponding to the first service request can be accurately determined according to the state information of the plurality of data slices and the data slices related to the first service request, the data processing efficiency is improved, and meanwhile, after the state information of each data slice in the first data block is determined according to the first state code, the data slices to be repaired are identified, and the repairing efficiency of the first data block is improved. Drawings The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. FIG. 1 is a flowchart illustrating a data processing method according to an embodiment of the present application; FIG. 2 is a second flow chart of a data processing method according to an embodiment of the present application; FIG. 3 is a schematic diagram of a data slice status code according to an embodiment of the present application; FIG. 4 is a schematic diagram of a data repair process according to an embodiment of the present application; FIG. 5 is a schematic diagram of the structural components of a data processing apparatus according to an embodiment of the present application; FIG. 6 is a schematic block d