[go: up one dir, main page]

CN110928887A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN110928887A
CN110928887A CN201811094736.4A CN201811094736A CN110928887A CN 110928887 A CN110928887 A CN 110928887A CN 201811094736 A CN201811094736 A CN 201811094736A CN 110928887 A CN110928887 A CN 110928887A
Authority
CN
China
Prior art keywords
data
target field
modification
field
client
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.)
Pending
Application number
CN201811094736.4A
Other languages
Chinese (zh)
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 Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201811094736.4A priority Critical patent/CN110928887A/en
Publication of CN110928887A publication Critical patent/CN110928887A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a data processing method and a data processing device, wherein in the method, data change is carried out by taking a field as a unit, the function of a version number in judging a modification conflict is cancelled, a client side sends a data modification request to a database server instead of carrying original data of a target field and update data of the target field, and the database server judges whether the modification conflict exists or not by judging whether the original data of the target field is consistent with the current data of the target field or not, so that the modification conflict in a non-real sense can be effectively removed, the probability of the occurrence of the modification conflict is greatly reduced, and a plurality of client sides can simultaneously and more efficiently realize data update.

Description

Data processing method and device
Technical Field
The present application relates to the field of computers, and in particular, to a data processing method and apparatus.
Background
At present, a client and a server can perform various data interactions, in some scenarios, the client can request to modify a data table stored in a database server, and after the database server updates the data table, the client can also perform synchronous update on the locally stored data table. Since different clients may simultaneously initiate requests to modify the data tables in the database server, it is necessary to first determine whether there is a modification conflict before the database server updates the data tables.
In the prior art, when a certain client sends a data modification request to a database server, the data modification request carries the entire row of data to be modified in a data table, the identification of the row and a version number, the database server judges whether the version number of the row in the current data table is consistent with the version number in the data modification request, if so, the data update can be performed, and simultaneously, after the data update is performed, a new version number is fed back to the client, if not, the data update is performed on the row of data by representing that other clients already update the row of data, and a modification conflict exists, and the modification cannot be performed.
However, according to this method, in some cases, there is no modification conflict for data actually, and it is also determined that there is a modification conflict, and modification cannot be performed, resulting in poor user experience.
Disclosure of Invention
In view of this, embodiments of the present application provide a data processing method and apparatus to solve the technical problem in the prior art that a modification conflict is misjudged.
And in the case of no modification conflict, a determination of a modification conflict is made,
in order to solve the above problem, the technical solution provided by the embodiment of the present application is as follows:
in a first aspect of the embodiments of the present application, a data processing method is provided, which is applied to a client, and the method includes:
sending a data modification request to a database server, wherein the data modification request comprises original data of a target field and updated data of the target field, so that the database server judges whether the original data of the target field is consistent with the current data of the target field, if so, updating the data in the database server according to the updated data of the target field, sending a successful data updating message to the client, and if not, sending a modification conflict prompt to the client; the target field is at least one field in any row of the data table;
when the data updating success message is received, updating the data in the client to complete the data modification request;
and when the modification conflict prompt is received, responding to the trigger of the user to perform modification conflict processing operation and finishing the data modification request.
In a possible implementation manner, the updating the data in the client when the data update success message is received includes:
and when the successful data updating message is received, updating the data of the related field according to the updating data of the target field, wherein the related field is the target field or the target field and the field related to the target field.
In a possible implementation manner, the data update success message carries data of a row in which the relevant field is located, and updating the data in the client when the data update success message is received includes:
and updating the data of the relevant fields according to the data of the row where the relevant fields are located.
In a possible implementation manner, the modification conflict prompt carries data of a row in which a target field is located, where the data of the row in which the target field is located includes current data of the target field; when the modification conflict prompt is received, the modification conflict processing operation is performed in response to the triggering of the user, and the data modification request is completed, including:
when receiving the modification conflict prompt, generating a modification option for giving up the current time and a modification option for insisting on the current time;
responding to the trigger of the user for giving up the current modification option, updating the data in the client according to the current data of the target field, and completing the current data modification request;
and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original data of the target field, generating a new data modification request, and completing the data modification request.
In one possible implementation, the method further includes:
and storing the data modification request in a queue, deleting the current data modification request from the queue after the data modification request is completed, acquiring the next data modification request from the queue again, and executing the steps of sending the data modification request to a database server and the subsequent steps.
In a second aspect of the embodiments of the present application, a data processing method is provided, which is applied to a database server, and the method includes:
receiving a data modification request sent by a client, wherein the data modification request comprises original data of a target field and updated data of the target field, and the target field is at least one field in any row of a data table;
judging whether the original data of the target field is consistent with the current data of the target field;
if the original data of the target field is consistent with the current data of the target field, updating the data in the database server according to the updated data of the target field, and sending a data updating success message to the client, so that the client updates the data in the client after receiving the data updating success message;
and if the original data of the target field is inconsistent with the current data of the target field, sending a modification conflict prompt to the client so that the client responds to the triggering of a user to perform modification conflict processing operation after receiving the modification conflict prompt.
In a possible implementation manner, the updating the data in the database server according to the update data of the target field includes:
and updating the data of the related field according to the updating data of the target field, wherein the related field is the target field or the target field and the field related to the target field.
In a possible implementation manner, the data update success message carries the data of the row in which the relevant field is located, so that the client updates the data of the relevant field according to the data of the row in which the relevant field is located;
the modification conflict prompt carries data of a line where a target field is located, and the data of the line where the target field is located comprises current data of the target field, so that the client generates a abandoning modification option and a persisting modification option after receiving the modification conflict prompt; responding to the trigger of the user for giving up the current modification option, updating the data of the relevant field according to the current data of the target field, and completing the current data modification request; and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original field of the target field, generating a new data modification request, and completing the data modification request.
A third aspect of the embodiments of the present application provides a data processing apparatus, which is applied to a client, and the apparatus includes:
a sending unit, configured to send a data modification request to a database server, where the data modification request includes original data of a target field and update data of the target field, so that the database server determines whether the original data of the target field is consistent with current data of the target field, if so, updates data in the database server according to the update data of the target field, and sends a data update success message to the client, and if not, sends a modification conflict prompt to the client; the target field is at least one field in any row of the data table;
the updating unit is used for updating the data in the client when the data updating success message is received, and finishing the data modification request;
and the first processing unit is used for responding to the trigger of the user to perform modification conflict processing operation when the modification conflict prompt is received, and finishing the data modification request.
In a possible implementation manner, the updating unit is specifically configured to update, when the data update success message is received, data of a relevant field according to the update data of the target field, where the relevant field is the target field, or the target field and a field relevant to the target field.
In a possible implementation manner, the updating unit is specifically configured to update the data of the relevant field according to the data of the row in which the relevant field is located when the data update success message carries the data of the row in which the relevant field is located.
In a possible implementation manner, the first processing unit specifically includes:
the first generating subunit is configured to generate, when the modification conflict prompt is received, a modification option to be given up this time and a modification option to be insist on this time; the modification conflict prompt carries data of a line where a target field is located, wherein the data of the line where the target field is located comprises current data of the target field;
the updating subunit is used for responding to the triggering of the user on the option for giving up the current modification, updating the data in the client according to the current data of the target field, and completing the current data modification request;
and the second generation subunit is used for responding to the trigger of the user for insisting on the current modification option, using the current data of the target field as the original data of the target field, generating a new data modification request, and completing the current data modification request.
In one possible implementation, the apparatus further includes:
and the second processing unit is used for storing the data modification request in a queue, deleting the current data modification request from the queue after the data modification request is completed, acquiring the next data modification request from the queue again, and executing the first sending unit.
In a fourth aspect of the embodiments of the present application, there is provided a data processing apparatus, where the apparatus is applied to a database server, and the apparatus includes:
the data modification method comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a data modification request sent by a client, the data modification request comprises original data of a target field and updated data of the target field, and the target field is at least one field in any row of a data table;
the judging unit is used for judging whether the original data of the target field is consistent with the current data of the target field;
the updating unit is used for updating the data in the database server according to the updating data of the target field and triggering the sending unit to send a data updating success message to the client when the judgment result of the judging unit is consistent, so that the client updates the data in the client after receiving the data updating success message;
and the sending unit is further used for sending a modification conflict prompt to the client when the judgment result of the judging unit is inconsistent, so that the client responds to the trigger of a user to perform modification conflict processing operation after receiving the modification conflict prompt.
In a possible implementation manner, the updating unit is specifically configured to update data of a related field according to the update data of the target field, where the related field is the target field or the target field and a field associated with the target field.
In a possible implementation manner, the data update success message carries the data of the row in which the relevant field is located, so that the client updates the data of the relevant field according to the data of the row in which the relevant field is located;
the modification conflict prompt carries data of a line where a target field is located, and the data of the line where the target field is located comprises current data of the target field, so that the client generates a abandoning modification option and a persisting modification option after receiving the modification conflict prompt; responding to the trigger of the user for giving up the current modification option, updating the data of the relevant field according to the current data of the target field, and completing the current data modification request; and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original field of the target field, generating a new data modification request, and completing the data modification request.
In a fifth aspect of embodiments of the present application, a storage medium is provided, where the storage medium includes a stored program, where the program executes the data processing method according to the first aspect or executes the data processing method according to the second aspect.
In a sixth aspect of embodiments of the present application, a processor is configured to execute a program, where the program executes the data processing method according to the first aspect or executes the data processing method according to the second aspect.
Therefore, the embodiment of the application has the following beneficial effects:
the data modification method and the data modification system have the advantages that the data modification is carried out by taking the field as a unit, the function of the version number in the judgment of the modification conflict is cancelled, the client side sends the original data of the target field and the updated data of the target field to the database server, and the database server judges whether the modification conflict exists or not by judging whether the original data of the target field is consistent with the current data of the target field or not, so that the modification conflict which is not in the true sense can be effectively removed, the probability of the modification conflict is greatly reduced, and the data updating can be realized by a plurality of client sides more efficiently.
Drawings
Fig. 1 is a schematic diagram of an exemplary application scenario framework provided in an embodiment of the present application;
fig. 2 is a flowchart of a data processing method according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for handling modification conflicts according to an embodiment of the present application;
FIG. 4 is a flow chart of another data processing method provided by the embodiments of the present application;
fig. 5 provides a data processing signaling interaction diagram according to an embodiment of the present application;
fig. 6 is a block diagram of a data processing apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of another data processing apparatus according to an embodiment of the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, embodiments accompanying the drawings are described in detail below.
For the convenience of understanding the technical solution of the present application, the background of the technical solution of the present application will be described below.
The traditional method for modifying the data table is that a client sends a data modification request to a database server according to a modification request triggered by a user, the request carries the whole row of data to be modified in the data table, the identification and the version number of the row, the database server judges whether the version number of the row in the current data table is consistent with the version number in the data modification request, if so, data updating is carried out, meanwhile, a new version number is fed back to the client after data updating is carried out, if not, the data is updated by other clients, modification conflict exists, and modification cannot be carried out.
In addition, when the row data modified by the user is in uplink and downlink association with other row data, the database server updates the row data, updates the data of the row associated with the row data, updates the version number of the associated row, and feeds back the new version numbers of the row and the associated row to the client.
According to the modification method, in some cases, there is actually no modification conflict for the data, and it is also determined that there is a modification conflict and modification cannot be performed, resulting in poor user experience. The inventor researches and finds that the situations of modification conflict in the modification method can be specifically divided into the following four situations.
The first situation is that when a plurality of users edit the same field of the same row through respective clients and submit data modification requests at the same time, because the database server processes the data modification requests in series, a queue is formed in the database server, and when the first data modification request is successfully processed, the database server updates the version number of the row, and when the database server processes the second data modification request, modification conflict is caused because the old version number of the row carried by the second data modification request is not consistent with the version number of the row currently stored in the database server, and modification cannot be performed.
The second situation is that when a row of data that a user wants to modify is associated with other rows of data, the database server updates the row version number and also updates other row version numbers associated with the row, and when another user just modifies the associated row of data at the same time, because the version number of the associated row in the client is not updated in time, the version number carried in the data modification request is inconsistent with the version number in the database server, resulting in modification conflict and failure to modify.
The third situation is that there are many fields in a row, when a user modifies one field in the row and another user modifies other fields in the same row, and there is no logical association between the fields modified by the two users, that is, the modification of one field does not cause the update of the other field. According to the normal modification logic, the modification of the two users should not have conflict, however, when the first user modifies the field, the database server has already updated the version number of the row, and when the database server processes the data modification request submitted by the second user, because the request carries the still old version number, and the version number stored in the database server is a new version number, the version numbers are inconsistent, so that the modification conflict is caused, and the modification cannot be performed.
The fourth situation is that when a user modifies a certain row of data at a client, due to careless line change, (the client sends a data modification request to the database server according to the line change operation, and then the database server completes the modification and updates the version number of the row according to the data modification request), the user continues to modify the row and submits the row again, and due to poor communication network, the version number of the row at the client cannot be updated in time, so that the data modification request submitted for the second time still carries the old version number of the row, which is inconsistent with the version number stored in the database server, and modification conflict is caused, and modification cannot be performed.
As can be seen from the above, in the first case, modification conflicts do exist when multiple users modify the same field simultaneously, while modification conflicts do not actually exist for the other three types of users, and misjudgment occurs because the database server needs to judge whether to respond to modification of the client according to the version number.
Based on this, the embodiment of the present application provides a data processing method, the method cancels the role of the version number in determining the modification conflict, but performs data update by taking a field as a unit, when a user needs to modify a field of a certain row of data, a data modification request sent by a client to a database server carries original data of a target field and update data of the target field, and the database server determines whether a modification conflict exists by determining whether the original data of the target field in the request is consistent with current data of the target field stored by the database server, thereby effectively solving the modification conflict in a non-true sense, greatly reducing the probability of the occurrence of the modification conflict, and enabling a plurality of clients to more efficiently implement data update at the same time.
Referring to fig. 1, the diagram is a schematic diagram of a framework of an exemplary application scenario provided in the embodiment of the present application, where the data processing method provided in the embodiment of the present application may be applied to a client 10 and a server 20, the client 10 sends a data modification request to the server 20 according to a modification operation of a user on a target field in a certain row, the server 20 determines whether the original data of the target field in the data modification request and current data of the target field stored by the server 20 are consistent, if so, the server 20 updates data of a relevant field according to update data of the target field in the data modification request, and sends a data update success message to the client 10, and the client 10 updates the relevant field to complete the data modification request; if not, the server 20 sends a modification conflict prompt to the client 10, and the client 10 performs a modification conflict processing operation according to user trigger to complete the data modification request.
Those skilled in the art will appreciate that the frame diagram shown in fig. 1 is only one example in which embodiments of the present application may be implemented, and the scope of applicability of embodiments of the present application is not limited in any way by this frame.
It should be noted that the client 10 in the embodiments of the present application may be any user equipment now existing, developing or later developed that is capable of interacting with the server 20 via any form of wired and/or wireless connection (e.g., Wi-Fi, LAN, cellular, coaxial cable, etc.), including but not limited to: existing, developing, or future developing smartphones, non-smartphones, tablets, laptop personal computers, desktop personal computers, minicomputers, midrange computers, mainframe computers, and the like. It should also be noted that the server 20 in the embodiment of the present application may be an example of an existing, developing or future developing device capable of providing an application service of information recommendation to a user. The embodiments of the present application are not limited in any way in this respect.
For the convenience of understanding the technical solutions provided by the present application, a data processing method provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 2, which is a flowchart of a data processing method provided in an embodiment of the present application, the method is applied to a client, and as shown in fig. 2, the method may include:
s201: a data modification request is sent to the database server.
When a user modifies one or more fields of a row of data in the data table through the client, the client sends a data modification request to the database server aiming at the modification operation of the user, so that the database server processes the data modification request.
In this embodiment, the data modification request includes original data of the target field and update data of the target field, so that the database server determines whether the original data of the target field is consistent with the current data of the target field, updates data of a related field according to the update data of the target field if the original data of the target field is consistent with the current data of the target field, and sends a data update success message to the client, and sends a modification conflict prompt to the client if the original data of the target field is inconsistent with the current data of the target field.
In this example, the original data of the target field is the data of the target field stored by the client, the updated data of the target field is the data after the user wants to modify the target field, and the current data of the target field judged by the database server is the data of the target field stored in the database server. The database server can compare the original data of the target field in the data modification request with the current data of the target field stored by the database server, when the two data are consistent, the modification conflict does not exist, the database server can update the data in the database server according to the updated data of the target field in the data modification request, and when the two data are inconsistent, the modification conflict exists, and a modification conflict prompt is sent to the client.
For example, a user 1 modifies a field 1, modifies the field data from a to B, a user 2 also modifies the field 1 at the same time, and modifies the field from a to C, when the database server processes the data modification request of the user 2 first and then processes the data modification request of the user 1, since the data of the field 1 in the database server is updated to C, that is, the current data of the field 1 is C, the original data of the field 1 in the data modification request of the user 1 is a, the updated data is B, and the database server judges that the original data a of the field 1 is inconsistent with the current data C of the field 1, indicating that there is a modification conflict, the database server sends a modification conflict prompt to a client corresponding to the user 1 to prompt the user 1 that there is a conflict in the current modification.
In practical application, when the database server performs data update, the data of the relevant field can be updated according to the update data of the target field. The target field is at least one field in any row of the data table, the related field is the target field or the target field and a field related to the target field, and the field related to the target field may be in the same row as the target field or in a different row from the target field. That is, when the target field modified by the user is not associated with other fields, the database server only updates the data of the target field by using the update data of the target field; when the target field modified by the user is associated with other fields, the database server updates the data of the target field and the data of the field associated with the target field by using the update data of the target field. For example, a certain row of data in the data table records data such as the occurrence start time, the occurrence end time, the occurrence duration and the like of an event, and when a user modifies the start time, the occurrence duration is determined by the end time and the start time, so that when the database server judges that the start time stored by the database server is consistent with the original time carrying the start time in the data modification request, the start time stored by the database server and the occurrence duration are updated according to the update time of the start time carried in the data modification request.
S202: and when the data updating success message is received, updating the data in the client to complete the data modification request.
And after the database server updates the data in the database server according to the updated data of the target field, sending a data updating success message to the client, and then synchronously updating the data stored by the client so as to complete the data modification request.
In the embodiment of the present application, the following two updating methods are provided for updating data by a client, and the two updating methods will be described below respectively.
When a data updating success message is received, updating data of a related field according to the updating data of a target field, wherein the related field is the target field or the target field and a field related to the target field.
In this embodiment, since the user modifies the target field at the client, and the client may also pre-store the association relationship between the target field and other fields, the client has obtained the update data of the target field, and after receiving the data update success message, may update the target field or the target field and the data of the field related to the target field according to the obtained update data of the target field, thereby completing the modification of the related field.
Another method for updating data is that the data updating success message carries the data of the row where the relevant field is located, and when the client receives the data updating success message, the data of the relevant field can be updated according to the data of the row where the relevant field is located.
In this embodiment, when the database server completes data update of the relevant fields, data in the row where the relevant fields that have been updated are located may be added to the data update success message, and when the client receives the data update success message, the data of the relevant fields may be directly updated by using the data in the row where the relevant fields are located, without updating the data of the relevant fields one by one, thereby improving the data update efficiency.
It can be understood that, in the first data updating method, the database server may only send the data updating success message to the client, and the message does not need to carry additional data, so that the load of transmission between the client and the database server is reduced, and the transmission rate of the message is increased. In the second data updating method, the data updating success message carries the data of the row where the relevant field is located, and the client can directly use the data of the row where the relevant field is located to cover the data of the row where the relevant field is stored, so that the data updating efficiency is improved.
S203: and when receiving the modification conflict prompt, responding to the trigger of the user to perform modification conflict processing operation and finishing the data modification request.
In this embodiment, when the database server determines that the original data of the target field in the data modification request is inconsistent with the current data of the target field stored by the database server, a modification conflict prompt is sent to the client to prompt the user that a conflict exists in the current modification.
In practical application, when the client receives the modification conflict prompt, different operations for processing the modification conflict can be displayed to the user, and then the data modification request is completed according to the selection of the user. Here, operations regarding handling of modification conflicts will be explained in the subsequent embodiments.
It can be known from the foregoing embodiments that, in the embodiments of the present application, a version number is cancelled in determining a modification conflict, but a field is used as a unit for data update, when a user needs to modify a field of a certain row of data, a data modification request sent by a client to a database server carries original data of a target field and update data of the target field, and the database server determines whether a modification conflict exists by determining whether the original data of the target field in the request is consistent with current data of the target field stored by the database server, so that the modification conflict in a non-true sense is effectively solved, the probability of the occurrence of the modification conflict is greatly reduced, and a plurality of clients can simultaneously and more efficiently implement data update.
With respect to handling a modification conflict, this embodiment provides a possible implementation manner, see fig. 3, which is a flowchart of a method for handling a modification conflict provided in this embodiment of the present application, where the method may include:
s301: and when receiving the modification conflict prompt, generating to give up the modification option of the time and insist on the modification option of the time.
In this embodiment, when the client receives the modification conflict prompt, different options for processing the current modification conflict may be displayed to the user, for example, the current modification option is abandoned and the current modification option is insist on, so that the client processes the current modification conflict according to the selection of the user. And the modification conflict prompt carries the data of the line where the target field is located, and the data of the line where the target field is located comprises the current data of the target field.
During specific implementation, the client can generate the option of giving up the current modification and the option of insisting on the current modification according to the received modification conflict prompt, and display the options on the display page, so that the user can select the options in the display page according to the requirement of the user, and the client performs subsequent processing according to the selection of the user.
S302: and responding to the trigger of the user for giving up the current modification option, updating the data in the client according to the current data of the target field, and completing the current data modification request.
In this example, when the user selects to abandon the current modification option, the client updates the data in the client according to the current data of the target field carried in the modification conflict prompt. In a specific implementation, the data of the relevant field in the client may be updated according to the current data of the target field carried in the modification conflict notice.
For example, the modification conflict prompt sent by the database server to the client corresponding to the user 1 is "you just conflict with other users by modifying the field 1 from a to B, the current data of the field 1 of the database server is currently C", when the user 1 chooses to abandon the modification option this time, the client updates the field 1 to C according to the current data C of the field 1 in the modification conflict prompt, and when the field related to the field 1 exists, the data of the field related to the field 1 is updated at the same time.
S303: and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original data of the target field, generating a new data modification request, and completing the data modification request.
In this example, when the user selects to adhere to the current modification option, the client uses the current data of the target field carried in the modification conflict prompt as the original data of the target field to generate a new data modification request, so as to request the current data modification. The client may then send a new data modification request to the database server to re-modify.
For example, the modification conflict prompt sent by the database server to the client corresponding to the user 1 is "you conflict with other users in the operation of modifying the field 1 from a to B, and the current data of the field 1 of the database server is currently C", when the user 1 chooses to adhere to the modification option this time, the client takes the current data C of the field 1 in the modification conflict prompt as the original data of the field 1, and then generates a new data modification request, in which the original data of the field 1 is C, the updated data is B, and the data modification this time is completed. The client may then send a new data modification request to the database server to effect modification of the data of field 1 to B.
In a possible implementation manner of the embodiment of the present application, to ensure that each submission of a data modification request is submitted under the condition that an previous data modification request is processed, so as to reduce the probability of modification conflict, a queue mechanism is added to a client, specifically, a data modification request is stored in a queue, after the data modification request is completed, a current data modification request is deleted from the queue, a next data modification request is obtained from the queue again, and the data modification request and subsequent steps are executed to be sent to a database server.
In specific implementation, the client adds the generated multiple data modification requests into the queue, and sends the second data modification request to the database server after the first data modification request is processed, so that the first data modification request is prevented from being collided due to the fact that the database server receives and processes the second data modification request due to network instability and the like when the client sends multiple data modification requests at the same time.
For example, a user modifies field 1 from a to B at a client, the client sends a first data modification request to a database server, then the user modifies field 1 from B to C again, and sends a second data modification request to the database server, which may be caused by the influence of network transmission performance that the second data modification request is sent to the database server first, and since the current data of field 1 in the database server is a, the current data is inconsistent with the original data B of field 1 in the second data modification request, the modification conflict is caused. When a queue mechanism is added at a client, after a first data modification request is processed, a second data modification request is sent to a database server, after the database server receives the first data modification request, the current data of a field 1 in the database server is A and is consistent with the original data A of the field 1 in the first data modification request, the database server updates the data of the field 1 to B, and when the second data modification request is processed, the current data of the field 1 in the database server is B and is consistent with the original data B of the field 1 in the second data modification request, the second modification can be successfully carried out, so that unnecessary modification conflict is avoided, and the data modification efficiency is improved.
According to the embodiment, when a modification conflict situation occurs, the client can provide different operations for processing the modification conflict for the user, the user can select corresponding processing operations according to needs, and the client completes the data modification request according to the selection of the user, so that the user experience is improved.
For the situation of misjudgment of modification conflict in the prior art, the data processing method provided in the embodiment of the present application can avoid judging the last three kinds of modification conflict situations, and the following will describe in detail how to avoid misjudgment of modification conflict in the embodiment of the present application.
In case one, when there are other row fields related to the field modified by the user 1, but the field 2 modified by the user 2 is not a related field, that is, the data of the field 2 in the database server is not changed, so that the original data of the field 2 in the data modification request sent by the client of the user 2 is consistent with the current data of the field 2 in the database server, no modification conflict is generated, and data modification can be performed.
However, when the field 2 modified by the user 2 is a related field, since the database server has modified the data in the field 2, the original data in the field 2 in the data modification request sent by the client corresponding to the user 2 is inconsistent with the current data in the field 2 in the database server, so as to cause a modification conflict, which is an actually existing modification conflict and needs to be processed by the user.
And in the second case, when different users modify different fields in the same row, the modified fields are not related, and the modification conflict does not exist as in the first case.
And thirdly, the data modification request submitted for a plurality of times before and after relates to the same field, for example, the field 1 is modified from A to B and then modified to C, the client side firstly sends the data modification request for modifying the field 1 from A to B to the database server due to the fact that a queue mechanism is added on the client side, the field 1 stored by the client side is modified to B after the data modification request is processed by the data server, then the client side sends the data modification request for modifying the field 1 from B to C to the database server, and since the current data of the field 1 in the database server is B and is consistent with the original data B of the field 1 in the data modification request, the data updating can be completed smoothly, and modification conflict caused by the fact that the database server processes a second data request firstly is avoided.
Therefore, when the modification conflict of the data does not exist actually, the embodiment of the application can avoid judging the modification conflict to update the data, greatly reduce the probability of the modification conflict, and enable a plurality of clients to update the data more efficiently.
Based on the method for processing data by the client, the embodiment of the present application further provides a method for processing data by a server, which will be described below with reference to the accompanying drawings.
Referring to fig. 4, which is a diagram of another data processing method provided in the embodiment of the present application, the method is applied to a database server, and as shown in fig. 4, the method may include:
s401: and receiving a data modification request sent by the client.
In this example, the client generates a data modification request according to the modification operation of the user on the target field, and sends the data modification request to the database server, and the database server performs subsequent judgment operation according to the data modification request.
The data modification request comprises original data of a target field and updated data of the target field, and the target field is at least one field in any row of the data table.
S402: and judging whether the original data of the target field is consistent with the current data of the target field.
And the database server acquires the original data of the target field in the data modification request and compares the original data of the target field with the current data of the target field stored by the database server to judge whether modification conflict exists. If the original data of the target field is consistent with the current data of the target field, indicating that no modification conflict exists, executing S403; if the original data of the target field is not consistent with the current data of the target field, indicating that there is a modification conflict, S404 is performed.
S403: and updating the data in the database server according to the updating data of the target field, and sending a data updating success message to the client so that the client updates the data in the client after receiving the data updating success message.
And when no modification conflict exists, the database server updates the data stored by the database server according to the update data of the target field in the data modification request, and sends a data update success message to the client, so that the client updates the data of the relevant field stored by the client.
In a specific implementation, the database server may update the data of the relevant field according to the update data of the target field, where the relevant field is the target field or the target field and the field associated with the target field. That is, when the target field modified by the user has no associated field, the database server updates only the data of the target field, and when the target field modified by the user has an associated field, the database server updates the data of the target field and the field related to the target field.
For specific implementation of updating the data of the relevant field in the client, reference may be made to specific implementation of the method embodiment described in fig. 2 for specific implementation of updating the data of the relevant field in the client, and details of this embodiment are not described herein again.
In a possible implementation manner of the embodiment of the present application, the data update success message may carry data of a row in which the relevant field is located, so that the client updates the data of the relevant field according to the data of the row in which the relevant field is located.
S404: and sending a modification conflict prompt to the client so that the client responds to the trigger of the user to perform modification conflict processing operation after receiving the modification conflict prompt.
When the modification has conflict, the database server sends a modification conflict prompt to the client so that when the client receives the modification conflict prompt, the client prompts the user that the current modification has conflict, and the user can manually solve the current conflict.
In a possible implementation manner of the embodiment of the present application, the modification conflict notification may carry data of a line in which the target field is located, where the data of the line in which the target field is located includes current data of the target field, so that the client generates the option of giving up the modification this time and the option of holding in the modification this time after receiving the modification conflict notification; responding to the trigger of the user for giving up the current modification option, updating the data of the relevant field according to the current data of the target field, and completing the current data modification request; and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original field of the target field, generating a new data modification request, and completing the data modification request.
For specific implementation of the client responding to the trigger of the user to abandon the current modification option or the trigger to insist on the current modification option, reference may be made to implementation of the method described in fig. 3, and this embodiment is not described herein again.
It can be known from the foregoing embodiments that, in the embodiments of the present application, a version number is cancelled in determining a modification conflict, but a field is used as a unit for data update, when a user needs to modify a field of a certain row of data, a data modification request sent by a client to a database server carries original data of a target field and update data of the target field, and the database server determines whether a modification conflict exists by determining whether the original data of the target field in the request is consistent with current data of the target field stored by the database server, so that the modification conflict in a non-true sense is effectively solved, the probability of the occurrence of the modification conflict is greatly reduced, and a plurality of clients can simultaneously and more efficiently implement data update.
In order to facilitate understanding of specific implementation of the technical solution of the present application, the following signaling interaction between the client and the database server is performed
Referring to fig. 5, which is a signaling interaction diagram provided in the embodiment of the present application, as shown in fig. 5, a data processing method may include:
s501: the client sends a data modification request to the database server.
The data modification request comprises original data of a target field and updated data of the target field, and the target field is at least one field in any row of the data table.
S502: the database server judges whether the original data of the target field is consistent with the current data of the target field.
In this example, if the original data of the target field is consistent with the current data of the target field, S503-S505 are executed; and if the original data of the target field is not consistent with the current data of the target field, executing S506 and S507.
S503: and the database server updates the data of the relevant fields according to the update data of the target fields.
In this example, the relevant fields are the target field or the target field and the field associated with the target field. When the target field modified by the user has no associated field, the database server only updates the data of the target field, and when the target field modified by the user has the associated field, the database server updates the data of the target field and the field related to the target field.
S504: and sending a data updating success message to the client.
S505: and the client updates the data of the relevant fields according to the data updating success message to complete the data modification request.
In this embodiment, when the target field modified by the user does not have the associated field, the client updates only the data of the target field, and when the target field modified by the user has the associated field, the client updates the data of the target field and the field related to the target field.
S506: and the database server sends a modification conflict prompt to the client.
S507: and the client responds to the trigger of the user to carry out modification conflict processing operation and complete the data modification request.
It should be noted that, for specific implementation of each step in this embodiment, reference may be made to implementation of the method described in fig. 2 to fig. 4, and details of this embodiment are not described herein again.
Based on the method embodiment executed by the client, the present application further provides a data processing apparatus, which will be described below with reference to the accompanying drawings.
Referring to fig. 6, which is a data processing apparatus provided in an embodiment of the present application, as shown in fig. 6, the apparatus is applied to a client, and the apparatus may include:
a sending unit 601, configured to send a data modification request to a database server, where the data modification request includes original data of a target field and update data of the target field, so that the database server determines whether the original data of the target field is consistent with current data of the target field, if so, updates data in the database server according to the update data of the target field, and sends a data update success message to the client, and if not, sends a modification conflict prompt to the client; the target field is at least one field in any row of the data table;
an updating unit 602, configured to update the data in the client when the data update success message is received, and complete the data modification request;
the first processing unit 603 is configured to, when the modification conflict prompt is received, perform a modification conflict processing operation in response to a trigger of a user, and complete the data modification request.
In a possible implementation manner, the updating unit is specifically configured to update, when the data update success message is received, data of a relevant field according to the update data of the target field, where the relevant field is the target field, or the target field and a field relevant to the target field.
In a possible implementation manner, the updating unit is specifically configured to update the data of the relevant field according to the data of the row in which the relevant field is located when the data update success message carries the data of the row in which the relevant field is located.
In a possible implementation manner, the first processing unit specifically includes:
the first generating subunit is configured to generate, when the modification conflict prompt is received, a modification option to be given up this time and a modification option to be insist on this time; the modification conflict prompt carries data of a line where a target field is located, wherein the data of the line where the target field is located comprises current data of the target field;
the updating subunit is used for responding to the triggering of the user on the option for giving up the current modification, updating the data in the client according to the current data of the target field, and completing the current data modification request;
and the second generation subunit is used for responding to the trigger of the user for insisting on the current modification option, using the current data of the target field as the original data of the target field, generating a new data modification request, and completing the current data modification request.
In one possible implementation, the apparatus further includes:
and the second processing unit is used for storing the data modification request in a queue, deleting the current data modification request from the queue after the data modification request is completed, acquiring the next data modification request from the queue again, and executing the first sending unit.
It should be noted that, in this embodiment, implementation of each unit or module may refer to implementation of a corresponding method embodiment, and details of this embodiment are not described herein again.
Based on the above method embodiment executed by the database server, the present application also provides a data processing apparatus, which will be described below with reference to the accompanying drawings.
Referring to fig. 7, which is another data processing apparatus provided in the embodiment of the present application, as shown in fig. 7, the apparatus is applied to a database server, and the apparatus may include:
a receiving unit 701, configured to receive a data modification request sent by a client, where the data modification request includes original data of a target field and update data of the target field, and the target field is at least one field in any row of a data table;
a determining unit 702, configured to determine whether the original data of the target field is consistent with the current data of the target field;
an updating unit 703, configured to update the data in the database server according to the update data of the target field when the determination result of the determining unit is consistent, and trigger a sending unit to send a data update success message to the client, so that the client updates the data in the client after receiving the data update success message;
the sending unit 704 is further configured to send a modification conflict prompt to the client when the determination result of the determining unit is inconsistent, so that the client performs a modification conflict processing operation in response to a trigger of a user after receiving the modification conflict prompt.
In a possible implementation manner, the updating unit is specifically configured to update data of a related field according to the update data of the target field, where the related field is the target field or the target field and a field associated with the target field.
In a possible implementation manner, the data update success message carries the data of the row in which the relevant field is located, so that the client updates the data of the relevant field according to the data of the row in which the relevant field is located;
the modification conflict prompt carries data of a line where a target field is located, and the data of the line where the target field is located comprises current data of the target field, so that the client generates a abandoning modification option and a persisting modification option after receiving the modification conflict prompt; responding to the trigger of the user for giving up the current modification option, updating the data of the relevant field according to the current data of the target field, and completing the current data modification request; and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original field of the target field, generating a new data modification request, and completing the data modification request.
It should be noted that, in this embodiment, implementation of each unit or module may refer to implementation of a corresponding method embodiment, and details of this embodiment are not described herein again.
In addition, it should be noted that the data processing apparatus shown in fig. 6 includes a processor and a memory, the transmitting unit, the updating unit, the receiving unit, the determining unit, the first processing unit, and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the technical problem that modification conflict exists and misjudgment exists in the prior art is solved by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium on which a program is stored, which, when executed by a processor, implements the client-side data processing method or implements the database server-side data processing method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program executes the client-side data processing method or the database server-side data processing method when running.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
sending a data modification request to a database server, wherein the data modification request comprises original data of a target field and updated data of the target field, so that the database server judges whether the original data of the target field is consistent with the current data of the target field, if so, updating the data in the database server according to the updated data of the target field, sending a successful data updating message to the client, and if not, sending a modification conflict prompt to the client; the target field is at least one field in any row of the data table;
when the data updating success message is received, updating the data in the client to complete the data modification request;
and when the modification conflict prompt is received, responding to the trigger of the user to perform modification conflict processing operation and finishing the data modification request.
In a possible implementation manner, the updating the data in the client when the data update success message is received includes:
and when the successful data updating message is received, updating the data of the related field according to the updating data of the target field, wherein the related field is the target field or the target field and the field related to the target field.
In a possible implementation manner, the data update success message carries data of a row in which the relevant field is located, and updating the data in the client when the data update success message is received includes:
and updating the data of the relevant fields according to the data of the row where the relevant fields are located.
In a possible implementation manner, the modification conflict prompt carries data of a row in which a target field is located, where the data of the row in which the target field is located includes current data of the target field; when the modification conflict prompt is received, the modification conflict processing operation is performed in response to the triggering of the user, and the data modification request is completed, including:
when receiving the modification conflict prompt, generating a modification option for giving up the current time and a modification option for insisting on the current time;
responding to the trigger of the user for giving up the current modification option, updating the data in the client according to the current data of the target field, and completing the current data modification request;
and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original data of the target field, generating a new data modification request, and completing the data modification request.
In one possible implementation, the method further includes:
and storing the data modification request in a queue, deleting the current data modification request from the queue after the data modification request is completed, acquiring the next data modification request from the queue again, and executing the steps of sending the data modification request to a database server and the subsequent steps.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor can also realize the following steps when executing the program:
receiving a data modification request sent by a client, wherein the data modification request comprises original data of a target field and updated data of the target field, and the target field is at least one field in any row of a data table;
judging whether the original data of the target field is consistent with the current data of the target field;
if the original data of the target field is consistent with the current data of the target field, updating the data in the database server according to the updated data of the target field, and sending a data updating success message to the client, so that the client updates the data in the client after receiving the data updating success message;
and if the original data of the target field is inconsistent with the current data of the target field, sending a modification conflict prompt to the client so that the client responds to the triggering of a user to perform modification conflict processing operation after receiving the modification conflict prompt.
In a possible implementation manner, the updating the data in the database server according to the update data of the target field includes:
and updating the data of the related field according to the updating data of the target field, wherein the related field is the target field or the target field and the field related to the target field.
In a possible implementation manner, the data update success message carries the data of the row in which the relevant field is located, so that the client updates the data of the relevant field according to the data of the row in which the relevant field is located;
the modification conflict prompt carries data of a line where a target field is located, and the data of the line where the target field is located comprises current data of the target field, so that the client generates a abandoning modification option and a persisting modification option after receiving the modification conflict prompt; responding to the trigger of the user for giving up the current modification option, updating the data of the relevant field according to the current data of the target field, and completing the current data modification request; and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original field of the target field, generating a new data modification request, and completing the data modification request.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
sending a data modification request to a database server, wherein the data modification request comprises original data of a target field and updated data of the target field, so that the database server judges whether the original data of the target field is consistent with the current data of the target field, if so, updating the data in the database server according to the updated data of the target field, sending a successful data updating message to the client, and if not, sending a modification conflict prompt to the client; the target field is at least one field in any row of the data table;
when the data updating success message is received, updating the data in the client to complete the data modification request;
and when the modification conflict prompt is received, responding to the trigger of the user to perform modification conflict processing operation and finishing the data modification request.
In a possible implementation manner, the updating the data in the client when the data update success message is received includes:
and when the successful data updating message is received, updating the data of the related field according to the updating data of the target field, wherein the related field is the target field or the target field and the field related to the target field.
In a possible implementation manner, the data update success message carries data of a row in which the relevant field is located, and updating the data in the client when the data update success message is received includes:
and updating the data of the relevant fields according to the data of the row where the relevant fields are located.
In a possible implementation manner, the modification conflict prompt carries data of a row in which a target field is located, where the data of the row in which the target field is located includes current data of the target field; when the modification conflict prompt is received, the modification conflict processing operation is performed in response to the triggering of the user, and the data modification request is completed, including:
when receiving the modification conflict prompt, generating a modification option for giving up the current time and a modification option for insisting on the current time;
responding to the trigger of the user for giving up the current modification option, updating the data in the client according to the current data of the target field, and completing the current data modification request;
and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original data of the target field, generating a new data modification request, and completing the data modification request.
In one possible implementation, the method further includes:
and storing the data modification request in a queue, deleting the current data modification request from the queue after the data modification request is completed, acquiring the next data modification request from the queue again, and executing the steps of sending the data modification request to a database server and the subsequent steps.
The present application further provides a computer program product, which, when being executed on a data processing device, is further adapted to carry out a program for initializing the following method steps:
receiving a data modification request sent by a client, wherein the data modification request comprises original data of a target field and updated data of the target field, and the target field is at least one field in any row of a data table;
judging whether the original data of the target field is consistent with the current data of the target field;
if the original data of the target field is consistent with the current data of the target field, updating the data in the database server according to the updated data of the target field, and sending a data updating success message to the client, so that the client updates the data in the client after receiving the data updating success message;
and if the original data of the target field is inconsistent with the current data of the target field, sending a modification conflict prompt to the client so that the client responds to the triggering of a user to perform modification conflict processing operation after receiving the modification conflict prompt.
In a possible implementation manner, the updating the data in the database server according to the update data of the target field includes:
and updating the data of the related field according to the updating data of the target field, wherein the related field is the target field or the target field and the field related to the target field.
In a possible implementation manner, the data update success message carries the data of the row in which the relevant field is located, so that the client updates the data of the relevant field according to the data of the row in which the relevant field is located;
the modification conflict prompt carries data of a line where a target field is located, and the data of the line where the target field is located comprises current data of the target field, so that the client generates a abandoning modification option and a persisting modification option after receiving the modification conflict prompt; responding to the trigger of the user for giving up the current modification option, updating the data of the relevant field according to the current data of the target field, and completing the current data modification request; and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original field of the target field, generating a new data modification request, and completing the data modification request.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A data processing method is applied to a client, and comprises the following steps:
sending a data modification request to a database server, wherein the data modification request comprises original data of a target field and updated data of the target field, so that the database server judges whether the original data of the target field is consistent with the current data of the target field, if so, updating the data in the database server according to the updated data of the target field, sending a successful data updating message to the client, and if not, sending a modification conflict prompt to the client; the target field is at least one field in any row of the data table;
when the data updating success message is received, updating the data in the client to complete the data modification request;
and when the modification conflict prompt is received, responding to the trigger of the user to perform modification conflict processing operation and finishing the data modification request.
2. The method of claim 1, wherein the updating the data in the client when receiving the data update success message comprises:
and when the successful data updating message is received, updating the data of the related field according to the updating data of the target field, wherein the related field is the target field or the target field and the field related to the target field.
3. The method according to claim 2, wherein the data update success message carries data of a row in which the relevant field is located, and the updating the data in the client when receiving the data update success message comprises:
and updating the data of the relevant fields according to the data of the row where the relevant fields are located.
4. The method of claim 2, wherein the modification conflict hint carries data for a row in which a target field is located, the data for the row in which the target field is located including current data for the target field; when the modification conflict prompt is received, the modification conflict processing operation is performed in response to the triggering of the user, and the data modification request is completed, including:
when receiving the modification conflict prompt, generating a modification option for giving up the current time and a modification option for insisting on the current time;
responding to the trigger of the user for giving up the current modification option, updating the data in the client according to the current data of the target field, and completing the current data modification request;
and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original data of the target field, generating a new data modification request, and completing the data modification request.
5. The method according to any one of claims 1-4, further comprising:
and storing the data modification request in a queue, deleting the current data modification request from the queue after the data modification request is completed, acquiring the next data modification request from the queue again, and executing the steps of sending the data modification request to a database server and the subsequent steps.
6. A data processing method is applied to a database server, and comprises the following steps:
receiving a data modification request sent by a client, wherein the data modification request comprises original data of a target field and updated data of the target field, and the target field is at least one field in any row of a data table;
judging whether the original data of the target field is consistent with the current data of the target field;
if the original data of the target field is consistent with the current data of the target field, updating the data in the database server according to the updated data of the target field, and sending a data updating success message to the client, so that the client updates the data in the client after receiving the data updating success message;
and if the original data of the target field is inconsistent with the current data of the target field, sending a modification conflict prompt to the client so that the client responds to the triggering of a user to perform modification conflict processing operation after receiving the modification conflict prompt.
7. The method of claim 6, wherein the updating the data in the database server according to the update data of the target field comprises:
and updating the data of the related field according to the updating data of the target field, wherein the related field is the target field or the target field and the field related to the target field.
8. The method according to claim 7, wherein the data update success message carries data of a row in which the relevant field is located, so that the client updates the data of the relevant field according to the data of the row in which the relevant field is located;
the modification conflict prompt carries data of a line where a target field is located, and the data of the line where the target field is located comprises current data of the target field, so that the client generates a abandoning modification option and a persisting modification option after receiving the modification conflict prompt; responding to the trigger of the user for giving up the current modification option, updating the data of the relevant field according to the current data of the target field, and completing the current data modification request; and responding to the trigger of the user for insisting on the modification option, taking the current data of the target field as the original field of the target field, generating a new data modification request, and completing the data modification request.
9. A storage medium characterized in that it comprises a stored program, wherein the program executes the data processing method of any one of claims 1 to 5 or executes the data processing method of any one of claims 6 to 8.
10. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to perform the data processing method of any one of claims 1 to 5 or the data processing method of any one of claims 6 to 8 when running.
CN201811094736.4A 2018-09-19 2018-09-19 Data processing method and device Pending CN110928887A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811094736.4A CN110928887A (en) 2018-09-19 2018-09-19 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811094736.4A CN110928887A (en) 2018-09-19 2018-09-19 Data processing method and device

