Data processing method and device
View Patent ↗A data processing method and apparatus are disclosed. The data processing method comprises: receiving a data processing request, wherein the data processing request carries target data; generating, based on the target data, a data preprocessing request for the target data; sending the data preprocessing request to at least two data storage modules respectively; in a case where a preprocessing completion notification returned by each data storage module in response to the data preprocessing request is received, sending the data processing request to each data storage module; and receiving a data processing completion notification returned by each data storage module in response to the data processing request. The method ensures the data consistency of each data storage module, further avoiding the problem of data loss in a case where any data storage module of at least two data storage modules fails, thereby ensuring the security of data.
1 . A data processing method, comprising:
receiving a data processing request, wherein the data processing request carries target data;
generating, based on the target data, a data preprocessing request for the target data;
sending the data preprocessing request to at least two data storage modules respectively;
when it is determined that a preprocessing completion notification returned by each data storage module in response to the data preprocessing request is received, sending the data processing request to each data storage module; and
receiving a data processing completion notification returned by each data storage module in response to the data processing request;
wherein when it is determined that there are at least two data processing requests, the method further comprises:
determining request processing sequence information corresponding to each data processing request, wherein the request processing sequence information is determined based on request receiving time corresponding to each data processing request;
storing, based on the request processing sequence information, the data processing requests and corresponding data preprocessing requests in a request sending queue.
2 . The data processing method as claimed in claim 1 , wherein generating, based on the target data, the data preprocessing request for the target data comprises:
when it is determined that there are at least two data processing requests, determining target data carried in each data processing request; and
generating, based on data storage units corresponding to each target data in the at least two data storage modules, a data preprocessing request for the data storage units corresponding to each target data respectively.
3 . The data processing method as claimed in claim 1 , wherein sending the data preprocessing request to the at least two data storage modules respectively comprises:
acquiring the data preprocessing request from the request sending queue, and sending the data preprocessing request to the at least two data storage modules respectively;
accordingly, wherein sending the data processing request to each data storage module comprises:
determining a data processing request corresponding to the data preprocessing request from the request sending queue, and sending the data processing request to each data storage module.
4 . The data processing method as claimed in claim 1 , wherein sending the data preprocessing request to the at least two data storage modules respectively comprises:
determining identification information of the data storage units corresponding to each target data;
determining a target data storage unit from the data storage units according to the identification information, wherein the identification information of the target data storage unit is different from identification information of other data storage units;
determining a data preprocessing request for the target data storage unit as a target data preprocessing request;
acquiring the target data preprocessing request from the request sending queue, and sending the target data preprocessing request to the at least two data storage modules respectively.
5 . The data processing method as claimed in claim 4 , wherein sending the data processing request to each data storage module comprises:
determining a data processing request corresponding to the target data preprocessing request from the request sending queue, and sending the data processing request to each data storage module.
6 . The data processing method as claimed in claim 4 , wherein the preprocessing completion notification is a notification generated by each data storage module after setting, based on the data preprocessing request, a data storage unit corresponding to the target data to be inaccessible.
7 . The data processing method as claimed in claim 1 , wherein receiving the data processing request comprises:
receiving a data processing request sent by a target data storage module among the at least two data storage modules, wherein the target data storage module is a module that receives the data processing request sent by a request initiator.
8 . The data processing method according to claim 1 , wherein receiving the data processing request comprises:
receiving a data update request carrying target data, wherein the target data is data for updating initial data in a data storage unit.
9 . The data processing method as claimed in claim 8 , wherein the data processing completion notification is a notification generated by each data storage module after updating, based on the data processing request, the initial data in the data storage unit with the target data.
10 . A non-transitory computer-readable storage medium having computer-executable instructions stored thereon which, when executed by a processor, implement steps of the data processing method as claimed in claim 1 .
11 . A data processing system, comprising a request processing module and at least two data storage modules, wherein
the request processing module is configured to receive a data update request carrying target data for updating initial data in data storage units comprised in the data storage modules; generate, based on the target data, a data preprocessing request for the target data; and send the data preprocessing request to the at least two data storage modules respectively;
the at least two data storage modules are configured to set data storage units corresponding to the target data to be inaccessible based on the data preprocessing request, and send a preprocessing completion notification to the request processing module;
the request processing module is further configured to send, when it is determined that the preprocessing completion notification returned by each data storage module in response to the data preprocessing request is received, the data update request to the at least two data storage modules; and
the at least two data storage modules are configured to update, according to the data update request, the initial data in the data storage units with the target data, and send a data processing completion notification to the request processing module;
the request processing module is further configured to, when it is determined that there are at least two data processing requests, determine request processing sequence information corresponding to each data processing request, wherein the request processing sequence information is determined based on request receiving time corresponding to each data processing request; and store, based on the request processing sequence information, the data processing requests and corresponding data preprocessing requests in a request sending queue.
12 . A computing device, comprising:
a memory and a processor;
wherein the memory is used for storing computer-executable instructions, and the processor is used for executing the computer-executable instructions to perform operations of:
receiving a data processing request, wherein the data processing request carries target data;
generating, based on the target data, a data preprocessing request for the target data;
sending the data preprocessing request to at least two data storage modules respectively;
when it is determined that a preprocessing completion notification returned by each data storage module in response to the data preprocessing request is received, sending the data processing request to each data storage module; and
receiving a data processing completion notification returned by each data storage module in response to the data processing request;
wherein the processor is used for executing the computer-executable instructions to perform operations of:
when it is determined that there are at least two data processing requests, determining request processing sequence information corresponding to each data processing request, wherein the request processing sequence information is determined based on request receiving time corresponding to each data processing request;
storing, based on the request processing sequence information, the data processing requests and corresponding data preprocessing requests in a request sending queue.
13 . The computing device as claimed in claim 12 , wherein the processor is used for executing the computer-executable instructions to perform operations of:
when it is determined that there are at least two data processing requests, determining target data carried in each data processing request; and
generating, based on data storage units corresponding to each target data in the at least two data storage modules, a data preprocessing request for the data storage units corresponding to each target data respectively.
14 . The computing device as claimed in claim 12 , wherein the processor is used for executing the computer-executable instructions to perform operations of:
acquiring the data preprocessing request from the request sending queue, and sending the data preprocessing request to the at least two data storage modules respectively;
accordingly, wherein sending the data processing request to each data storage module comprises:
determining a data processing request corresponding to the data preprocessing request from the request sending queue, and sending the data processing request to each data storage module.
15 . The computing device as claimed in claim 12 , wherein the processor is used for executing the computer-executable instructions to perform operations of:
determining identification information of the data storage units corresponding to each target data;
determining a target data storage unit from the data storage units according to the identification information, wherein the identification information of the target data storage unit is different from identification information of other data storage units;
determining a data preprocessing request for the target data storage unit as a target data preprocessing request;
acquiring the target data preprocessing request from the request sending queue, and sending the target data preprocessing request to the at least two data storage modules respectively.
16 . The computing device as claimed in claim 15 , wherein the processor is used for executing the computer-executable instructions to perform operations of:
determining a data processing request corresponding to the target data preprocessing request from the request sending queue, and sending the data processing request to each data storage module.
17 . The computing device as claimed in claim 15 , wherein the preprocessing completion notification is a notification generated by each data storage module after setting, based on the data preprocessing request, a data storage unit corresponding to the target data to be inaccessible.
18 . The computing device as claimed in claim 12 , wherein the processor is used for executing the computer-executable instructions to perform operations of:
receiving a data processing request sent by a target data storage module among the at least two data storage modules, wherein the target data storage module is a module that receives the data processing request sent by a request initiator.