CN113986915A - Data storage method and device - Google Patents

Data storage method and device Download PDF

Info

Publication number
CN113986915A
CN113986915A CN202111194320.1A CN202111194320A CN113986915A CN 113986915 A CN113986915 A CN 113986915A CN 202111194320 A CN202111194320 A CN 202111194320A CN 113986915 A CN113986915 A CN 113986915A
Authority
CN
China
Prior art keywords
transaction
data
stored
compensation
compensation transaction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111194320.1A
Other languages
Chinese (zh)
Inventor
陈美清
冯志远
顾俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Ant Blockchain Technology Shanghai 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 Alipay Hangzhou Information Technology Co Ltd, Ant Blockchain Technology Shanghai Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202111194320.1A priority Critical patent/CN113986915A/en
Publication of CN113986915A publication Critical patent/CN113986915A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Data Mining & Analysis (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data storage certificate method and device are applied to a server side which is in butt joint with a block chain, and the server side is provided with a certificate storage service for storing data on the block chain; the method comprises the following steps: under the condition that the certificate storing service fails, acquiring to-be-stored certificate data with certificate storing failure; creating a compensation transaction corresponding to the data to be stored, and storing the compensation transaction into a preset compensation transaction queue; and after the failure recovery of the evidence storing service, acquiring any compensation transaction from the compensation transaction queue, and sending any compensation transaction to the block chain through the evidence storing service so as to store the data to be stored corresponding to any compensation transaction on the block chain.

Description

Data storage method and device
Technical Field
The specification relates to the field of computer application, in particular to a data evidence storing method and device.
Background
The block chain technology, also called distributed ledger technology, is an emerging technology in which several computing devices participate in "accounting" together, and a complete distributed database is maintained together. Wherein, the data storage certificate is an important application of the block chain technology; in the service processing, a service end connected to a block chain generally needs to generate a transaction carrying service data and issue the transaction to the block chain, so that the service data is stored in the block chain. However, in the above authentication technology practical application process, the rate of generating the service data to be authenticated and the rate of authentication may not match, so if the synchronous uplink mode is adopted, the service end is likely to suspend waiting due to the need to wait for the service end to issue the transaction to the blockchain, thereby adversely affecting the service performance.
In the related art, the data uplink can be completed in an asynchronous uplink manner, and in this case, the service side does not need to wait for the service side to issue the transaction to the execution result of the blockchain, so that the adverse effect of the synchronous uplink manner on the service performance can be reduced; however, in the above manner, if the authentication service for uplink authentication fails, data loss, authentication failure, and other consequences may result.
Disclosure of Invention
In view of this, the present specification discloses a data storage method and apparatus.
According to a first aspect of an embodiment of the present specification, a data evidence storing method is disclosed, which is applied to a server that is docked with a blockchain, where the server is equipped with an evidence storing service for storing data on the blockchain; the method comprises the following steps:
under the condition that the certificate storing service fails, acquiring to-be-stored certificate data with certificate storing failure;
creating a compensation transaction corresponding to the data to be stored, and storing the compensation transaction into a preset compensation transaction queue;
and after the failure recovery of the evidence storing service, acquiring any compensation transaction from the compensation transaction queue, and sending any compensation transaction to the block chain through the evidence storing service so as to store the data to be stored corresponding to any compensation transaction on the block chain.
According to a second aspect of embodiments herein, there is disclosed a data credentialing apparatus,
the system comprises a server side and a block chain, wherein the server side is used for being in butt joint with the block chain and is provided with a certificate storing service for storing the certificate of data on the block chain; the device comprises:
the acquisition module acquires the data to be stored with the certificate failure under the condition that the certificate storage service fails;
the creating module is used for creating a compensation transaction corresponding to the data to be stored and storing the compensation transaction into a preset compensation transaction queue;
and the sending module is used for obtaining any compensation transaction from the compensation transaction queue after the failure recovery of the evidence storing service, and sending the compensation transaction to the block chain through the evidence storing service so as to store the data to be stored corresponding to the compensation transaction on the block chain.
In the above technical solution, on one hand, the created compensation transaction corresponds to the to-be-stored-certificate data that fails to store the certificate, and the compensation transaction can be sent to the block chain after the certificate storage service failure is recovered, so that the to-be-stored-certificate data that fails to store the certificate due to the certificate storage service failure can be successfully stored in the block chain, thereby avoiding the problems of data loss and the like.
On the other hand, the compensation transaction is stored in a compensation transaction queue, and the data structure of the queue has the first-in first-out read-write characteristic, so that the compensation transaction is taken out from the compensation transaction queue and sent to the block chain, the sequence of the compensation transaction stored in the compensation transaction queue can be kept, the data to be stored which is earlier failed due to failure storage can be linked and stored as soon as possible, the storage waiting time is prevented from being too long, and the user experience of the service is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this specification and together with the description, serve to explain the principles.
FIG. 1 is a diagram illustrating an exemplary configuration of a data depository system described herein;
FIG. 2 is a flowchart illustrating a data credentialing method as described herein;
fig. 3 is a diagram illustrating a structure of a correspondence table according to the present specification;
FIG. 4 is a diagram illustrating an exemplary structure of a data certification device according to the present disclosure;
fig. 5 is a diagram illustrating a structure of a server for data storage according to this specification.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure. It is to be understood that the described embodiments are only a few, and not all embodiments. All other embodiments that can be derived by one of ordinary skill in the art from one or more embodiments of the disclosure without making any creative effort shall fall within the scope of the disclosure.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of systems and methods consistent with certain aspects of the present description, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The block chain technology, also called distributed ledger technology, is an emerging technology in which several computing devices participate in "accounting" together, and a complete distributed database is maintained together. The blockchain technology has been widely used in many fields due to its characteristics of decentralization, transparency, participation of each computing device in database records, and rapid data synchronization between computing devices.
Evidence preservation is an important application of blockchains; the real data generated by the physical world can be constructed into a standard transaction (transaction) format supported by a block chain, then is issued to the block chain, the node equipment in the block chain performs consensus processing on the received transaction, and after the consensus is achieved, the node equipment serving as an accounting node in the block chain packs the transaction into a block and performs persistent evidence storage in the block chain.
Referring to fig. 1, fig. 1 is a diagram illustrating a structure of a data storage system according to the present disclosure; as shown in fig. 1, the data validation system may include a blockchain network and a server connected to the blockchain network.
The blockchain network may be a network composed of a plurality of blockchain node devices, where the blockchain node devices may be physical devices or virtual devices implemented in a server or a server cluster; for example, the block-node device may be a physical host in a server cluster, or may be a virtual machine created after a virtualization technology is performed on a server or a hardware resource carried by the server cluster. Each blockchain node can be connected together by various types of communication methods (such as TCP/IP) to form a network so as to carry one or more blockchains. In general, blockchains can be divided into three types: public chain (Public Blockchain), Private chain (Private Blockchain) and alliance chain (Consortium Blockchain). Furthermore, there may be a combination of the above types, such as private chain + federation chain, federation chain + public chain, and so on.
Among them, the most decentralized is the public chain. The public chain is represented by bitcoin and ether house, and participants (also called nodes in the block chain) joining the public chain can read data records on the chain, participate in transactions, compete for accounting rights of new blocks, and the like. Moreover, each node can freely join or leave the network and perform related operations.
Private chains are the opposite, with the network's write rights controlled by an organization or organization and the data read rights specified by the organization. Briefly, a private chain may be a weakly centralized system with strict restrictions on nodes and a small number of nodes. This type of blockchain is more suitable for use within a particular establishment.
A federation chain is a block chain between a public chain and a private chain, and "partial decentralization" can be achieved. Each node in a federation chain typically has a physical organization or organization corresponding to it; the nodes are authorized to join the network and form a benefit-related alliance, and block chain operation is maintained together.
Based on the basic characteristics of a blockchain, a blockchain is usually composed of several blocks. The time stamps corresponding to the creation time of the block are recorded in the blocks respectively, and all the blocks form a time-ordered data chain according to the time stamps recorded in the blocks strictly.
The server may be any type of server interfacing with the block link; for example, the server may be a single physical server, a server cluster formed by a plurality of physical servers, or a server virtual machine operating in a cloud service; the server and the block link point can be connected through a communication network, and the communication network can comprise a wired and/or wireless communication network; for example, the Network may be a Local Area Network (LAN), a Wide Area Network (WAN), the internet, or a combination thereof, implemented based on a wired access Network or a wireless access Network provided by an operator (such as a mobile cellular Network); those skilled in the art can select a specific implementation form of the server and a network connection mode between the server and the blockchain according to specific service requirements.
Based on the evidence storing system, the service end connected to the block chain can generate the transaction carrying the service data and issue the generated transaction to the block chain, so that the corresponding service data is stored in the block chain. However, in the actual application process of the above evidence storing technology, the rate of generating the service data to be stored and the rate of storing the evidence may not be matched; for example, during a peak period of traffic, the rate of generating traffic data to be stored may be higher, and the rate of storing block chain may be lower due to network congestion. Therefore, in the above situation, if the synchronous uplink mode is adopted, the service end is likely to suspend waiting due to the need of waiting for the service end to issue the transaction to the blockchain, which results in accumulation of a large amount of service data to be stored and further adversely affects service performance.
In the related art, the data uplink can be completed in an asynchronous uplink manner, and in this case, the service side does not need to wait for the service side to issue the transaction to the execution result of the blockchain, so that the adverse effect of the synchronous uplink manner on the service performance can be reduced; however, in the above manner, if the authentication service for uplink authentication fails, data loss, authentication failure, and other consequences may result.
Based on this, the present specification proposes a technical solution for compensating the chain credit for the data with the credit failure by using the compensation transaction corresponding to the data with the credit failure.
When the verification is realized, under the condition that the verification service fails, compensation transactions corresponding to data which fail to store the verification can be generated, and the generated compensation transactions are stored in a preset compensation transaction queue; after the failure of the evidence storing service is recovered, the compensation transaction can be extracted from the compensation transaction queue and sent to the block chain, so that the uplink evidence storing of the corresponding data with the evidence storing failure is completed.
For example, if the network communication between the server and the block chain is interrupted, the server is configured to fail to operate the evidence storing service for storing evidence in the block chain, which results in failure of storing evidence of the to-be-stored electronic evidence numbered 101010, the server may generate a compensation transaction corresponding to the to-be-stored electronic evidence numbered 101010, and store the compensation transaction in a compensation transaction queue, and after the problem of the network communication interruption is solved and the failure of the evidence storing service is recovered, the previously generated compensation transaction may be extracted from the compensation transaction queue and sent to the block chain, so as to complete uplink evidence storage of the to-be-stored electronic evidence numbered 101010.
In the above technical solution, on one hand, the created compensation transaction corresponds to the to-be-stored-certificate data that fails to store the certificate, and the compensation transaction can be sent to the block chain after the certificate-storing service failure is recovered, so that the to-be-stored-certificate data that fails to store the certificate due to the certificate-storing service failure can be successfully stored in the block chain, thereby avoiding the problems of data loss and the like.
On the other hand, the compensation transaction is stored in a compensation transaction queue, and the data structure of the queue has the first-in first-out read-write characteristic, so that the compensation transaction is taken out from the compensation transaction queue and sent to the block chain, the sequence of the compensation transaction stored in the compensation transaction queue can be kept, the data to be stored which is earlier failed due to failure storage can be linked and stored as soon as possible, the storage waiting time is prevented from being too long, and the user experience of the service is improved.
The present specification is described below with reference to specific embodiments and specific application scenarios.
Referring to fig. 2, fig. 2 is a flowchart illustrating a data evidence storing method according to an embodiment of the present disclosure, where the method may be applied to a server connected to a blockchain network, and the server may be equipped with an evidence storing service for storing data on the blockchain; the method may comprise the steps of:
s201, under the condition that the certificate storing service fails, acquiring to-be-stored certificate data with certificate storing failure;
s202, creating a compensation transaction corresponding to the data to be stored, and storing the compensation transaction into a preset compensation transaction queue;
and S203, after the failure of the evidence storing service is recovered, acquiring any compensation transaction from the compensation transaction queue, and sending the compensation transaction to the block chain through the evidence storing service so as to store the data to be stored corresponding to the compensation transaction on the block chain.
The server and the blockchain may include a server and a blockchain in the authentication system shown in fig. 1, that is, the server may be a single physical server, a server cluster formed by multiple physical servers, or a server virtual machine operating in a cloud service, and the blockchain may be a public chain, a federation chain or a private chain, or a private chain + a federation chain, a federation chain + a public chain, or the like; those skilled in the art can select the specific type of the service end and the block chain according to the specific service requirement, and the specification is not limited in detail.
The certificate storing service may include a software service configured in the server and configured to store the certificate in the block chain to which the server is connected. For example, the blockchain gateway software module in the server may be regarded as the above-mentioned certificate storage service, or the whole software of the whole process, such as the blockchain gateway software module, the transaction creation software module, the signature verification software module, and the network communication software module in the server, may be regarded as the above-mentioned certificate storage service, which is not strictly limited in this specification.
The failure of the certificate storing service can include any condition that the certificate storing service cannot work; it is to be understood that, although the aforementioned authentication service is a software service, the aforementioned authentication service failure may include both a software failure, such as a crash of an operating system of the aforementioned service end, an error in configuration of network communication parameters, a program crash of a blockchain gateway, and the like, and a hardware failure, such as a physical disconnection of a network communication line, a power interruption of the service end, a fire in a computer room, and the like. The above scheme can be applied to any fault recovery scenario of the credential storage service of the server by those skilled in the art.
In this specification, the server may obtain the data to be stored with the certificate failure in case of the fault of the certificate storing service; specifically, under the condition that the certificate storing service cannot work normally, the certificate storing service usually causes a plurality of pieces of data to be stored to fail, and the server side can acquire the data to be stored which fails to store the certificate for subsequent related operations. For example, assuming that the service end is a service end for interfacing an order evidence storage block chain in an e-commerce background, in a normal state, an evidence storage service in the service end may use an order generated by the e-commerce as data to be stored, generate a corresponding transaction and issue the transaction to the block chain, and complete uplink evidence storage for the order generated by the e-commerce; if the deposit certificate transaction fails from the time 14:00, the order generated by the e-commerce from the time 14:00 cannot normally complete the uplink deposit certificate, and thus, the order can be acquired by the server as the data to be deposited certificate which fails to be deposited.
In an embodiment, the to-be-stored data with storage failure can be obtained by analyzing the original transaction which is not successfully issued to the blockchain; the original transaction may refer to a transaction in a normal business process for carrying data to be stored and completing an uplink storage task by being issued to the blockchain. For example, assuming that the authentication service failure is caused by the unavailability of the blockchain gateway, in such a case, there may be a plurality of original transactions that have been generated and carry the data to be authenticated that cannot be issued to the blockchain due to the unavailability of the blockchain gateway; therefore, the server can analyze the original transaction which is not successfully issued to the blockchain, so as to obtain the data to be stored carried by the original transaction from the analyzed original transaction.
In an embodiment shown, the original transaction that is not successfully issued to the blockchain may include an original transaction that has an issue retry number greater than a preset threshold, and may also include an original transaction that has an expired authentication signature. For example, in a default uplink credit transaction flow, a failure retry mechanism may be preset to reduce adverse effects on the service due to events such as network temporary fluctuation, and if a failure number threshold in the failure retry mechanism is preset to 10, after a retry number of any original transaction is greater than 10, the original transaction that is not successfully issued to the blockchain may be regarded as an original transaction; in addition, the validity of the original transaction may also be managed through a signature mechanism, for example, in order to reduce the risk of theft of the original transaction, an expiration date may be set for the authentication signature carried by the original transaction, so as to ensure that the signature carried by the original transaction can pass the signature verification only within the expiration date.
It is to be understood that obtaining the data to be stored with evidence failure from the generated original transaction is only a feasible example, and those skilled in the art may also obtain the data to be stored with evidence failure by other means; for example, if the server includes a cache region for storing the to-be-stored data of the original transaction to be generated, and the failure of the certificate storing service is caused by the unavailability of the transaction creating mechanism, in this case, the to-be-stored data in the cache region cannot be normally created as the original transaction, so the server may directly obtain the to-be-stored data in the cache region as the to-be-stored data with the certificate storing failure.
It can also be understood that, before the data to be stored with the failed evidence is obtained, the server is specifically configured to determine whether the evidence storing service fails, and this specification need not be defined in detail; for example, a network monitoring software plug-in may be used to monitor a certificate storage service failure caused by a network communication problem, and a temperature sensor may be used to monitor a certificate storage service failure caused by a hardware overheating problem, and the like. The person skilled in the art can choose himself according to specific requirements with reference to the relevant technical literature.
In this specification, after the server acquires the data to be stored, a compensation transaction corresponding to the data to be stored may be created, and the created compensation transaction is stored in a preset compensation transaction queue. Specifically, the server may create a compensation transaction carrying the data to be stored with the certificate based on a transaction creation manner similar to a normal business process. Moreover, since the certificate storing service is in a failure state, the created compensation transaction corresponding to the data to be certified needs to be stored in a specific data structure for subsequent use; because the data to be stored for evidence may have the data to be stored for evidence with limited uplink sequence, the data structure of the queue can ensure the first-in first-out characteristic of the compensation transaction in the compensation transaction queue, thereby meeting the requirement of the data to be stored for the uplink sequence.
It can be understood that, if the pending evidence data also includes pending evidence data that does not require for the uplink evidence storing sequence, the non-queue storage structure can be used to store the corresponding compensation transaction, so as to utilize the characteristics of other non-queue data structures to obtain additional technical effects; for example, the compensation transactions described above may be stored in a hash table data structure, and then rapid retrieval of a large number of compensation transactions may be achieved based on the hash index of the hash table. Those skilled in the art can select other data structures to be matched with the compensation transaction queue according to specific needs, and the description need not be complete.
In this specification, after the failure of the evidence storing service is recovered, the server may obtain any compensation transaction from the compensation transaction queue, and send the compensation transaction to the block chain through the evidence storing service, so as to store the data to be stored corresponding to the compensation transaction on the block chain. Specifically, after the failure of the evidence storing service is recovered, the transaction can be uplink processed, and at this time, the service end can obtain the previously stored compensation transaction from the compensation transaction queue and send the obtained compensation transaction to the block chain; because the compensation transaction actually carries the data to be certified, which is failed to be certified due to the failure of the certification service, the carried data to be certified also completes the uplink certification process after the compensation transaction is sent to the block chain; continuing with the above-mentioned e-commerce order evidence storage scenario as an example, assuming that there is an order a generated at 14:02 time that needs to be stored with evidence, but there is an evidence storage service failure at that time, the server generates a compensation transaction carrying the order a and stores the compensation transaction in a compensation transaction queue, and assuming that after the evidence storage service failure at 15:00 time is recovered, the server can take out the compensation transaction carrying the order a from the compensation transaction queue and send the compensation transaction to the blockchain, so that the order a completes the uplink evidence storage.
It can be understood that, similar to the foregoing identification process for the failure of the credential storage service, the specific recovery manner of the failure of the credential storage service and the manner of determining whether the failure of the credential storage service has been recovered need not to be limited in this specification, and those skilled in the art can select an appropriate specific recovery manner of the failure of the credential storage service and determine whether the failure of the credential storage service has been recovered according to the business application scenario.
In one embodiment, the compensation transaction queue may include a compensation transaction sub-queue corresponding to a plurality of priorities; when adding the created compensation transaction to the compensation transaction queue, the priority of the created compensation transaction may be determined first, and then the created compensation transaction is added to the compensation transaction sub-queue corresponding to the determined priority according to the determined priority. For example, the compensation transaction queue may include three compensation transaction sub-queues, which respectively correspond to a high priority, a medium priority and a low priority, and if the priority of the created compensation transaction is a high priority, the created compensation transaction may be stored in the compensation transaction sub-queue corresponding to the high priority, and if the priority of the created compensation transaction is a low priority, the created compensation transaction may be stored in the compensation transaction sub-queue corresponding to the low priority. The priority of the created compensation transaction can be determined by identifying a preset priority identifier in the corresponding data to be stored; in addition, a source of the data to be stored and certified, such as a customer ID, corresponding to the created compensation transaction can be determined first, and then the priority of the created compensation transaction is indirectly determined according to the priority corresponding to the customer ID; the person skilled in the art may choose, by himself or herself, the way in which to specifically determine the priority of the created compensation transaction, with reference to the related art, without this specification needing to be further restricted.
It should be understood that the above-mentioned high, medium and low third-level priority mechanism is only a feasible example for description, and those skilled in the art can design and select the priority mechanism and set up the compensation transaction sub-queue corresponding to multiple priorities according to specific business requirements.
In an embodiment shown, the server may further store a corresponding relationship between the data to be stored and the compensation transaction, so as to provide feedback to the certificate storing initiator; specifically, after the compensation transaction corresponding to the data to be stored is created, the server may store a corresponding relationship between the data to be stored and the corresponding compensation transaction in a preset corresponding relationship table; after any compensation transaction is sent to the block chain through the evidence storing service, the server side can inquire the data to be stored corresponding to any compensation transaction in the preset corresponding relation table; and generating certificate storage success feedback information corresponding to the inquired data to be stored, and sending the certificate storage success feedback information to a certificate storage initiator corresponding to the inquired data to be stored. Generally, the correspondence between the data to be stored and the certificate storing initiator can be directly carried in the data to be stored, for example, the identifier of the corresponding certificate storing initiator is retained in the data to be stored, or can be stored in the history record of the certificate storing request; therefore, after the data to be stored corresponding to any compensation transaction is inquired through the corresponding relation table, the storage initiator corresponding to the inquired data to be stored can be further determined.
Referring to fig. 3, fig. 3 is a diagram illustrating a structure of the correspondence table, in this case, a data serial number of data to be stored and a transaction serial number of a corresponding compensation transaction are stored in the correspondence table; for example, assuming that the transaction serial number of the compensation transaction acquired from the compensation transaction queue after the failure recovery of the evidence storing service by the server is B00002, the data serial number of the corresponding to-be-stored-evidence data may be determined to be a00002, and after the compensation transaction with the transaction serial number of B00002 is sent to the block chain, the server may generate evidence storing success feedback information corresponding to the to-be-stored-evidence data with the data serial number of a00002, and send the evidence storing success feedback information to an evidence storing initiator corresponding to the to-be-stored-evidence data with the data serial number of a00002, for example, a service background of a certain electronic company.
Through the scheme, under the condition that a large time span exists between the occurrence of the fault and the recovery of the fault, the evidence storing initiator is given definite evidence storing success feedback information so that the evidence storing initiator can be definite the latest state of the data to be stored which is subjected to the uplink evidence storing failure previously, the service flow is more perfect, and the user experience is improved.
The above contents are all embodiments of the data evidence storage method in the present specification. The present specification also provides embodiments of a corresponding data credentialing apparatus as follows:
referring to fig. 4, fig. 4 is a diagram illustrating a structure of a data evidence storing device according to an embodiment of the present disclosure, where the device may be applied to a server connected to a blockchain network, and the server may be equipped with an evidence storing service for storing data on the blockchain; the apparatus may include the following modules:
the obtaining module 401 obtains the data to be stored with the certificate failure in case of the fault of the certificate storage service;
a creating module 402, configured to create a compensation transaction corresponding to the data to be stored, and store the compensation transaction in a preset compensation transaction queue;
the sending module 403, after the failure of the evidence storing service is recovered, obtains any compensation transaction from the compensation transaction queue, and sends the compensation transaction to the block chain through the evidence storing service, so as to store the evidence to be stored corresponding to the compensation transaction on the block chain.
In an embodiment shown in the present disclosure, the obtaining module 401 may further obtain the data to be credited for crediting failure by analyzing the original transaction that is not successfully issued to the blockchain; the original transaction may refer to a transaction in a normal business process for carrying data to be stored and completing an uplink storage task by being issued to the blockchain. For example, assuming that the authentication service failure is caused by the unavailability of the blockchain gateway, in such a case, there may be a plurality of original transactions that have been generated and carry the data to be authenticated that cannot be issued to the blockchain due to the unavailability of the blockchain gateway; therefore, the server can analyze the original transaction which is not successfully issued to the blockchain, so as to obtain the data to be stored carried by the original transaction from the analyzed original transaction.
In an embodiment shown, the original transaction that is not successfully issued to the blockchain may include an original transaction that has an issue retry number greater than a preset threshold, and may also include an original transaction that has an expired authentication signature. For example, in a default uplink credit transaction flow, a failure retry mechanism may be preset to reduce adverse effects on the service due to events such as network temporary fluctuation, and if a failure number threshold in the failure retry mechanism is preset to 10, after a retry number of any original transaction is greater than 10, the original transaction that is not successfully issued to the blockchain may be regarded as an original transaction; in addition, the validity of the original transaction may also be managed through a signature mechanism, for example, in order to reduce the risk of theft of the original transaction, an expiration date may be set for the authentication signature carried by the original transaction, so as to ensure that the signature carried by the original transaction can pass the signature verification only within the expiration date.
In one embodiment, the compensation transaction queue may include a compensation transaction sub-queue corresponding to a plurality of priorities; when the created compensation transaction is added to the compensation transaction queue, the creating module 402 may first determine the priority of the created compensation transaction, and then add the created compensation transaction to the compensation transaction sub-queue corresponding to the determined priority according to the determined priority. For example, the compensation transaction queue may include three compensation transaction sub-queues, which respectively correspond to a high priority, a medium priority and a low priority, and if the priority of the created compensation transaction is a high priority, the created compensation transaction may be stored in the compensation transaction sub-queue corresponding to the high priority, and if the priority of the created compensation transaction is a low priority, the created compensation transaction may be stored in the compensation transaction sub-queue corresponding to the low priority. The priority of the created compensation transaction can be determined by identifying a preset priority identifier in the corresponding data to be stored; in addition, a source of the data to be stored and certified, such as a customer ID, corresponding to the created compensation transaction can be determined first, and then the priority of the created compensation transaction is indirectly determined according to the priority corresponding to the customer ID; the person skilled in the art may choose, by himself or herself, the way in which to specifically determine the priority of the created compensation transaction, with reference to the related art, without this specification needing to be further restricted.
It should be understood that the above-mentioned high, medium and low third-level priority mechanism is only a feasible example for description, and those skilled in the art can design and select the priority mechanism and set up the compensation transaction sub-queue corresponding to multiple priorities according to specific business requirements.
In an embodiment shown, the apparatus may further include a storage module for storing a correspondence between the data to be stored and the compensation transaction, and a feedback module for providing feedback to the storage initiator; specifically, the storage module may store a correspondence between the data to be stored and the corresponding compensation transaction in a preset correspondence table after the compensation transaction corresponding to the data to be stored is created; the feedback module may query, in the preset correspondence table, to-be-stored data corresponding to any compensation transaction after sending the compensation transaction to the block chain through the certificate storing service; and generating certificate storage success feedback information corresponding to the inquired data to be stored, and sending the certificate storage success feedback information to a certificate storage initiator corresponding to the inquired data to be stored. Generally, the correspondence between the data to be stored and the certificate storing initiator can be directly carried in the data to be stored, for example, the identifier of the corresponding certificate storing initiator is retained in the data to be stored, or can be stored in the history record of the certificate storing request; therefore, after the data to be stored corresponding to any compensation transaction is inquired through the corresponding relation table, the storage initiator corresponding to the inquired data to be stored can be further determined.
Embodiments of the present disclosure also provide a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned data storage method when executing the program.
Fig. 5 is a schematic diagram illustrating a more specific hardware structure of a computing device according to an embodiment of the present disclosure, where the computing device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.
The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 1050 includes a path that transfers information between various components of the device, such as processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.
It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.
Embodiments of the present specification further provide a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the aforementioned data storage method.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
From the above description of the embodiments, it is clear to those skilled in the art that the embodiments of the present disclosure can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the embodiments of the present specification may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments of the present specification.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described apparatus embodiments are merely illustrative, and the modules described as separate components may or may not be physically separate, and the functions of the modules may be implemented in one or more software and/or hardware when implementing the embodiments of the present disclosure. And part or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is only a specific embodiment of the embodiments of the present disclosure, and it should be noted that, for those skilled in the art, a plurality of modifications and decorations can be made without departing from the principle of the embodiments of the present disclosure, and these modifications and decorations should also be regarded as the protection scope of the embodiments of the present disclosure.

Claims (11)

1. A data evidence storing method is applied to a server end which is in butt joint with a block chain, and the server end carries evidence storing service for storing evidence of data on the block chain; the method comprises the following steps:
under the condition that the certificate storing service fails, acquiring to-be-stored certificate data with certificate storing failure;
creating a compensation transaction corresponding to the data to be stored, and storing the compensation transaction into a preset compensation transaction queue;
and after the failure recovery of the evidence storing service, acquiring any compensation transaction from the compensation transaction queue, and sending any compensation transaction to the block chain through the evidence storing service so as to store the data to be stored corresponding to any compensation transaction on the block chain.
2. The method of claim 1, after creating a compensation transaction corresponding to the data to be credited, the method further comprising:
storing the corresponding relation between the data to be stored and the corresponding compensation transaction into a preset corresponding relation table;
after sending the any compensation transaction to the blockchain through the credentialing service, the method further comprises:
inquiring the data to be stored corresponding to any compensation transaction in the preset corresponding relation table;
and generating certificate storage success feedback information corresponding to the inquired data to be stored, and sending the certificate storage success feedback information to a certificate storage initiator corresponding to the inquired data to be stored.
3. The method of claim 1, the obtaining of forensic data for forensic failure, comprising:
analyzing the original transaction which is not successfully issued to the block chain, and acquiring the data to be stored and verified carried in the original transaction.
4. The method of claim 3, the original transaction that failed to be successfully issued to the blockchain comprising:
issuing the original transaction with the retry number larger than a preset threshold value; and/or
And carrying the original transaction with the expired authentication signature.
5. The method of claim 1, the compensation transaction queue comprising a compensation transaction sub-queue corresponding to a plurality of priorities; the storing of the compensation transaction into a preset compensation transaction queue comprises:
determining a priority of the compensation transaction;
and storing the compensation transaction into a compensation transaction sub-queue corresponding to the priority.
6. A data evidence storing device is applied to a server side which is in butt joint with a block chain, and the server side is provided with evidence storing service for storing data on the block chain; the device comprises:
the acquisition module acquires the data to be stored with the certificate failure under the condition that the certificate storage service fails;
the creating module is used for creating a compensation transaction corresponding to the data to be stored and storing the compensation transaction into a preset compensation transaction queue;
and the sending module is used for obtaining any compensation transaction from the compensation transaction queue after the failure recovery of the evidence storing service, and sending the compensation transaction to the block chain through the evidence storing service so as to store the data to be stored corresponding to the compensation transaction on the block chain.
7. The apparatus of claim 6, the apparatus further comprising:
the storage module is used for storing the corresponding relation between the data to be stored and the corresponding compensation transaction to a preset corresponding relation table after the compensation transaction corresponding to the data to be stored is established;
the feedback module is used for inquiring the data to be stored corresponding to any compensation transaction in the preset corresponding relation table after the verification storage service sends the any compensation transaction to the block chain; and generating certificate storage success feedback information corresponding to the inquired data to be stored, and sending the certificate storage success feedback information to a certificate storage initiator corresponding to the inquired data to be stored.
8. The apparatus of claim 6, the acquisition module further to:
analyzing the original transaction which is not successfully issued to the block chain, and acquiring the data to be stored and verified carried in the original transaction.
9. The device of claim 8, the original transaction that failed to be successfully issued to the blockchain comprising:
issuing the original transaction with the retry number larger than a preset threshold value; and/or
And carrying the original transaction with the expired authentication signature.
10. The apparatus of claim 9, the compensation transaction queue comprising a compensation transaction sub-queue corresponding to a plurality of priorities; the storage module further:
determining a priority of the compensation transaction;
and storing the compensation transaction into a compensation transaction sub-queue corresponding to the priority.
11. A computer device comprising at least a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 5 when executing the program.
CN202111194320.1A 2021-10-13 2021-10-13 Data storage method and device Pending CN113986915A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111194320.1A CN113986915A (en) 2021-10-13 2021-10-13 Data storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111194320.1A CN113986915A (en) 2021-10-13 2021-10-13 Data storage method and device

Publications (1)

Publication Number Publication Date
CN113986915A true CN113986915A (en) 2022-01-28

Family

ID=79738517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111194320.1A Pending CN113986915A (en) 2021-10-13 2021-10-13 Data storage method and device

Country Status (1)

Country Link
CN (1) CN113986915A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108376106A (en) * 2018-02-01 2018-08-07 中国工商银行股份有限公司 A kind of block chain message feedback method and system
CN109344000A (en) * 2018-08-16 2019-02-15 北京京东尚科信息技术有限公司 Block chain network service platform restores tool and its fault handling method, storage medium
CN110022217A (en) * 2019-04-04 2019-07-16 深圳大通实业股份有限公司 A kind of credible deposit system of advertisement media business datum based on block chain
CN110222085A (en) * 2019-05-07 2019-09-10 北京奇艺世纪科技有限公司 A kind of processing method, device and storage medium for depositing card data
US20190356470A1 (en) * 2018-05-16 2019-11-21 International Business Machines Corporation Identifying faults in a blockchain ordering service
WO2020015978A1 (en) * 2018-07-17 2020-01-23 Siemens Aktiengesellschaft Traffic shaping for transactions of a distributed database system
CN111552676A (en) * 2020-04-26 2020-08-18 北京众享比特科技有限公司 Block chain based evidence storing method, device, equipment and medium
CN112383441A (en) * 2019-11-18 2021-02-19 杭州趣链科技有限公司 Data processing method based on block chain, database uplink system and node equipment
WO2021043144A1 (en) * 2019-09-03 2021-03-11 杭州趣链科技有限公司 Blockchain-based evidence collection service system
WO2021197105A1 (en) * 2020-04-02 2021-10-07 支付宝(杭州)信息技术有限公司 Blockchain-based information release

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108376106A (en) * 2018-02-01 2018-08-07 中国工商银行股份有限公司 A kind of block chain message feedback method and system
US20190356470A1 (en) * 2018-05-16 2019-11-21 International Business Machines Corporation Identifying faults in a blockchain ordering service
WO2020015978A1 (en) * 2018-07-17 2020-01-23 Siemens Aktiengesellschaft Traffic shaping for transactions of a distributed database system
CN109344000A (en) * 2018-08-16 2019-02-15 北京京东尚科信息技术有限公司 Block chain network service platform restores tool and its fault handling method, storage medium
CN110022217A (en) * 2019-04-04 2019-07-16 深圳大通实业股份有限公司 A kind of credible deposit system of advertisement media business datum based on block chain
CN110222085A (en) * 2019-05-07 2019-09-10 北京奇艺世纪科技有限公司 A kind of processing method, device and storage medium for depositing card data
WO2021043144A1 (en) * 2019-09-03 2021-03-11 杭州趣链科技有限公司 Blockchain-based evidence collection service system
CN112383441A (en) * 2019-11-18 2021-02-19 杭州趣链科技有限公司 Data processing method based on block chain, database uplink system and node equipment
WO2021197105A1 (en) * 2020-04-02 2021-10-07 支付宝(杭州)信息技术有限公司 Blockchain-based information release
CN111552676A (en) * 2020-04-26 2020-08-18 北京众享比特科技有限公司 Block chain based evidence storing method, device, equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
屈艳玲;: "区块链技术驱动图书馆智慧服务增值路径的再选择――基于Fabric构建自律型借阅环境", 图书馆学研究, no. 07, 15 April 2020 (2020-04-15) *

Similar Documents

Publication Publication Date Title
CN108389129B (en) Transaction execution method and device based on block chain and electronic equipment
US11469891B2 (en) Expendable cryptographic key access
EP3639465B1 (en) Improved hardware security module management
CN110188096B (en) Index creating method, device and equipment for data record
CN110049087B (en) Credibility verification method, system, device and equipment of alliance chain
EP3720045A1 (en) Blockchain-based data verification method and apparatus, and electronic device
CN110163755B (en) Block chain-based data compression and query method and device and electronic equipment
CN110046901B (en) Credibility verification method, system, device and equipment of alliance chain
CN110020854B (en) Data evidence storage method and system based on multiple block chain networks
CN110334153B (en) Authorization method, system, device and equipment in block chain type account book
CN110022345B (en) Method, system, device and equipment for processing request in alliance chain
CN110020846B (en) Transfer service processing method and system
CN111400112A (en) Writing method and device of storage system of distributed cluster and readable storage medium
CN110197075A (en) Resource access method, calculates equipment and storage medium at device
WO2021008400A1 (en) Blockchain-based batch data processing method, apparatus, and storage medium
US10936734B2 (en) Blockchain authorization
CN110008203A (en) A kind of data clearing method, device and equipment
WO2022206439A1 (en) Method and apparatus for providing cross-chain message
CN111444216A (en) Data block deleting method based on centralized block chain type account book
CN114039733B (en) Certificate storage service transfer method, device and equipment for alliance chains
CN112291321B (en) Service processing method, device and system
CN115619395A (en) Data processing method based on block chain and related equipment
CN110225103B (en) Service recommendation method, device and equipment
CN113949632B (en) Dynamic node configuration method and device for block chain
CN113986915A (en) Data storage method and device

Legal Events

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