Publications (1)

Publication Number Publication Date
CN110928887A true CN110928887A (en) 2020-03-27

Family

ID=69855961

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811094736.4A Pending CN110928887A (en) 2018-09-19 2018-09-19 Data processing method and device

Country Status (1)

Country Link
CN (1) CN110928887A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111598560A (en) * 2020-05-13 2020-08-28 广州市百果园信息技术有限公司 Data modification method and device based on storage service and storage server
CN112287644A (en) * 2020-09-30 2021-01-29 成都新潮传媒集团有限公司 Data submission method and device, computer equipment and readable storage medium
CN112632957A (en) * 2020-12-18 2021-04-09 湖南特能博世科技有限公司 Power drawing management method and device, terminal equipment and server
CN112817995A (en) * 2021-02-22 2021-05-18 北京奇艺世纪科技有限公司 Data processing method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104008100A (en) * 2013-02-21 2014-08-27 纽海信息技术(上海)有限公司 Cluster environment concurrent processing method
US20160203166A1 (en) * 2014-04-11 2016-07-14 Nutanix, Inc. Mechanism for performing lockless rolling upgrade of nosql database
CN105808559A (en) * 2014-12-29 2016-07-27 深圳市金蝶中间件有限公司 Data conflict processing method and apparatus
CN107577678A (en) * 2016-06-30 2018-01-12 华为技术有限公司 The method of processing data storehouse affairs, client and server
CN108023908A (en) * 2016-10-31 2018-05-11 腾讯科技(深圳)有限公司 Data-updating method, apparatus and system
CN108268497A (en) * 2016-12-30 2018-07-10 北京国双科技有限公司 The method of data synchronization and device of relevant database

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104008100A (en) * 2013-02-21 2014-08-27 纽海信息技术(上海)有限公司 Cluster environment concurrent processing method
US20160203166A1 (en) * 2014-04-11 2016-07-14 Nutanix, Inc. Mechanism for performing lockless rolling upgrade of nosql database
CN105808559A (en) * 2014-12-29 2016-07-27 深圳市金蝶中间件有限公司 Data conflict processing method and apparatus
CN107577678A (en) * 2016-06-30 2018-01-12 华为技术有限公司 The method of processing data storehouse affairs, client and server
CN108023908A (en) * 2016-10-31 2018-05-11 腾讯科技(深圳)有限公司 Data-updating method, apparatus and system
CN108268497A (en) * 2016-12-30 2018-07-10 北京国双科技有限公司 The method of data synchronization and device of relevant database

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
335046781: "Compare and Swap [CAS] 算法", 《HTTP://T.CSDN.CN/3GS6P》 *
GRAY,J: "《事务处理:概念与技术》", 31 January 2001, 北京:机械工业出版社 *
STEVENS...: "浅谈CAS(Compare and Swap) 原理", 《HTTP://T.CSDN.CN/LUYXU》 *
XIHUANYUYE: "用CAS解决并发", 《HTTP://T.CSDN.CN/CXJXQ》 *
微软公司: "《组件应用程序设计 COM+应用程序设计》", 31 March 2004, 北京:高等教育出版社 *
罗桂琼: "《云计算环境下教育信息化资源共建共享研究》", 30 September 2017, 长春:吉林人民出版社 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111598560A (en) * 2020-05-13 2020-08-28 广州市百果园信息技术有限公司 Data modification method and device based on storage service and storage server
CN112287644A (en) * 2020-09-30 2021-01-29 成都新潮传媒集团有限公司 Data submission method and device, computer equipment and readable storage medium
CN112287644B (en) * 2020-09-30 2024-01-30 成都新潮传媒集团有限公司 Data submitting method, device, computer equipment and readable storage medium
CN112632957A (en) * 2020-12-18 2021-04-09 湖南特能博世科技有限公司 Power drawing management method and device, terminal equipment and server
CN112817995A (en) * 2021-02-22 2021-05-18 北京奇艺世纪科技有限公司 Data processing method and device, electronic equipment and storage medium
CN112817995B (en) * 2021-02-22 2023-09-15 北京奇艺世纪科技有限公司 Data processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11762697B2 (en) Method and apparatus for scheduling resource for deep learning framework
JP6348937B2 (en) Method and apparatus for updating object data in object storage system
CN110928887A (en) Data processing method and device
US10198238B2 (en) Data transmission method, and relevant device and system
US20200264777A1 (en) Method and apparatus for upgrading a distributed storage system
CN105468302B (en) A method, device and system for processing data
CN111273963B (en) Application program configuration information generation method and device, computer equipment and medium
CN113051245A (en) Method, device and system for migrating data
CN114124593B (en) Method, device, control terminal and storage medium for calling multiple devices
US11438401B2 (en) Service processing method and device
CN110764930B (en) Request or response processing method and device based on message mode
CN110417910B (en) Notification message sending method, device, server and storage medium
CN115525631A (en) Database data migration method, device, equipment and storage medium
US12346733B2 (en) Batch processing and error resolution management
CN112579308A (en) Task processing method and system
CN111694639A (en) Method and device for updating address of process container and electronic equipment
EP3149625A1 (en) Data uniqueness control and information storage
CN112579877A (en) Information source system control method, device, storage medium and equipment
CN111294377A (en) Network request sending method of dependency relationship, terminal device and storage medium
CN111159298B (en) Service request processing method and device, electronic equipment and storage medium
CN110381143A (en) Operation, which is submitted, executes method, apparatus, equipment and computer storage medium
CN112583879A (en) Request processing method, device and system, storage medium and electronic equipment
CN111274176B (en) Information processing method, electronic equipment, system and storage medium
CN114691703A (en) Data update method, device, electronic device and storage medium
CN110928944B (en) Data processing 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200327

RJ01 Rejection of invention patent application after publication