CN109871294B - Method and device for checking data and processing request - Google Patents

Method and device for checking data and processing request Download PDF

Info

Publication number
CN109871294B
CN109871294B CN201910098633.3A CN201910098633A CN109871294B CN 109871294 B CN109871294 B CN 109871294B CN 201910098633 A CN201910098633 A CN 201910098633A CN 109871294 B CN109871294 B CN 109871294B
Authority
CN
China
Prior art keywords
task
data
request
type
storage device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910098633.3A
Other languages
Chinese (zh)
Other versions
CN109871294A (en
Inventor
韩帅
朱明�
李莅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910098633.3A priority Critical patent/CN109871294B/en
Publication of CN109871294A publication Critical patent/CN109871294A/en
Application granted granted Critical
Publication of CN109871294B publication Critical patent/CN109871294B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application discloses a method and a device for checking data and processing a request. One embodiment of the above method comprises: scanning the data fragments stored in the storage device, and determining the number and the identification of the data fragments; generating data verification tasks according to the number and the identification, and determining the types of the data verification tasks; receiving a task request sent by at least one task execution server; and transmitting the data verification task and the type to the at least one task execution server so that the at least one task execution server transmits a request corresponding to the type to the storage device to execute the data verification task. The embodiment can complete the verification of the data fragments stored in the storage device by generating different types of data verification tasks.

Description

Method and device for checking data and processing request
Technical Field
The embodiment of the application relates to the technical field of data security, in particular to a method and a device for checking data and processing requests.
Background
The correctness and the safety of the data are important guarantees of normal operation of the data storage system, whether the check codes obtained by comparing the original data with the target data are consistent or not is checked by the data, and whether the target data are consistent with the original data or not, namely whether damage occurs or not can be judged. Common check codes are e.g. MD5 (MD 5Message-Digest Algorithm) values, CRC (Cyclic Redundancy Check) values, etc.
For data storage systems, unavoidable factors such as hard disk failures can cause data within the data storage system to be damaged, which is a significant hidden danger for the data storage system. In order to find out the damage condition of the data in time to check the risk of the data storage system, the data storage system needs a periodic mechanism to check the whole data, so that the accuracy of the data in the system is ensured.
Disclosure of Invention
The embodiment of the application provides a method and a device for checking data and processing a request.
In a first aspect, an embodiment of the present application provides a method for checking data, which is applied to a task generating server in a checking server cluster, where the checking server cluster further includes a task executing server, and the method includes: scanning the data fragments stored in the storage device, and determining the number and the identification of the data fragments; generating data verification tasks according to the number and the identification, and determining the types of the data verification tasks; receiving a task request sent by at least one task execution server; and transmitting the data verification task and the type to the at least one task execution server so that the at least one task execution server transmits a request corresponding to the type to the storage device to execute the data verification task.
In some embodiments, the types of data verification tasks include a first type; and the step of transmitting the data verification task and the type to the at least one task execution server, including: and sending the first type of data verification task to the at least one task execution server so that the at least one task execution server sends a first request to the storage device, wherein the first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
In some embodiments, the type of data verification task includes a second type; and the step of transmitting the data verification task and the type to the at least one task execution server, including: and sending a second type of data verification task to the at least one task execution server so that the at least one task execution server sends a second request to the storage device, wherein the second request is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
In some embodiments, the above method further comprises: receiving a data verification result sent by the at least one task execution server; determining whether the data fragments stored in the storage device are abnormal or not according to the data verification result; and generating alarm information in response to determining that the data stored in the storage device is fragmented abnormally.
In a second aspect, an embodiment of the present application provides a method for checking data, which is applied to a task execution server in a check server cluster, where the check server cluster further includes a task generation server, and the method includes: sending a task request to a task generation server; receiving a data verification task and a type sent by the task generation server; and according to the type, sending a request corresponding to the type to a storage device to execute the data verification task.
In some embodiments, the type of data verification task includes a first type, the data verification task including an identification of the data shard; and sending a request corresponding to the type to the storage device according to the type, wherein the request comprises: and in response to determining that the type is a first type, sending a first request to the storage device, wherein the first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
In some embodiments, the type of data verification task includes a second type, the data verification task including an identification of the data shard; and sending a request corresponding to the type to the storage device according to the type, wherein the request comprises: and in response to determining that the type is a second type, sending a second request to the storage device, wherein the second request is used for requesting the storage device to determine the state of the data fragment indicated by the identification in the data verification task.
In some embodiments, the above method further comprises: generating a data verification result in response to determining completion of the data verification task; and sending the data verification result to the task generating server.
In some embodiments, the above method further comprises: and sending a request corresponding to the type to the storage device at intervals of preset time intervals in response to receiving a rejection check message sent by the storage device, wherein the rejection check message is sent by the storage device under the condition that the current data access meets preset conditions.
In a third aspect, an embodiment of the present application provides a method for processing a request, applied to a storage device, including: receiving a request and determining a sender of the request; determining the priority of the request according to the sender; and processing the request according to the priority.
In some embodiments, the determining the priority of the request according to the sender includes: and setting the priority of the request to be a preset value in response to determining that the sender is a task execution server.
In some embodiments, processing the request according to the priority includes: determining whether the current data access meets a preset condition or not in response to determining that the priority of the request is a preset value; and sending a rejection check message to the task execution server in response to determining that the current data access meets the preset condition.
In some embodiments, the request comprises a first request, the request comprising an identification of a data chunk; and processing the request according to the priority, including: and in response to determining that the current data access does not meet the preset condition and the request is a first request, establishing access connection with the task execution server so that the task execution server reads the data fragments indicated by the identification.
In some embodiments, the request includes a second request, the request including an identification of the data fragment; and processing the request according to the priority, including: and transmitting the state information of the data fragments indicated by the identification to the task execution server in response to the fact that the current data access does not meet the preset condition and the request is a second request.
In a fourth aspect, an embodiment of the present application provides an apparatus for verifying data, which is disposed in a task generating server in a verification server cluster, where the verification server cluster further includes a task execution server, and the apparatus includes: the data scanning unit is configured to scan the data fragments stored in the storage device and determine the number and the identification of the data fragments; a task generating unit configured to generate a data verification task according to the number and the identification, and to determine a type of the data verification task; a first request receiving unit configured to receive a task request transmitted by at least one task execution server; and a task transmitting unit configured to transmit the data verification task and the type to the at least one task execution server, so that the at least one task execution server transmits a request corresponding to the type to the storage device to execute the data verification task.
In some embodiments, the types of data verification tasks include a first type; and the task transmitting unit is further configured to: and sending the first type of data verification task to the at least one task execution server so that the at least one task execution server sends a first request to the storage device, wherein the first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
In some embodiments, the type of data verification task includes a second type; and the task transmitting unit is further configured to: and sending a second type of data verification task to the at least one task execution server so that the at least one task execution server sends a second request to the storage device, wherein the second request is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
In some embodiments, the apparatus further comprises: a result receiving unit configured to receive a data verification result transmitted from the at least one task execution server; a result verification unit configured to determine whether the data fragment stored in the storage device is abnormal or not, based on the data verification result; and an alarm generation unit configured to generate alarm information in response to a determination that the data fragment stored in the storage device is abnormal.
In a fifth aspect, an embodiment of the present application provides an apparatus for checking data, where the apparatus is disposed on a task execution server in a check server cluster, and the check server cluster further includes a task generation server, where the apparatus includes: a first request transmitting unit configured to transmit a task request to a task generating server; the task receiving unit is configured to receive the data verification task and the type sent by the task generating server; and the task execution unit is configured to send a request corresponding to the type to the storage device according to the type so as to execute the data verification task.
In some embodiments, the type of data verification task includes a first type, the data verification task including an identification of the data shard; and the task execution unit is further configured to: and in response to determining that the type is a first type, sending a first request to the storage device, wherein the first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
In some embodiments, the type of data verification task includes a second type, the data verification task including an identification of the data shard; and the task execution unit is further configured to: and in response to determining that the type is a second type, sending a second request to the storage device, wherein the second request is used for requesting the storage device to determine the state of the data fragment indicated by the identification in the data verification task.
In some embodiments, the apparatus further comprises: a result generation unit configured to generate a data verification result in response to determining completion of the above-described data verification task; and a result transmitting unit configured to transmit the data verification result to the task generating server.
In some embodiments, the apparatus further comprises: and a second request transmitting unit configured to transmit a request corresponding to the type to the storage device at intervals of a preset time period in response to receiving a rejection check message transmitted from the storage device, wherein the rejection check message is transmitted by the storage device when determining that the current data access satisfies a preset condition.
In a sixth aspect, an embodiment of the present application provides an apparatus for processing a request, configured to be disposed on a storage device, where the apparatus includes: a second request receiving unit configured to receive a request and to determine a sender of the request; a priority determining unit configured to determine a priority of the request according to the sender; and a request processing unit configured to process the request according to the priority.
In some embodiments, the priority determining unit is further configured to: and setting the priority of the request to be a preset value in response to determining that the sender is a task execution server.
In some embodiments, the request processing unit is further configured to: determining whether the current data access meets a preset condition or not in response to determining that the priority of the request is a preset value; and sending a rejection check message to the task execution server in response to determining that the current data access meets the preset condition.
In some embodiments, the request comprises a first request, the request comprising an identification of a data chunk; and the request processing unit is further configured to: and in response to determining that the current data access does not meet the preset condition and the request is a first request, establishing access connection with the task execution server so that the task execution server reads the data fragments indicated by the identification.
In some embodiments, the request includes a second request, the request including an identification of the data fragment; and the request processing unit is further configured to: and transmitting the state information of the data fragments indicated by the identification to the task execution server in response to the fact that the current data access does not meet the preset condition and the request is a second request.
In a seventh aspect, embodiments of the present application provide a server, including: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors cause the one or more processors to implement the method as described in any of the embodiments of the first aspect.
In an eighth aspect, embodiments of the present application provide a server, including: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors cause the one or more processors to implement a method as described in any embodiment of the second aspect.
In a ninth aspect, an embodiment of the present application provides a storage device, including: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors cause the one or more processors to implement a method as described in any of the embodiments of the third aspect.
In a tenth aspect, embodiments of the present application provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the embodiments of the first aspect.
In an eleventh aspect, embodiments of the present application provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the embodiments of the second aspect.
In a twelfth aspect, embodiments of the present application provide a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as described in any of the embodiments of the third aspect.
The method and the device for checking data provided by the embodiments of the present application can determine the number and the identification of the data fragments by scanning the data fragments stored in the storage device. And generating data verification tasks according to the number and the identification, and determining the types of the data verification tasks. Meanwhile, a task request sent by at least one task execution server can also be received. And finally, sending the data verification task and the type to at least one task execution server so that the at least one task execution server sends a request corresponding to the type to a storage device to execute the data verification task. The method of the embodiment can complete the verification of the data fragments stored in the storage device by generating different types of data verification tasks.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the following drawings, in which:
FIG. 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a method for verifying data according to the present application;
FIG. 3 is a flow chart of another embodiment of a method for verifying data according to the present application;
FIG. 4 is a flow chart of one embodiment of a method for processing a request according to the present application;
FIG. 5 is a schematic diagram illustrating the structure of one embodiment of an apparatus for verifying data according to the present application;
FIG. 6 is a schematic diagram of another embodiment of an apparatus for verifying data according to the present application;
FIG. 7 is a schematic diagram of an embodiment of an apparatus for processing requests according to the present application;
fig. 8 is a schematic diagram of a computer system suitable for use in implementing the server or storage device of an embodiment of the present application.
Detailed Description
The present application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the present application for methods of verifying data, methods of processing requests, apparatuses for verifying data, or apparatuses for processing requests may be applied.
As shown in fig. 1, the system architecture 100 may include a check server cluster 101, a web server 102, and a storage 103. Wherein the verification server cluster 101 may comprise a task generating server 1011 and at least one task execution server 1012. The storage 103 may include a plurality of storage devices 1031. The verification server cluster 101 may access the storage device 103 through the web server 102 to perform data verification on data stored in the storage device 103.
The task generation server 1011 in the check server cluster 101 may scan the data fragments stored by the respective storage devices 1031 in the storage apparatus 103 and generate at least one type of data check task. The generated data verification task and type are then sent to the task execution server 1012.
The task execution servers 1012 in the check server cluster 101 may send requests to the web server 102 or the storage 103 to execute the data check tasks according to the type of the data check tasks.
The web server 102 may be a server that provides various services, such as a server that provides support for data shards stored in the storage device 103. The web server 102 may receive the request sent by the task execution server 1012 in the check server cluster 101, process the request, and then send the processed request to each storage device 1031 in the storage apparatus 103.
The storage device 103 may be various devices for storing data, such as a database, a data center, and the like.
The task generating server 1011, the task executing server 1012, and the web server 102 may be hardware or software. When the task generating server 1011, the task executing server 1012, and the web server 102 are hardware, they may be realized as a distributed server cluster composed of a plurality of servers, or as a single server. When the task generating server 1011, the task executing server 1012, and the web server 102 are software, they may be implemented as a plurality of software or software modules (for example, to provide distributed services), or may be implemented as a single software or software module. The present invention is not particularly limited herein.
Note that, the web server 102 may not be included in the architecture 100, and the task execution server 1012 may directly interact with the storage device 103.
It should be noted that the method for verifying data provided in the embodiment shown in fig. 2 of the present application is generally performed by the task generating server 1011. Accordingly, the apparatus for verifying data shown in fig. 5 is generally provided in the task generating server 1011. The method for verifying data provided by the embodiment shown in fig. 3 of the present application is generally performed by task execution server 1012. Accordingly, the means for verifying data shown in fig. 6 is generally provided in the task execution server 1012. The method for processing requests provided by the embodiment shown in fig. 4 of the present application is generally performed by the storage device 103. Accordingly, the means for processing the request shown in fig. 7 is generally provided in the storage means 103.
It should be understood that the number of task generating servers, task execution servers, web servers, and storage devices in FIG. 1 are merely illustrative. There may be any number of task generation servers, task execution servers, web servers, and storage devices, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for verifying data according to the present application is shown. The method for verifying data of the embodiment is applied to a task generating server in a verification server cluster, and the verification server cluster may further include a task executing server. The method of the present embodiment includes the steps of:
In step 201, the data fragments stored in the storage device are scanned, and the number and the identity of the data fragments are determined.
In this embodiment, an execution subject of the method for verifying data (e.g., the task generating server 1011 shown in fig. 1) may scan the pieces of data stored in the storage device (e.g., the storage device 103 shown in fig. 1) to determine the number and the identification of the pieces of data. The storage means may be a database. In the storage device, data is stored in the form of data fragments, each of which has a unique identifier. The task generation server may determine the number and identity of the data fragments by scanning the full amount of data in the storage device.
And 202, generating a data verification task according to the number and the identification, and determining the type of the data verification task.
In this embodiment, after determining the number and the identifier of the data fragments, the execution body may generate a data verification task according to the number and the identifier, and determine the type of the data verification task. For example, the task generation server may generate M data check tasks, where M is the number of data fragments. And, the task generating server may encapsulate the identification of the data fragment in the data verification task. Thus, each data verification task corresponds to each data slice one by one. Alternatively, the task generating server may further encapsulate a plurality of data fragments and a plurality of identifiers in one data verification task according to the size of each data fragment. The data verification task is used to send to a task execution server (e.g., task execution server 1012 shown in fig. 1) for the task execution server to execute the data verification task, thereby completing the verification of the total data in the storage device.
In this embodiment, the data verification task may include at least one type of data verification task, for example, may include a first type of data verification task and a second type of data verification task. The first type of data verification task is used for indicating the task execution server to completely read each data fragment of the data, and then calculate a verification code for the read data and compare the verification code with the self-stored verification code. The first type of data verification task can ensure the correctness of data, but takes up the I/O (input/output) resources of the storage device when reading the data fragments, and the time for calculating the verification code is relatively long. The second type of data verification task is used for indicating a task execution server to request a storage device to determine the state of the data fragments. The states may include a null state and a non-null state. If the data fragment is in a null state, the data stored in the storage device is incomplete, and the data fragment in the null state is unreadable. The second type of data verification task does not read data, reduces the occupation of I/O resources of the hard disk and the network, and does not use a computing verification code. Thus, the second type of data verification task is relatively time-consuming, which has the disadvantage that anomalies in the data content cannot be verified.
When the task generating server generates the data checking task, the task generating server can generate the first type of data checking task and the second type of data checking task at the same time, and can also generate the data checking task according to the execution state of each type of data checking task. For example, if the current first type of data verification task is still in progress, the task generation server may generate only the second type of data verification task.
Step 203, a task request sent by at least one task execution server is received.
In this embodiment, the task generating server may determine a state of each task executing server by receiving a task request, where the state may include a task executing process and a task completed. And if the task generating server receives the task request sent by the task executing server, the task generating server indicates that the state of the task executing server is that the task is executed. At this time, the task generation server may transmit the generated data verification task and type to the task execution server.
Step 204, the data verification task and the type are sent to at least one task execution server, so that the at least one task execution server sends a request corresponding to the type to the storage device to execute the data verification task.
In this embodiment, the task generating server may send the generated data verification task and type to each task executing server. After receiving the data verification task and the type, each task execution server may send a request corresponding to the type to the storage device to execute the data verification task. For example, if the task execution server receives a data verification task of a first type, a first request corresponding to the first type may be sent to the storage device. If the task execution server receives a data verification task of a second type, a second request corresponding to the second type may be sent to the storage device.
It should be noted that, the task generating server may generate a plurality of data verification tasks at the same time, and the task generating server may send different data verification tasks to each task executing server.
In some alternative implementations of the present embodiment, the type of data verification task includes a first type. The above step 204 may be implemented by the following steps, not shown in fig. 2: the first type of data verification task is sent to the at least one task execution server to cause the at least one task execution server to send a first request to the storage device. The first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
In this implementation, if the task execution server receives a data verification task of a first type, a first request corresponding to the first type may be sent to the storage device. Taking the storage device as a database as an example, after the task execution server sends a first request to the database, the database can establish a database connection so that the task execution server can read the data in the database. It can be understood that the data verification task includes the identification of the data fragments, and the task execution server only needs to read the data fragments indicated by the identification.
In some alternative implementations of the present embodiment, the type of data verification task includes a second type. The above step 204 may be implemented by the following steps, not shown in fig. 2: the second type of data verification task is sent to the at least one task execution server to cause the at least one task execution server to send a second request to the storage device. The second request is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
In this implementation, if the task execution server receives a second type of data verification task, a second request corresponding to the second type may be sent to the storage device. After receiving the second request, the storage device only needs to determine the state of the data fragments indicated by the identification in the data verification task and send the state information to the task execution server. It may be appreciated that the second request includes an identifier of the data fragment, and the storage device may store a mapping relationship between the data identifier and the storage location. After receiving the second request, the storage device may parse the second request to determine the identity of the data fragment therein. And then combining the mapping relation to determine the storage position of the data fragment indicated by the identification. If the data fragment is still stored at the storage location, then its state is not empty. If the data fragments are not stored in the storage positions, the state is blank.
In some optional implementations of this embodiment, the method may further include the following steps in fig. 2: receiving a data verification result sent by at least one task execution server; determining whether the data fragments stored in the storage device are abnormal or not according to the data verification result; in response to determining that the data fragment stored in the storage device is abnormal, alarm information is generated.
In the implementation manner, each task execution server generates a data verification result after completing the data verification task, and sends the data verification result to the task generation server. For a task execution server which receives a first type of data verification task, after the task execution server reads the data fragments, the verification codes of the data fragments are calculated, and the obtained verification codes are compared with locally stored verification codes to indicate that the task execution server completes the data verification task. For a task execution server that receives a second type of data verification task, when it receives the state information of the data fragments returned by the storage device, it indicates that it completes the data verification task. The task execution server may generate a check result according to the check code comparison result or the received status information. The check result is used for indicating whether the data fragments have abnormality or not.
After receiving the verification result sent by each task execution server, the task generation server can determine whether each data fragment stored in the storage device is abnormal. Specifically, if each check result received by the task generating server indicates that the data fragment is normal, the task generating server may determine that each data fragment stored in the storage device is normal. If the one or more verification results by the task generation server indicate a data-slicing anomaly, the task generation server may determine each data-slicing anomaly stored in the storage device.
The task generating server may generate alarm information when determining that each data fragment is abnormal. The alarm information is used for reminding technicians of the abnormality of the data fragments, so that the technicians repair the data fragments.
In this implementation manner, since the second type of data verification task consumes a short time, the task generating server can discover data anomalies caused by the data slicing gaps as early as possible. Meanwhile, as the first type of data verification task can determine whether the data content is abnormal or not, the task generation server can also ensure the accuracy of data verification.
The method for verifying data provided in the foregoing embodiments of the present application may determine the number and the identifier of the data fragments by scanning the data fragments stored in the storage device. And generating data verification tasks according to the number and the identification, and determining the types of the data verification tasks. Meanwhile, a task request sent by at least one task execution server can also be received. And finally, sending the data verification task and the type to at least one task execution server so that the at least one task execution server sends a request corresponding to the type to a storage device to execute the data verification task. The method of the embodiment can complete the verification of the data fragments stored in the storage device by generating different types of data verification tasks.
With continued reference to FIG. 3, a flow 300 of another embodiment of a method for verifying data according to the present application is shown. The method for verifying data of the present embodiment is applied to verifying task execution servers in a server cluster. The verification server cluster further comprises a task generating server. As shown in fig. 3, the method for verifying data of the present embodiment includes the steps of:
Step 301, a task request is sent to a task generating server.
In this embodiment, the execution body of the method for verifying data (for example, the task execution server 1012 shown in fig. 1) may send the task request to the task generation server by wired connection or wireless connection when the data verification task is not executed. After receiving the task request, the task generating server can identify that the task executing server can currently receive the data verification task.
Step 302, receiving a data verification task and a type sent by a task generation server.
In this embodiment, the task execution server may receive the data verification task and the type sent by the task generation server. The data verification task may be that the task generating server scans the data fragments stored in the storage device, and determines the number and the identification of the data fragments. And then generated based on the number and identification. The task generation server may transmit the generated data verification task to the task execution server. The types of data verification tasks may include a first type and a second type. The data verification task may include an identifier of the data fragment, and the task execution server is configured to verify the data fragment indicated by the identifier. The first type of data verification task is used for indicating the task execution server to completely read each piece of data, and then calculates a verification code for the read data and compares the verification code with the self-stored verification code. The first type of data verification task can ensure the correctness of data, but takes up the I/O (input/output) resources of the storage device when reading the data, and the time for calculating the verification code is relatively long. The second type of data verification task is used for indicating a task execution server to request a storage device to determine the state of the data fragments. The states may include a null state and a non-null state. If the data fragment is in a blank state, the data stored in the storage device is incomplete and unreadable. The second type of data verification task does not read data, reduces the occupation of I/O resources of the hard disk and the network, and does not use a computing verification code. Thus, the second type of data verification task is relatively time-consuming, which has the disadvantage that anomalies in the data content cannot be verified.
And step 303, according to the type, sending a request corresponding to the type to the storage device to execute the data verification task.
After receiving the data verification task and the type, the task execution server may send a request corresponding to the type to the storage device to execute the data verification task. The first type corresponds to a first request and the second type corresponds to a second request.
In some optional implementations of this embodiment, the type of data verification task includes a first type, and the data verification task includes an identification of the data shard. The above step 303 may be specifically performed by the following steps not shown in fig. 3: in response to determining that the type is the first type, a first request is sent to the storage device.
In this implementation, the first request is used to request to read the data fragment indicated by the identifier in the data verification task. Taking the storage device as a database as an example, after the task execution server sends a first request to the database, the database can establish a database connection so that the task execution server can read the data in the database. It can be understood that the task execution server only needs to read the data fragments indicated by the above identification.
In some optional implementations of this embodiment, the type of data verification task includes a second type, and the data verification task includes an identification of the data shard. The above step 303 may be specifically performed by the following steps not shown in fig. 3: in response to determining that the type is the second type, a second request is sent to the storage device.
In this implementation, the second request is used to request the storage device to determine a state of the data fragment indicated by the identifier in the data verification task. After receiving the second request, the storage device only needs to determine the state of the data fragments indicated by the identification in the data verification task and send the state information to the task execution server.
In some optional implementations of the present embodiment, the method may further include the following steps not shown in fig. 3: generating a data verification result in response to determining completion of the data verification task; and sending the data verification result to the task generating server.
In this implementation manner, the task execution server may generate the data verification result after completing the data verification task. The generated data verification result may then be transmitted to the task generation server. For a task execution server which receives a first type of data verification task, after the task execution server reads the data fragments, the verification codes of the data fragments are calculated, and the obtained verification codes are compared with locally stored verification codes to indicate that the task execution server completes the data verification task. For a task execution server that receives a second type of data verification task, when it receives the state information of the data fragments returned by the storage device, it indicates that it completes the data verification task. The task execution server may generate a check result according to the check code comparison result or the received status information. The check result is used for indicating whether the data fragments have abnormality or not.
The task generating server may determine whether or not there is an abnormality in each data fragment stored in the storage device based on the verification result transmitted from each task executing server.
In some optional implementations of the present embodiment, the method may further include the following steps not shown in fig. 3: and responding to the receiving of the refusal check message sent by the storage device, and sending a request corresponding to the type to the storage device at intervals of preset duration.
In this implementation manner, the rejection check message is sent by the storage device when it is determined that the current data access meets a preset condition. The preset condition may be a condition for judging whether the current data access is congested. The preset conditions may include, but are not limited to: the number of the received requests is larger than a preset threshold, and the flow occupied by each request is larger than the preset threshold. If the current data access meets the preset condition, the current data access is more congested, and the pressure of the storage device for processing the request is higher. At this time, the storage device may reject the first request and/or the second request sent by the task execution server, and send a reject verification message to the task execution server. When the task execution server receives the refusing verification message, the task execution server can identify that the current processing request of the storage device is high in pressure, and can send a request corresponding to the type of the data verification task to the storage device at intervals of preset duration. In this way, the storage device can process the first request and/or the second request sent by the task execution server in the case that the current data access is not congested.
The method of the implementation manner can allow the storage device to suspend the verification of the data fragments stored in the storage device when the user accesses the data in the storage device more frequently, so that the reading of the data fragments by the user is not affected.
The method for verifying data provided in the foregoing embodiment of the present application may first send a task request to a task generating server. And receiving the data verification task and the type sent by the task generation server. And finally, according to the type, sending a request corresponding to the type to the storage device to execute the data verification task. According to the method, different requests can be sent to the storage device according to the type of the data verification task, so that the data verification task can be completed in different modes, and the data verification mode is increased.
With continued reference to FIG. 4, a flow 400 of one embodiment of a method for processing a request according to the present application is shown. The method for processing a request of the present embodiment may be applied to a storage device that may receive a request sent by a task execution server. As shown in fig. 4, the method of the present embodiment may include the steps of:
step 401, receiving a request and determining a sender of the request.
In this embodiment, the execution body of the method for processing a request (for example, the storage device 103 shown in fig. 1) may receive a request sent by a user terminal, a task execution server, or other electronic devices through a wired connection or a wireless connection. The request may include information about the sender, such as a source IP address. The storage device may determine, according to the information of the sender in the request, whether the sender of the request is a user terminal or a task execution server.
Step 402, determining the priority of the request according to the sender.
The storage device may also determine the priority of the request based on the sender. For example, if it is determined that the sender of the request is a user terminal, the storage device may set the priority of the request to 1. If it is determined that the sender of the request is the task execution server, the storage device may set the priority of the request to 0. Wherein priority 1 is higher than priority 0. It will be appreciated that the storage device may also identify the priority of the requests of different senders in other ways.
Step 403, the request is processed according to the priority.
The storage device may process the request according to the set priority. For example, the storage device may prioritize higher priority requests and re-process lower priority requests when the number of higher priority requests is less than a preset threshold.
In some alternative implementations of the present embodiment, the step 403 may specifically include the following steps not shown in fig. 4: in response to determining that the sender is a task execution server, the priority of the request is set to a preset value.
In this implementation, if the storage device determines that the sender of the request is the task execution server, the priority of the request may be set to a preset value. Here, the preset value may be used to indicate that the priority of the request is low.
In some alternative implementations of the present embodiment, the step 403 may specifically include the following steps not shown in fig. 4: determining whether the current data access meets a preset condition or not in response to determining that the priority of the request is a preset value; and sending a rejection check message to the task execution server in response to determining that the current data access meets the preset condition.
After determining that the priority of the request is a preset value, the storage device may further determine whether the current data access satisfies a preset condition. In this implementation manner, the preset condition may be a condition for determining whether the current data access is congested. The preset conditions may include, but are not limited to: the number of the received requests is larger than a preset threshold, and the flow occupied by each request is larger than the preset threshold. If the current data access meets the preset condition, the current data access is more congested, and the pressure of the storage device for processing the request is higher. At this time, the storage device may reject the request transmitted from the task execution server and transmit a reject verification message to the task execution server.
The method of the implementation manner can allow the storage device to suspend the verification of the data fragments stored in the storage device when the user accesses the data in the storage device more frequently, so that the reading of the data fragments by the user is not affected.
In some optional implementations of this embodiment, the request may include a first request, the request further including an identification of the data fragment. The step 403 may specifically include the following steps, not shown in fig. 4: and in response to determining that the current data access does not meet the preset condition and the request is a first request, establishing access connection with the task execution server so that the task execution server reads the data fragments indicated by the identification.
If the storage device determines that the current data access does not meet the preset condition, the storage device indicates that the current processing request is not stressed, and can process the request sent by the task execution server. If the request sent by the task execution server is the first request, an access connection with the task execution server may be established. Thus, the task execution server can read the data fragments indicated by the identification in the first request. The task execution server can calculate the check code of the data fragment after reading is completed, and compare the check code with the locally stored check code to generate a check result.
In some optional implementations of this embodiment, the request may include a second request, the request further including an identification of the data fragment. The step 403 may specifically include the following steps, not shown in fig. 4: and in response to determining that the current data access does not meet the preset condition and the request is a second request, sending state information of the data fragments indicated by the identification to the task execution server.
If the storage device determines that the current data access does not meet the preset condition, the storage device indicates that the current processing request is not stressed, and can process the request sent by the task execution server. If the request sent by the task execution server is the second request, the storage device may determine the storage location of the data fragment indicated by the identifier. If the data fragment is still stored at the storage location, then its state is not empty. If the data fragments are not stored in the storage positions, the state is blank. The storage device may send the status information to the task execution server for the task execution server to generate a verification result.
The method for processing a request provided in the foregoing embodiment of the present application may determine the sender of the request after receiving the request. And determines the priority of the request according to the sender. Finally, the request is processed according to the priority. Therefore, the method can ensure that the request sent by the user is processed preferentially, and ensure that the data verification process can not influence the data reading experience of the user.
With further reference to fig. 5, as an implementation of the method shown in the foregoing figures, the present application provides an embodiment of an apparatus for verifying data, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for verifying data according to the present embodiment may be disposed in a task generating server in a verification server cluster, where the verification server cluster further includes a task execution server. The apparatus 500 includes: a data scanning unit 501, a task generating unit 502, a first request receiving unit 503, and a task transmitting unit 504.
The data scanning unit 501 is configured to scan the data fragments stored in the storage device, and determine the number and the identification of the data fragments.
The task generating unit 502 is configured to generate a data verification task according to the number and the identification, and to determine the type of the data verification task.
The first request receiving unit 503 is configured to receive a task request sent by at least one task execution server.
And a task transmitting unit 504 configured to transmit the data checking task and the type to the at least one task execution server, so that the at least one task execution server transmits a request corresponding to the type to the storage device to execute the data checking task.
In some alternative implementations of the present embodiment, the type of data verification task includes a first type. The task sending unit 504 may be further configured to: the first type of data verification task is sent to the at least one task execution server to cause the at least one task execution server to send a first request to the storage device. The first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
In some alternative implementations of the present embodiment, the type of data verification task includes a second type. The task transmitting unit 504 is further configured to: the second type of data verification task is sent to the at least one task execution server to cause the at least one task execution server to send a second request to the storage device. The second request is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
In some optional implementations of this embodiment, the apparatus 500 may further include a result receiving unit, a result verifying unit, and an alarm generating unit, which are not shown in fig. 5.
And the result receiving unit is configured to receive the data verification result sent by the at least one task execution server.
And a result verification unit configured to determine whether the data fragment stored in the storage device is abnormal according to the data verification result.
And an alarm generation unit configured to generate alarm information in response to determining that the data fragment stored in the storage device is abnormal.
It should be understood that the units 501 to 504 described in the apparatus 500 for verifying data correspond to the respective steps in the method described with reference to fig. 2. Thus, the operations and features described above with respect to the method for verifying data are equally applicable to the apparatus 500 and the units contained therein, and are not described in detail herein.
With continued reference to fig. 6, a schematic diagram of another embodiment of an apparatus for verifying data according to the present application is shown. As shown in fig. 6, the apparatus 600 of this embodiment may be disposed in a task execution server in a verification server cluster, where the verification server cluster further includes a task generation server. The apparatus 600 includes: a first request transmitting unit 601, a task receiving unit 602, and a task executing unit 603.
The first request sending unit 601 is configured to send a task request to a task generating server.
The task receiving unit 602 is configured to receive the data verification task and the type sent by the task generating server.
The task execution unit 603 is configured to send a request corresponding to the type to the storage device according to the type to execute the data verification task.
In some optional implementations of this embodiment, the type of data verification task includes a first type, and the data verification task includes an identification of the data shard. The task execution unit 603 may be further configured to: in response to determining that the type is the first type, a first request is sent to the storage device, wherein the first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
In some optional implementations of this embodiment, the type of data verification task includes a second type, and the data verification task includes an identification of the data shard. The task execution unit 603 may be further configured to: in response to determining that the type is the second type, a second request is sent to the storage device. Wherein the second request is for requesting the storage device to determine a state of the data fragment indicated by the identification in the data verification task.
In some optional implementations of this embodiment, the apparatus 600 may further include a result generating unit and a result transmitting unit that are not shown in fig. 6.
And a result generation unit configured to generate a data verification result in response to determining completion of the data verification task.
And a result transmitting unit configured to transmit the data verification result to the task generating server.
In some optional implementations of this embodiment, the foregoing apparatus 600 may further include a second request sending unit, which is not shown in fig. 6, configured to send, to the storage device, a request corresponding to the type at intervals of a preset duration in response to receiving the rejection check message sent by the storage device. The refusal check message is sent by the storage device under the condition that the current data access meets the preset condition.
It should be understood that the units 601 to 603 described in the apparatus 600 for verifying data correspond to the respective steps in the method described with reference to fig. 3. Thus, the operations and features described above with respect to the method for verifying data are equally applicable to the apparatus 600 and the units contained therein, and are not described in detail herein.
With continued reference to fig. 7, a schematic diagram of an embodiment of an apparatus for processing requests according to the present application is shown. The apparatus for processing a request of this embodiment may be provided in a storage apparatus. The apparatus 700 of the present embodiment includes a second request receiving unit 701, a priority determining unit 702, and a request processing unit 703.
The second request receiving unit 701 is configured to receive the request and to determine the sender of the request.
The priority determining unit 702 is configured to determine the priority of the request according to the sender.
The request processing unit 703 is configured to process the request according to the priority.
In some optional implementations of the present embodiment, the priority determination unit 702 may be further configured to: in response to determining that the sender is a task execution server, the priority of the request is set to a preset value.
In some optional implementations of the present embodiment, the request processing unit 703 may be further configured to: determining whether the current data access meets a preset condition or not in response to determining that the priority of the request is a preset value; and sending a rejection check message to the task execution server in response to determining that the current data access meets the preset condition.
In some alternative implementations of the present embodiment, the request includes a first request, the request including an identification of the data fragment. The request processing unit 703 may be further configured to: and in response to determining that the current data access does not meet the preset condition and the request is a first request, establishing access connection with the task execution server so that the task execution server reads the data fragments indicated by the identification.
In some alternative implementations of the present embodiment, the request includes a second request, the request including an identification of the data fragment. The request processing unit 703 may be further configured to: and in response to determining that the current data access does not meet the preset condition and the request is a second request, sending state information of the data fragments indicated by the identification to the task execution server.
It should be understood that the units 701 to 703 described in the apparatus 700 for processing a request correspond to the respective steps in the method described with reference to fig. 4. Thus, the operations and features described above with respect to the method for processing a request are equally applicable to the apparatus 700 and the units contained therein, and are not described in detail herein.
Referring now to fig. 8, a schematic diagram of an electronic device (e.g., server or storage device of fig. 1) 800 suitable for use in implementing embodiments of the present disclosure is shown. The storage device/server illustrated in fig. 8 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 8, the electronic device 800 may include a processing means (e.g., a central processor, a graphics processor, etc.) 801, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
In general, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, etc.; storage 808 including, for example, magnetic tape, hard disk, etc.; communication means 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 shows an electronic device 800 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 8 may represent one device or a plurality of devices as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 809, or installed from storage device 808, or installed from ROM 802. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 801. It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In an embodiment of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. Whereas in embodiments of the present disclosure, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: scanning the data fragments stored in the storage device, and determining the number and the identification of the data fragments; generating a data verification task according to the number and the identification, and determining the type of the data verification task; receiving a task request sent by at least one task execution server; and sending the data verification task and the type to at least one task execution server so that the at least one task execution server sends a request corresponding to the type to a storage device to execute the data verification task. Or sending a task request to a task generation server; receiving a data verification task and a type sent by a task generation server; and sending a request corresponding to the type to the storage device according to the type so as to execute the data verification task. Or, receiving the request and determining the sender of the request; determining the priority of the request according to the sender; the request is processed according to the priority.
Computer program code for carrying out operations of embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments described in the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes a data scanning unit, a task generating unit, a first request receiving unit, and a task transmitting unit. Alternatively, a processor includes a first request sending unit, a task receiving unit, and a task executing unit. Alternatively, a processor includes a second request receiving unit, a priority determining unit, and a request processing unit. The names of these units do not in any way constitute a limitation of the unit itself, for example, the data scanning unit may also be described as "a unit that scans the data pieces stored in the storage means, determines the number and identity of the data pieces".
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (28)

1. A method for verifying data, applied to a task generating server in a verification server cluster, the verification server cluster further comprising a task execution server, the method comprising:
scanning the data fragments stored in the storage device, and determining the number and the identification of the data fragments;
generating data verification tasks according to the number and the identifiers, and determining the types of the data verification tasks, wherein at least one data fragment and at least one identifier are packaged in the data verification tasks;
receiving a task request sent by at least one task execution server;
transmitting the data verification task and the type to the at least one task execution server so that the at least one task execution server transmits a request corresponding to the type to the storage device to execute the data verification task;
wherein the request corresponding to the type comprises:
the data fragments are used for reading the identification indication in the data verification task; and/or the number of the groups of groups,
and the data verification task is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
2. The method of claim 1, wherein the type of data verification task comprises a first type; and
The sending the data verification task and the type to the at least one task execution server comprises the following steps:
and sending the first type of data verification task to the at least one task execution server so that the at least one task execution server sends a first request to the storage device, wherein the first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
3. The method of claim 1, wherein the type of data verification task comprises a second type; and
the sending the data verification task and the type to the at least one task execution server comprises the following steps:
and sending a second type of data verification task to the at least one task execution server so that the at least one task execution server sends a second request to the storage device, wherein the second request is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
4. A method according to any one of claims 1-3, wherein the method further comprises:
receiving a data verification result sent by the at least one task execution server;
Determining whether the data fragments stored in the storage device are abnormal or not according to the data verification result;
in response to determining that the data fragment stored in the storage device is abnormal, generating alarm information.
5. A method for verifying data, applied to a task execution server in a verification server cluster, the verification server cluster further comprising a task generation server, the method comprising:
sending a task request to a task generation server;
receiving a data verification task and a type sent by the task generation server, wherein the data verification task is generated according to the number and the identification of the data fragments stored in the storage device, and the data verification task comprises at least one data fragment and at least one identification;
according to the type, sending a request corresponding to the type to the storage device to execute the data verification task;
wherein the request corresponding to the type comprises:
the data fragments are used for reading the identification indication in the data verification task; and/or the number of the groups of groups,
and the data verification task is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
6. The method of claim 5, wherein the type of data verification task comprises a first type, the data verification task comprising an identification of a data fragment; and
the sending, according to the type, a request corresponding to the type to a storage device includes:
and in response to determining that the type is a first type, sending a first request to the storage device, wherein the first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
7. The method of claim 5, wherein the type of data verification task comprises a second type, the data verification task comprising an identification of a data fragment; and
the sending, according to the type, a request corresponding to the type to a storage device includes:
and in response to determining that the type is a second type, sending a second request to the storage device, wherein the second request is used for requesting the storage device to determine the state of the data fragments indicated by the identification in the data verification task.
8. The method of any of claims 5-7, wherein the method further comprises:
generating a data verification result in response to determining completion of the data verification task;
And sending the data verification result to the task generating server.
9. The method of any of claims 5-7, wherein the method further comprises:
and responding to receiving a refusal check message sent by the storage device, and sending a request corresponding to the type to the storage device at intervals of preset time, wherein the refusal check message is sent by the storage device under the condition that the current data access meets preset conditions.
10. A method for processing a request, applied to a storage device, comprising:
receiving a request and determining a sender of the request, the request including an identification of a data fragment;
in response to determining that the sender is a task execution server, setting a priority of the request to a preset value, wherein the task execution server is configured to perform the method of any of claims 5-9;
determining whether the current data access meets a preset condition or not in response to determining that the priority of the request is a preset value;
responding to the fact that the current data access does not meet the preset condition and the request is a first request, and establishing access connection with the task execution server so that the task execution server reads the data fragments indicated by the identification;
And in response to determining that the current data access does not meet the preset condition and the request is a second request, sending the state information of the data fragments indicated by the identification to the task execution server.
11. The method of claim 10, wherein the method further comprises:
and sending a rejection check message to the task execution server in response to determining that the current data access meets a preset condition.
12. An apparatus for verifying data, provided in a task generating server in a verification server cluster, the verification server cluster further including a task execution server, the apparatus comprising:
the data scanning unit is configured to scan the data fragments stored in the storage device and determine the number and the identification of the data fragments;
a task generating unit configured to generate a data verification task according to the number and the identifier, and determine a type of the data verification task, wherein at least one data fragment and at least one identifier are packaged in the data verification task;
a first request receiving unit configured to receive a task request transmitted by at least one task execution server;
a task transmitting unit configured to transmit the data verification task and a type to the at least one task execution server, so that the at least one task execution server transmits a request corresponding to the type to the storage device to execute the data verification task;
Wherein the request corresponding to the type comprises:
the data fragments are used for reading the identification indication in the data verification task; and/or the number of the groups of groups,
and the data verification task is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
13. The apparatus of claim 12, wherein the type of data verification task comprises a first type; and
the task sending unit is further configured to:
and sending the first type of data verification task to the at least one task execution server so that the at least one task execution server sends a first request to the storage device, wherein the first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
14. The apparatus of claim 12, wherein the type of data verification task comprises a second type; and
the task sending unit is further configured to:
and sending a second type of data verification task to the at least one task execution server so that the at least one task execution server sends a second request to the storage device, wherein the second request is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
15. The apparatus of any of claims 12-14, wherein the apparatus further comprises:
a result receiving unit configured to receive a data verification result transmitted by the at least one task execution server;
a result verification unit configured to determine whether the data fragment stored in the storage device is abnormal according to the data verification result;
and an alarm generation unit configured to generate alarm information in response to determining that the data fragment stored in the storage device is abnormal.
16. An apparatus for verifying data, a task execution server disposed in a verification server cluster, the verification server cluster further comprising a task generation server, the apparatus comprising:
a first request transmitting unit configured to transmit a task request to a task generating server;
the task receiving unit is configured to receive a data verification task and a type sent by the task generating server, wherein the data verification task is generated according to the number and the identification of the data fragments stored in the storage device, and the data verification task comprises at least one data fragment and at least one identification;
a task execution unit configured to send a request corresponding to the type to the storage device according to the type, so as to execute the data verification task;
Wherein the request corresponding to the type comprises:
the data fragments are used for reading the identification indication in the data verification task; and/or the number of the groups of groups,
and the data verification task is used for requesting the storage device and determining the state of the data fragments indicated by the identification in the data verification task.
17. The apparatus of claim 16, wherein the type of data verification task comprises a first type, the data verification task comprising an identification of a data fragment; and
the task execution unit is further configured to:
and in response to determining that the type is a first type, sending a first request to the storage device, wherein the first request is used for requesting to read the data fragments indicated by the identification in the data verification task.
18. The apparatus of claim 16, wherein the type of data verification task comprises a second type, the data verification task comprising an identification of a data fragment; and
the task execution unit is further configured to:
and in response to determining that the type is a second type, sending a second request to the storage device, wherein the second request is used for requesting the storage device to determine the state of the data fragments indicated by the identification in the data verification task.
19. The apparatus of any of claims 16-18, wherein the apparatus further comprises:
a result generation unit configured to generate a data verification result in response to determining completion of the data verification task;
and the result sending unit is configured to send the data verification result to the task generating server.
20. The apparatus of any of claims 16-18, wherein the apparatus further comprises:
and a second request sending unit configured to send a request corresponding to the type to the storage device at intervals of a preset duration in response to receiving a rejection check message sent by the storage device, wherein the rejection check message is sent by the storage device when determining that the current data access meets a preset condition.
21. An apparatus for processing a request, disposed on a storage device, the apparatus comprising:
a second request receiving unit configured to receive a request including an identification of a data fragment and to determine a sender of the request;
a priority determining unit configured to set a priority of the request to a preset value in response to determining that the sender is a task execution server, wherein the task execution server is configured to perform the method of any one of claims 5-9;
A request processing unit configured to determine whether a current data access satisfies a preset condition in response to determining that a priority of the request is a preset value; responding to the fact that the current data access does not meet the preset condition and the request is a first request, and establishing access connection with the task execution server so that the task execution server reads the data fragments indicated by the identification; and in response to determining that the current data access does not meet the preset condition and the request is a second request, sending the state information of the data fragments indicated by the identification to the task execution server.
22. The apparatus of claim 21, wherein the request processing unit is further configured to:
and sending a rejection check message to the task execution server in response to determining that the current data access meets a preset condition.
23. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-4.
24. A server, comprising:
One or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 5-9.
25. A storage device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 10-11.
26. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-4.
27. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 5-9.
28. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 10-11.
CN201910098633.3A 2019-01-31 2019-01-31 Method and device for checking data and processing request Active CN109871294B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910098633.3A CN109871294B (en) 2019-01-31 2019-01-31 Method and device for checking data and processing request

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910098633.3A CN109871294B (en) 2019-01-31 2019-01-31 Method and device for checking data and processing request

Publications (2)

Publication Number Publication Date
CN109871294A CN109871294A (en) 2019-06-11
CN109871294B true CN109871294B (en) 2023-08-01

Family

ID=66918396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910098633.3A Active CN109871294B (en) 2019-01-31 2019-01-31 Method and device for checking data and processing request

Country Status (1)

Country Link
CN (1) CN109871294B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061357B (en) * 2019-12-13 2021-09-03 北京奇艺世纪科技有限公司 Energy saving method and device, electronic equipment and storage medium
CN112269706B (en) * 2020-11-16 2024-04-05 北京百度网讯科技有限公司 Interface parameter verification method, device, electronic equipment and computer readable medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032824A (en) * 2018-05-31 2018-12-18 康键信息技术(深圳)有限公司 Database method of calibration, device, computer equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143040A (en) * 2010-06-30 2011-08-03 华为技术有限公司 Traffic control method and device
CN102546755A (en) * 2011-12-12 2012-07-04 华中科技大学 Data storage method of cloud storage system
US9479525B2 (en) * 2014-10-23 2016-10-25 International Business Machines Corporation Interacting with a remote server over a network to determine whether to allow data exchange with a resource at the remote server
US9817726B2 (en) * 2015-01-09 2017-11-14 Ariba, Inc. Delta replication of index fragments to enhance disaster recovery
CN105813032A (en) * 2016-03-11 2016-07-27 中国联合网络通信集团有限公司 Information sending method and server
CN108897806A (en) * 2018-06-15 2018-11-27 东软集团股份有限公司 Comparison of data consistency method, apparatus, storage medium and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032824A (en) * 2018-05-31 2018-12-18 康键信息技术(深圳)有限公司 Database method of calibration, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109871294A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
CN112650685B (en) Automatic test method, device, electronic equipment and computer storage medium
CN110868276A (en) Data transmission method and system for Internet of things equipment and electronic equipment
CN110688428B (en) Method and device for issuing intelligent contracts
CN110955899A (en) Safety test method, device, test equipment and medium
CN110324185B (en) Hyper-parameter tuning method, device, server, client and medium
CN104050054B (en) Processing method for installation package installation failure and cause determining method and device
CN109871294B (en) Method and device for checking data and processing request
CN113468515A (en) User identity authentication method and device, electronic equipment and storage medium
CN110764979A (en) Log identification method, system, electronic device and computer readable medium
CN109299124B (en) Method and apparatus for updating a model
CN112887355B (en) Service processing method and device for abnormal server
CN113037850A (en) Application program upgrading method and device, electronic equipment and storage medium
CN114428815A (en) Data storage method and device, electronic equipment and computer readable medium
CN113283891A (en) Information processing method and device and electronic equipment
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN110688677B (en) Method and device for executing intelligent contracts
CN112084114A (en) Method and apparatus for testing an interface
CN113344598A (en) Data verification method, device, medium and electronic equipment
CN112272211A (en) Service request processing method, device and system
CN111786936A (en) Method and device for authentication
CN117294745B (en) Network connection state information sending method, device, electronic equipment and medium
CN110262756B (en) Method and device for caching data
CN113721934A (en) Hot patch installation method and device, electronic equipment and computer readable medium
CN110221869B (en) Method and device for configuring data center operating environment
CN107911248B (en) Upgrading method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant