Movatterモバイル変換


[0]ホーム

URL:


CN115098521B - Data consistency processing method, device, terminal and storage medium - Google Patents

Data consistency processing method, device, terminal and storage medium

Info

Publication number
CN115098521B
CN115098521BCN202210733917.7ACN202210733917ACN115098521BCN 115098521 BCN115098521 BCN 115098521BCN 202210733917 ACN202210733917 ACN 202210733917ACN 115098521 BCN115098521 BCN 115098521B
Authority
CN
China
Prior art keywords
data
chain
request
blockchain
uplink
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210733917.7A
Other languages
Chinese (zh)
Other versions
CN115098521A (en
Inventor
谭锦志
张延楠
施德强
尚璇
胡麦芳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
Filing date
Publication date
Application filed by Hangzhou Qulian Technology Co LtdfiledCriticalHangzhou Qulian Technology Co Ltd
Priority to CN202210733917.7ApriorityCriticalpatent/CN115098521B/en
Publication of CN115098521ApublicationCriticalpatent/CN115098521A/en
Application grantedgrantedCritical
Publication of CN115098521BpublicationCriticalpatent/CN115098521B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Abstract

The application is applicable to the technical field of blockchains and provides a data consistency processing method, a device, a terminal and a storage medium, wherein the method comprises the steps of obtaining a service data uplink request, extracting a target data uplink request record with a first flag bit as a first value from a system database when abnormal writing of the service data to be uplink to the blockchain is detected, searching target data matched with the target data uplink request record from the blockchain, and determining that the service data in the system database and the uplink data in the blockchain have consistency based on the target data, wherein the flag position corresponding to the target data uplink request record is a second value. The scheme can reduce service pressure of the service party and the block chain server, and simultaneously ensures timeliness of data synchronization.

Description

Data consistency processing method, device, terminal and storage medium
Technical Field
The application belongs to the technical field of blockchain, and particularly relates to a data consistency processing method, a device, a terminal and a storage medium.
Background
In blockchain services, data uplinking requires invocation of a contract third party service to implement. When a business party invokes a blockchain intelligent contract, if service restart or network congestion is met, the completion state of contract execution on the chain cannot be timely acquired, so that the consistency of the data of the business party and the data of the blockchain cannot be ensured.
The existing processing means is to pull the whole data, namely, the whole data is compared and updated through interfaces provided by contracts at certain intervals, so that the consistency of the data of a business party and the data of a blockchain is ensured, the data processing performance is reduced due to the fact that the data quantity is increased in the process, the whole data is required to be pulled regularly, the server pressure of the business party and the blockchain service is increased, and the influence of network fluctuation is large.
The existing processing means also has the function of triggering the active pulling of the data when the user needs to query the data, namely, firstly removing the block chain to acquire account book data when the user queries the data or operates the data, so that the business side data can keep consistency with the data of the block chain. However, the method has certain hysteresis in keeping the consistency of the data, and brings inconvenience to the user data operation.
Disclosure of Invention
The embodiment of the application provides a data consistency processing method, a device, a terminal and a storage medium, which are used for solving the problem that the prior art can increase the server pressure of a business party and a block chain service and has hysteresis in data synchronization when the data consistency is maintained.
A first aspect of an embodiment of the present application provides a data consistency processing method, including:
acquiring a service data uplink request, wherein the service data uplink request is used for indicating to write service data to be uplink into a block chain;
When the condition that the business data to be uplink is written into the block chain and is abnormal is detected, extracting a target data uplink request record with a first value of a zone bit from a system database, wherein the system database stores business data, a data uplink request record corresponding to the business data uplink request and the zone bit for indicating the processing state of the business data uplink request;
searching target data matched with the target data uplink request record from the blockchain;
and based on the target data, when the service data in the system database and the uplink data in the blockchain are consistent, the mark position corresponding to the target data uplink request record is set to be a second value.
A second aspect of an embodiment of the present application provides a data consistency processing apparatus, including:
the system comprises an acquisition module, a block chain and a data processing module, wherein the acquisition module is used for acquiring a service data uplink request, and the service data uplink request is used for indicating to write service data to be uplink into the block chain;
The system comprises a block chain, an extraction module, a system database, a processing module and a processing module, wherein the block chain is used for writing service data to be uplink into the block chain, and the extraction module is used for extracting a target data uplink request record with a flag bit as a first value from the system database when the abnormality occurs in writing the service data to be uplink into the block chain;
the searching module is used for searching target data matched with the target data uplink request record from the blockchain;
and the state value setting module is used for setting the mark position corresponding to the target data uplink request record as a second value when the service data in the system database and the uplink data in the block chain are determined to have consistency based on the target data.
A third aspect of an embodiment of the present application provides a terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect when executing the computer program.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method according to the first aspect.
A fifth aspect of the application provides a computer program product for causing a terminal to carry out the steps of the method of the first aspect described above when the computer program product is run on the terminal.
In the embodiment of the application, the record information of the service data uplink request is formed at the service end, and the processing state of the service data uplink request is marked by means of the adjustment of the value of the flag bit, so that when the condition that the service data to be uplink is written into the blockchain is abnormal is detected, the target data matched with the record of the target data uplink request is searched from the blockchain based on the record information of the service data uplink request and the corresponding flag bit, and further the consistency between the service data in the service end and the data in the blockchain is determined, the service pressure of a service party and a blockchain server is reduced, and the timeliness of data synchronization is ensured.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating a data consistency processing method according to an embodiment of the present application;
FIG. 2 is a second flowchart of a data consistency processing method according to an embodiment of the present application;
FIG. 3 is a block diagram of a data consistency processing apparatus according to an embodiment of the present application;
Fig. 4 is a block diagram of a terminal according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. 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 be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In particular implementations, the terminals described in embodiments of the application include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad). It should also be appreciated that in some embodiments, the device is not a portable communication device, but a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad).
In the following discussion, a terminal including a display and a touch sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The terminal supports various applications such as one or more of a drawing application, a presentation application, a word processing application, a website creation application, a disk burning application, a spreadsheet application, a game application, a telephone application, a video conferencing application, an email application, an instant messaging application, an exercise support application, a photograph management application, a digital camera application, a digital video camera application, a web browsing application, a digital music player application, and/or a digital video player application.
Various applications that may be executed on the terminal may use at least one common physical user interface device such as a touch sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal may be adjusted and/or changed between applications and/or within the corresponding applications. In this way, the common physical architecture (e.g., touch-sensitive surface) of the terminal may support various applications with user interfaces that are intuitive and transparent to the user.
It should be understood that, the sequence number of each step in this embodiment does not mean the execution sequence, and the execution sequence of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiment of the present application in any way.
In order to illustrate the technical scheme of the application, the following description is made by specific examples.
Referring to fig. 1, fig. 1 is a flowchart of a data consistency processing method according to an embodiment of the present application. As shown in fig. 1, a data consistency processing method includes the following steps:
and step 101, acquiring a service data uplink request.
The service data uplink request is used to indicate that service data to be uplink is written to the blockchain.
In the embodiment of the application, the execution main body of the data consistency processing method is a service end. The service end is, for example, a personal computer equipped with a service system, a user mobile phone, etc. The business system is, for example, a transaction system, a transfer system, etc.
Correspondingly, in step 101, the business data is transaction data, transfer data, etc., and more specifically includes information such as account information of both sides of the transaction, transaction amount, account information of both sides of the transfer, transfer amount, etc.
And 102, when detecting that the business data to be uplink is written into the blockchain and is abnormal, extracting a target data uplink request record with a flag bit as a first value from a system database.
The system database stores service data, a data uplink request record corresponding to the service data uplink request and a flag bit for indicating the processing state of the service data uplink request.
The service end needs to store service data, and the service data needs to have data consistency with the service data stored on the block chain.
Specifically, when service data is generated in the service end, the service data to be uplink needs to be written into the blockchain based on a corresponding triggered service data uplink request, if the service data to be uplink is successfully written into the blockchain, the service end obtains feedback information of the blockchain, analyzes and obtains data parameters corresponding to the data to be uplink based on the feedback information, performs data synchronization on the service end based on the data parameters, and specifically needs to synchronize the data parameters corresponding to the data to be uplink into the service data of the system database, so that the service end data and the on-chain data are kept synchronous.
The data uplink request record stored in the system database is generated corresponding to each service data uplink request. Different data uplink request records form a service data uplink request record table in a system database.
The data uplink request record may include request information such as request time and request identifier corresponding to each service data uplink request. Each data uplink request record corresponds to a flag bit, and the initial value of the flag bit is a first value.
The system database is also provided with a flag bit for indicating the processing state of the service data uplink request, and different values of the flag bit can indicate whether the service data uplink request is normally processed on a data link. Here, when the uplink result feedback information sent by the data link based on the service data uplink request is normally received, the service data uplink request can be considered to be normally processed on the data link (the flag bit is set to the second value at this time), and the uplink result feedback information can be uplink success or uplink failure. When no feedback information of the uplink result sent by the data link based on the service data uplink request is received, it can be considered that the service data uplink request is processed on the data link to be abnormal (i.e. it is determined that the service data to be uplink is written into the blockchain to be abnormal, and at this time, the value of the flag bit is still the first value).
The failure to receive the feedback information of the uplink result sent by the data link based on the service data uplink request may be caused by service restart or network congestion, which results in failure to receive the feedback information of the uplink result sent by the data link based on the service data uplink request within a set duration.
Therefore, when it is detected that the writing of the service data to be uplink into the blockchain is abnormal, a target data uplink request record with the flag bit as a first value needs to be extracted from the system database so as to determine the service data uplink request which is not normally processed based on the service data uplink request record table.
And step 103, searching target data matched with the target data uplink request record from the blockchain.
Under the condition that the service data to be uplink is written into the block chain to be abnormal is detected, and the target data uplink request record corresponding to the service data uplink request which is not normally processed is determined from the system database of the service end, the target data matched with the target data uplink request record is required to be pulled from the block chain.
In one embodiment, the target data uplink request record includes a request time of the service data uplink request.
Correspondingly, searching the target data matched with the target data uplink request record from the blockchain comprises the following steps:
And based on the target data uplink request record, extracting uplink data which is within a set duration range from the request time from the blockchain as the target data.
Typically, the service end sends the service data uplink request to the blockchain immediately after acquiring the service data uplink request. And if the block chain receives the service data uplink request and carries out uplink processing on the data to be uplink indicated by the service data uplink request, and if the uplink is successful, the block chain stores corresponding uplink data. The uplink time of the uplink data meets the requirement that the request time from the service data uplink request is within the set duration range.
And searching target data matched with the target data uplink request record from the block chain according to the request time of the business data uplink request recorded in the target data uplink request record.
And 104, based on the target data, when the service data in the system database and the uplink data in the blockchain are consistent, setting the mark position corresponding to the target data uplink request record as a second value.
The flag bit is used as a judging basis for judging whether the abnormal state of the block chain is recovered when the service data to be uplink is written into the block chain.
Wherein the first value of the flag bit is, for example, 0 and the second value is, for example, 1.
And determining whether the service data in the system database and the uplink data in the block chain have consistency or not based on the target data.
Here, when the service data to be uplink indicated by the service data uplink request is not written into the blockchain (i.e. the data uplink fails), it can be determined that the data in the blockchain has not been changed, and at this time, it can be determined that the service data in the system database has consistency with the uplink data in the blockchain. Or when the service data to be uplink indicated by the service data uplink request is written into the blockchain (namely, the data uplink is successful), the data in the blockchain can be determined to be changed, then the data to be uplink is required to be synchronized into the service data of the system database, the data of the service end is updated, the service data of the updated system database is consistent with the data of the blockchain, and at the moment, the consistency of the service data in the system database and the uplink data in the blockchain can be determined.
Specifically, in one embodiment, the target data uplink request record includes a request identifier of a service data uplink request, and the determining that the service data in the system database has consistency with the uplink data in the blockchain includes:
And determining that the data in the system has consistency with the data in the blockchain when the target data does not contain the target uplink data corresponding to the request identifier based on the request identifier in the target data uplink request record.
And when the target data does not contain the target uplink data corresponding to the request identification, the processing state of the service data uplink request is considered to be data uplink failure.
Specifically, in another embodiment, the target data uplink request record includes a request identifier of a service data uplink request, and the determining that the service data in the system database has consistency with the uplink data in the blockchain includes:
And synchronizing the data to be uplink to the service data of the system database when determining that the target data contains target uplink data corresponding to the request identifier based on the request identifier in the target data uplink request record, and determining that the service data in the system database has consistency with the uplink data in the block chain.
And when the target data contains target uplink data corresponding to the request identification of the service data uplink request, the processing state of the service data uplink request is considered to be successful in data uplink.
In the above process, when abnormal conditions such as network timeout and external hanging of service are met, data uplink feedback information sent by a blockchain based on a service data uplink request cannot be obtained, at this time, it is determined that the abnormality occurs when service data to be uplink is written into the blockchain, at this time, the service end to be uplink data is submitted, and the service end does not know the data uplink result, so that consistency between the service data and the link needs to be ensured through a compensation mechanism.
Specifically, all abnormal data with a flag bit of 0 (i.e., a first value) is required to be pulled from a system database, the generation time of each piece of data is taken as a parameter, all transaction data in a set time period is pulled up by a deblocking chain, after the transaction data is unpacked, a request number (requestId) corresponding to a service data uplink request is compared with requestId of the unpacked uplink data, if the target uplink data with the same request number is not matched, it is determined that target uplink data corresponding to a request identifier of the service data uplink request is not contained in target data stored in the block chain, and at the moment, the data uplink is considered to be failed, and local compensation data at a service end is not required. If the target uplink data with the consistent request number is matched, determining that the target data stored in the blockchain contains target uplink data corresponding to the request identifier of the service data uplink request, and considering that the data uplink is successful at the moment, determining that the service data in the local system database and the uplink data in the blockchain are in a state of no consistency at the moment, unpacking the target uplink data to obtain corresponding uplink parameters (such as transfer amount, account, transfer balance, transfer contract and the like), executing service logic at the service end to re-warehouse to complete data compensation of the service data at the service end, enabling the service data in the system database to have consistency with the uplink data in the blockchain, and enabling the mark position corresponding to the target data uplink request record to be 1 (namely a second value).
In the processing process, when the consistency of the data is maintained, the adopted scheme is not full pulling, or active pulling triggered by a user, but when the occurrence of uplink abnormality of the data to be uplink is detected, the data uplink request record with the flag bit as a first value is extracted from the system database of the service end, the target data corresponding to the record is obtained from the block chain, when the data content corresponding to the data to be uplink is matched from the target data, the data synchronization is locally carried out at the service end, the consistency of the data between the service end and the block chain is maintained, the value of the flag bit of the data uplink request record is changed, and the value of the flag bit is set as a second value, so that the effective marking of the processing state of the data uplink request is realized.
In the embodiment of the application, the record information of the service data uplink request is formed at the service end, and the mark of the processing state of the service data uplink request is realized by means of the adjustment of the value of the flag bit, so that when the condition that the service data to be uplink is written into the blockchain and is abnormal is detected, the target data matched with the record of the target data uplink request is searched from the blockchain based on the record information of the service data uplink request and the corresponding flag bit, and further the consistency between the service data in the service end and the data in the blockchain is determined, the service pressure of a service party and a blockchain server is reduced, and the timeliness of data synchronization is ensured.
Different implementation manners of the data consistency processing method are also provided in the embodiment of the application.
Referring to fig. 2, fig. 2 is a flowchart second of a data consistency processing method according to an embodiment of the present application. As shown in fig. 2, a data consistency processing method includes the following steps:
Step 201, a service data uplink request is acquired.
The service data uplink request is used to indicate that service data to be uplink is written to the blockchain.
The implementation process of this step is the same as that of step 101 in the foregoing embodiment, and will not be described here again.
Step 202, storing the request information of the service data uplink request into the system database, obtaining a data uplink request record corresponding to the service data uplink request, and setting the flag position corresponding to the data uplink request record as the first value.
The request information specifically includes information such as request time and request identification of the service data uplink request.
And 203, when the fact that the to-be-uplinked service data is successfully written in the block chain is detected, synchronizing the to-be-uplinked data into the service data of the system database, wherein the mark position corresponding to the data uplink request record is the second value.
And if the feedback information of successful data uplink sent by the block chain based on the service data uplink request is received, determining that the service data to be uplink is successfully written in the block chain.
At this time, it can be determined that the data in the blockchain is changed, and then the data to be uplink needs to be synchronized to the service data of the system database, the service end data is updated, and the service data of the updated system database is consistent with the data of the blockchain.
And 204, when the fact that the writing of the business data to be uplinked in the block chain fails is detected, setting the mark position corresponding to the data uplink request record as the second value, and outputting prompt information of data processing failure.
And if the feedback information of the data uplink failure sent by the block chain based on the service data uplink request is received, determining that the writing failure of the service data to be uplink in the block chain is detected.
When the writing of the service data to be uplink in the block chain fails, the prompting information of the data processing failure needs to be output to the user at the service end.
And step 205, when detecting that the abnormality occurs in writing the business data to be uplink into the blockchain, extracting a target data uplink request record with a flag bit as a first value from a system database.
The system database stores service data, a data uplink request record corresponding to the service data uplink request and a flag bit for indicating the processing state of the service data uplink request.
The implementation process of this step is the same as that of step 102 in the foregoing embodiment, and will not be described here again.
And step 206, searching the target data matched with the target data uplink request record from the blockchain.
The implementation process of this step is the same as that of step 103 in the foregoing embodiment, and will not be described here again.
Step 207, based on the target data, when it is determined that the service data in the system database has consistency with the uplink data in the blockchain, the flag position corresponding to the target data uplink request record is set to be a second value.
The implementation process of this step is the same as that of step 104 in the foregoing embodiment, and will not be described here again.
In the embodiment of the application, the record information of the service data uplink request is formed at the service end, and the mark of the processing state of the service data uplink request is realized by means of the adjustment of the value of the flag bit, so that when the condition that the service data to be uplink is written into the blockchain is detected to be abnormal, the target data matched with the record of the target data uplink request is searched from the blockchain based on the record information of the service data uplink request and the corresponding flag bit, and further, the consistency between the service data in the service end and the data in the blockchain is determined, and when the condition that the service data to be uplink is written into the blockchain fails or is written into the blockchain successfully is detected, different processing measures are respectively adopted, the consistency between the service data in the service end and the data in the blockchain is ensured, the service pressure of a service party and a blockchain server is reduced, and the timeliness of data synchronization is ensured.
Referring to fig. 3, fig. 3 is a block diagram of a data consistency processing apparatus according to an embodiment of the present application, and for convenience of explanation, only a portion related to the embodiment of the present application is shown.
The data consistency processing apparatus 300 includes:
An obtaining module 301, configured to obtain a service data uplink request, where the service data uplink request is used to indicate writing service data to be uplink to a blockchain;
The extraction module 302 is configured to extract, when it is detected that an abnormality occurs in writing the service data to be uplink to the blockchain, a target data uplink request record with a flag bit as a first value from a system database, where the system database stores service data, a data uplink request record corresponding to the service data uplink request, and a flag bit for indicating a processing state of the service data uplink request;
a searching module 303, configured to search the blockchain for target data matching the target data uplink request record;
And the state value setting module 304 is configured to, based on the target data, set the flag position corresponding to the target data uplink request record to a second value when it is determined that the service data in the system database has consistency with the uplink data in the blockchain.
Wherein, the state value setting module 304 is further configured to:
storing the request information of the service data uplink request into the system database to obtain a data uplink request record corresponding to the service data uplink request;
and taking the mark position corresponding to the data uplink request record as the first value.
Wherein, the state value setting module 304 is further configured to:
And when the fact that the business data to be uplink is successfully written in the block chain is detected, the mark position corresponding to the data uplink request record is the second value, and the business data to be uplink is synchronized to the business data of the system database.
Wherein, the state value setting module 304 is further configured to:
When the fact that the writing of the business data to be uplinked in the block chain fails is detected, the mark position corresponding to the data uplink request record is taken as the second value, and prompt information of data processing failure is output.
The target data uplink request record comprises the request time of a service data uplink request; the searching module 303 is specifically configured to:
And based on the target data uplink request record, extracting uplink data which is within a set duration range from the request time from the blockchain as the target data.
The target data uplink request record includes a request identifier of a service data uplink request, and the state value setting module 304 is specifically configured to:
And determining that the data in the system has consistency with the data in the blockchain when the target data does not contain the target uplink data corresponding to the request identifier based on the request identifier in the target data uplink request record.
The target data uplink request record includes a request identifier of a service data uplink request, and the state value setting module 304 is further specifically configured to:
And synchronizing the data to be uplink to the service data of the system database when determining that the target data contains target uplink data corresponding to the request identifier based on the request identifier in the target data uplink request record, and determining that the service data in the system database has consistency with the uplink data in the block chain.
The data consistency processing device provided by the embodiment of the application can realize the processes of the embodiment of the data consistency processing method and achieve the same technical effects, and is not repeated here for avoiding repetition.
Fig. 4 is a block diagram of a terminal according to an embodiment of the present application. As shown in this figure, the terminal 4 of this embodiment comprises at least one processor 40 (only one is shown in fig. 4), a memory 41 and a computer program 42 stored in said memory 41 and executable on said at least one processor 40, said processor 40 implementing the steps of any of the various method embodiments described above when executing said computer program 42.
The terminal 4 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The terminal 4 may include, but is not limited to, a processor 40, a memory 41. It will be appreciated by those skilled in the art that fig. 4 is merely an example of the terminal 4 and is not limiting of the terminal 4, and may include more or fewer components than shown, or may combine some components, or different components, e.g., the terminal may further include input and output devices, network access devices, buses, etc.
The Processor 40 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the terminal 4, such as a hard disk or a memory of the terminal 4. The memory 41 may also be an external storage device of the terminal 4, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the terminal 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal 4. The memory 41 is used for storing the computer program as well as other programs and data required by the terminal. The memory 41 may also be used for temporarily storing data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other manners. For example, the apparatus/terminal embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
The present application may also be implemented as a computer program product for implementing all or part of the procedures of the methods of the above embodiments, which when run on a terminal causes the terminal to perform the steps of the method embodiments described above.
The foregoing embodiments are merely illustrative of the technical solutions of the present application, and not restrictive, and although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that modifications may still be made to the technical solutions described in the foregoing embodiments or equivalent substitutions of some technical features thereof, and that such modifications or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

