Information storage method and information verification method

By forming a transaction chain in the transaction system and utilizing the target transaction data and summary information of other transactions, the problem of transaction information security is solved, and efficient information storage and tamper protection are achieved.

CN114677134BActive Publication Date: 2026-01-02CHINA UNIONPAY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210243417.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2026-01-02
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

In large-scale transaction systems, the security of transaction information is difficult to guarantee with existing technologies, and existing encrypted storage and multi-location storage methods cannot effectively prevent transaction information from being maliciously tampered with.

Method used

By acquiring target transaction data and summary information of other transactions, target summary information is determined, and target transaction data, summary information, and target summary information are stored to form a transaction chain, increasing the difficulty of tampering.

Benefits of technology

This effectively ensures the security of transaction information. When an unauthorized user tampers with a transaction, they would need to alter the entire transaction chain, greatly increasing the difficulty and improving the security of information storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114677134B_ABST
    Figure CN114677134B_ABST
Patent Text Reader

Abstract

The application discloses an information storage method and an information verification method. The information storage method comprises the following steps: obtaining target transaction data corresponding to a target transaction, and first digest information corresponding to first transaction data, wherein the first transaction data is transaction data corresponding to other transactions except the target transaction; determining target digest information corresponding to the target transaction data according to the target transaction data and the first digest information; and storing target transaction information corresponding to the target transaction, wherein the target transaction information comprises the target transaction data, the first digest information and the target digest information. According to the embodiment of the application, the security of information storage can be effectively ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of information processing, and particularly relates to an information storage method and an information verification method. BACKGROUND

[0002] With the rapid development of Internet technology, emerging technologies such as mobile payment are increasingly widely applied to people's daily life, and the transaction scale of the transaction system also increases year by year. Therefore, the historical transaction information stored by the transaction system often exceeds hundreds of billions. In such a large transaction volume, how to effectively retrieve and find whether a transaction record is illegally tampered with has become a great challenge.

[0003] In the prior art, the transaction information is stored in the form of encryption storage of part of the transaction field, summary of all transaction information, or multi-storage of transaction information, so as to increase the difficulty of malicious modification of the transaction information. However, the above information storage methods cannot effectively guarantee the security of information storage. SUMMARY

[0004] The embodiments of the present application provide an information storage method and an information verification method, which can effectively guarantee the security of information storage.

[0005] In a first aspect, the embodiments of the present application provide an information storage method, which comprises:

[0006] obtaining target transaction data corresponding to a target transaction, and first summary information corresponding to first transaction data, wherein the first transaction data is transaction data corresponding to other transactions than the target transaction;

[0007] determining target summary information corresponding to the target transaction data according to the target transaction data and the first summary information;

[0008] storing target transaction information corresponding to the target transaction, wherein the target transaction information comprises the target transaction data, the first summary information and the target summary information.

[0009] In a second aspect, the embodiments of the present application provide an information verification method, which comprises:

[0010] obtaining target transaction information corresponding to a target transaction, wherein the target transaction information comprises target transaction data corresponding to the target transaction, first summary information corresponding to first transaction data, and target summary information corresponding to the target transaction data, and the first transaction data is transaction data corresponding to other transactions than the target transaction;

[0011] determining second summary information according to the target transaction data and the first summary information;

[0012] in the case that the second summary information is identical to the target summary information, determining whether at least one transaction information including the target summary information exists in the database;

[0013] in the case that the at least one transaction information exists, determining that the target transaction information is verified.

[0014] In a third aspect, an embodiment of the present application provides an information storage device, which comprises:

[0015] a first obtaining module, configured to obtain target transaction data corresponding to a target transaction and first summary information corresponding to first transaction data, wherein the first transaction data is transaction data corresponding to other transactions than the target transaction;

[0016] a first determining module, configured to determine target summary information corresponding to the target transaction data according to the target transaction data and the first summary information;

[0017] a first storage module, configured to store target transaction information corresponding to the target transaction after determining the target summary information corresponding to the target transaction data, wherein the target transaction information comprises the target transaction data, the first summary information and the target summary information.

[0018] In a fourth aspect, an embodiment of the present application provides an information verification device, which comprises:

[0019] a second obtaining module, configured to obtain target transaction information corresponding to a target transaction, wherein the target transaction information comprises target transaction data corresponding to the target transaction, first summary information corresponding to first transaction data and target summary information corresponding to the target transaction data, and the first transaction data is transaction data corresponding to other transactions than the target transaction;

[0020] a second determining module, configured to determine second summary information according to the target transaction data and the first summary information;

[0021] a third determining module, configured to determine whether at least one transaction information including the target summary information exists in the database in the case that the second summary information is identical to the target summary information;

[0022] a fourth determining module, configured to determine that the target transaction information is verified in the case that the at least one transaction information exists.

[0023] In a fifth aspect, an embodiment of the present application provides an electronic device, which comprises a processor and a memory storing computer program instructions.

