CN112905614A - Data updating method and device, electronic equipment and computer readable storage medium - Google Patents

Data updating method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN112905614A
CN112905614A CN202110189554.0A CN202110189554A CN112905614A CN 112905614 A CN112905614 A CN 112905614A CN 202110189554 A CN202110189554 A CN 202110189554A CN 112905614 A CN112905614 A CN 112905614A
Authority
CN
China
Prior art keywords
data
update
version
current
updating
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.)
Granted
Application number
CN202110189554.0A
Other languages
Chinese (zh)
Other versions
CN112905614B (en
Inventor
周辉
高俊峰
李鹏
郝磊
李佳林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Postal Savings Bank of China Ltd
Original Assignee
Postal Savings Bank of China 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 Postal Savings Bank of China Ltd filed Critical Postal Savings Bank of China Ltd
Priority to CN202110189554.0A priority Critical patent/CN112905614B/en
Publication of CN112905614A publication Critical patent/CN112905614A/en
Application granted granted Critical
Publication of CN112905614B publication Critical patent/CN112905614B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/219Managing data history or versioning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data updating method and device, electronic equipment and a computer readable storage medium. The data updating method comprises the following steps: reading object data, wherein the object data is subjected to operation processing by a plurality of transaction objects, and then detecting whether update data exists in the object data, wherein the update data refers to data changed on the basis of a current data version, the current data version corresponds to a data current value, if the object data has the update data, merging all the update data, and finally loading the merged update data into the data current value. The invention solves the technical problem of low success rate when updating data under concurrent affairs in the related technology.

Description

Data updating method and device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of data updating technologies, and in particular, to a data updating method and apparatus, an electronic device, and a computer-readable storage medium.
Background
The lock is used for concurrency control, and aims to avoid unreasonable phenomenon when different users operate the same data, currently, pessimistic locks and optimistic locks are mainly used, wherein the pessimistic locks are characterized by monopolization and exclusion, and typical pessimistic locks are mainly shared locks or exclusive locks; the optimistic lock assumes that data generally cannot cause conflict, so when submitting and updating the data, whether the data conflict is detected or not is detected, if the conflict is found, wrong information is returned to a user, the user decides how to do the conflict, the problem of reading the data under concurrent transactions is solved essentially, but after reading the data, the data is updated, only the Version (Version) of the data is checked, if the conflict does not occur, the updating is performed, otherwise, the updating is refused, and therefore the problem of updating the data under high concurrent transactions is not solved, namely the optimistic lock is embodied in the condition that only one transaction is read and updated, and no other transaction updates the data, so once other transactions update the data during the period of reading and updating the one transaction, the optimistic lock loses the effect.
In the related art, the steps of using an optimistic lock under concurrent transactions are: 1, reading data from a data source, including a version of the data; 2, processing the data according to the requirement and preparing the data to be updated; 3, carrying out data version judgment before updating; 4, if the versions are consistent, updating the processed data to a data source; and 5, if the versions are not consistent, not updating the data. If the versions are inconsistent, data updating cannot be performed, that is, the data updating is zero-tolerant, and once data change occurs, all data updating fails, so that in a scenario of concurrent updating in a large number, a large number of updating operations are retried, that is, data reading, data processing, and version judgment are performed again, and once the versions are inconsistent again, the above steps are repeated again, which may possibly cause transaction timeout failure, and even if the final updating is successful, a large number of system resources are wasted for performing repeated calculation.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a data updating method and device, electronic equipment and a computer readable storage medium, which at least solve the technical problem of low success rate when data updating is carried out under concurrent transactions in the related technology.
According to an aspect of an embodiment of the present invention, there is provided a data updating method, including: reading object data, wherein the object data is operated and processed by a plurality of transaction objects; detecting whether updated data exists in the object data, wherein the updated data refers to data changed on the basis of a current data version, and the current data version corresponds to a current data value; if the object data has the updating data, merging all the updating data; and loading the merged update data into the current data value.
Optionally, the step of detecting whether there is update data in the object data includes: and detecting whether another transaction object carries out change operation on the current data value in the current data version on the basis of the current data value, and determining whether updated data exists in the object data.
Optionally, after detecting whether there is update data in the object data, the data update method further includes: detecting that no update data exists in the object data, and recording all read object data; all object data is stored in the transaction database.
Optionally, if there is update data in the object data, merging all update data, including: if the object data has updating data, calculating a difference value between the updating data and original data stored in a current data value; and if the difference value is within the preset difference value range, combining all the updating data.
Optionally, if there is update data in the object data, the step of merging all update data further includes: if the object data has updating data, judging whether the current data version is consistent with the historical record version; if the current data version is inconsistent with the historical record version, merging all update data in the current data version; and loading all the merged updated data to the current data value.
Optionally, after determining whether the current data version is consistent with the historical record version, the data updating method further includes: and if the current data version is consistent with the historical record version, recording the current data version.
According to another aspect of the embodiments of the present invention, there is also provided a data updating apparatus including: the reading unit is used for reading object data, wherein the object data is operated and processed by a plurality of transaction objects; the detection unit is used for detecting whether update data exist in the object data, wherein the update data refer to data changed on the basis of a current data version, and the current data version corresponds to a current data value; a merging unit, configured to merge all update data if the update data exists in the object data; and the loading unit is used for loading the merged update data into the current data value.
Optionally, the detection unit includes: and the first detection module is used for detecting whether another transaction object carries out change operation on the current data value in the current data version on the basis of the current data value and determining whether updated data exists in the object data.
Optionally, the data updating apparatus further includes: the second detection module is used for detecting whether the object data has the updated data or not and then recording all the read object data; the first storage module is used for storing all the object data in the transaction database.
Optionally, the merging unit includes: the first calculation module is used for calculating the difference value between the updated data and the original data stored in the current data value if the updated data exists in the object data; and the first merging module is used for merging all the updating data if the difference value is within a preset difference value range.
Optionally, the merging unit further includes: the first judgment module is used for judging whether the current data version is consistent with the historical record version or not when the object data has the updated data; the second merging module is used for merging all the updating data in the current data version if the current data version is inconsistent with the historical record version; and the first loading module is used for loading all the merged update data to the current data value.
Optionally, the data updating apparatus further includes: and the first recording module is used for recording the current data version if the current data version is consistent with the historical record version after judging whether the current data version is consistent with the historical record version.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the data update method described above via execution of the executable instructions.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to execute the above-mentioned data updating method.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program, where the program executes the data updating method described above.
In the embodiment of the present invention, by reading object data, where the object data is subjected to operation processing by multiple transaction objects, and then detecting whether update data exists in the object data, where the update data refers to data that has been changed based on a current data version, and the current data version corresponds to a current data value, if update data exists in the object data, merging all update data, and finally loading the merged update data into the current data value. In the embodiment, on the basis of the existing optimistic lock, the optimistic lock is enhanced in the aspect of data updating, so that during the period of reading and updating one or more transactions, even if other transactions update data, the data updating of partial or all concurrent transactions can be completed within a certain tolerance range, the success rate of the concurrent transaction data updating is improved, and the technical problem of low success rate in data updating under the concurrent transactions in the related art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of an alternative data update method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of an alternative data update method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of an alternative data update apparatus according to an embodiment of the present invention;
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
To facilitate understanding of the invention by those skilled in the art, some terms or nouns referred to in the embodiments of the invention are explained below:
the optimistic lock is a mechanism which adopts a looser locking mechanism and avoids data processing errors caused by unreal reading of a database, overlong service processing time and the like.
The tolerance mechanism refers to a mechanism that can accept the degree of data change, i.e. the tolerance degree of data change, within a certain range, and based on the tolerance degree, complete data update as much as possible.
And the arbitration recording mechanism is used for judging whether the rule condition of data recording is carried out.
And the arbitration updating mechanism is used for judging whether the rule condition of data updating is carried out.
The following embodiments of the invention may be applied to various industrial transactions including, but not limited to: the invention adds a tolerance mechanism on the basis of the existing optimistic lock, can combine and process the previously generated updated data when in need (namely when the updated data is needed), reduces the times of modifying the current value of the data, enables the updating of the concurrent data of the same field to be possible, simultaneously, can process the tolerance on the aspect of the concurrent updated data through an arbitration mechanism to promote the updating of the data as much as possible, and improves the success rate of the concurrent transaction processing.
The present invention will be described in detail with reference to examples.
Example one
In accordance with an embodiment of the present invention, there is provided a data update method embodiment, it should be noted that the steps illustrated in the flowchart of the figure may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a flowchart of an alternative data updating method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S102, reading object data, wherein the object data is operated and processed by a plurality of transaction objects;
step S104, detecting whether updated data exists in the object data, wherein the updated data refers to data changed on the basis of the current data version, and the current data version corresponds to a current data value;
step S106, if the object data contains the updating data, merging all the updating data;
and step S108, loading the merged updated data into the current data value.
Through the steps, the object data can be read, wherein the object data is subjected to operation processing by a plurality of transaction objects, and then whether the object data has the updated data or not is detected, wherein the updated data refers to the data which is changed on the basis of the current data version, the current data version corresponds to the current data value, if the object data has the updated data, all the updated data are merged, and finally the merged updated data are loaded into the current data value. In the embodiment, on the basis of the existing optimistic lock, the optimistic lock is enhanced in the aspect of data updating, so that during the period of reading and updating one or more transactions, even if other transactions update data, the data updating of partial or all concurrent transactions can be completed within a certain tolerance range, the success rate of the concurrent transaction data updating is improved, and the technical problem of low success rate in data updating under the concurrent transactions in the related art is solved.
The following describes embodiments of the present invention in detail with reference to the above-mentioned respective implementation steps.
Step S102, reading object data, wherein the object data is operated and processed by a plurality of transaction objects.
In this embodiment, the read object data is generally performed when the object data is simultaneously processed by a plurality of transaction objects, and the data types include, but are not limited to: the number type (for example, integer type, floating point type, etc.), the character string type, the set, the dictionary, etc., the plurality of transaction objects may be a plurality of ordinary users, a plurality of administrators, or a plurality of ordinary users and administrators, and the operation processing performed on the data may be four types of operations of adding, deleting, modifying, and searching.
Taking bank account processing as an example, the data type is a digital type, adding is completed when the account is signed, deleting is completed when the account is cleared, and therefore, the data type is basically disposable; the check is the operation which occurs most frequently in the four types of operation, but because no change is generated on the data, a plurality of transaction objects have no influence when being operated simultaneously (but can be influenced by other three types of operation); "change" (i.e. data update) occurs not much more times than "check", but during the whole life cycle of the data (from addition to deletion), the data is affected most, and the data operation is relatively frequent.
Step S104, whether the object data has update data or not is detected, wherein the update data refers to data which is changed on the basis of the current data version, and the current data version corresponds to a current data value.
In the concurrent transaction processing process, when the current transaction calls the object data, another transaction may also synchronously call the object data, and query, modify, etc. the object data, so before operating the object data, it is necessary to determine whether the object data is updated.
In this embodiment, if one transaction a relates to data update, it may be a process of "checking" -logical processing- "changing", and the direction of "changing" (i.e. data change direction) may be increasing (direction W for short) or decreasing (direction M for short), because this embodiment is applied in a concurrent transaction scenario, while a transaction a occurs, there are other transactions, taking two transactions concurrently as an example, and another transaction B may relate to data update, then in addition to the direction of data "changing" of the transaction itself, the direction of "changing" of other transactions is also concerned, that is, the data update may be affected by the other concurrent transactions on the direction of data "changing", which may be expressed as the effect of one transaction on the direction of data modification of another transaction, and is called "data change allowable direction" (i.e. tolerance of data change "), the method can be divided into an increase allowing mode (direction Z for short) and a decrease allowing mode (direction J for short), wherein the direction Z is specifically thinned into an increase allowing mode without limitation (direction Z1 for short) and an increase allowing mode with limitation (direction Z2 for short), and similarly, the direction J is specifically thinned into an increase allowing mode without limitation (direction J1 for short) and a decrease allowing mode with limitation (direction J2 for short).
The arbitration mechanism established in this embodiment arbitrates data updates during concurrent multiple transactions according to the optimistic lock and the data change permission direction and related parameters, and determines whether each transaction can successfully update the data. The data structure involved in this embodiment is shown in table 1 (for one determined account):
TABLE 1
Figure BDA0002944835450000061
Figure BDA0002944835450000071
If the transactions with TransOrder 2, 3 and 5 in Table 1 all fail based on the existing optimistic lock, the optimistic lock strengthened based on the tolerance mechanism in the embodiment is adopted, only the transaction with TransOrder 2 fails, and the transaction with TransOrder 3 and 5 succeeds.
Optionally, the step of detecting whether there is update data in the object data includes: and detecting whether another transaction object carries out change operation on the current value of the data in the current data version on the basis of the current value of the data, and determining whether updated data exists in the object data.
In the embodiment, while reading data, it is checked whether there is another transaction that has performed data update (e.g., "change") based on the current version, if there is data update, the "arbitration update mechanism" is triggered, otherwise, the "arbitration record mechanism" is triggered.
As an optional implementation manner of this embodiment, after detecting whether there is update data in the target data, the data update method further includes: detecting that no updating data exists in the object data, and recording all the read object data; all object data is stored in the transaction database.
In the embodiment, when the update data does not exist in the detection object data, an arbitration recording mechanism is triggered, and the data is directly recorded and stored in the service database while being acquired.
And step S106, if the object data contains the updating data, merging all the updating data.
In this embodiment, when there is update data in the detection object data, an "arbitration update mechanism" is triggered, which indicates that merging and updating of the data of the current version are required, and at this time, all the data that need to be updated are merged and updated to the current value of the data.
Optionally, if there is update data in the object data, merging all update data, including: if the object data has the updated data, calculating a difference value between the updated data and the original data stored in the current value of the data; and if the difference value is within the preset difference value range, combining all the updating data.
The above optional implementation mode is that a tolerance mechanism is added on the basis of the optimistic lock, that is, data with a difference value within a preset difference value range can be processed continuously, and it is not necessary to exclude object data that will not affect the result.
If the arbitration updating mechanism is triggered, which indicates that the merging and updating of the data of the current version are needed, all the data needing to be updated are merged and updated to the current value of the data, which is different from the existing optimistic lock, and the optimistic lock modifies the current value of the data when each piece of data is updated.
Optionally, if there is update data in the object data, the step of merging all update data further includes: if the object data has updating data, judging whether the current data version is consistent with the historical record version; if the current data version is inconsistent with the historical record version, merging all updated data in the current data version; and loading all the merged updated data to the current data value.
Optionally, after determining whether the current data version is consistent with the historical record version, the data updating method further includes: and if the current data version is consistent with the historical record version, recording the current data version.
In this embodiment, when updating data, it is necessary to determine whether the data versions are consistent, and if so, trigger the "arbitration recording mechanism", otherwise, trigger the "arbitration updating mechanism". If an arbitration recording mechanism is triggered, in a data updating scene, arbitration is required according to related data recorded when the data are acquired, if an arbitration condition is met, data recording is finished and serves as a basis for subsequent data updating, and if the arbitration recording mechanism is not triggered, the data are rejected; if the arbitration update mechanism is triggered, which indicates that the merging update of the data of the current version is needed, all the data needing to be updated are merged and updated to the current value of the data, which is also different from the existing optimistic lock, and the existing optimistic lock directly rejects once the data versions are found to be inconsistent, but in the embodiment, the data update is facilitated as much as possible through the arbitration mechanism, so that the success rate of the data update is improved.
And step S108, loading the merged updated data into the current data value.
In this embodiment, when data needs to be updated, all data that needs to be updated are merged and updated to the current value of the data.
Fig. 2 is a flow chart of another alternative data updating method according to an embodiment of the present invention, as shown in fig. 2, the method includes the following steps:
1, a transaction performs a data read operation (e.g., "look-up"), which may be based on an optimistic lock-like approach;
2, while reading data, checking whether other transactions have data update (for example, "change") on the basis of the current version, if so, triggering an arbitration update mechanism, otherwise, triggering an arbitration record mechanism;
3.1, if an arbitration updating mechanism is triggered, the data of the current version needs to be merged and updated, and at the moment, all the data needing to be updated are merged and updated to the current value of the data. Compared with the existing optimistic lock which modifies the current value of the data when updating the data, the embodiment combines the updated data which occurs before when needed (namely when the updated data is needed), so that the times of modifying the current value of the data are reduced;
3.2, if an arbitration recording mechanism is triggered, directly recording related data when data is read;
4, after the transaction reads the data, performing various logic processing and applying for updating the data;
5, when updating data, judging whether the data versions are consistent, if so, triggering an arbitration recording mechanism, otherwise, triggering an arbitration updating mechanism;
6.1, if an arbitration recording mechanism is triggered, during data updating, arbitration is required according to related data recorded during data reading, if an arbitration condition is met, data recording is finished and is used as a basis for subsequent data updating, and if the arbitration recording mechanism is not triggered, data recording is refused;
6.2, if the arbitration updating mechanism is triggered, merging and updating the data of the current version, merging all the data needing to be updated at the moment, and updating to the current value of the data. Compared with the prior optimistic lock which directly rejects the data version inconsistency once the optimistic lock finds out, the method and the device facilitate the data updating as much as possible through the arbitration mechanism processing, and improve the success rate of the data updating.
Based on the tolerance mechanism in the embodiment, the same data is allowed to be updated concurrently in a scene of updating a large amount of concurrent data, so that the updating success rate is effectively improved, and the processing efficiency is improved.
The invention is described below in connection with an alternative embodiment.
Example two
The embodiment of the present invention provides a data updating apparatus, and each implementation unit included in the processing apparatus corresponds to each implementation step in the first embodiment.
Fig. 3 is a schematic diagram of an alternative data updating apparatus according to an embodiment of the present invention, as shown in fig. 3, the data updating apparatus includes: a reading unit 30, a detection unit 32, a merging unit 34, a loading unit 36, wherein,
a reading unit 30, configured to read object data, where the object data is subjected to operation processing by a plurality of transaction objects;
a detecting unit 32, configured to detect whether there is update data in the object data, where the update data is data that has been changed based on a current data version, and the current data version corresponds to a current data value;
a merging unit 34, configured to merge all update data if there is update data in the object data;
and the loading unit 36 is configured to load the merged update data into the current data value.
The data updating apparatus may read, by the reading unit 30, object data, where the object data is operated by a plurality of transaction objects, and then detect, by the detecting unit 32, whether there is update data in the object data, where the update data refers to data that has been changed based on a current data version, and the current data version corresponds to a current data value, and if there is update data in the object data, merge all update data by the merging unit 34, and finally load the merged update data into the current data value by the loading unit 36. In the embodiment, on the basis of the existing optimistic lock, the optimistic lock is enhanced in the aspect of data updating, so that during the period of reading and updating one or more transactions, even if other transactions update data, the data updating of partial or all concurrent transactions can be completed within a certain tolerance range, the success rate of the concurrent transaction data updating is improved, and the technical problem of low success rate in data updating under the concurrent transactions in the related art is solved.
Optionally, the detection unit comprises: and the first detection module is used for detecting whether another transaction object carries out change operation on the current value of the data in the current data version on the basis of the current value of the data and determining whether updated data exists in the object data.
Optionally, the data updating apparatus further includes: the second detection module is used for detecting whether the object data has the updated data or not and recording all the read object data; the first storage module is used for storing all the object data in the transaction database.
Optionally, the merging unit includes: the first calculation module is used for calculating the difference value between the updated data and the original data stored in the current value of the data if the updated data exists in the object data; and the first merging module is used for merging all the updating data if the difference value is within the preset difference value range.
Optionally, the merging unit further includes: the first judgment module is used for judging whether the current data version is consistent with the historical record version or not when the updated data exists in the object data; the second merging module is used for merging all the updating data in the current data version if the current data version is inconsistent with the historical record version; and the first loading module is used for loading all the merged update data to the current data value.
Optionally, the data updating apparatus further includes: and the first recording module is used for recording the current data version if the current data version is consistent with the historical record version after judging whether the current data version is consistent with the historical record version.
The data updating device may further include a processor and a memory, and the reading unit 30, the detecting unit 32, the merging unit 34, the loading unit 36, 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 a corresponding program unit from the memory. The kernel may be set to one or more, and the kernel parameter is adjusted to merge all the update data if the update data exists in the object data, and then the merged update data is loaded into the current data value.
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.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including: a processor; and a memory for storing executable instructions for the processor; wherein the processor is configured to perform the data update method described above via execution of the executable instructions.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, which includes a stored computer program, wherein when the computer program runs, the apparatus on which the computer-readable storage medium is located is controlled to execute the above-mentioned data updating method.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program, where the program executes the data updating method described above.
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: reading the object data, detecting whether the object data has the updated data, if so, merging all the updated data, and finally loading the merged updated data into the current data value.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for updating data, comprising:
reading object data, wherein the object data is operated and processed by a plurality of transaction objects;
detecting whether updated data exists in the object data, wherein the updated data refers to data changed on the basis of a current data version, and the current data version corresponds to a current data value;
if the object data has the updating data, merging all the updating data;
and loading the merged update data into the current data value.
2. The method according to claim 1, wherein the step of detecting whether the update data exists in the object data comprises:
and detecting whether another transaction object carries out change operation on the current data value in the current data version on the basis of the current data value, and determining whether updated data exists in the object data.
3. The method according to claim 2, wherein after detecting whether update data exists in the object data, the data update method further comprises:
detecting that no update data exists in the object data, and recording all read object data;
all object data is stored in the transaction database.
4. The method according to claim 1, wherein if there is update data in the object data, the step of merging all update data comprises:
if the object data has updating data, calculating a difference value between the updating data and original data stored in a current data value;
and if the difference value is within the preset difference value range, combining all the updating data.
5. The method according to claim 4, wherein if there is update data in the object data, the step of merging all update data further comprises:
if the object data has updating data, judging whether the current data version is consistent with the historical record version;
if the current data version is inconsistent with the historical record version, merging all update data in the current data version;
and loading all the merged updated data to the current data value.
6. The method of claim 4, wherein after determining whether the current data version is consistent with the history version, the data update method further comprises:
and if the current data version is consistent with the historical record version, recording the current data version.
7. A data update apparatus, comprising:
the reading unit is used for reading object data, wherein the object data is operated and processed by a plurality of transaction objects;
the detection unit is used for detecting whether update data exist in the object data, wherein the update data refer to data changed on the basis of a current data version, and the current data version corresponds to a current data value;
a merging unit, configured to merge all update data if the update data exists in the object data;
and the loading unit is used for loading the merged update data into the current data value.
8. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data update method of any one of claims 1 to 6 via execution of the executable instructions.
9. A computer-readable storage medium, comprising a stored computer program, wherein the computer program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the data update method of any one of claims 1 to 6.
10. A processor, characterized in that the processor is configured to run a program, wherein the program when running performs the data updating method of any one of claims 1 to 6.
CN202110189554.0A 2021-02-19 2021-02-19 Data updating method and device, electronic equipment and computer readable storage medium Active CN112905614B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110189554.0A CN112905614B (en) 2021-02-19 2021-02-19 Data updating method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110189554.0A CN112905614B (en) 2021-02-19 2021-02-19 Data updating method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112905614A true CN112905614A (en) 2021-06-04
CN112905614B CN112905614B (en) 2024-04-12

Family

ID=76123808

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110189554.0A Active CN112905614B (en) 2021-02-19 2021-02-19 Data updating method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112905614B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020127806A1 (en) * 2018-12-20 2020-06-25 Amadeus S.A.S. Updating multiple data records in a database
CN111444199A (en) * 2019-01-17 2020-07-24 阿里巴巴集团控股有限公司 Data processing method and device, storage medium and processor
CN111694853A (en) * 2020-06-02 2020-09-22 北京北大软件工程股份有限公司 Lineage-based data increment acquisition method and device, storage medium and electronic equipment
CN112199391A (en) * 2020-09-30 2021-01-08 深圳前海微众银行股份有限公司 Data locking detection method and device and computer readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020127806A1 (en) * 2018-12-20 2020-06-25 Amadeus S.A.S. Updating multiple data records in a database
CN111444199A (en) * 2019-01-17 2020-07-24 阿里巴巴集团控股有限公司 Data processing method and device, storage medium and processor
CN111694853A (en) * 2020-06-02 2020-09-22 北京北大软件工程股份有限公司 Lineage-based data increment acquisition method and device, storage medium and electronic equipment
CN112199391A (en) * 2020-09-30 2021-01-08 深圳前海微众银行股份有限公司 Data locking detection method and device and computer readable storage medium

Also Published As

Publication number Publication date
CN112905614B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
US6772155B1 (en) Looking data in a database system
KR101343212B1 (en) Online storage volume shrink
CN112669155B (en) Block chain-based transaction distribution execution method, device server and storage medium
US20220171754A1 (en) Method for indexing data in storage engine and related apparatus
US20210326359A1 (en) Compare processing using replication log-injected compare records in a replication environment
CN112084161A (en) Database-based data processing method and device and readable storage medium
CN112037058B (en) Data verification method, device and storage medium
US20080270407A1 (en) System for ensuring referential integrity in highly concurrent database environments
US6718349B2 (en) Intelligent, optimistic concurrency database access scheme
CN115145943B (en) Method, system, equipment and storage medium for rapidly comparing metadata of multiple data sources
JP6877435B2 (en) Database operation method and equipment
CN112052264A (en) Business data query method and device, electronic equipment and readable storage medium
US11150993B2 (en) Method, apparatus and computer program product for improving inline pattern detection
CN114331440A (en) Conflict detection and performance optimization method and device
CN112597762B (en) Blockchain system with intelligent contract data supervision function and supervision method
US20160275134A1 (en) Nosql database data validation
CN112559496A (en) Distributed database transaction atomicity realization method and device
US7051051B1 (en) Recovering from failed operations in a database system
CN110377614B (en) Order processing lock system under distributed environment
CN112732427A (en) Data processing method, system and related device based on Redis cluster
CN112905614A (en) Data updating method and device, electronic equipment and computer readable storage medium
WO2023206926A1 (en) User configuration data recovery method and device, and medium
CN116401229A (en) Database data verification method, device and equipment
CN115956240B (en) Incremental clone based database upgrades
CN115203217A (en) Data synchronization method, device, equipment and computer readable storage medium

Legal Events

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