Translated fromUnknown language
1.一种数据一致性处理方法,其特征在于,包括:1. A data consistency processing method, characterized by comprising:获取业务数据上链请求,所述业务数据上链请求用于指示将待上链业务数据写入至区块链;Obtain a business data on-chain request, which is used to instruct the business data to be on-chain to be written to the blockchain;在检测到将所述待上链业务数据写入至所述区块链出现异常时,从系统数据库中提取标志位为第一值的目标数据上链请求记录;所述系统数据库中存储有业务数据、与所述业务数据上链请求对应的数据上链请求记录及用于指示所述业务数据上链请求的处理状态的标志位;所述标志位的不同取值用于指示业务数据上链请求是否在数据链上正常处理;When an abnormality is detected in writing the business data to be uploaded to the blockchain, a target data upload request record with a flag bit set to a first value is extracted from a system database; the system database stores business data, a data upload request record corresponding to the business data upload request, and a flag bit used to indicate the processing status of the business data upload request; different values of the flag bit are used to indicate whether the business data upload request is processed normally on the data chain;从所述区块链中查找与所述目标数据上链请求记录匹配的目标数据;Searching the blockchain for target data that matches the target data upload request record;基于所述目标数据,在确定所述系统数据库中所述业务数据与所述区块链中的上链数据具备一致性时,将所述目标数据上链请求记录对应的所述标志位置为第二值。Based on the target data, when it is determined that the business data in the system database is consistent with the on-chain data in the blockchain, the flag position corresponding to the target data on-chain request record is set to the second value.2.根据权利要求1所述的方法,其特征在于,所述获取业务数据上链请求之后,还包括:2. The method according to claim 1, characterized in that after obtaining the service data upload request, it also includes:将所述业务数据上链请求的请求信息存储至所述系统数据库中,得到与所述业务数据上链请求对应的数据上链请求记录;Storing the request information of the business data on-chain request in the system database to obtain a data on-chain request record corresponding to the business data on-chain request;将所述数据上链请求记录对应的标志位置为所述第一值。The flag position corresponding to the data uplink request record is set to the first value.3.根据权利要求2所述的方法,其特征在于,所述将所述数据上链请求记录对应的标志位置为所述第一值之后,还包括:3. The method according to claim 2, characterized in that after setting the flag position corresponding to the data upload request record to the first value, the method further comprises:在检测到所述待上链业务数据在所述区块链中写入成功时,将所述数据上链请求记录对应的标志位置为所述第二值,并将所述待上链数据同步至所述系统数据库的所述业务数据中。When it is detected that the business data to be uploaded to the chain is successfully written into the blockchain, the flag position corresponding to the data upload request record is set to the second value, and the data to be uploaded to the chain is synchronized with the business data in the system database.4.根据权利要求2所述的方法,其特征在于,所述将所述数据上链请求记录对应的标志位置为所述第一值之后,还包括:4. The method according to claim 2, characterized in that after setting the flag position corresponding to the data upload request record to the first value, the method further comprises:在检测到所述待上链业务数据在所述区块链中写入失败时,将所述数据上链请求记录对应的标志位置为所述第二值,并输出数据处理失败的提示信息。When it is detected that the business data to be uploaded to the chain fails to be written into the blockchain, the flag position corresponding to the data upload request record is set to the second value, and a prompt message indicating that the data processing failed is output.5.根据权利要求1所述的方法,其特征在于,所述目标数据上链请求记录中包含业务数据上链请求的请求时间;所述从所述区块链中查找与所述目标数据上链请求记录匹配的目标数据,包括:5. The method according to claim 1, wherein the target data on-chain request record includes the request time of the business data on-chain request; and searching the blockchain for target data that matches the target data on-chain request record comprises:基于所述目标数据上链请求记录,从所述区块链中提取距所述请求时间在设定时长范围内的上链数据作为所述目标数据。Based on the target data on-chain request record, the on-chain data within a set time range from the request time is extracted from the blockchain as the target data.6.根据权利要求1所述的方法,其特征在于,所述目标数据上链请求记录中包含业务数据上链请求的请求标识;所述确定所述系统数据库中所述业务数据与所述区块链中的上链数据具备一致性,包括:6. The method according to claim 1, wherein the target data on-chain request record includes a request identifier for the business data on-chain request; and determining whether the business data in the system database is consistent with the on-chain data in the blockchain comprises:基于所述目标数据上链请求记录中的所述请求标识,在确定所述目标数据中不包含与所述请求标识对应的目标上链数据时,确定所述系统中数据与所述区块链中数据具备一致性。Based on the request identifier in the target data on-chain request record, when it is determined that the target data does not contain the target on-chain data corresponding to the request identifier, it is determined that the data in the system is consistent with the data in the blockchain.7.根据权利要求1所述的方法,其特征在于,所述目标数据上链请求记录中包含业务数据上链请求的请求标识;所述确定所述系统数据库中所述业务数据与所述区块链中的上链数据具备一致性,包括:7. The method according to claim 1, wherein the target data on-chain request record includes a request identifier for the business data on-chain request; and determining whether the business data in the system database is consistent with the on-chain data in the blockchain comprises:基于所述目标数据上链请求记录中的所述请求标识,在确定所述目标数据中包含与所述请求标识对应的目标上链数据时,将所述待上链数据同步至所述系统数据库的所述业务数据中,确定所述系统数据库中所述业务数据与所述区块链中的上链数据具备一致性。Based on the request identifier in the target data on-chain request record, when it is determined that the target data contains the target on-chain data corresponding to the request identifier, the data to be on-chain is synchronized with the business data in the system database to determine whether the business data in the system database is consistent with the on-chain data in the blockchain.8.一种数据一致性处理装置,其特征在于,包括:8. A data consistency processing device, comprising:获取模块,用于获取业务数据上链请求,所述业务数据上链请求用于指示将待上链业务数据写入至区块链;An acquisition module is used to obtain a business data on-chain request, where the business data on-chain request is used to instruct the business data to be on-chain to be written to the blockchain;提取模块,用于在检测到将所述待上链业务数据写入至所述区块链出现异常时,从系统数据库中提取标志位为第一值的目标数据上链请求记录;所述系统数据库中存储有业务数据、与所述业务数据上链请求对应的数据上链请求记录及用于指示所述业务数据上链请求的处理状态的标志位;所述标志位的不同取值用于指示业务数据上链请求是否在数据链上正常处理;an extraction module configured to extract, from a system database, a target data on-chain request record with a flag bit set to a first value upon detecting an abnormality in writing the business data to be on-chain to the blockchain; the system database storing business data, a data on-chain request record corresponding to the business data on-chain request, and a flag bit indicating a processing status of the business data on-chain request; different values of the flag bit indicating whether the business data on-chain request is processed normally on the data chain;查找模块,用于从所述区块链中查找与所述目标数据上链请求记录匹配的目标数据;A search module, configured to search the blockchain for target data that matches the target data upload request record;状态值设置模块,用于基于所述目标数据,在确定所述系统数据库中所述业务数据与所述区块链中的上链数据具备一致性时,将所述目标数据上链请求记录对应的所述标志位置为第二值。A status value setting module is used to set the flag position corresponding to the target data on-chain request record to a second value when it is determined that the business data in the system database is consistent with the on-chain data in the blockchain based on the target data.9.一种终端,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述方法的步骤。9. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.10.一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述方法的步骤。10. A computer-readable storage medium storing a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 7 when executed by a processor.
CN202210733917.7A2022-06-27 Data consistency processing method, device, terminal and storage mediumActiveCN115098521B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210733917.7ACN115098521B (en)2022-06-27 Data consistency processing method, device, terminal and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210733917.7ACN115098521B (en)2022-06-27 Data consistency processing method, device, terminal and storage medium

