CN-115269236-B - Data restoration method, device, electronic equipment and storage medium
Abstract
The application discloses a data restoration method, a data restoration device, electronic equipment and a storage medium. The service system also comprises an interface layer module and a blockchain node; the method comprises the steps of obtaining interaction data between different business systems cached by an interface layer module to obtain cache data, obtaining target data to be interacted by the interface layer module from the blockchain node to obtain blockchain data, comparing the cache data with the blockchain data to obtain a comparison result, and repairing the cache data according to the blockchain data when the comparison result is that the cache data is inconsistent with the blockchain data. By adopting the data restoration method provided by the application, the interactive data with abnormal interaction can be automatically restored, so that the technical effect of restoring the interactive data is improved.
Inventors
- WANG XIN
- SHI YUAN
Assignees
- 中国移动通信集团辽宁有限公司
- 中国移动通信集团有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20210429
Claims (8)
- 1. The data restoration method is characterized by being applied to an interface monitoring module in a service system, wherein the service system further comprises an interface layer module and a blockchain node, the interface monitoring module is respectively in communication connection with the interface layer module and the blockchain node, and the method comprises the following steps: Acquiring interaction data between different service systems cached by the interface layer module to obtain cached data; obtaining target data to be interacted by the interface layer module from the blockchain node to obtain blockchain data; comparing the cache data with the blockchain data to obtain a comparison result; When the comparison result shows that the cache data is inconsistent with the blockchain data, repairing the cache data according to the blockchain data; Before the interface layer module performs data interaction, the interface monitoring module sends target data records to be interacted to a blockchain node, and the target data to be interacted is stored in a blockchain data area in the blockchain node to realize data uplink; The step of obtaining the target data to be interacted by the interface layer module from the blockchain node to obtain blockchain data comprises the following steps: acquiring the number of target data stored in the block link points at a preset time point; The interface monitoring module compares the number of the target data acquired at the current time point with the number of the target data acquired at the previous time point; When the number of the target data acquired at the current time point is larger than the number of the target data acquired at the previous time point, acquiring the target data to obtain blockchain data, or And acquiring the target data at fixed time according to a preset time point to obtain the blockchain data.
- 2. The method of claim 1, wherein prior to obtaining the interaction data cached by the interface layer module, the method further comprises: And pushing the target data to be interacted by the interface layer module to the blockchain node for storage.
- 3. The method of claim 2, wherein pushing the target data to be interacted with by the interface layer module to the blockchain node for storage comprises: Screening the data to be interacted with by the interface layer module according to a preset rule to obtain target data; Pushing the target data to the blockchain node for storage.
- 4. The method of claim 1, further comprising, after comparing the cached data with the blockchain data to obtain a comparison result: When the comparison result shows that the cache data is consistent with the blockchain data, acquiring next cache data and next blockchain data; And comparing the next cache data with the next blockchain data to determine whether the next cache data needs to be repaired.
- 5. The method of claim 1, wherein repairing the cached data from the blockchain data comprises: Determining distinguishing data of the cache data and the blockchain data; And repairing the cache data according to the blockchain data and the distinguishing data.
- 6. The data repairing device is characterized by being applied to an interface monitoring module in a service system, wherein the service system further comprises an interface layer module and a blockchain node, the interface monitoring module is respectively in communication connection with the interface layer module and the blockchain node, and the device comprises: The cache data acquisition module is used for acquiring interaction data between different service systems cached by the interface layer module to obtain cache data; The block chain data acquisition module is used for acquiring target data to be interacted by the interface layer module from the block chain node to obtain block chain data, and the cache data and the block chain data are obtained by the interface monitoring module in an asynchronous acquisition mode; the data comparison module is used for comparing the cache data with the blockchain data to obtain a comparison result; the data restoration module is used for restoring the cache data according to the block chain data when the comparison result is that the cache data is inconsistent with the block chain data; the system comprises a block chain data acquisition module, an interface monitoring module, a block chain data acquisition module and a block chain data timing module, wherein the block chain data acquisition module is also used for acquiring the number of target data stored in the block chain link point at a preset time point, the interface monitoring module compares the number of target data acquired at the current time point with the number of target data acquired at the last time point, and when the number of target data acquired at the current time point is larger than the number of target data acquired at the last time point, the target data is acquired to obtain the block chain data, or the target data is acquired at regular time according to the preset time point to obtain the block chain data.
- 7. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, the program or instruction when executed by the processor implementing the steps of the data repair method according to any one of claims 1 to 5.
- 8. A computer storage medium having stored thereon computer program instructions which, when executed by a processor, implement a data restoration method as claimed in any one of claims 1-5.
Description
Data restoration method, device, electronic equipment and storage medium Technical Field The present application relates to computer technologies, and in particular, to a data repair method, apparatus, electronic device, and storage medium. Background At present, with the rapid development of computer network technology, each business system realizes data interaction based on interfaces. When data interaction is carried out between the business systems through the interfaces, the operation state of the interfaces is monitored through the log-adding service, abnormal conditions often occur in the interface interaction process, and in general, the problem analysis is carried out by using the interface logs and then the interface data is repaired, so that the method is a main mode for processing the abnormal conditions. The function of interface monitoring can be achieved by recording the running state of the interface in the traditional interface log mode, but the log recording mode is usually only used for recording the state concerned by the interface of the business system, and a complete tracking chain does not exist in the interaction process of the interface of the business system, so that abnormal interaction data cannot be repaired through the interface log when the interaction data is problematic due to the interface, and the business process is greatly influenced. Disclosure of Invention The embodiment of the invention provides a data repairing method, a device, electronic equipment and a storage medium, which are used for realizing the technical effect of automatically repairing problem data when the problem occurs in the data transmission of an interface layer module. The technical scheme of the application is as follows: In a first aspect, a data repairing method is provided, which is applied to an interface monitoring module in a service system, the service system further comprises an interface layer module and a blockchain node, the interface monitoring module is respectively in communication connection with the interface layer module and the blockchain node, and the data repairing method comprises the following steps: acquiring interaction data between different service systems cached by an interface layer module to obtain cached data; obtaining target data to be interacted by an interface layer module from a block chain node to obtain block chain data; Comparing the cache data with the blockchain data to obtain a comparison result; and when the comparison result is that the cache data is inconsistent with the blockchain data, repairing the cache data according to the blockchain data. In a second aspect, a data repairing device is provided, and the data repairing device is applied to an interface monitoring module in a service system, wherein the service system further comprises an interface layer module and a blockchain node, the interface monitoring module is respectively in communication connection with the interface layer module and the blockchain node, and the device comprises: The cache data acquisition module is used for acquiring interaction data among different service systems cached by the interface layer module to obtain cache data; The block chain data acquisition module is used for acquiring target data to be interacted by the interface layer module from the block chain node to obtain block chain data; the data comparison module is used for comparing the cache data with the blockchain data to obtain a comparison result; and the data restoration module is used for restoring the cache data according to the blockchain data when the comparison result is that the cache data is inconsistent with the blockchain data. In a third aspect, an embodiment of the present application provides an electronic device, where the electronic device includes a processor, a memory, and a program or an instruction stored in the memory and capable of running on the processor, where the program or the instruction is executed by the processor to implement the steps of the data restoration method according to any one of the embodiments of the present application. In a fourth aspect, embodiments of the present application provide a computer storage medium having stored thereon computer program instructions which, when executed by a processor, implement the steps of the data restoration method of any of the embodiments of the present application. The technical scheme provided by the embodiment of the application at least has the following beneficial effects: The data interaction is carried out between the service systems, when the interface has problems, the abnormal data interaction can be caused, and the interface log can not carry out complete record on the interaction process of the data, so that the abnormal interaction log can not be timely found and repaired according to the interface log. The data restoration method comprises the steps that before data interaction is carried out on an interface layer mo