[go: up one dir, main page]

CN106815289A - Date storage method and device in a kind of transaction processing system - Google Patents

Date storage method and device in a kind of transaction processing system Download PDF

Info

Publication number
CN106815289A
CN106815289A CN201611115747.7A CN201611115747A CN106815289A CN 106815289 A CN106815289 A CN 106815289A CN 201611115747 A CN201611115747 A CN 201611115747A CN 106815289 A CN106815289 A CN 106815289A
Authority
CN
China
Prior art keywords
data
transaction
value
version information
data value
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
CN201611115747.7A
Other languages
Chinese (zh)
Other versions
CN106815289B (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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN201611115747.7A priority Critical patent/CN106815289B/en
Publication of CN106815289A publication Critical patent/CN106815289A/en
Application granted granted Critical
Publication of CN106815289B publication Critical patent/CN106815289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; 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 device in a transaction processing system, which are used to solve the problems in the prior art that the transaction data volume is large, the data consistency is difficult to guarantee, and the data repeatability is high, including: obtaining data sets, The data set carries version information; for each transaction element in the data set, determine whether the transaction element exists in the data storage space; if the transaction element exists, compare whether the first data value is the same as the second data value; if they are the same, then The version information of the data set is added to the storage information corresponding to the second data value. With this technical solution, it is not necessary to repeatedly record the repeated data values of transaction elements, thereby reducing the repetition of stored transaction data and reducing the amount of stored transaction data. Furthermore, due to the reduction in the amount of stored transaction data, multi-system Data consistency among them is easier to guarantee.

Description

一种交易处理系统中的数据存储方法及装置Data storage method and device in a transaction processing system

技术领域technical field

本发明涉及计算机技术领域,尤其涉及一种交易处理系统中的数据存储方法及装置。The invention relates to the field of computer technology, in particular to a data storage method and device in a transaction processing system.

背景技术Background technique

联机处理系统是日常生活中非常常见的一种系统架构,如典型的金融联机交易系统,以缴费交易为例,需要交易发起方、银行(扣款服务)和服务提供商(销账服务)三方参与,在三方中需要传递交易数据。交易系统需要记录和处理三方的交易数据,用于当交易异常时,根据中间步骤信息进行交易的回滚(冲正)。The online processing system is a very common system architecture in daily life, such as a typical financial online transaction system, taking the payment transaction as an example, which requires three parties: the transaction initiator, the bank (debit service) and the service provider (debit service) To participate, transaction data needs to be passed among the three parties. The transaction system needs to record and process the transaction data of the three parties, which is used to roll back (reverse) the transaction according to the intermediate step information when the transaction is abnormal.

以三方交易为例,目前对于联机系统中数据的管理多采用如图1所示的方法。图1为本发明实施例提供的一种现有技术中的数据存储方法示意图,如图1所示,一笔成功的交易需要交易发起方、服务提供商和银行三方参与。图中数字1-6为交易步骤,分别对应着每一个交易步骤有数据集1、数据集2、数据集3、数据集4、数据集5和数据集6共六个数据集。当交易处理系统接收到交易发起方的交易请求后,将此时的交易数据记录为数据集1;然后交易处理系统对交易数据进行处理后,将处理后的交易数据记录为数据集2,并把处理后的交易数据发送到银行,对应步骤2;银行接收到交易数据后对交易数据进行处理并发送给交易处理系统,即步骤3;交易处理系统接收到交易数据后,将其存为数据集3之后,对交易数据进行处理,将处理后的交易数据记录为数据集4,并将此时的交易数据发送给服务提供商,对应步骤4;服务提供商接收到交易数据后,对交易数据进行处理并发送给交易处理系统,对应步骤5;交易处理系统接收到交易数据后,将交易数据记录为数据集5,对交易数据进行处理,将处理后的交易数据记录为数据集6,并将处理后的交易数据发送给交易发起方,对应步骤6。Taking the three-party transaction as an example, currently the method shown in Figure 1 is mostly used for the management of data in the online system. FIG. 1 is a schematic diagram of a data storage method in the prior art provided by an embodiment of the present invention. As shown in FIG. 1 , a successful transaction requires the participation of the transaction initiator, the service provider and the bank. Numbers 1-6 in the figure are transaction steps, corresponding to each transaction step, there are six data sets including data set 1, data set 2, data set 3, data set 4, data set 5 and data set 6. When the transaction processing system receives the transaction request from the transaction initiator, it records the transaction data at this time as data set 1; then the transaction processing system processes the transaction data, records the processed transaction data as data set 2, and Send the processed transaction data to the bank, corresponding to step 2; after the bank receives the transaction data, process the transaction data and send it to the transaction processing system, that is, step 3; after the transaction processing system receives the transaction data, save it as data After set 3, process the transaction data, record the processed transaction data as data set 4, and send the transaction data at this time to the service provider, corresponding to step 4; after the service provider receives the transaction data, it The data is processed and sent to the transaction processing system, which corresponds to step 5; after the transaction processing system receives the transaction data, it records the transaction data as data set 5, processes the transaction data, and records the processed transaction data as data set 6, And send the processed transaction data to the transaction initiator, corresponding to step 6.

由图1可知,现有的多方交易系统中,对一笔交易中每个步骤的数据都需要在数据库中记录一个数据集,例如三方交易中,针对每一方都需要记录两个数据集,因此三方交易共需要记录六个数据集,这种数据管理方式存在着以下几点不足:It can be seen from Figure 1 that in the existing multi-party transaction system, a data set needs to be recorded in the database for the data of each step in a transaction. For example, in a three-party transaction, two data sets need to be recorded for each party, so Three-party transactions need to record a total of six data sets. This data management method has the following deficiencies:

1、交易数据量大1. Large amount of transaction data

由于对一笔交易中的每一个步骤的数据都需单独记录,尤其是对于多方交易记录,所产生的数据量较大。对于繁忙的交易系统,每天交易笔数高达几百万或者更高,对系统数据库和存储的压力比较大。Since the data of each step in a transaction needs to be recorded separately, especially for multi-party transaction records, the generated data volume is relatively large. For a busy trading system, the number of transactions per day is as high as several million or higher, which puts a lot of pressure on the system database and storage.

2、数据一致性难保证2. Data consistency is difficult to guarantee

由于一笔交易的信息在数据库中记录多条交易,为保证一笔交易的完整性需要保证相关的每条记录必须是完整的。现在系统都是多系统备份,系统之间需要数据的同步,数据同步的单位为一条数据。如果数据同步中一笔交易相关的一条数据丢失,会导致数据的完整性遭到破坏。Since the information of a transaction records multiple transactions in the database, in order to ensure the integrity of a transaction, it is necessary to ensure that each related record must be complete. Now the system is multi-system backup, data synchronization is required between systems, and the unit of data synchronization is a piece of data. If a piece of data related to a transaction is lost during data synchronization, the integrity of the data will be destroyed.

3、数据重复性高3. High data repeatability

在一笔交易数据中有些交易数据是重复的,这些重复交易数据浪费了存储资源,并且在程序运行中浪费更多的内存来存储这些数据。Some transaction data in a transaction data is repeated, and these repeated transaction data waste storage resources, and waste more memory to store these data during program operation.

综上所述,现有的联机处理系统中的数据管理方法存在着交易数据量大,数据一致性难保证,数据重复性高的问题。To sum up, the existing data management methods in the online processing system have the problems of large amount of transaction data, difficulty in ensuring data consistency, and high data repeatability.

发明内容Contents of the invention

本发明提供一种交易处理系统中的数据存储方法及装置,用以解决现有技术中存在的交易数据量大,数据一致性难保证,数据重复性高的问题。The present invention provides a data storage method and device in a transaction processing system, which are used to solve the problems in the prior art that there is a large amount of transaction data, difficult to ensure data consistency, and high data repeatability.

本发明实施例提供一种交易处理系统中的数据存储方法,包括:An embodiment of the present invention provides a data storage method in a transaction processing system, including:

获取数据集,数据集中携带版本信息,版本信息与交易处理步骤相对应;Obtain the data set, the data set carries version information, and the version information corresponds to the transaction processing steps;

针对数据集中的每一个交易元素,执行如下步骤:For each transaction element in the data set, perform the following steps:

判断数据存储空间中是否存在交易元素;Determine whether there is a transaction element in the data storage space;

若存在交易元素,则比较第一数据值与第二数据值是否相同;第一数据值为数据集中交易元素对应的数据值,第二数据值为数据存储空间中交易元素对应的数据值;If there is a transaction element, compare whether the first data value is the same as the second data value; the first data value is the data value corresponding to the transaction element in the data set, and the second data value is the data value corresponding to the transaction element in the data storage space;

若相同,则在第二数据值对应的存储信息中增加数据集的版本信息。If they are the same, the version information of the data set is added to the storage information corresponding to the second data value.

可选地,还包括:Optionally, also include:

若数据存储空间中不存在交易元素,则在数据存储空间中添加交易元素,并将第一数据值及数据集的交易版本信息存储至交易元素对应的存储位置,数据集的交易版本信息属于第一数据值的存储信息。If there is no transaction element 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 in the storage location corresponding to the transaction element, and the transaction version information of the data set belongs to the first Storage information for a data value.

可选地,还包括:Optionally, also include:

若第一数据值与第二数据值不同,则将第一数据值及数据集的交易版本信息存储至交易元素对应的存储位置,数据集的交易版本信息属于第一数据值的存储信息。If the first data value is different from the second data value, 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.

可选地,判断数据存储空间中是否存在交易元素之前,还包括:Optionally, before judging whether there is a transaction element in the data storage space, it also includes:

计算交易元素的哈希桶(Hash bucket)值;Calculate the hash bucket (Hash bucket) value of the transaction element;

判断数据存储空间中是否存在交易元素,包括:Determine whether there are transaction elements in the data storage space, including:

根据Hash bucket值在数据存储空间查找具有相同哈希桶值的交易元素;Find transaction elements with the same hash bucket value in the data storage space according to the Hash bucket value;

从具有相同哈希桶值的交易元素中查找是否存在交易元素。Find whether there is a transaction element from the transaction elements with the same hash bucket value.

本发明实施例提供一种数据读取方法,适用于采用上述数据存储方法的交易处理系统,包括:An embodiment of the present invention provides a data reading method, which is applicable to a transaction processing system adopting the above data storage method, including:

接收数据查询请求,数据查询请求中包括版本信息和交易元素;Receive a data query request, which includes version information and transaction elements;

从交易处理系统的数据存储空间中,查询交易元素对应的版本信息的数据值;From the data storage space of the transaction processing system, query the data value of the version information corresponding to the transaction element;

返回交易元素对应的版本信息的数据值。Returns 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 collection module is used to obtain the data set, the data set carries version information, and the version information corresponds to the transaction processing steps;

判断模块,用于针对数据集中的每一个交易元素,判断数据存储空间中是否存在交易元素;A judging module, for each transaction element in the data set, to judge whether there is a transaction element in the data storage space;

比较模块,用于当数据存储空间存在交易元素时,比较第一数据值与第二数据值是否相同;第一数据值为数据集中交易元素对应的数据值,第二数据值为数据存储空间中交易元素对应的数据值;The comparison module is used to compare whether the first data value and the second data value are the same when there is a transaction element in the data storage space; the first data value is the data value corresponding to the transaction element in the data set, and the second data value is in the data storage space The data value corresponding to the transaction element;

存储模块,用于当交易元素的第一数据值与第二数据值相同时,在第二数据值对应的存储信息中增加数据集的版本信息。The storage module is configured to add the version information of the data set to the storage 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 is also used to add a transaction element in the data storage space when there is no transaction element in the data storage space, and store the first data value and the transaction version information of the data set in the storage corresponding to the transaction element Location, the transaction version information of the data set belongs to the storage information of the first data value.

可选地,存储模块,还用于当第一数据值与第二数据值不同时,将第一数据值及数据集的交易版本信息存储至交易元素对应的存储位置,数据集的交易版本信息属于第一数据值的存储信息。Optionally, the storage module is also used to store the first data value and the transaction version information of the data set in the storage location corresponding to the transaction element when the first data value is different from the second data value, and the transaction version information of the data set Storage information pertaining to the first data value.

可选地,判断模块,还用于计算交易元素的哈希桶(Hash bucket)值;Optionally, the judging module is also used to calculate the hash bucket (Hash bucket) value of the transaction element;

判断模块,具体用于:The judgment module is specifically used for:

根据Hash bucket值在数据存储空间查找具有相同哈希桶值的交易元素;Find transaction elements with the same hash bucket value in the data storage space according to the Hash bucket value;

从具有相同哈希桶值的交易元素中查找是否存在交易元素。Find whether there is a transaction element from the transaction elements with the same hash bucket value.

本发明实施例提供一种数据读取装置,适用于采用上述数据存储装置的交易处理系统,包括:An embodiment of the present invention provides a data reading device, which is suitable for a transaction processing system using the above-mentioned data storage device, including:

接收模块,用于接收数据查询请求,数据查询请求中包括版本信息和交易元素;The receiving module is used to receive a data query request, and the data query request includes version information and transaction elements;

查询模块,用于从交易处理系统的数据存储空间中,查询交易元素对应的版本信息的数据值;A query module, configured to query the data value of the version information corresponding to the transaction element from the data storage space of the transaction processing system;

返回模块,用于返回交易元素对应的版本信息的数据值。The return module is used to return the data value of the version information corresponding to the transaction element.

综上所述,本发明实施例提供了一种交易处理系统中的数据存储方法及装置,包括:获取数据集,数据集中携带版本信息,版本信息与交易处理步骤相对应;针对数据集中的每一个交易元素,执行如下步骤:判断数据存储空间中是否存在交易元素;若存在交易元素,则比较交易元素的第一数据值与第二数据值是否相同;第一数据值为数据集中交易元素对应的数据值,第二数据值为数据存储空间中交易元素对应的数据值;若相同,则在第二数据值对应的存储信息中增加数据集的版本信息。一次交易过程包含了多个版本的数据集,对于不同版本中的同一个交易元素,若这个交易元素的数据值并没有发生变化,则不需要重复记录此交易元素的数据值,而只需增加一个版本记录即可,从而降低了存储的交易数据的重复性,减少了存储的交易数据量,进一步地,由于存储的交易数据量的减少,使得多系统之间的数据一致性更容易得到保证。To sum up, the embodiments of the present invention provide a data storage method and device in a transaction processing system, including: acquiring a data set, the data set carries version information, and the version information corresponds to the transaction processing steps; for each data set in the data set A transaction element, perform the following steps: determine whether there is a transaction element in the data storage space; if there is a transaction element, compare whether the first data value of the transaction element is the same as the second data value; the first data value corresponds to the transaction element in the data set , the second data value is the data value corresponding to the transaction element in the data storage space; if they are the same, the version information of the data set is added to the storage information corresponding to the second data value. A transaction process contains multiple versions of data sets. For the same transaction element in different versions, if the data value of this transaction element has not changed, there is no need to repeatedly record the data value of this transaction element, but only need to increase Only one version record is enough, which reduces the repetition of stored transaction data and the amount of stored transaction data. Further, due to the reduction of stored transaction data, it is easier to ensure data consistency between multiple systems .

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without any creative effort.

图1为本发明实施例提供的一种现有技术中的数据存储方法示意图;FIG. 1 is a schematic diagram of a data storage method in the prior art provided by an embodiment of the present invention;

图2为本发明实施例提供的一种交易处理系统中的数据存储方法流程示意图;FIG. 2 is a schematic flowchart of a data storage method in a transaction processing system provided by an embodiment of the present invention;

图3为本发明实施例提供的一种数据存储结构示意图;FIG. 3 is a schematic diagram of a data storage structure provided by an embodiment of the present invention;

图4本发明实施例提供的一种数据存储流程图;Fig. 4 is a flow chart of data storage provided by an embodiment of the present invention;

图5为本发明实施例提供的一种数据读取方法流程示意图;FIG. 5 is a schematic flow chart of a data reading method provided by an embodiment of the present invention;

图6为本发明实施例提供的一种交易处理系统中的数据存储装置结构示意图;Fig. 6 is a schematic structural diagram of a data storage device in a transaction processing system provided by an embodiment of the present invention;

图7为本发明提供的一种数据读取装置结构示意图。Fig. 7 is a schematic structural diagram of a data reading device provided by the present invention.

具体实施方式detailed description

为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部份实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments . Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

图2为本发明实施例提供的一种交易处理系统中的数据存储方法流程示意图,如图2所示,包括以下步骤:Fig. 2 is a schematic flowchart of a data storage method in a transaction processing system provided by an embodiment of the present invention, as shown in Fig. 2 , including the following steps:

S201:获取数据集,数据集中携带版本信息,版本信息与交易处理步骤相对应;S201: Obtain a data set, the data set carries version information, and the version information corresponds to the transaction processing steps;

S202:针对数据集中的每一个交易元素,判断数据存储空间中是否存在交易元素;S202: For each transaction element in the data set, determine whether there is a transaction element in the data storage space;

S203:若存在交易元素,则比较第一数据值与第二数据值是否相同;第一数据值为数据集中交易元素对应的数据值,第二数据值为数据存储空间中交易元素对应的数据值;S203: If there is a transaction element, compare whether the first data value is the same as the second data value; the first data value is the data value corresponding to the transaction element in the data set, and the second data value is the data value corresponding to the transaction element in the data storage space ;

S204:若相同,则在第二数据值对应的存储信息中增加数据集的版本信息。S204: If they are the same, add the version information of the data set to the storage information corresponding to the second data value.

在具体实施过程中,本发明实施例所示的方法即适用于双方、三方交易,也适用于参与方多于三方的多方交易。数据存储空间对交易数据的存储是暂时的,当一次完整的交易确认无误后,存储空间即可删去关于此次交易的数据记录。数据存储空间可同时存储多个交易的交易数据,这些交易的交易数据相互独立,互不干扰。In the specific implementation process, the method shown in the embodiment of the present invention is not only applicable to two-party and three-party transactions, but also applicable to multi-party transactions with more than three parties involved. The data storage space stores the transaction data temporarily. When a complete transaction is confirmed to be correct, the storage space can delete the data records about this transaction. The data storage space can store the transaction data of multiple transactions at the same time, and the transaction data of these transactions are independent of each other and do not interfere with each other.

在步骤S201的具体实施过程中,一个数据集对应着一次交易数据处理结果,如图1中数据集1、数据集2、数据集3、数据集4、数据集5和数据集6,每一个都是一个数据集。数据集中携带有版本信息,版本信息与交易处理步骤相对应,如图1中的数据集1对应着第一次数据处理结果,即交易发起方生成了数据集1中的交易数据,数据集1的版本信息所对应的版本号即为1,而数据集2对应着第二次处理结果,即交易处理系统对数据集1中的交易数据的处理结果生成了数据集2中的交易数据,数据集2的版本信息所对应的版本号即为2。In the specific implementation process of step S201, a data set corresponds to a 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 Figure 1, each is a data set. The data set carries version information, and the version information corresponds to the transaction processing steps. Data set 1 in Figure 1 corresponds to the first data processing result, that is, the transaction initiator generated the transaction data in data set 1, and data set 1 The version number corresponding to the version information is 1, and the data set 2 corresponds to the second processing result, that is, the transaction processing system generates the transaction data in the data set 2 from the processing result of the transaction data in the data set 1, and the data The version number corresponding to the version information of set 2 is 2.

在步骤S202的具体实施过程中,一个数据集由多个交易元素及其之间的关系组成,如交易时间、交易金额、交易账户、交易次数等,可选地,交易元素可以根据实际应用情况及经验确定。可选地,针对每一个交易元素,按照数据名(Key)、数据长度(Len)和数据值(Value)的格式进行组织,其中,数据名与交易元素有着唯一固定的对照关系,如交易元素为交易金额,其数据名为Money,此时,Money便只能表示交易金额这一交易元素,而不能再表示其它交易元素。数据长度表示了该交易元素对应的数据存储大小,数据长度不仅可用于计算存储数据所占的空间大小以更高效地分配存储空间,对于数据调用时,数据长度也是需要调用的重要信息。数据值代表了交易元素的具体内容,例如,交易金额的数据值为1000、10、233等等,又如,交易地点的数据值为上海、北京、深圳等等。In the specific implementation process of step S202, a data set is composed of multiple transaction elements and their relationships, such as transaction time, transaction amount, transaction account, transaction times, etc. Optionally, transaction elements can be based on actual application conditions and determined by experience. Optionally, for each transaction element, organize according to the format of data name (Key), data length (Len) and data value (Value), where the data name has a unique fixed relationship with the transaction element, such as the transaction element is the transaction amount, and its data name is Money. At this time, Money can only represent the transaction element of the transaction amount, and cannot represent other transaction elements. The data length indicates the data storage size corresponding to the transaction element. The data length can not only be used to calculate the space occupied by the stored data to allocate storage space more efficiently, but also important information that needs to be called when calling the data. The data value represents the specific content of the transaction element, for example, the data value of the transaction amount is 1000, 10, 233, etc., and for example, the data value of the transaction location is Shanghai, Beijing, Shenzhen, etc.

可选地,当获取一个数据集时,针对每一个交易元素,计算交易元素的哈希桶(Hash bucket)值;根据Hash bucket值在数据存储空间查找具有相同哈希桶值的交易元素;从具有相同哈希桶值的交易元素中查找是否存在交易元素。具体实施过程中,一个Hashbucket值有可能对应着多个交易元素,可选地,针对每一个交易元素,当在数据存储空间中查找到该交易算数对应的Hash bucket值时,再根据数据名从这个Hash bucket值所对应的交易元素中查找是否包含了具有相同数据名的交易元素。通过先Hash bucket值查找,可以大大减少查找过程中的比较次数,从而加快了查找速度。可选地,也可以不利用Hashbucket值查找,即数据存储过程中并不引入Hash bucket,在数据查找时,通过比较交易元素数据名的方式判断数据存储空间中是否存有该交易元素,但这种方法的查找速度相对于借助Hash bucket值查找的方式来说大幅度降低。Optionally, when obtaining a data set, for each transaction element, calculate the hash bucket (Hash bucket) value of the transaction element; search the transaction element with the same hash bucket value in the data storage space according to the Hash bucket value; from Check whether there is a transaction element in the transaction element with the same hash bucket value. In the specific implementation process, a Hashbucket value may correspond to multiple transaction elements. Optionally, for each transaction element, when the Hash bucket value corresponding to the transaction calculation is found in the data storage space, then according to the data name from Check whether a transaction element with the same data name is included in the transaction element corresponding to the Hash bucket value. By looking up the Hash bucket value first, the number of comparisons in the lookup process can be greatly reduced, thereby speeding up the lookup. Optionally, it is also possible not to use the Hashbucket value search, that is, the Hash bucket is not introduced in the data storage process. During the data search, it is judged whether the transaction element exists in the data storage space by comparing the data name of the transaction element, but this The search speed of this method is greatly reduced compared with the method of searching with the help of Hash bucket values.

可选地,针对每一个交易元素,若数据存储空间中不存在该交易元素,则在数据存储空间中添加交易元素,并将第一数据值及所述数据集的交易版本信息存储至交易元素对应的存储位置,数据集的交易版本信息属于第一数据值的存储信息。数据存储空间中不存在该交易元素,说明该交易元素是数据处理过程中新增加的交易元素。对于新增加的交易元素,应在数据存储空间中添加对于该新增的交易元素的存储,其存储信息应包括该交易元素的数据名、数据值和版本信息,可选地,还包括该交易元素的数据长度。可选地,存储过程为:计算此交易元素的Hash bucket值,判断已有的Hash bucket值中是否有与该交易元素的Hash bucket值相同的Hash bucket值,若有,则在此Hash bucket后添加新的节点,此节点的数据名为该交易元素的数据名。若HASH桶中已有的Hash bucket值中不存在该交易元素的Hash bucket值,则在HASH桶中添加新的bucket值。Optionally, for each transaction element, if the transaction element does not exist in the data storage space, add the transaction element in the data storage space, and store the first data value and the transaction version information of the data set in the transaction element Corresponding to the storage location, the transaction version information of the data set belongs to the storage information of the first data value. The fact that the transaction element does not exist in the data storage space indicates that the transaction element is a newly added transaction element in the data processing process. For a newly added transaction element, storage for the newly added transaction element should be added in the data storage space, and its storage information should include the data name, data value and version information of the transaction element, and optionally, the transaction The data length of the element. Optionally, the stored procedure is: calculate the Hash bucket value of this transaction element, judge whether there is a Hash bucket value identical to the Hash bucket value of this transaction element among the existing Hash bucket values, and if so, after this Hash bucket Add a new node, the data name of this 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 value in the HASH bucket, add a new bucket value in the HASH bucket.

在步骤S203的具体实施过程中,针对每一个交易元素,若数据存储空间中存在该交易元素,则还需比较该交易元素的第一数据值与第二数据值是否相同,此处的第一数据值为数据集中的交易元素对应的数据值,第二数据值为数据存储空间中该交易元素对应的数据值。例如,图1中的数据集1、数据集2和数据集3,对于交易金额,若数据集2中交易金额的数据值为第一数据值,则数据集1中交易金额的数据值为第二数据值;若数据集3中交易金额的数据值为第一数据值,则数据集1和数据集2中交易金额的数据值为第二数据值,即当前版本之前所有版本中的该交易元素对应的数据值都是第二数据值,第二数据值可能存在的数量并不仅限于1。In the specific implementation process of step S203, for each transaction element, if the transaction element exists in the data storage space, it is also necessary to compare whether the first data value and the second data value of the transaction element are the same, where the first The data value is the data value corresponding to the transaction element in the data set, and the second data value is the data value corresponding to the transaction element in the data storage space. For example, for data set 1, data set 2 and data set 3 in Figure 1, for the transaction amount, if the data value of the transaction amount in data set 2 is the first data value, then the data value of the transaction amount in data set 1 is the first Two data values; if the data value of the transaction amount in data set 3 is the first data value, then the data value of the transaction amount in data set 1 and data set 2 is the second data value, that is, the transaction in all versions before the current version The data values corresponding to the elements are all second data values, and the number of possible second data values is not limited to 1.

在步骤S204的具体实施过程中,针对每一个交易元素,若该交易元素的第一数据值和第二数据值相同,则在第二数据值对应的存储信息中增加数据集的版本信息。对于存在多个第二数据值的情况下,这里的第一数据值和第二数据值相同,指的是第一数据值与任一个第二数据值相同。若第一数据值与第二数据值相同,则在第二数据值对应的存储信息中增加数据集的版本信息,例如,第一数据值value3与第二数据值value2相同,第一数据值value3对应的版本信息为版本3,第二数据值value2对应的版本信息为版本2,则第二数据值value2对应的版本信息中添加版本信息版本3。In the specific 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. For the case where there are multiple second data values, 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 second data value. If the first data value is the same as the second data value, the version information of the data set is added to the storage information corresponding to the second data value, for example, the first data value value3 is the same as the second data value value2, and the first data value value3 The corresponding version information is version 3, and the version information corresponding to the second data value value2 is version 2, then the version information version 3 is added to the version information corresponding to the second data value value2.

可选地,针对每一个交易元素,若该交易元素的第一数据值与第二数据值不同,则将第一数据值及数据集的交易版本信息存储至交易元素对应的存储位置,数据集的交易版本信息属于第一数据值的存储信息。交易元素对应的存储位置指的是根据交易元素的数据名划分的存储区域,若交易元素的第一数据值与第二数据值不同,则在交易元素的数据名对应的存储区域中添加第一数据值及其对应的交易版本信息。Optionally, for each transaction element, if the first data value of the transaction element is different from the second data value, 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 data set The transaction version information of belongs to the storage information of the first data value. The storage location corresponding to the transaction element refers to the storage area divided according to the data name of the transaction element. If the first data value of the transaction element is different from the second data value, the first data value is added to the storage area corresponding to the data name of the transaction element. Data values and their corresponding transaction version information.

图3为本发明实施例提供的一种数据存储结构示意图,如图3所示,存储结构包含了HASH桶,HASH桶采用记录哈希值的方式存储数据节点(item),每一个节点后的[v1]、[v2]和[v3]表示的是节点中记录的版本信息,分别为数据集1对应的第一版本、数据集2对应的第二版本和数据集3对应的第三版本,HASH链表的横链表示具有相同Hash bucket值的具有不同数据名的节点,竖链表表示具有相同数据名但数据值不同的节点,在数据存储过程中,只有交易元素的第一数据值和第二数据值不同或出现新增的交易元素时才会有新的节点。具体存储过程中,当一个交易元素在存储空间中查找不到时,即图3所示的HASH桶中不存在此交易元素的节点,则计算此交易元素的Hash bucket值,判断已有的Hash bucket值中是否有与该交易元素的Hash bucket值相同的Hash bucket值,若有,则在此Hash bucket后的横链中添加新的节点,此节点的数据名为该交易元素的数据名。若HASH桶中已有的Hashbucket值中不存在该交易元素的Hash bucket值,则在HASH桶中添加新的bucket值链表,如图3所示的结构,添加bucket[n+1]。可选地,如图3所示,存储结构中除了HASH桶外,还可以包括版本位图、版本列表、已用节点数、空闲节点数和空闲节点位置。其中,版本位图一个用于辅助运算的标志位,可以用于版本过滤。版本列表用于存储当前数据集已有的版本号,如图3所示的存储结构,其版本列表应存有1,2,3三个版本。已用节点数记录的是已使用的节点数目。空闲节点数记录的是空闲的节点数目。空闲节点位置记录的是未使用的空闲节点链表。需要指出的是,节点侧的存储方式是本发明实施例的主要内容,而哈希桶是对节点侧的优化,版本位图、版本列表、已用节点数、空闲节点数和空闲节点位置都是可选的内容。Fig. 3 is a kind of data storage structure schematic diagram that the embodiment of the present invention provides, as shown in Fig. 3, storage structure has included HASH bucket, and HASH bucket adopts the mode storage data node (item) of record hash value, after each node [v1], [v2], and [v3] represent the version information recorded in the node, which are the first version corresponding to dataset 1, the second version corresponding to dataset 2, and the third version corresponding to dataset 3, respectively. The horizontal chain of the HASH linked list indicates nodes with different data names with the same Hash bucket value, and the vertical linked list indicates nodes with the same data name but different data values. In the data storage process, only the first data value and the second data value of the transaction element A new node will only appear when the data value is different or a new transaction element appears. In the specific storage process, when a transaction element cannot be found in the storage space, that is, there is no node for this transaction element in the HASH bucket shown in Figure 3, the Hash bucket value of the transaction element is calculated to determine the existing Hash Whether the bucket value has the same Hash bucket value as the Hash bucket value of the transaction element, if so, add a new node in the horizontal chain after the Hash bucket, and the data name of this 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 value in the HASH bucket, add a new bucket value linked list in the HASH bucket, as shown in Figure 3, add bucket[n+1]. Optionally, as shown in FIG. 3 , in addition to the HASH bucket, the storage structure may also include a version bitmap, a version list, the number of used nodes, the number of idle nodes, and the location of idle nodes. Among them, the version bitmap is a flag bit used for auxiliary operations, which can be used for version filtering. The version list is used to store the existing version numbers of the current data set. For the storage structure shown in Figure 3, the version list should contain three versions 1, 2, and 3. The number of used nodes records the number of used nodes. The number of idle nodes records the number of idle nodes. The free node location record is the linked list of unused free nodes. It should be pointed out that the storage mode of the node side is the main content of the embodiment of the present invention, and the hash bucket is an optimization of the node side. The version bitmap, version list, number of used nodes, number of idle nodes and idle node positions are all is optional content.

图4为本发明实施例提供的一种数据存储流程图,如图4所示,包括以下步骤:Fig. 4 is a flow chart of data storage provided by an embodiment of the present invention, as shown in Fig. 4, including the following steps:

S401:获取数据集;S401: Obtain a data set;

S402:提取数据集中的一个交易元素;S402: Extract a transaction element in the data set;

S403:判断数据存储空间中是否存在该交易元素;若是,则继续步骤S404,若否,则继续步骤S408;S403: Determine whether the transaction element exists in the data storage space; if yes, proceed to step S404, if not, proceed to step S408;

S404:比较交易元素的第一数据值与第二数据值是否相同;若是,则继续步骤S405,若否,则继续步骤S409;S404: Compare whether the first data value and the second data value of the transaction element are the same; if yes, proceed to step S405, if not, proceed to step S409;

S405:在第二数据值对应的存储信息中增加数据集的版本信息;S405: Add version information of the data set to storage information corresponding to the second data value;

S406:判断所有交易要素是否存储完毕;若是,则继续步骤S407,若否,则返回步骤S402;S406: Determine whether all transaction elements have been stored; if yes, continue to step S407, if not, return to step S402;

S407:存储完毕;S407: the storage is completed;

S408:存储该交易元素;S408: store the transaction element;

S409:将第一数据值及数据集的交易版本信息存储至交易元素对应的存储位置。S409: Store the first data value and the transaction version information of the data set in a storage location corresponding to the transaction element.

图5为本发明实施例提供的一种数据读取方法流程示意图,如图5所示,包括以下步骤:Fig. 5 is a schematic flow chart of a data reading method provided by an embodiment of the present invention, as shown in Fig. 5, including the following steps:

S501:接收数据查询请求,数据查询请求中包括版本信息和交易元素;S501: Receive a data query request, where the data query request includes version information and transaction elements;

S502:从交易处理系统的数据存储空间中,查询交易元素对应的版本信息的数据值;S502: Query the data value of the version information corresponding to the transaction element from the data storage space of the transaction processing system;

S503:返回交易元素对应的版本信息的数据值。S503: Return the data value of the version information corresponding to the transaction element.

具体实施过程中,本发明实施例适用于本发明所提供的交易系统数据存储方法存储的数据。例如,当需要回滚到交易第二步时,查询需从数据存储空间中提取数据集2对应的第二版本数据。查询请求中包含了查询第二版本数据的请求,从数据存储空间中,查询版本信息为第二版本的各数据值及其数据名,可选地,还可以提取该数据值对应的数据长度,最后返回交易元素对应的版本信息的数据值时,按照数据名、数据长度和数据值组合的格式返回。可选地,对于按照本实施例所示的存储方法存储的交易数据,还可以提取指定交易元素对应不同版本时的数据值,如指定提取交易金额要素时,根据交易金额的数据名Money从数据存储空间中提取Money数据名对应的各版本的数据值,可选地,以数据名、数据长度和数据值组合的格式返回。In the specific implementation process, the embodiment of the present invention is applicable to the data stored in the transaction system data storage method provided by the present invention. For example, when it is necessary to roll back to the second step of the transaction, the query needs to extract the second version of data corresponding to dataset 2 from the data storage space. The query request includes a request to query the second version of data. From the data storage space, the query version information is each data value and its data name of the second version. Optionally, the data length corresponding to the data value can also be extracted. Finally, when returning the data value of the version information corresponding to the transaction element, it will be returned in the format of the combination of data name, data length and data value. Optionally, for the transaction data stored according to the storage method shown in this embodiment, it is also possible to extract the data value when the specified transaction element corresponds to a different version, such as specifying to extract the transaction amount element, according to the data name of the transaction amount Money from the data The data value of each version corresponding to the Money data name is extracted from the storage space, and optionally returned in the format of the combination of the data name, data length and data value.

综上所述,本发明实施例提供了一种交易处理系统中的数据存储方法,包括:获取数据集,数据集中携带版本信息,版本信息与交易处理步骤相对应;针对数据集中的每一个交易元素,执行如下步骤:判断数据存储空间中是否存在交易元素;若存在交易元素,则比较交易元素的第一数据值与第二数据值是否相同;第一数据值为数据集中交易元素对应的数据值,第二数据值为数据存储空间中交易元素对应的数据值;若相同,则在第二数据值对应的存储信息中增加数据集的版本信息。一次交易过程包含了多个版本的数据集,对于不同版本中的同一个交易元素,若这个交易元素的数据值并没有发生变化,则不需要重复记录此交易元素的数据值,而只需增加一个版本记录即可,从而降低了存储的交易数据的重复性,减少了存储的交易数据量,进一步地,由于存储的交易数据量的减少,使得多系统之间的数据一致性更容易得到保证。To sum up, the embodiment of the present invention provides a data storage method in a transaction processing system, including: obtaining a data set, the data set carries version information, and the version information corresponds to the transaction processing steps; for each transaction in the data set element, perform the following steps: determine whether there is a transaction element in the data storage space; if there is a transaction element, compare whether the first data value and the second data value of the transaction element are the same; the first data value is the data corresponding to the transaction element in the data set value, the second data value is the data value corresponding to the transaction element in the data storage space; if they are the same, the version information of the data set is added to the storage information corresponding to the second data value. A transaction process contains multiple versions of data sets. For the same transaction element in different versions, if the data value of this transaction element has not changed, there is no need to repeatedly record the data value of this transaction element, but only need to increase Only one version record is enough, which reduces the repetition of stored transaction data and the amount of stored transaction data. Further, due to the reduction of stored transaction data, it is easier to ensure data consistency between multiple systems .

基于相同的技术构思,本发明实施例还提供了一种交易处理系统中的数据存储装置,该数据存储装置可以执行上述方法实施例。图6为本发明实施例提供的一种交易处理系统中的数据存储装置结构示意图,如图6所示,数据存储装置600包括:采集模块601、判断模块602、比较模块603和存储模块604,其中:Based on the same technical concept, an embodiment of the present invention also provides a data storage device in a transaction processing system, and the data storage device can execute the above method embodiment. Fig. 6 is a schematic structural diagram of a data storage device in a transaction processing system provided by an embodiment of the present invention. 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, in:

采集模块601,用于获取数据集,数据集中携带版本信息,版本信息与交易处理步骤相对应;The collection module 601 is used to obtain a data set, the data set carries version information, and the version information corresponds to the transaction processing steps;

判断模块602,用于针对数据集中的每一个交易元素,判断数据存储空间中是否存在交易元素;Judgment module 602, for each transaction element in the data set, to determine whether there is a transaction element in the data storage space;

比较模块603,用于当数据存储空间存在交易元素时,比较第一数据值与第二数据值是否相同;第一数据值为数据集中交易元素对应的数据值,第二数据值为数据存储空间中交易元素对应的数据值;The comparison module 603 is used to compare whether the first data value and the second data value are the same when there is a transaction element in the data storage space; the first data value is the data value corresponding to the transaction element in the data set, and the second data value is the data storage space The data value corresponding to the transaction element in ;

存储模块604,用于当交易元素的第一数据值与第二数据值相同时,在第二数据值对应的存储信息中增加数据集的版本信息。The storage module 604 is configured to add the version information of the data set to the storage information corresponding to the second data value when the first data value of the transaction element is the same as the second data value.

可选地,存储模块604,还用于当数据存储空间中不存在交易元素时,在数据存储空间中添加交易元素,并将第一数据值及数据集的交易版本信息存储至交易元素对应的存储位置,数据集的交易版本信息属于第一数据值的存储信息。Optionally, the storage module 604 is also configured to add a transaction element in the data storage space when there is no transaction element in the data storage space, and store the first data value and the transaction version information of the data set in the transaction element corresponding to The storage location, the transaction version information of the data set belongs to the storage information of the first data value.

可选地,存储模块604,还用于当第一数据值与第二数据值不同时,将第一数据值及数据集的交易版本信息存储至交易元素对应的存储位置,数据集的交易版本信息属于第一数据值的存储信息。Optionally, the storage module 604 is further configured to store the first data value and the transaction version information of the data set in the storage location corresponding to the transaction element when the first data value is different from the second data value, and the transaction version information of the data set The information belongs to the stored information of the first data value.

可选地,判断模块602,还用于计算交易元素的哈希桶(Hash bucket)值;Optionally, the judging module 602 is also used to calculate the hash bucket (Hash bucket) value of the transaction element;

判断模块602,具体用于:Judgment module 602, specifically for:

根据Hash bucket值在数据存储空间查找具有相同哈希桶值的交易元素;Find transaction elements with the same hash bucket value in the data storage space according to the Hash bucket value;

从具有相同哈希桶值的交易元素中查找是否存在交易元素。Find whether there is a transaction element from the transaction elements with the same hash bucket value.

本发明实施例还提供了一种数据读取装置,,适用于采用上述数据存储装置的交易处理系统。图7为本发明提供的一种数据读取装置结构示意图,如图7所示,读取装置700包括:接收模块701、查询模块702和返回模块703,其中:The embodiment of the present invention also provides a data reading device, which is suitable for a transaction processing system using the above-mentioned data storage device. Fig. 7 is a schematic structural diagram of a data reading device provided by the present invention. As shown in Fig. 7, the reading device 700 includes: a receiving module 701, a query module 702 and a returning module 703, wherein:

接收模块701,用于接收数据查询请求,数据查询请求中包括版本信息和交易元素;A receiving module 701, configured to receive a data query request, where the data query request includes version information and transaction elements;

查询模块702,用于从交易处理系统的数据存储空间中,查询交易元素对应的版本信息的数据值;A query module 702, configured to query the data value of the version information corresponding to the transaction element from the data storage space of the transaction processing system;

返回模块703,用于返回交易元素对应的版本信息的数据值。Returning module 703, configured to return the data value of the version information corresponding to the transaction element.

综上所述,本发明实施例提供了一种交易处理系统中的数据存储方法及装置,包括:获取数据集,数据集中携带版本信息,版本信息与交易处理步骤相对应;针对数据集中的每一个交易元素,执行如下步骤:判断数据存储空间中是否存在交易元素;若存在交易元素,则比较交易元素的第一数据值与第二数据值是否相同;第一数据值为数据集中交易元素对应的数据值,第二数据值为数据存储空间中交易元素对应的数据值;若相同,则在第二数据值对应的存储信息中增加数据集的版本信息。一次交易过程包含了多个版本的数据集,对于不同版本中的同一个交易元素,若这个交易元素的数据值并没有发生变化,则不需要重复记录此交易元素的数据值,而只需增加一个版本记录即可,从而降低了存储的交易数据的重复性,减少了存储的交易数据量,进一步地,由于存储的交易数据量的减少,使得多系统之间的数据一致性更容易得到保证。To sum up, the embodiments of the present invention provide a data storage method and device in a transaction processing system, including: acquiring a data set, the data set carries version information, and the version information corresponds to the transaction processing steps; for each data set in the data set A transaction element, perform the following steps: determine whether there is a transaction element in the data storage space; if there is a transaction element, compare whether the first data value of the transaction element is the same as the second data value; the first data value corresponds to the transaction element in the data set , the second data value is the data value corresponding to the transaction element in the data storage space; if they are the same, the version information of the data set is added to the storage information corresponding to the second data value. A transaction process contains multiple versions of data sets. For the same transaction element in different versions, if the data value of this transaction element has not changed, there is no need to repeatedly record the data value of this transaction element, but only need to increase Only one version record is enough, which reduces the repetition of stored transaction data and the amount of stored transaction data. Further, due to the reduction of stored transaction data, it is easier to ensure data consistency between multiple systems .

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。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 should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。While preferred embodiments of the invention have been described, additional changes and modifications to these embodiments can be made by those skilled in the art once the basic inventive concept is appreciated. Therefore, it is intended that the appended claims be construed to cover the preferred embodiment as well as all changes and modifications which fall within the scope of the invention.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (10)

1. the date storage method in a kind of transaction processing system, it is characterised in that including:
Data set is obtained, version information is carried in the data set, the version information is corresponding with transaction processing procedure;
For each traded elements in the data set, following steps are performed:
Judge to whether there is the traded elements in data space;
If there are the traded elements, compare the first data value whether identical with the second data value;First data value is The corresponding data value of traded elements described in the data set, second data value is to be handed over described in the data space The corresponding data value of easy element;
If identical, the version information of the data set is increased in the corresponding storage information of second data value.
2. the method for claim 1, it is characterised in that also include:
If not existing the traded elements in the data space, the transaction is added in the data space Element, and the transaction version information of first data value and the data set is stored into storage corresponding to the traded elements Position, the transaction version information of the data set belongs to the storage information of first data value.
3. the method for claim 1, it is characterised in that also include:
If first data value is different from second data value, by the transaction of first data value and the data set Version information stores storage location corresponding to the traded elements, and the transaction version information of the data set belongs to described first The storage information of data value.
4. the method as described in any one of claims 1 to 3, it is characterised in that judge in data space with the presence or absence of institute Before stating traded elements, also include:
Calculate the Hash bucket Hash bucket values of the traded elements;
Judge to whether there is the traded elements in data space, including:
Traded elements with identical Hash bucket value are searched in the data space according to the Hash bucket values;
Search whether there are the traded elements from the traded elements with identical Hash bucket value.
5. a kind of method for reading data, it is characterised in that be applicable for use with the data as described in any one of Claims 1-4 and deposit The transaction processing system of method for storing, including:
Data inquiry request is received, the data inquiry request includes version information and traded elements;
From the data space of the transaction processing system, the number of the corresponding version information of the traded elements is inquired about According to value;
Return to the data value of the corresponding version information of the traded elements.
6. the data storage device in a kind of transaction processing system, it is characterised in that including:
Acquisition module, for obtaining data set, carries version information in the data set, the version information is walked with trading processing It is rapid corresponding;
Judge module, for for each traded elements in the data set, judging to whether there is in data space The traded elements;
Comparison module, for when the data space has the traded elements, comparing the first data value and the second number It is whether identical according to being worth;First data value is the corresponding data value of traded elements described in the data set, second number It is the corresponding data value of traded elements described in the data space according to value;
Memory module, for when the first data value of the traded elements is identical with the second data value, in second data Being worth in corresponding storage information increases the version information of the data set.
7. device as claimed in claim 6, it is characterised in that including:
The memory module, is additionally operable to, when not existing the traded elements in the data space, be deposited in the data Storage adds the traded elements in space, and the transaction version information of first data value and the data set is stored to institute The corresponding storage location of traded elements is stated, the transaction version information of the data set belongs to the storage letter of first data value Breath.
8. device as claimed in claim 6, it is characterised in that including:
The memory module, is additionally operable to when first data value is different from second data value, by first data The transaction version information of value and the data set stores storage location corresponding to the traded elements, the transaction of the data set Version information belongs to the storage information of first data value.
9. the device as described in any one of claim 6 to 8, it is characterised in that including:
The judge module, is additionally operable to calculate the Hash bucket Hash bucket values of the traded elements;
The judge module, specifically for:
Traded elements with identical Hash bucket value are searched in the data space according to the Hash bucket values;
Search whether there are the traded elements from the traded elements with identical Hash bucket value.
10. a kind of digital independent device, it is characterised in that be applicable for use with the data as described in any one of claim 6 to 9 and deposit The transaction processing system of storage device, including:
Receiver module, for receiving data inquiry request, the data inquiry request includes version information and traded elements;
Enquiry module, for from the data space of the transaction processing system, inquiring about the corresponding institute of the traded elements State the data value of version information;
Return to module, the data value for returning to the corresponding version information of the traded elements.
CN201611115747.7A 2016-12-07 2016-12-07 A data storage method and device in a transaction processing system Active CN106815289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611115747.7A CN106815289B (en) 2016-12-07 2016-12-07 A data storage method and device in a transaction processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611115747.7A CN106815289B (en) 2016-12-07 2016-12-07 A data storage method and device in a transaction processing system

Publications (2)

Publication Number Publication Date
CN106815289A true CN106815289A (en) 2017-06-09
CN106815289B 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 A data storage method and device in a transaction processing system

Country Status (1)

Country Link
CN (1) CN106815289B (en)

Citations (6)

* Cited by examiner, † Cited by third party
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
US20160098724A1 (en) * 2005-04-04 2016-04-07 Iii Holdings 1, Llc Systems and methods for risk triggering values
US20160350356A1 (en) * 2015-05-27 2016-12-01 Microsoft Technology Licensing, Llc Multi-version data system nested transactions isolation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160098724A1 (en) * 2005-04-04 2016-04-07 Iii Holdings 1, Llc Systems and methods for risk triggering values
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
US20160350356A1 (en) * 2015-05-27 2016-12-01 Microsoft Technology Licensing, Llc Multi-version data system nested transactions isolation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZUO XIAOQING: "Application and Research on ArcSDE-Based Spatial Data Version Management", 《IEEE》 *
周欢等: "OceanBase一致性与可用性分析", 《华东师范大学学报(自然科学版)》 *

Also Published As

Publication number Publication date
CN106815289B (en) 2020-06-23

Similar Documents

Publication Publication Date Title
CN110362632B (en) Data synchronization method, device, equipment and computer readable storage medium
CN111383005B (en) Digital currency flow tracking method and device
CN110738477B (en) Account checking method and device, computer equipment and storage medium
JP2020509445A5 (en)
CN108595563A (en) A kind of data quality management method and device
CN110378681B (en) Method, device, equipment and storage medium for determining account resource transfer path
CN112598510B (en) Resource data processing method and device
CN107944866B (en) Transaction record sorting method and computer readable storage medium
CN109981715B (en) Session management method and device
CN116167005A (en) Abnormality judgment method and device for target account, computer equipment and storage medium
CN112749167A (en) Method and device for determining broken link data and nonvolatile storage medium
CN106250501B (en) Report processing method and reporting system
CN112989216A (en) Colleague recommendation method and device, computer equipment and storage medium
CN115687599A (en) Service data processing method and device, electronic equipment and storage medium
CN112948461B (en) Method, apparatus, storage medium and program product for calendar data processing
CN115829771A (en) Financial accounting method, device, electronic equipment and storage medium
CN106815289A (en) Date storage method and device in a kind of transaction processing system
CN110363515B (en) Method, system, server and readable storage medium for entitlement card account information inquiry
CN107239548A (en) Report processing method based on SQL Server and HIVE
CN117453737A (en) Touch relation construction method, touch path query method and related devices
CN102932513B (en) A kind of business card maintaining method, device and equipment
CN113011787B (en) Virtual object allocation method and related equipment based on data clustering
CN117743409A (en) Document query method, device, computer equipment and storage medium
CN105550072B (en) A kind of method and system of data backup
CN105824824B (en) Standby call ticket collection equipment and call ticket file collection method thereof

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