Publications (2)

Publication NumberPublication Date
CN115098521A CN115098521A (en)2022-09-23
CN115098521Btrue CN115098521B (en)2025-10-10

Family

ID=

Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111274252A (en)*2020-01-082020-06-12平安科技(深圳)有限公司Block chain data chaining method, device, storage medium and server

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111274252A (en)*2020-01-082020-06-12平安科技(深圳)有限公司Block chain data chaining method, device, storage medium and server

Similar Documents

PublicationPublication DateTitle
US8701127B2 (en)Web services access to content items stored by collaboration systems
CN109359091B (en)File management method, device, terminal and computer readable storage medium
US10235030B2 (en)Electronic device and user interface display method for the same
CN108400868B (en) Seed key storage method, device and mobile terminal
CN108038112B (en)File processing method, mobile terminal and computer readable storage medium
CN112183045B (en)Online document processing method and device and electronic equipment
US20100076937A1 (en)Feed processing
US20220083507A1 (en)Trust chain for official data and documents
CN108230014A (en)Electronic device and the method that webpage is shown using electronic device
CN105868608A (en)Method and terminal for fingerprint unlocking
CN111352952A (en)Information query method, server and computer readable storage medium
CN112559913B (en)Data processing method, device, computing equipment and readable storage medium
CN107330058A (en) Application search method, mobile terminal and computer-readable storage medium
CN107301236A (en)Application searches method, mobile terminal, server and computer-readable recording medium
WO2023066258A1 (en)Data processing method and apparatus for private data, computer device and medium
CN113515717B (en)Navigation page updating method and device, electronic equipment and storage medium
US20150112997A1 (en)Method for content control and electronic device thereof
CN115098521B (en) Data consistency processing method, device, terminal and storage medium
CN105354506B (en)The method and apparatus of hidden file
CN107332988A (en) Information processing method, mobile terminal, and computer-readable storage medium
CN107679222A (en)Image processing method, mobile terminal and computer-readable recording medium
CN112711955A (en)NFC information transmission method, NFC information transmission device and NFC terminal
CN109271543B (en) Thumbnail display method, device, terminal, and computer-readable storage medium
CN108021648B (en) Method, device and intelligent terminal for searching questions
US10572955B2 (en)Presenting context for contacts

Legal Events

DateCodeTitleDescription
PB01Publication
SE01Entry into force of request for substantive examination
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp