CN106815289B - Data storage method and device in transaction processing system - Google Patents
Data storage method and device in transaction processing system Download PDFInfo
- Publication number
- CN106815289B CN106815289B CN201611115747.7A CN201611115747A CN106815289B CN 106815289 B CN106815289 B CN 106815289B CN 201611115747 A CN201611115747 A CN 201611115747A CN 106815289 B CN106815289 B CN 106815289B
- Authority
- CN
- China
- Prior art keywords
- data
- transaction
- value
- data value
- version information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9014—Indexing; Data structures therefor; Storage structures hash tables
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Software 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 storage method and a device in a transaction processing system, which are used for solving the problems of large transaction data volume, difficult guarantee of data consistency and high data repeatability in the prior art, and comprise the following steps: acquiring a data set, wherein the data set carries version information; aiming at each transaction element in the data set, judging whether the transaction element exists in the data storage space; if the transaction element exists, comparing whether the first data value is the same as the second data value; and if the data set is the same as the first data value, adding version information of the data set to the storage information corresponding to the second data value. By adopting the technical scheme, repeated data values of transaction elements do not need to be repeatedly recorded, so that the repeatability of the stored transaction data is reduced, the amount of the stored transaction data is reduced, and further, the data consistency among multiple systems is easier to ensure due to the reduction of the amount of the stored transaction data.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a data storage method and device in a transaction processing system.
Background
An online processing system is a very common system architecture in daily life, such as a typical financial online transaction system, taking payment transaction as an example, a transaction initiator, a bank (deduction service) and a service provider (accounting service) are required to participate, and transaction data needs to be transmitted among the three parties. The transaction system needs to record and process transaction data of three parties, and is used for rolling back (correcting) the transaction according to the intermediate step information when the transaction is abnormal.
Taking a three-party transaction as an example, the method shown in fig. 1 is mostly adopted for the management of data in an online system at present. Fig. 1 is a schematic diagram of a data storage method in the prior art according to an embodiment of the present invention, and as shown in fig. 1, a successful transaction requires participation of a transaction initiator, a service provider, and a bank. In the figure, the numbers 1-6 are transaction steps, and six data sets including a data set 1, a data set 2, a data set 3, a data set 4, a data set 5 and a data set 6 respectively correspond to each transaction step. When a transaction processing system receives a transaction request of a transaction initiator, recording the transaction data at the moment as a data set 1; then, after the transaction processing system processes the transaction data, recording the processed transaction data as a data set 2, and sending the processed transaction data to a bank, corresponding to the step 2; after receiving the transaction data, the bank processes the transaction data and sends the transaction data to a transaction processing system, namely step 3; after receiving the transaction data, the transaction processing system stores the transaction data as a data set 3, processes the transaction data, records the processed transaction data as a data set 4, and sends the transaction data to a service provider, corresponding to step 4; after receiving the transaction data, the service provider processes the transaction data and sends the transaction data to a transaction processing system, corresponding to step 5; and after receiving the transaction data, the transaction processing system records the transaction data as a data set 5, processes the transaction data, records the processed transaction data as a data set 6, and sends the processed transaction data to the transaction initiator, corresponding to step 6.
As shown in fig. 1, in the existing multi-party transaction system, one data set needs to be recorded in a database for data of each step in one transaction, for example, in a three-party transaction, two data sets need to be recorded for each party, so that six data sets need to be recorded for the three-party transaction, and the data management method has the following disadvantages:
1. the transaction data volume is large
Because the data of each step in one transaction needs to be recorded separately, especially for multi-party transaction records, the generated data volume is large. For a busy trading system, the number of trades per day is as high as several million or more, and the pressure on the system database and storage is relatively large.
2. Data consistency hard guarantee
Since the information of a transaction records multiple transactions in the database, it is necessary to ensure that each record related to the transaction must be complete in order to ensure the integrity of the transaction. At present, systems are all multi-system backups, data synchronization is needed among the systems, and the unit of data synchronization is one piece of data. If a piece of data related to one transaction in data synchronization is lost, the integrity of the data is damaged.
3. High data repeatability
Some transaction data are duplicated in one transaction data, which wastes memory resources and consumes more memory to store the data during program execution.
In summary, the data management method in the existing online processing system has the problems of large transaction data volume, difficult guarantee of data consistency and high data repeatability.
Disclosure of Invention
The invention provides a data storage method and a data storage device in a transaction processing system, which are used for solving the problems of large transaction data volume, difficult guarantee of data consistency and high data repeatability in the prior art.
The embodiment of the invention provides a data storage method in a transaction processing system, which comprises the following steps:
acquiring a data set, wherein the data set carries version information, and the version information corresponds to the transaction processing step;
for each transaction element in the data set, performing the steps of:
judging whether a transaction element exists in the data storage space;
if the transaction element exists, comparing whether the first data value is the same as the second data value; the first data value is a data value corresponding to a transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space;
and if the data set is the same as the first data value, adding version information of the data set to the storage information corresponding to the second data value.
Optionally, the method further comprises:
and if the transaction element does not exist in the data storage space, adding the transaction element in the data storage space, and storing the first data value and the transaction version information of the data set to a storage position corresponding to the transaction element, wherein the transaction version information of the data set belongs to the storage information of the first data value.
Optionally, the method further comprises:
and if the first data value is different from the second data value, storing the first data value and the transaction version information of the data set to a storage position corresponding to the transaction element, wherein the transaction version information of the data set belongs to the storage information of the first data value.
Optionally, before determining whether there is a transaction element in the data storage space, the method further includes:
calculating a Hash bucket (Hash bucket) value for the transaction element;
judging whether a transaction element exists in the data storage space, comprising the following steps:
searching transaction elements with the same Hash bucket value in a data storage space according to the Hash bucket value;
the existence of a transaction element is looked up from among transaction elements having the same hash bucket value.
The embodiment of the invention provides a data reading method, which is suitable for a transaction processing system adopting the data storage method, and comprises the following steps:
receiving a data query request, wherein the data query request comprises version information and transaction elements;
inquiring the data value of the version information corresponding to the transaction element from the data storage space of the transaction processing system;
and returning the data value of the version information corresponding to the transaction element.
An embodiment of the present invention provides a data storage device in a transaction processing system, including:
the acquisition module is used for acquiring a data set, the data set carries version information, and the version information corresponds to the transaction processing step;
the judging module is used for judging whether the transaction elements exist in the data storage space or not aiming at each transaction element in the data set;
the comparison module is used for comparing whether the first data value is the same as the second data value when the transaction element exists in the data storage space; the first data value is a data value corresponding to a transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space;
and the storage module is used for increasing the version information of the data set in the storage information corresponding to the second data value when the first data value and the second data value of the transaction element are the same.
Optionally, the storage module is further configured to add a transaction element in the data storage space when the transaction element does not exist in the data storage space, and store the first data value and the transaction version information of the data set to a storage location corresponding to the transaction element, where the transaction version information of the data set belongs to the storage information of the first data value.
Optionally, the storage module is further configured to store the first data value and the transaction version information of the data set in a storage location corresponding to the transaction element when the first data value is different from the second data value, where the transaction version information of the data set belongs to the storage information of the first data value.
Optionally, the determining module is further configured to calculate a Hash bucket (Hash bucket) value of the transaction element;
the judgment module is specifically used for:
searching transaction elements with the same Hash bucket value in a data storage space according to the Hash bucket value;
the existence of a transaction element is looked up from among transaction elements having the same hash bucket value.
An embodiment of the present invention provides a data reading apparatus, which is suitable for a transaction processing system using the data storage apparatus, and includes:
the receiving module is used for receiving a data query request, and the data query request comprises version information and transaction elements;
the query module is used for querying the data value of the version information corresponding to the transaction element from the data storage space of the transaction processing system;
and the return module is used for returning the data value of the version information corresponding to the transaction element.
To sum up, an embodiment of the present invention provides a data storage method and apparatus in a transaction processing system, including: acquiring a data set, wherein the data set carries version information, and the version information corresponds to the transaction processing step; for each transaction element in the data set, performing the steps of: judging whether a transaction element exists in the data storage space; if the transaction element exists, comparing whether the first data value and the second data value of the transaction element are the same; the first data value is a data value corresponding to a transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space; and if the data set is the same as the first data value, adding version information of the data set to the storage information corresponding to the second data value. The transaction process comprises a plurality of versions of data sets, and for the same transaction element in different versions, if the data value of the transaction element is not changed, the data value of the transaction element does not need to be repeatedly recorded, and only one version record needs to be added, so that the repeatability of the stored transaction data is reduced, and the amount of the stored transaction data is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of a data storage method in the prior art according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a data storage method in a transaction processing system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a data storage structure according to an embodiment of the present invention;
FIG. 4 is a flow chart of data storage according to an embodiment of the present invention;
fig. 5 is a schematic flow chart of a data reading method according to an embodiment of the present invention;
FIG. 6 is a block diagram of a data storage device in a transaction processing system according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a data reading apparatus according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, 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.
Fig. 2 is a schematic flow chart of a data storage method in a transaction processing system according to an embodiment of the present invention, as shown in fig. 2, including the following steps:
s201: acquiring a data set, wherein the data set carries version information, and the version information corresponds to the transaction processing step;
s202: judging whether a transaction element exists in the data storage space or not aiming at each transaction element in the data set;
s203: if the transaction element exists, comparing whether the first data value is the same as the second data value; the first data value is a data value corresponding to a transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space;
s204: and if the data set is the same as the first data value, adding version information of the data set to the storage information corresponding to the second data value.
In the specific implementation process, the method disclosed by the embodiment of the invention is suitable for transactions of two parties and three parties, and is also suitable for multi-party transactions with more participating parties than three parties. The data storage space is used for temporarily storing the transaction data, and after a complete transaction is confirmed to be correct, the data record related to the transaction can be deleted. The data storage space can simultaneously store transaction data of a plurality of transactions, and the transaction data of the transactions are independent and do not interfere with each other.
In the implementation of step S201, one data set corresponds to one transaction data processing result, such as data set 1, data set 2, data set 3, data set 4, data set 5, and data set 6 in fig. 1, each of which is a data set. The data set carries version information corresponding to the transaction processing step, for example, the data set 1 in fig. 1 corresponds to a first data processing result, that is, the transaction initiator generates transaction data in the data set 1, the version number corresponding to the version information of the data set 1 is 1, the data set 2 corresponds to a second processing result, that is, the transaction processing system generates transaction data in the data set 2 according to the processing result of the transaction data in the data set 1, and the version number corresponding to the version information of the data set 2 is 2.
In the specific implementation process of step S202, one data set is composed of a plurality of transaction elements and relationships between the transaction elements, such as transaction time, transaction amount, transaction account, transaction times, and the like, and optionally, the transaction elements may be determined according to actual application conditions and experience. Optionally, each transaction element is organized according to a format of a data name (Key), a data length (Len) and a data Value (Value), wherein the data name and the transaction element have a unique fixed comparison relationship, for example, the transaction element is a transaction amount, and the data name is a Money, and at this time, the Money can only represent the transaction element of the transaction amount, and cannot represent other transaction elements. The data length represents the data storage size corresponding to the transaction element, and the data length can be used for calculating the space size occupied by the stored data to more efficiently allocate the storage space, and is important information to be called when the data is called. The data values represent the specific contents of the transaction elements, for example, the data values of the transaction amount are 1000, 10, 233 and the like, and for another example, the data values of the transaction place are shanghai, beijing, shenzhen and the like.
Optionally, when obtaining a data set, for each transaction element, calculating a Hash bucket (Hash bucket) value of the transaction element; searching transaction elements with the same Hash bucket value in a data storage space according to the Hash bucket value; the existence of a transaction element is looked up from among transaction elements having the same hash bucket value. In a specific implementation process, one Hash bucket value may correspond to multiple transaction elements, and optionally, for each transaction element, when the Hash bucket value corresponding to the transaction operand is found in the data storage space, whether the transaction element having the same data name is included is found from the transaction element corresponding to the Hash bucket value according to the data name. By searching the Hash packet value, the comparison times in the searching process can be greatly reduced, so that the searching speed is accelerated. Optionally, the Hash bucket value search may not be utilized, that is, the Hash bucket is not introduced in the data storage process, and during the data search, whether the transaction element exists in the data storage space is determined by comparing the data name of the transaction element, but the search speed of the method is greatly reduced compared with the search method by means of the Hash bucket value.
Optionally, for each transaction element, if the transaction element does not exist in the data storage space, adding the transaction element in the data storage space, and storing the first data value and the transaction version information of the data set to a storage location corresponding to the transaction element, where the transaction version information of the data set belongs to the storage information of the first data value. The transaction element does not exist in the data storage space, and the transaction element is a transaction element newly added in the data processing process. For the newly added transaction element, the storage for the newly added transaction element should be added in the data storage space, and the storage information of the newly added transaction element should include the data name, the data value and the version information of the transaction element, and optionally, also include the data length of the transaction element. Optionally, the storing procedure is: and calculating the Hash bucket value of the transaction element, judging whether the existing Hash bucket value has the same Hash bucket value with the Hash bucket value of the transaction element, if so, adding a new node behind the Hash bucket, wherein the data name of the node is the data name of the transaction element. And if the HASH bucket value of the transaction element does not exist in the existing HASH bucket values in the HASH bucket, adding a new bucket value in the HASH bucket.
In the specific implementation process of step S203, for each transaction element, if the transaction element exists in the data storage space, it is further required to compare whether a first data value of the transaction element is the same as a second data value, where the first data value is a data value corresponding to the transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space. For example, data set 1, data set 2, and data set 3 in fig. 1, for a transaction amount, if the data value of the transaction amount in data set 2 is a first data value, then the data value of the transaction amount in data set 1 is a second data value; if the data value of the transaction amount in the data set 3 is the first data value, the data values of the transaction amounts in the data set 1 and the data set 2 are the second data values, that is, the data values corresponding to the transaction elements in all versions before the current version are the second data values, and the possible number of the second data values is not limited to 1.
In the implementation process of step S204, for each transaction element, if the first data value and the second data value of the transaction element are the same, the version information of the data set is added to the storage information corresponding to the second data value. In the case where a plurality of second data values exist, the first data value and the second data value are the same here, which means that the first data value is the same as any one of the second data values. If the first data value is the same as the second data value, adding version information of the data set to the storage information corresponding to the second data value, for example, if the first data value3 is the same as the second data value2, the version information corresponding to the first data value3 is version 3, and the version information corresponding to the second data value2 is version 2, then adding version information version 3 to the version information corresponding to the second data value 2.
Optionally, for each transaction element, if the first data value of the transaction element is different from the second data value of the transaction element, the first data value and the transaction version information of the data set are stored in the storage location corresponding to the transaction element, and the transaction version information of the data set belongs to the storage information of the first data value. The storage position corresponding to the transaction element refers to a storage area divided according to the data name of the transaction element, and if the first data value and the second data value of the transaction element are different, the first data value and the corresponding transaction version information thereof are added in the storage area corresponding to the data name of the transaction element.
Fig. 3 is a schematic diagram of a data storage structure according to an embodiment of the present invention, as shown in fig. 3, the storage structure includes a HASH bucket, the HASH bucket stores data nodes (items) by recording HASH values, [ v1], [ v2], and [ v3] behind each node represent version information recorded in the node, the version information is respectively a first version corresponding to data set 1, a second version corresponding to data set 2, and a third version corresponding to data set 3, a horizontal chain of the HASH chain table represents nodes with different data names and the same HASH bucket value, a vertical chain table represents nodes with the same data name but different data values, and only when a first data value and a second data value of a transaction element are different or a new transaction element occurs during data storage, a new node exists. In the specific storage process, when a transaction element cannot be searched in the storage space, that is, a node of the transaction element does not exist in the HASH bucket shown in fig. 3, a HASH bucket value of the transaction element is calculated, whether a HASH bucket value identical to the HASH bucket value of the transaction element exists in the existing HASH bucket values is judged, if yes, a new node is added in a horizontal chain after the HASH bucket, and the data name of the node is the data name of the transaction element. If the HASH bucket value of the transaction element does not exist in the existing HASH bucket values, adding a new bucket value linked list into the HASH bucket, such as the structure shown in fig. 3, and adding a bucket [ n +1 ]. Optionally, as shown in fig. 3, the storage structure may include a version bitmap, a version list, the number of used nodes, the number of free nodes, and the location of free nodes in addition to the HASH bucket. The version bitmap is a flag bit for auxiliary operation, and can be used for version filtering. The version list is used to store the existing version number of the current data set, and as shown in the storage structure shown in fig. 3, the version list should store three versions 1, 2, and 3. The number of used nodes is recorded as the number of used nodes. The number of free nodes records the number of free nodes. The idle node position records an unused idle node linked list. It should be noted that the storage mode of the node side is the main content of the embodiment of the present invention, the hash bucket is optimized for the node side, and the version bitmap, the version list, the number of used nodes, the number of idle nodes, and the position of the idle node are optional contents.
Fig. 4 is a flowchart of data storage according to an embodiment of the present invention, as shown in fig. 4, including the following steps:
s401: acquiring a data set;
s402: extracting a transaction element in the data set;
s403: judging whether the transaction element exists in the data storage space; if yes, continue step S404, otherwise continue step S408;
s404: comparing whether the first data value and the second data value of the transaction element are the same; if yes, continuing to step S405, otherwise, continuing to step S409;
s405: adding version information of the data set in the storage information corresponding to the second data value;
s406: judging whether all transaction elements are stored completely; if yes, continuing to step S407, otherwise returning to step S402;
s407: finishing the storage;
s408: storing the transaction element;
s409: and storing the first data value and the transaction version information of the data set to a storage position corresponding to the transaction element.
Fig. 5 is a schematic flow chart of a data reading method according to an embodiment of the present invention, as shown in fig. 5, including the following steps:
s501: receiving a data query request, wherein the data query request comprises version information and transaction elements;
s502: inquiring the data value of the version information corresponding to the transaction element from the data storage space of the transaction processing system;
s503: and returning the data value of the version information corresponding to the transaction element.
In a specific implementation process, the embodiment of the invention is suitable for the data stored by the data storage method of the transaction system provided by the invention. For example, when a rollback to the second step of the transaction is required, the query may be required to extract the second version of data corresponding to data set 2 from the data storage space. The query request includes a request for querying the data of the second version, and the query version information is the data values and data names of the data values of the second version from the data storage space, optionally, the data length corresponding to the data value may also be extracted, and when the data value of the version information corresponding to the transaction element is finally returned, the data value is returned according to the format of the combination of the data name, the data length and the data value. Optionally, for the transaction data stored according to the storage method shown in this embodiment, data values of different versions corresponding to the specified transaction element may also be extracted, for example, when the transaction amount element is specified to be extracted, data values of respective versions corresponding to the Money data name are extracted from the data storage space according to the data name Money of the transaction amount, and optionally, the data values are returned in a format of a combination of the data name, the data length, and the data value.
To sum up, an embodiment of the present invention provides a data storage method in a transaction processing system, including: acquiring a data set, wherein the data set carries version information, and the version information corresponds to the transaction processing step; for each transaction element in the data set, performing the steps of: judging whether a transaction element exists in the data storage space; if the transaction element exists, comparing whether the first data value and the second data value of the transaction element are the same; the first data value is a data value corresponding to a transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space; and if the data set is the same as the first data value, adding version information of the data set to the storage information corresponding to the second data value. The transaction process comprises a plurality of versions of data sets, and for the same transaction element in different versions, if the data value of the transaction element is not changed, the data value of the transaction element does not need to be repeatedly recorded, and only one version record needs to be added, so that the repeatability of the stored transaction data is reduced, and the amount of the stored transaction data is reduced.
Based on the same technical concept, the embodiment of the invention also provides a data storage device in the transaction processing system, and the data storage device can execute the method embodiment. Fig. 6 is a schematic structural diagram of a data storage device in a transaction processing system according to an embodiment of the present invention, and as shown in fig. 6, the data storage device 600 includes: an acquisition module 601, a judgment module 602, a comparison module 603 and a storage module 604, wherein:
the acquisition module 601 is used for acquiring a data set, wherein the data set carries version information, and the version information corresponds to the transaction processing steps;
a determining module 602, configured to determine, for each transaction element in the data set, whether a transaction element exists in the data storage space;
a comparing module 603, configured to compare whether the first data value is the same as the second data value when the transaction element exists in the data storage space; the first data value is a data value corresponding to a transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space;
the storage module 604 is configured to add version information of the data set to the stored information corresponding to the second data value when the first data value of the transaction element is the same as the second data value.
Optionally, the storage module 604 is further configured to, when no transaction element exists in the data storage space, add a transaction element in the data storage space, and store the first data value and the transaction version information of the data set to a storage location corresponding to the transaction element, where the transaction version information of the data set belongs to the storage information of the first data value.
Optionally, the storage module 604 is further configured to store the first data value and the transaction version information of the data set to a storage location corresponding to the transaction element when the first data value is different from the second data value, where the transaction version information of the data set belongs to the storage information of the first data value.
Optionally, the determining module 602 is further configured to calculate a Hash bucket (Hash bucket) value of the transaction element;
the determining module 602 is specifically configured to:
searching transaction elements with the same Hash bucket value in a data storage space according to the Hash bucket value;
the existence of a transaction element is looked up from among transaction elements having the same hash bucket value.
The embodiment of the invention also provides a data reading device which is suitable for a transaction processing system adopting the data storage device. Fig. 7 is a schematic structural diagram of a data reading apparatus according to the present invention, and as shown in fig. 7, the reading apparatus 700 includes: a receiving module 701, a query module 702 and a return module 703, wherein:
a receiving module 701, configured to receive a data query request, where the data query request includes version information and transaction elements;
a query module 702, configured to query a data value of version information corresponding to a transaction element from a data storage space of the transaction processing system;
and a returning module 703, configured to return a data value of the version information corresponding to the transaction element.
To sum up, an embodiment of the present invention provides a data storage method and apparatus in a transaction processing system, including: acquiring a data set, wherein the data set carries version information, and the version information corresponds to the transaction processing step; for each transaction element in the data set, performing the steps of: judging whether a transaction element exists in the data storage space; if the transaction element exists, comparing whether the first data value and the second data value of the transaction element are the same; the first data value is a data value corresponding to a transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space; and if the data set is the same as the first data value, adding version information of the data set to the storage information corresponding to the second data value. The transaction process comprises a plurality of versions of data sets, and for the same transaction element in different versions, if the data value of the transaction element is not changed, the data value of the transaction element does not need to be repeatedly recorded, and only one version record needs to be added, so that the repeatability of the stored transaction data is reduced, and the amount of the stored transaction data is reduced.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. 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.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (10)
1. A method of data storage in a transaction processing system, comprising:
acquiring a data set, wherein the data set carries version information, and the version information corresponds to a transaction processing step;
for each transaction element in the data set, performing the steps of:
judging whether the transaction elements exist in the data storage space;
if the transaction element exists, comparing whether the first data value and the second data value are the same; the first data value is a data value corresponding to the transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space;
and if the data set is the same as the first data value, adding version information of the data set in the storage information corresponding to the second data value.
2. The method of claim 1, further comprising:
if the transaction element does not exist in the data storage space, adding the transaction element in the data storage space, and storing the first data value and the transaction version information of the data set to a storage position corresponding to the transaction element, wherein the transaction version information of the data set belongs to the storage information of the first data value.
3. The method of claim 1, further comprising:
and if the first data value is different from the second data value, storing the first data value and the transaction version information of the data set to a storage position corresponding to the transaction element, wherein the transaction version information of the data set belongs to the storage information of the first data value.
4. The method of any of claims 1 to 3, wherein prior to determining whether the transaction element is present in the data storage space, further comprising:
calculating a Hash bucket value of the transaction element;
judging whether the transaction element exists in the data storage space or not, comprising the following steps:
searching transaction elements with the same Hash bucket value in the data storage space according to the Hash bucket value;
and searching whether the transaction element exists from the transaction elements with the same hash bucket value.
5. A data reading method, characterized in that a transaction processing system adapted to employ the data storage method according to any one of claims 1 to 4, comprises:
receiving a data query request, wherein the data query request comprises version information and transaction elements;
inquiring the data value of the version information corresponding to the transaction element from the data storage space of the transaction processing system;
and returning the data value of the version information corresponding to the transaction element.
6. A data storage device in a transaction processing system, comprising:
the system comprises an acquisition module, a transaction processing module and a processing module, wherein the acquisition module is used for acquiring a data set, the data set carries version information, and the version information corresponds to the transaction processing step;
the judging module is used for judging whether the transaction elements exist in the data storage space or not aiming at each transaction element in the data set;
a comparison module for comparing whether the first data value is the same as the second data value when the transaction element exists in the data storage space; the first data value is a data value corresponding to the transaction element in the data set, and the second data value is a data value corresponding to the transaction element in the data storage space;
and the storage module is used for increasing the version information of the data set in the storage information corresponding to the second data value when the first data value and the second data value of the transaction element are the same.
7. The apparatus of claim 6, comprising:
the storage module is further configured to add the transaction element to the data storage space and store the first data value and the transaction version information of the data set to a storage location corresponding to the transaction element when the transaction element does not exist in the data storage space, where the transaction version information of the data set belongs to the storage information of the first data value.
8. The apparatus of claim 6, comprising:
the storage module is further configured to store the first data value and the transaction version information of the data set to a storage location corresponding to the transaction element when the first data value is different from the second data value, where the transaction version information of the data set belongs to the storage information of the first data value.
9. The apparatus of any of claims 6 to 8, comprising:
the judgment module is also used for calculating a Hash bucket value of the transaction element;
the judgment module is specifically configured to:
searching transaction elements with the same Hash bucket value in the data storage space according to the Hash bucket value;
and searching whether the transaction element exists from the transaction elements with the same hash bucket value.
10. A data reading apparatus, adapted for use in a transaction processing system employing a data storage apparatus as claimed in any one of claims 6 to 9, comprising:
the receiving module is used for receiving a data query request, wherein the data query request comprises version information and transaction elements;
the query module is used for querying the data value of the version information corresponding to the transaction element from the data storage space of the transaction processing system;
and the return module is used for returning the data value of the version information corresponding to the transaction element.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611115747.7A CN106815289B (en) | 2016-12-07 | 2016-12-07 | Data storage method and device in transaction processing system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611115747.7A CN106815289B (en) | 2016-12-07 | 2016-12-07 | Data storage method and device in transaction processing system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106815289A CN106815289A (en) | 2017-06-09 |
CN106815289B true CN106815289B (en) | 2020-06-23 |
Family
ID=59106040
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611115747.7A Active CN106815289B (en) | 2016-12-07 | 2016-12-07 | Data storage method and device in transaction processing system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106815289B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101739310A (en) * | 2009-12-10 | 2010-06-16 | 上海爱数软件有限公司 | Method and device for cycling backup |
CN102426611A (en) * | 2012-01-13 | 2012-04-25 | 广州从兴电子开发有限公司 | Database synchronization method and device |
CN103020058A (en) * | 2011-09-21 | 2013-04-03 | 阿里巴巴集团控股有限公司 | Multi-version data acquisition method and device |
CN104809615A (en) * | 2015-03-31 | 2015-07-29 | 锐波天下(北京)科技有限公司 | First transaction authentication device and hierarchic transaction authentication system and method |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8104675B2 (en) * | 2005-04-04 | 2012-01-31 | American Express Travel Related Services Company, Inc. | Systems and methods for risk triggering values |
US10019476B2 (en) * | 2015-05-27 | 2018-07-10 | Microsoft Technology Licensing, Llc | Multi-version data system nested transactions isolation |
-
2016
- 2016-12-07 CN CN201611115747.7A patent/CN106815289B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101739310A (en) * | 2009-12-10 | 2010-06-16 | 上海爱数软件有限公司 | Method and device for cycling backup |
CN103020058A (en) * | 2011-09-21 | 2013-04-03 | 阿里巴巴集团控股有限公司 | Multi-version data acquisition method and device |
CN102426611A (en) * | 2012-01-13 | 2012-04-25 | 广州从兴电子开发有限公司 | Database synchronization method and device |
CN104809615A (en) * | 2015-03-31 | 2015-07-29 | 锐波天下(北京)科技有限公司 | First transaction authentication device and hierarchic transaction authentication system and method |
Non-Patent Citations (2)
Title |
---|
Application and Research on ArcSDE-Based Spatial Data Version Management;Zuo Xiaoqing;《IEEE》;20090724;第158-161页 * |
OceanBase一致性与可用性分析;周欢等;《华东师范大学学报(自然科学版)》;20140930;第2014年卷(第5期);第103-116页 * |
Also Published As
Publication number | Publication date |
---|---|
CN106815289A (en) | 2017-06-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20160035044A1 (en) | Account processing method and apparatus | |
CN108647357B (en) | Data query method and device | |
CN106649828B (en) | Data query method and system | |
US11087371B2 (en) | Blockchain-based invoice creation method apparatus, and electronic device | |
CN107153646B (en) | Data processing method and equipment | |
CN112862578A (en) | Account checking system and device | |
CN106897338A (en) | A kind of data modification request processing method and processing device for database | |
WO2019033741A1 (en) | Investment commodity resource processing method, device, storage medium and computer apparatus | |
CN112749167A (en) | Method and device for determining broken link data and nonvolatile storage medium | |
CN109614263B (en) | Disaster tolerance data processing method, device and system | |
CN109857806B (en) | Synchronous verification method and device for database table | |
CN112598510B (en) | Resource data processing method and device | |
CN111105277B (en) | Method and device for tracing transaction of block chain state change | |
CN106815289B (en) | Data storage method and device in transaction processing system | |
CN111259053A (en) | Bill inquiry method and device | |
CN115687599B (en) | Service data processing method and device, electronic equipment and storage medium | |
CN112801616B (en) | Abnormal account book processing method and device | |
CN115578180A (en) | Bank outlet cash resource management method and device | |
CN110363515B (en) | Rights and interests card account information inquiry method, system, server and readable storage medium | |
CN114138786A (en) | Method, device, medium, product and equipment for duplicate removal of online transaction message | |
CN113344333A (en) | Configurable enterprise credit investigation early warning method, device, equipment and storage medium | |
CN114625729B (en) | Service data storage method and device, electronic equipment and storage medium | |
WO2016192584A1 (en) | Method and device for processing information and determining invoice information | |
CN115357484A (en) | Method and device for realizing availability of test data among multiple systems based on data cleaning | |
CN114237977A (en) | Transaction rollback method, device, computer equipment and 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 |