[0024] The processor implements the steps of the information storage method as described in any one of the embodiments of the first aspect and / or the information verification method as described in any one of the embodiments of the second aspect when executing the computer program instructions.

[0025] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores computer program instructions. The computer program instructions are executed by a processor to implement the steps of the information storage method as described in any one of the embodiments of the first aspect and / or the information verification method as described in any one of the embodiments of the second aspect.

[0026] The information storage method in the embodiments of the present application determines the target summary information by the target transaction data and the first summary information, so that the target summary information depends on not only the target transaction data but also the first transaction data. In this way, since the summary information of each transaction data is associated with the summary information of other transaction data, a transaction chain of transaction information of multiple transactions is formed. Therefore, if an illegal user wants to tamper with the transaction information of a transaction, he needs to tamper with not only the transaction information of the transaction but also all the transaction information on the entire chain after the transaction, which is difficult to achieve. In this way, the information storage method in the embodiments of the present application can effectively ensure the security of information storage. BRIEF DESCRIPTION OF DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments of the present application will be briefly introduced. Those skilled in the art can obtain other drawings according to these drawings without creating any creative labor.

[0028] Figure 1 is a flowchart of an information storage method provided by an embodiment of the present application;

[0029] Figure 2 is a schematic diagram of an example of a transaction storage result provided by the present application;

[0030] Figure 3 is a schematic diagram of an example of a thread extinction process provided by the present application;

[0031] Figure 4 is a flowchart of an information storage method provided by another embodiment of the present application;

[0032] Figure 5 is a flowchart of an information verification method provided by an embodiment of the present application;

[0033] Figure 6 is a flowchart of an information verification method provided by another embodiment of the present application;

[0034] Figure 7 is a structural schematic diagram of an information storage device provided by an embodiment of the present application;

[0035] Figure 8 is a structural schematic diagram of an information verification device provided by an embodiment of the present application;

[0036] Figure 9 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0037] The features and exemplary embodiments of various aspects of the present application will be described in detail below with reference to the drawings. To make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, but not to limit the present application. The present application can be implemented without some of the specific details by those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.

[0038] It should be noted that, in this document, relational terms such as first and second and the like can only be used to distinguish one entity or action from another entity or action, and do not necessarily require or imply that there is any such actual relationship or order between these entities or actions. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed or other elements inherent to such process, method, article or apparatus. Without more limitations, an element defined by the statement "comprising" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0039] In the prior art, the encryption storage of part of the fields in the transaction data, the summary of all transaction data or the multi-storage of transaction information are usually used to increase the difficulty of malicious modification of transaction information. The above methods will be described in detail below.

[0040] First, part of the fields in the transaction data is encrypted and stored, that is, in order to prevent the transaction information from being tampered with, part of the core fields in the transaction data is encrypted by using an encryption algorithm, and then the ciphertext information is stored. Since the encryption key is highly confidential, it is difficult for an illegal user to tamper with this part of the field information. However, it will also cause difficulty in query for normal users, that is, normal users are difficult to retrieve the transaction meeting the conditions through part of the information of these fields. In addition, since all fields are not encrypted, it is also impossible to prevent and discover whether other fields are tampered with.

[0041] Second, the transaction data is summarized, that is, the data of all fields of the transaction is summarized, and the summary information is stored in the database together with the transaction data. Subsequently, the summary information of all fields of the transaction is compared with the summary information of the transaction stored in the database, so as to identify whether the transaction information is tampered with. However, an illegal user can tamper with the data by re-summarizing the transaction data after modifying the data of part of the fields of the transaction.

[0042] Third, the transaction information is stored in different places, that is, the transaction information is stored in different places, and the historical information in different places can be compared regularly to identify the tampered information. However, the information comparison workload is large, the comparison time is long, and it is not suitable for the scene of massive information checking.

[0043] In order to solve the problems in the prior art, the embodiments of the present application provide an information storage method and an information verification method. First, the information storage method provided by the embodiments of the present application is introduced.

[0044] Figure 1 is a flowchart of the information storage method provided by an embodiment of the present application. As shown in Figure 1 , the information storage method can specifically include the following steps:

[0045] S110, obtaining target transaction data corresponding to a target transaction, and first summary information corresponding to first transaction data, wherein the first transaction data is transaction data corresponding to other transactions except the target transaction;

[0046] S120, determining target summary information corresponding to the target transaction data according to the target transaction data and the first summary information;

[0047] S130, storing target transaction information corresponding to the target transaction, the target transaction information including the target transaction data, the first summary information and the target summary information.

[0048] Thus, by jointly determining the target summary information from the target transaction data and the first summary information, the target summary information is dependent not only on the target transaction data, but also on the first transaction data. In this way, since the summary information of each transaction data is associated with the summary information of other transaction data, a transaction chain of transaction information of multiple transactions is formed. Therefore, if an illegal user wants to tamper with the transaction information of a transaction, not only the transaction information of the transaction needs to be tampered with, but also all the transaction information on the entire chain after the transaction needs to be tampered with, which is difficult to achieve. In this way, by using the information storage method in the embodiments of the present application, the security of information storage can be effectively ensured.

[0049] The specific implementation of each of the above steps will be described below.

[0050] In some embodiments, in S110, the target transaction can be a current transaction to be stored, and the target transaction data can include all transaction data of the target transaction. In addition, the first transaction data can be transaction data of a previous transaction of the target transaction, or transaction data of a next transaction of the target transaction. The previous transaction can be a transaction that occurs before the target transaction or a transaction whose transaction information has been saved before the target transaction. In addition, the next transaction can be a transaction that occurs after the target transaction, but whose transaction information has been saved before the target transaction.

[0051] As an example, the persistence layer of the transaction system can receive the target transaction data sent by the transaction module and perform data processing. The persistence layer can be an application layer that directly deals with the database and keeps synchronization. The persistence layer can be an intermediate layer added between the storage layer and the business layer in the standard three-layer architecture.

[0052] On the other hand, the way to obtain the first summary information corresponding to the first transaction data can include querying from the database or obtaining from the current processing thread, which is not limited here.

[0053] In some embodiments, in S120, the target summary information corresponding to the target transaction data can be obtained by information extraction from all transaction information in the target transaction data and the first summary information. The information extraction methods include but are not limited to using Hash algorithm for summary extraction, using a pre-trained feature extraction model for feature extraction, etc.

[0054] In some embodiments, S120 can specifically include:

[0055] According to the Hash algorithm, the target transaction data and the first summary information are summarized to obtain the target summary information corresponding to the target transaction data.

[0056] In this way, by determining the target summary information jointly by the target transaction data and the first summary information, i.e., each transaction saves the summary information of the previous transaction, the previous transaction and the current transaction can be sequentially connected into a transaction chain. Therefore, if a user wants to tamper with a transaction, he not only needs to modify the transaction, but also needs to modify all the transactions in the entire chain after the transaction, which is difficult to achieve, so the security of information storage can be effectively guaranteed.

[0057] In some embodiments, in S130, after obtaining the target summary information, the processing thread can store the target transaction data, the first summary information and the target summary information together as target transaction information of the target transaction into the database. The target transaction information can include information of three fields, which can be specifically all transaction data field for storing the target transaction data, PreHash field for storing the first summary information, and CurHash field for storing the target summary information. That is, the finally stored transaction information can include three parts, one part is all transaction data of the current transaction to be stored, one part is data summary information of other stored transactions, and one part is data summary information of the current transaction.

[0058] Therefore, each transaction in the transaction system can be connected together by the summary information CurHash of the current transaction and the summary information PreHash of other stored transactions to form a transaction chain. Since the transaction T+1 includes the summary information of the transaction T, if the transaction T is changed, the PreHash saved in the transaction T+1 will not be consistent with the CurHash of the transaction T, so that whether the transaction T is tampered with can be quickly identified.

[0059] In some embodiments, the above S110 of obtaining the first summary information corresponding to the first transaction data can specifically include:

[0060] determining whether the historical summary information is recorded in the processing thread, the historical summary information being summary information corresponding to historical transaction data, the historical transaction data being transaction data of a previous transaction corresponding to the target transaction;

[0061] in a case where the historical summary information is recorded in the processing thread, determining the historical summary information as the first summary information.

[0062] Here, the processing thread can be a thread that is currently processing the transaction data of the target transaction and storing the processed transaction information. The processing thread can include a ThreadLocal variable for recording historical summary information, i.e., the value of the ThreadLocal in the current processing thread can cache the transaction data of the previous transaction before the transaction to be stored. In this way, when the processing thread performs the transaction information storage operation of the target transaction, the processing thread can directly obtain the summary information of the previous transaction from the ThreadLocal.

[0063] In addition, in some embodiments, after S130, the information storage method provided by the embodiments of the present application can further include:

[0064] record the target summary information as the updated historical summary information in the processing thread.

[0065] Here, when storing the transaction information of the current transaction in the database, the summary information of the current transaction can be recorded as new historical summary information in the ThreadLocal of the processing thread. When the processing thread continues to process and store the transaction information of the next transaction, the summary information recorded in the ThreadLocal of the processing thread can be used as the summary information of the other transaction referenced by the transaction, i.e., the first summary information.

[0066] For example, if the currently recorded historical summary information in the ThreadLocal of the processing thread is H1, and the target summary information of the current transaction is H2, after the transaction information of the current transaction is stored, the historical summary information recorded in the ThreadLocal will be updated to H2 for calling when storing the transaction information of the next transaction. An example of the transaction storage result is shown in Figure 2

[0067] In this way, by using the summary information of the previous transaction saved in the ThreadLocal of the current thread, and updating the summary information of the previous transaction with the summary information of the current transaction after each transaction record is completed, the thread can quickly obtain the summary information of the previous transaction without searching the database when recording the transaction, and the problem of information transmission between two independent transactions is solved at low cost.

[0068] Since the processing thread of the transaction system can be dynamically added or reduced, the generation or disappearance of the thread can occur between the transaction information storage of two transactions. Based on this, in some embodiments, after the step of determining whether the historical summary information is recorded in the processing thread, the information storage method provided by the embodiments of the present application can further include:

[0069] ​In the case that no historical summary information is recorded in the processing thread, it is determined whether there is idle summary information in the database;

[0070] In the case that there is idle summary information in the database, the idle summary information is determined as the first summary information;

[0071] In the case that there is no idle summary information in the database, preset information is determined as the first summary information.

[0072] Here, the current processing thread can be a newly started processing thread. Therefore, no historical summary information can be recorded in the processing thread, i.e., no summary information of the last transaction is saved in the current thread ThreadLocal. Alternatively, when the transaction system is a newly started system, all processing threads in the system can be newly started processing threads, i.e., no historical summary information can be recorded in all processing threads.

[0073] Based on this, in the case that no historical summary information is recorded in the processing thread, it can be determined from the database whether there is idle summary information. The idle summary information can be summary information that is not referenced by subsequent transactions. Since the processing thread has a life cycle, there can be a phenomenon that the summary information recorded in the ThreadLocal of a thread is not referenced by other transactions due to the death of the thread. If a thread dies, the target summary information recorded in the ThreadLocal of the thread can be stored in the database.

[0074] Exemplarily, in the case that no historical summary information is recorded in the processing thread, if there is idle summary information in the database, the idle summary information can be determined as the first summary information.

[0075] Of course, there can be no idle summary information in the database. For example, when the transaction system is first put into operation, there is no idle summary information in the database. When there is no idle summary information in the database, preset information can be determined as the first summary information. For example, the first summary information can be assigned a default value INIT_HASH.

[0076] In this way, by determining the idle summary information or the preset information as the first summary information, it can be ensured that the first summary information can exist in any case, thereby guaranteeing the continuity and integrity of the entire transaction chain.

[0077] In some embodiments, after the idle summary information is determined as the first summary information, the information storage method provided by the embodiments of the present application can further include:

[0078] Deleting the idle summary information from the database.

[0079] In this way, by deleting the idle summary information after the idle summary information is referenced by other transaction information, the occupation of the database memory can be reduced while ensuring the continuity of the entire transaction chain.

[0080] Based on this, in order to ensure the integrity of the transaction information storage, in some embodiments, the information storage method provided by the embodiments of the present application can further include:

[0081] determining whether the death event corresponding to the processing thread is monitored;

[0082] In the case where the death event corresponding to the processing thread is monitored, the historical summary information stored in the processing thread is stored as idle summary information into the database.

[0083] Exemplarily, in the life cycle of each processing thread, each processing thread for storing transaction information can be monitored, and after it is determined that the death event corresponding to a certain processing thread is monitored, that is, when a certain processing thread dies, the historical summary information recorded in the ThreadLocal of the processing thread can be transferred to the database, and the historical summary information can be stored as idle summary information. When a new thread is started, the new thread can also query the idle summary information from the database, and the queried idle summary information can be saved to the ThreadLocal of the new thread, so as to be referenced when generating the transaction information of a new transaction.

[0084] An example of a schematic diagram of the above thread death process can be as shown in Figure 3 .

[0085] It should be noted that when multiple processing threads are processed in parallel, since the information recorded in the ThreadLocal of different processing threads does not interfere with each other, even in a multi-thread scenario, the situation of historical summary information conflict can be avoided. However, when the thread dies, the transaction information of two transactions may both reference the same idle information, for example, when the target processing thread dies, two or more new threads can simultaneously use a certain idle summary information as the first summary information.

[0086] In this way, by storing the historical summary information stored in the processing thread as idle summary information into the database when the death event corresponding to the processing flow is monitored, the idle summary information can be continued to be used when a new thread is started, so that the chain of concatenating the target summary information CurHash and the first summary information PreHash can be avoided to be broken, and the integrity of the transaction information storage can be ensured.

[0087] In order to better describe the entire information storage scheme, based on the above embodiments, a flowchart of the information storage method provided by the present application can be as shown in Figure 4 .

[0088] In Figure 4 In the method, after receiving the transaction data sent by the transaction module, the persistence layer of the transaction system determines whether the summary information H1 of the previous transaction is saved in the current processing thread ThreadLocal. If the ThreadLocal has saved the summary information H1 of the previous transaction, the H1 is set to the PreHash field of the current transaction. On the other hand, if the summary information H1 of the previous transaction is not saved in the current processing thread ThreadLocal, it is determined whether there is idle transaction summary information H2 in the current system. If there is idle transaction summary information H2, the H2 is set to the PreHash field of the current transaction. On the other hand, if there is no idle transaction summary information H2 in the current system, the PreHash field of the current transaction can take the default value INIT_HASH.

[0089] After determining the Prehash, the processing thread extracts the summary information CurHash of the current transaction by using the Hash algorithm on the whole information of the current transaction and the value of the Prehash field.

[0090] Based on this, the processing thread saves the whole information of the current transaction, the summary information of the previous transaction PreHash field value and the summary information CurHash field value of the current transaction into the database as the transaction information corresponding to the current transaction. And the processing thread updates and saves the value of the summary information CurHash of the current transaction into the ThreadLocal for use when processing the next transaction as the PreHash field value of the next transaction.

[0091] It should be noted that if the above H2 is set to the PreHash field of the current transaction, the H2 can be deleted from the idle transaction summary table stored in the memory of the current system database after the H2 is set to the PreHash field of the current transaction.

[0092] In order to effectively verify whether the transaction information is tampered, the embodiment of the application also provides an information verification method, which is described in detail below.

[0093] Figure 5 is a flowchart of an information storage method provided by an embodiment of the application. Please refer to Figure 5 The information verification method can include the following steps:

[0094] S510, target transaction information corresponding to the target transaction is acquired, the target transaction information includes target transaction data corresponding to the target transaction, first summary information corresponding to the first transaction data, and target summary information corresponding to the target transaction data, the first transaction data is transaction data corresponding to other transactions except the target transaction;

[0095] S520, second summary information is determined according to the target transaction data and the first summary information;

[0096] S530, in the case that the second summary information is the same as the target summary information, it is determined whether there is at least one transaction information including the target summary information in the database;

[0097] S540, in the case that there is at least one transaction information, it is determined that the target transaction information is verified.

[0098] Therefore, in the transaction information verification link, by verifying whether the second summary information determined by the target transaction data and the first summary information is the same as the stored target summary information, and determining whether there is at least one transaction information including the target summary information in the database, the two conditions are used to determine whether the target transaction information is tampered, so that the transaction integrity check can be quickly and effectively completed, the transaction information is prevented from being tampered, and the security of the transaction information is improved.

[0099] The specific implementation modes of the above steps are introduced below.

[0100] In some embodiments, in S510, the target transaction information can be the target transaction information corresponding to the target transaction stored by the above information storage method.

[0101] In some embodiments, in S520, the second summary information can be obtained by abstracting the target transaction data and the first summary information according to the Hash algorithm. For example, the target transaction data can be all transaction information of the Nth transaction, and the first summary information can be the summary information H(n-1) in the last transaction information recorded in the transaction. Then, the all transaction information of the Nth transaction and the summary information H(n-1) of the last transaction information recorded in the transaction can be abstracted to obtain the summary information H(n').

[0102] In some embodiments, in S530, the second summary information can be the same as or different from the target summary information. If the second summary information H(n') is the same as the target summary information H(n), it is further determined whether the second summary information H(n') and the target summary information H(n), that is, the second summary information H(n'), are illegally tampered. At this time, it can be determined whether the target summary information H(n), that is, the second summary information H(n'), is referenced by other transactions in the database.

[0103] In some embodiments, in S540, if the previous transaction summary information corresponding to the N+1th transaction is the same as H(n) (i.e. H(n’)), it can be considered that the transaction is not tampered, i.e. it can be determined that the target transaction information verification is passed. Of course, if the illegal user also modifies the N+1th transaction, the tampering behavior of the illegal user can be found by continuing to verify the N+1th transaction.

[0104] Based on this, in some embodiments, the information storage method provided by the embodiments of the present application can further include:

[0105] In the case that the second summary information is different from the target summary information, or there is no at least one transaction information, it is determined that the target transaction information verification is not passed.

[0106] Here, if the second summary information H(n’) is not the same as the target summary information H(n), it can be indicated that the Nth transaction has been tampered by an illegal user, i.e. it can be determined that the target transaction information verification is not passed. Or, if the previous transaction summary information corresponding to the N+1th transaction is not the same as H(n), it can be considered that the transaction has been tampered, i.e. it can be determined that the target transaction information verification is not passed.

[0107] As can be seen from the above embodiments, if an illegal user wants to tamper with a transaction without being found by the transaction verification module, not only the transaction needs to be modified, but also all the transactions on the entire chain after the transaction need to be modified. In actual business, the workload of modifying the transactions on the entire transaction chain is very large, and it is difficult to achieve in a concealed manner.

[0108] In order to better describe the entire information verification method, based on the above embodiments, the flowchart of the information verification method provided by the present application can be as shown in Figure 6 .

[0109] In Figure 6In the embodiment, the summary H(n') is calculated based on the summary H(n-1) of the previous transaction and the transaction information of the Nth transaction. After obtaining the summary H(n'), it is determined whether the summary H(n') is consistent with the summary information H(n) of the Nth transaction recorded in the database. If not, it is determined that the transaction information of the Nth transaction is illegally tampered with. If yes, it is further determined whether the summary H(n-1) of the previous transaction, the summary H(n) of the Nth transaction, and the transaction information of the Nth transaction are illegally modified. That is, it is determined whether the summary H(n) of the Nth transaction, i.e., the calculated H(n'), is referenced by other transactions. If the summary of the previous transaction corresponding to the transaction N+1 is the same as H(n), i.e., H(n'), it is determined that the transaction is not tampered with.

[0110] Therefore, according to the description of the information verification step, if a user wants to tamper with a transaction without being discovered by the transaction verification module, the user needs to modify not only the transaction but also all the transactions in the entire transaction chain after the transaction. In actual business, the workload of modifying the transactions in the entire transaction chain is very large, and it is difficult to achieve in a hidden manner. Therefore, the embodiments of the present application can effectively prevent and identify whether the transaction record is tampered with.

[0111] Based on the same inventive concept, the present application further provides an information storage device. The information storage device will be described in detail below. Figure 7

[0112] Figure 7 FIG. 7 is a structural schematic diagram of an information storage device according to an embodiment of the present application.

[0113] As shown in FIG. 7, the information storage device 700 can include: Figure 7

[0114] The first obtaining module 701 is configured to obtain target transaction data corresponding to a target transaction and first summary information corresponding to first transaction data, wherein the first transaction data is transaction data corresponding to other transactions than the target transaction.

[0115] The first determining module 702 is configured to determine target summary information corresponding to the target transaction data according to the target transaction data and the first summary information.

[0116] The first storage module 703 is configured to store target transaction information corresponding to the target transaction after determining the target summary information corresponding to the target transaction data, wherein the target transaction information includes the target transaction data, the first summary information, and the target summary information.

[0117] The information storage device 700 is described in detail as follows.​​

[0118] In some embodiments, the first obtaining module 701 can specifically include:

[0119] a first determining sub-module, configured to determine whether historical summary information is recorded in the processing thread, the historical summary information being summary information corresponding to historical transaction data, the historical transaction data being transaction data of a previous transaction corresponding to the target transaction;

[0120] a second determining sub-module, configured to determine the historical summary information as the first summary information in a case where the historical summary information is recorded in the processing thread.

[0121] In some embodiments, the first obtaining module 701 can specifically further include:

[0122] a third determining sub-module, configured to determine whether there is idle summary information in the database in a case where the historical summary information is not recorded in the processing thread;

[0123] a fourth determining sub-module, configured to determine the idle summary information as the first summary information in a case where there is the idle summary information in the database;

[0124] a fifth determining sub-module, configured to determine preset information as the first summary information in a case where there is no idle summary information in the database.

[0125] In some embodiments, the first obtaining module 701 can specifically further include:

[0126] a deleting sub-module, configured to delete the idle summary information from the database after the idle summary information is determined as the first summary information.

[0127] In some embodiments, the information storage apparatus 700 can further include:

[0128] a second storage module, configured to record the target summary information as updated historical summary information in the processing thread.

[0129] In some embodiments, the information storage apparatus 700 can further include:

[0130] a fifth determining module, configured to determine whether a death event corresponding to the processing thread is listened to;

[0131] a third storage module, configured to store the historical summary information stored in the processing thread as idle summary information in the database in a case where the death event corresponding to the processing thread is listened to.

[0132] In some embodiments, the first determining module 702 can specifically include:

[0133] The extraction submodule is configured to extract target summary information corresponding to the target transaction data according to a Hash algorithm based on the target transaction data and the first summary information.

[0134] Thus, the target summary information is determined based on the target transaction data and the first summary information, so that the target summary information depends on not only the target transaction data but also the first transaction data. In this way, since the summary information of each transaction data is associated with the summary information of other transaction data, a transaction chain in which the transaction information of multiple transactions is associated with each other can be formed. Therefore, if an illegal user tampers with the transaction information of a transaction, the illegal user needs to tamper with not only the transaction information of the transaction but also all the transaction information on the entire chain after the transaction, which is difficult to achieve. In this way, the information storage method and the information verification method in the embodiments of the present application can effectively ensure the security of information storage.

[0135] Based on the same inventive concept, the present application further provides an information verification device. The information verification device will be described in detail below in combination with Figure 8 the information verification method.

[0136] Figure 8 FIG. 8 is a structural schematic diagram of an information verification device provided in an embodiment of the present application.

[0137] As Figure 8 shown, the information verification device 800 can include:

[0138] The second acquisition module 801 is configured to acquire target transaction information corresponding to a target transaction, the target transaction information including target transaction data corresponding to the target transaction, first summary information corresponding to first transaction data, and target summary information corresponding to the target transaction data, the first transaction data being transaction data corresponding to other transactions than the target transaction;

[0139] The second determination module 802 is configured to determine second summary information based on the target transaction data and the first summary information;

[0140] The third determination module 803 is configured to determine whether at least one transaction information including the target summary information exists in the database in a case where the second summary information is the same as the target summary information.

[0141] The fourth determination module 804 is configured to determine that the target transaction information passes verification in a case where the at least one transaction information exists.

[0142] In some embodiments, the information verification device 800 can further include:

[0143] The sixth determination module is configured to determine that the target transaction information fails verification in a case where the second summary information is different from the target summary information or the at least one transaction information does not exist.

[0144] Therefore, in the transaction information verification link, by verifying whether the second summary information determined by the target transaction data and the first summary information is the same as the stored target summary information, and whether there is at least one transaction information including the target summary information in the database, the two conditions are used to determine whether the target transaction information is tampered, so that the transaction integrity check can be quickly and effectively completed, the transaction information is prevented from being tampered, and the security of the transaction information is improved.

[0145] Figure 9 is a hardware structure schematic diagram of an electronic device provided by an embodiment of the present application.

[0146] The electronic device 900 can include a processor 901 and a memory 902 storing computer program instructions.

[0147] Specifically, the processor 901 can include a central processing unit (CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or can be configured to implement one or more integrated circuits of the embodiments of the present application.

[0148] The memory 902 can include a mass storage for data or instructions. By way of example and not limitation, the memory 902 can include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 902 can include removable or non-removable (or fixed) media. Where appropriate, the memory 902 can be internal or external to the integrated gateway disaster recovery device. In certain embodiments, the memory 902 is non-volatile solid-state memory.

[0149] In certain embodiments, the memory can include read-only memory (ROM), random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software that, when executed (e.g., by one or more processors), is operable to perform operations described with reference to the methods according to an aspect of the present application.

[0150] The processor 901 reads and executes the computer program instructions stored in the memory 902 to implement any one of the information storage methods and information verification methods in the above embodiments.

[0151] In some examples, the electronic device 900 can further include a communication interface 903 and a bus 904. As shown, the processor 901, the memory 902, the communication interface 903 are connected through the bus 904 and complete communication between each other. Figure 9

[0152] The communication interface 903 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the present application.

[0153] The bus 904 includes hardware, software or both to couple components of the electronic device to each other. By way of example, and not limitation, the bus 904 can include an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (ISA) bus, an InfiniBand (IB) interconnect, a low pin count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standards board (VLB) bus, or another suitable bus or combination of two or more of these. Where appropriate, the bus 904 can include one or more buses. Although the present embodiments describe and show a particular bus, the present application contemplates any suitable bus or interconnect.

[0154] For example, the electronic device 900 can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc.

[0155] The electronic device 900 can perform the information storage method and the information verification method in the embodiments of the present application, thereby realizing the information storage method, the information verification method, the information storage device and the information verification device described in combination Figures 1 to 8 with the above description.

[0156] ​In addition, in combination with the information storage method and the information verification method in the above embodiments, the embodiments of the present application can provide a computer readable storage medium for implementation. The computer readable storage medium has computer program instructions stored thereon. The computer program instructions are executed by a processor to implement any one of the information storage method and the information verification method in the above embodiments. Examples of the computer readable storage medium include non-transitory computer readable storage media, such as a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, etc.

[0157] It should be noted that the present application is not limited to the specific configurations and processes described above and shown in the drawings. For the sake of brevity, detailed descriptions of known methods are omitted. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order of the steps, after understanding the spirit of the present application.

[0158] The functional blocks shown in the structural block diagrams described above can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, etc. When implemented in software, the elements of the present application are program or code segments used to perform the required tasks. The program or code segments can be stored in a machine readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The "machine readable medium" can include any medium capable of storing or transmitting information. Examples of the machine readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segments can be downloaded via a computer network such as the Internet, an intranet, etc.

[0159] It should also be noted that the exemplary embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be performed simultaneously.

[0160] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0161] The above description is only specific implementation of the present application. For the convenience and brevity of description, the specific working process of the above-described system, module and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described herein. It should be understood that the protection scope of the present application is not limited in this way. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed in the present application, and these modifications or replacements should be covered within the protection scope of the present application.

Claims

1. An information storage method characterized by, The method comprises: obtaining target transaction data corresponding to a target transaction and first summary information corresponding to first transaction data, wherein the first transaction data is transaction data corresponding to a transaction other than the target transaction; determining target summary information corresponding to the target transaction data according to the target transaction data and the first summary information; storing target transaction information corresponding to the target transaction, the target transaction information comprising the target transaction data, the first summary information and the target summary information; wherein obtaining the first summary information corresponding to the first transaction data comprises: determining whether historical summary information is recorded in a variable of a processing thread for recording historical summary information, the historical summary information being summary information corresponding to historical transaction data, the historical transaction data being transaction data of a previous transaction corresponding to the target transaction, the processing thread being a thread currently processing the transaction data of the target transaction and storing the processed transaction information; in the case where the historical summary information is recorded in the variable of the processing thread for recording historical summary information, determining the historical summary information as the first summary information; in the case where no historical summary information is recorded in the processing thread, determining whether there is idle summary information in a database; in the case where the idle summary information exists in the database, determining the idle summary information as the first summary information; in the case where the idle summary information does not exist in the database, determining preset information as the first summary information; after storing the target transaction information corresponding to the target transaction, the method further comprises: recording the target summary information as updated historical summary information in the processing thread.

2. The method of claim 1, wherein, after determining the idle summary information as the first summary information, the method further comprises: deleting the idle summary information from the database.

3. The method according to claim 1 or 2, characterized in that, The method further comprises: determining whether a termination event corresponding to the processing thread is listened to; in the case where the termination event corresponding to the processing thread is listened to, storing the historical summary information stored in the processing thread as idle summary information in the database.

4. The method of claim 1, wherein, The determination of the target summary information corresponding to the target transaction data according to the target transaction data and the first summary information comprises: performing summary extraction on the target transaction data and the first summary information according to a Hash algorithm to obtain the target summary information corresponding to the target transaction data.

5. An information verification method characterized by comprising: The method comprises: obtaining target transaction information corresponding to a target transaction, the target transaction information including target transaction data corresponding to the target transaction, first summary information corresponding to first transaction data, and target summary information corresponding to the target transaction data, the first transaction data being transaction data corresponding to a transaction other than the target transaction, the first summary information being historical summary information obtained from a variable of a processing thread for recording historical summary information, or idle summary information obtained from a database, or preset information, the processing thread being a thread for storing the target transaction information, and the target summary information being recorded in the processing thread as updated historical summary information; determining second summary information according to the target transaction data and the first summary information; in a case where the second summary information is the same as the target summary information, determining whether there is at least one transaction information including the target summary information in a database; in a case where the at least one transaction information exists, determining that the target transaction information is verified.

6. The method of claim 5, wherein, The method further includes: in a case where the second summary information is different from the target summary information, or the at least one transaction information does not exist, determining that the target transaction information is not verified.

7. An information storage device, characterized by comprising: The apparatus includes: a first obtaining module, configured to obtain target transaction data corresponding to a target transaction, and first summary information corresponding to first transaction data, wherein the first transaction data is transaction data corresponding to a transaction other than the target transaction; a first determining module, configured to determine target summary information corresponding to the target transaction data according to the target transaction data and the first summary information; a first storing module, configured to store target transaction information corresponding to the target transaction after determining the target summary information corresponding to the target transaction data, the target transaction information including the target transaction data, the first summary information, and the target summary information; The first obtaining module is specifically configured to: determine whether historical summary information is recorded in a variable of a processing thread for recording historical summary information, the historical summary information being summary information corresponding to historical transaction data, the historical transaction data being transaction data of a previous transaction corresponding to the target transaction, the processing thread being a thread for processing transaction data of the target transaction and storing processed transaction information; in a case where the historical summary information is recorded in the variable of the processing thread for recording historical summary information, determine the historical summary information as the first summary information; in a case where no historical summary information is recorded in the processing thread, determine whether idle summary information exists in a database; in a case where the idle summary information exists in the database, determine the idle summary information as the first summary information; in a case where the idle summary information does not exist in the database, determine preset information as the first summary information. The first storage module is further configured to record the target summary information as updated historical summary information into the processing thread after storing the target transaction information corresponding to the target transaction.

8. An information verification apparatus characterized by comprising: The apparatus comprises: The second acquisition module is configured to acquire target transaction information corresponding to a target transaction, the target transaction information comprising target transaction data corresponding to the target transaction, first summary information corresponding to first transaction data, and target summary information corresponding to the target transaction data, the first transaction data being transaction data corresponding to other transactions than the target transaction, the first summary information being historical summary information acquired from a variable of a processing thread for recording historical summary information, or idle summary information acquired from a database, or preset information, the processing thread being a thread for storing the target transaction information, and the target summary information being recorded into the processing thread as updated historical summary information; The second determination module is configured to determine second summary information according to the target transaction data and the first summary information; The third determination module is configured to determine whether there is at least one transaction information comprising the target summary information in a database in the case that the second summary information is identical to the target summary information; The fourth determination module is configured to determine that the target transaction information is verified in the case that the at least one transaction information exists.

9. An electronic device, comprising: The device comprises a processor and a memory storing computer program instructions; The processor, when executing the computer program instructions, implements the steps of the information storage method according to any one of claims 1-4 and / or the information verification method according to any one of claims 5-6.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer program instructions, and the computer program instructions, when executed by a processor, implement the steps of the information storage method according to any one of claims 1-4 and / or the information verification method according to any one of claims 5-6.

Citation Information

Patent Citations

  • Data processing method, data processing server and storage medium

    CN107994991A

  • Log information processing method and device, electronic equipment and storage medium

    CN112711570A