CN111030784A - Information synchronization method and device - Google Patents
Information synchronization method and device Download PDFInfo
- Publication number
- CN111030784A CN111030784A CN201911106603.9A CN201911106603A CN111030784A CN 111030784 A CN111030784 A CN 111030784A CN 201911106603 A CN201911106603 A CN 201911106603A CN 111030784 A CN111030784 A CN 111030784A
- Authority
- CN
- China
- Prior art keywords
- service data
- message
- message queue
- state
- local file
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/1607—Details of the supervisory signal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/12—Arrangements for detecting or preventing errors in the information received by using return channel
- H04L1/16—Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
- H04L1/18—Automatic repetition systems, e.g. Van Duuren systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0631—Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/16—Threshold monitoring
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention discloses an information synchronization method and device, and relates to the technical field of computers. One embodiment of the method comprises: storing the service data into a first local file, initializing the synchronous state of the service data and recording the synchronous state of the service data into the first local file; sending the service data to a first message queue so that the first message queue sends the service data to a message receiver subscribing the service data; updating the synchronization state when receiving the pre-subscribed feedback information from the second message queue; and scanning the first local file to acquire the current synchronization state of the service data, and resending the service data to the first message queue according to the current synchronization state. According to the method, the message sending party subscribes the feedback information of the service data produced by the message sending party to the second message queue, the message receiving party generates the feedback information after receiving the service data and sends the feedback information to the message sending party through the second message queue, so that the message sending party can timely acquire the synchronization result, and subsequent processing is facilitated.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to an information synchronization method and apparatus.
Background
In the information age, information synchronization between partners and between business systems within a company is very important. For example, an insurance company establishes an order system in front of its own core business system to interface channels in order to deal with the traffic peak of the channels and realize quick order issuing. The order issuing system needs to respond to the order issuing request of the channel quickly and also needs to synchronize policy data to the core business system as soon as possible so as to avoid the inconsistency of the channel and the information of the insurance company. Wherein, the channel refers to the seller of the insurance.
In order to ensure information consistency between systems, the prior art generally adopts a message queue. The decoupling between systems can be realized through the synchronization of the message queues, and the message sender directly returns success after writing the produced message into the message queues without concerning the message receiver.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
the message sender cannot know the consumption condition of the message receiver to the message, the message may not be consumed in the message queue for a long time, or the message is consumed due to the fault of the message receiver, but is not successfully stored in the local database.
Disclosure of Invention
In view of this, embodiments of the present invention provide an information synchronization method and apparatus, where a message sending party subscribes to feedback information of service data generated by the message sending party to a second message queue, and a message receiving party generates feedback information after receiving the service data and sends the feedback information to the message sending party through the second message queue, so that the message sending party can obtain a synchronization result in time, and subsequent processing is facilitated.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided an information synchronization method.
An information synchronization method of an embodiment of the present invention includes: storing the produced service data into a first local file, initializing the synchronous state of the service data and recording the synchronous state of the service data into the first local file; sending the service data to a first message queue so that the first message queue sends the service data to a message receiver subscribing the service data; updating the synchronization state when receiving pre-subscribed feedback information from a second message queue; the feedback information is generated by the message receiving party when the service data exists in a second local file, and then is sent to the second message queue; and scanning the first local file to acquire the current synchronization state of the service data, and resending the service data to the first message queue according to the current synchronization state.
Optionally, the synchronization state comprises a storage state and a feedback state; initializing a synchronization state of the service data, including: setting the storage state of the service data to be stored, and setting the feedback state of the service data to be not fed back; updating the synchronization state, including: and updating the feedback state of the service data to be fed back.
Optionally, according to the current synchronization status, resending the service data to the first message queue includes: and if the feedback state in the current synchronization state is unrevealed and the synchronization time is greater than a set time threshold, resending the service data to the first message queue.
Optionally, the service data is multiple; according to the current synchronization state, resending the service data to the first message queue comprises: counting the number of data records of which the feedback state in the current synchronization state is unrevealed and the synchronization time is greater than a set time threshold; and sending alarm information or resending a plurality of service data to the first message queue according to the number of the data records.
Optionally, sending alarm information or resending a plurality of service data to the first message queue according to the number of data records includes: comparing the data record quantity with a set alarm threshold value; if the number of the data records is larger than or equal to the alarm threshold value, sending alarm information; and if the number of the data records is smaller than the alarm threshold value, retransmitting the plurality of service data to the first message queue.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided an information synchronization method.
An information synchronization method of an embodiment of the present invention includes: receiving pre-subscribed service data from a first message queue, and inquiring a second local file according to a set dimension field of the service data; the service data is generated by a message sending party and then sent to the first message queue; when the business data do not exist in the second local file, storing the business data into the second local file; and generating corresponding feedback information for the service data, and sending the feedback information to a message sender subscribing the feedback information in advance by using a second message queue so that the message sender updates the synchronization state of the service data stored in the first local file.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided an information synchronization apparatus.
An information synchronization apparatus according to an embodiment of the present invention includes: the initialization module is used for storing the produced service data into a first local file, initializing the synchronous state of the service data and recording the synchronous state of the service data into the first local file; the sending module is used for sending the service data to a first message queue so that the first message queue sends the service data to a message receiving party subscribing the service data; the updating module is used for updating the synchronous state when receiving the pre-subscribed feedback information from the second message queue; the feedback information is generated by the message receiving party when the service data exists in a second local file, and then is sent to the second message queue; and the retransmission module is used for scanning the first local file to acquire the current synchronization state of the service data and retransmitting the service data to the first message queue according to the current synchronization state.
Optionally, the synchronization state comprises a storage state and a feedback state; the initialization module is further configured to: setting the storage state of the service data to be stored, and setting the feedback state of the service data to be not fed back; the updating module is further configured to update the feedback state of the service data to be fed back.
Optionally, the retransmission module is further configured to resend the service data to the first message queue if the feedback state in the current synchronization state is unrevealed and the synchronization time is greater than a set time threshold.
Optionally, the service data is multiple; the retransmission module is further configured to count the number of data records of which the feedback state in the current synchronization state is unrevealed and the synchronization time is greater than a set time threshold; and sending alarm information or resending a plurality of service data to the first message queue according to the number of the data records.
Optionally, the retransmission module is further configured to compare the number of data records with a set alarm threshold; if the number of the data records is larger than or equal to the alarm threshold value, sending alarm information; and if the number of the data records is smaller than the alarm threshold value, resending the plurality of service data to the first message queue.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided an information synchronization apparatus.
An information synchronization apparatus according to an embodiment of the present invention includes: the query module is used for receiving pre-subscribed service data from the first message queue and querying a second local file according to the set dimension field of the service data; the service data is generated by a message sending party and then sent to the first message queue; the synchronization module is used for storing the service data into the second local file when the second local file is determined not to have the service data; and the feedback module is used for generating corresponding feedback information for the service data, and sending the feedback information to a message sending party subscribing the feedback information in advance by using a second message queue so as to enable the message sending party to update the synchronization state of the service data stored in the first local file.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement an information synchronization method according to an embodiment of the present invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention has a computer program stored thereon, which, when executed by a processor, implements an information synchronization method of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: the message sending party subscribes the feedback information of the service data produced by the message sending party to the second message queue, and the message receiving party generates feedback information after receiving the service data and sends the feedback information to the message sending party through the second message queue, so that the message sending party can acquire the synchronization result in time and is convenient for subsequent processing; the synchronization state comprises a storage state and a feedback state of the service data, and whether the synchronization is successful can be determined according to the values of the two states, so that the method is simple to implement; the first local file is scanned regularly to determine whether the service data is not synchronized to a message receiver overtime, so that the subsequent automatic retransmission is facilitated, and the data consistency is ensured; and counting the number of the data records which are not synchronized overtime, and carrying out alarm processing or automatic retry according to the number of the data records and the size of a set alarm threshold value to ensure the data consistency.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of an implementation principle of an information synchronization method in the prior art;
fig. 2 is a schematic diagram of the main steps of an information synchronization method at a message sender according to an embodiment of the present invention;
fig. 3 is a schematic diagram of the main steps of an information synchronization method at a message recipient according to an embodiment of the present invention;
FIG. 4 is a timing diagram of an information synchronization method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of main blocks of an information synchronization apparatus (message sender) according to an embodiment of the present invention;
fig. 6 is a schematic diagram of main blocks of an information synchronization apparatus (message recipient) according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 8 is a schematic diagram of a computer apparatus suitable for use in an electronic device to implement an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of an implementation principle of an information synchronization method in the prior art. As shown in fig. 1, in the prior art, a first service system produces a message, then pushes the message to a message queue, and then the message queue sends the message to a second service system subscribing to the message, and the second service system consumes the message. The first service system in the synchronization mode cannot acquire the consumption condition of the message receiver to the message, and data of the first service system and the second service system may be inconsistent.
For example, after the policy issuing system of the insurance system and the internet area successfully issues the policy, the policy data is sent to the message queue, but at this time, the policy data is not really taken away by the core service system due to various reasons such as the network, and the data of the policy issuing system and the core service system are inconsistent. If the settlement cannot be found in time, the settlement amount of the two systems is inconsistent during settlement, so that the settlement fails. The embodiment of the invention optimizes the scheme and ensures the consistency of data among systems.
Fig. 2 is a schematic diagram of the main steps of the information synchronization method at the message sender according to the embodiment of the present invention. As shown in fig. 2, the information synchronization method according to the embodiment of the present invention is executed by a message sender, and mainly includes the following steps:
step S201: and storing the produced service data into a first local file, initializing the synchronous state of the service data and recording the synchronous state of the service data into the first local file. The message sender produces the service data, stores the service data into a local file of the message sender, and records the synchronous state of the service data in the local file. The synchronous state comprises a storage state and a feedback state, and during initialization, the storage state of the service data is set to be stored, and the feedback state of the service data is set to be not fed back. In one embodiment, custom characters may be used to indicate various states, such as the letter Y indicating sent, fed back, and the letter N indicating not sent, not fed back.
Step S202: and sending the service data to a first message queue, so that the first message queue sends the service data to a message receiver subscribed with the service data. And a first message queue is established in advance, and a message receiving party subscribes service data from the first message queue. And the message sending party sends the service data to the first message queue. And then the first message queue sends the service data to a message receiver subscribing the service data. And after receiving the service data, the message receiver generates corresponding feedback information and sends the feedback information to the second message queue.
Step S203: and updating the synchronization state when the pre-subscribed feedback information from the second message queue is received. The feedback information is generated by the message receiving party when the service data exists in the second local file, and then is sent to the second message queue. And a second message queue is pre-established, and a message sender subscribes feedback information of the service data from the second message queue. The second message queue sends the feedback information to the message sender who subscribes to the feedback information. And then the message receiver can update the synchronization state of the service data in the local file, namely, the feedback state of the service data is updated to be fed back.
Step S204: and scanning the first local file to acquire the current synchronization state of the service data, and resending the service data to the first message queue according to the current synchronization state. The message sending party can scan the local file regularly or irregularly, obtain the current synchronization state of the service data produced by the message sending party from the local file, if the feedback state in the current synchronization state is not feedback and the synchronization time is greater than the set time threshold, the message receiving party can be considered to consume the service data abnormally, and the service data is pushed to the first message queue again to be sent to the message receiving party again.
Fig. 3 is a schematic diagram of the main steps of the information synchronization method at the message receiver according to the embodiment of the present invention. As shown in fig. 3, the information synchronization method according to the embodiment of the present invention is executed by a message receiver, and mainly includes the following steps:
step S301: and receiving pre-subscribed service data from the first message queue, and inquiring a second local file according to the set dimension field of the service data. And a first message queue is established in advance, and a message receiving party subscribes service data from the first message queue. And after the message sending party generates the service data, the service data is sent to the first message queue, and the first message queue is sent to the message receiving party. And the message receiver inquires the local file according to the set dimension field of the service data and judges whether the service data exists in the local file of the message receiver. For example, whether the service data exists in the local file of the user is queried through the service identification of the service data.
Step S302: and when the business data do not exist in the second local file, storing the business data into the second local file. If the message receiver does not inquire the service data in the local file, the message receiver stores the service data in the local file, that is, adds the data record of the service data in the local file, and then executes step S303. If the message receiver inquires the service data in its local file, step S303 is directly executed.
Step S303: and generating corresponding feedback information for the service data, and sending the feedback information to a message sender subscribing the feedback information in advance by using a second message queue so that the message sender updates the synchronization state of the service data stored in the first local file. And a second message queue is pre-established, and a message sender subscribes feedback information of the service data from the second message queue. And the message receiving party generates feedback information for the service data and sends the feedback information to the second message queue. And then the second message queue sends the feedback information to the message sender. And the message receiver can update the synchronization state of the service data in the local file after receiving the feedback information.
Fig. 4 is a timing diagram of an information synchronization method according to an embodiment of the present invention. As shown in fig. 4, the information synchronization method according to the embodiment of the present invention is executed by a first service system (i.e., a message sending side), a message queue, and a first service system (i.e., a message receiving side), so as to implement information synchronization between systems, and the systems are decoupled from each other, and the method mainly includes the following steps:
step S401: a first message queue and a second message queue are established. A first message queue Q1 and a second message queue Q2 are established. The first message queue Q1 is mainly used for receiving a subscription request of the second service system and forwarding service data; the second message queue Q2 is mainly used for receiving a subscription request of the first service system and forwarding feedback information. Taking the insurance system as an example, the first business system can be an order issuing system and is responsible for carrying traffic and completing the work of underwriting and issuing orders; the second service system may be a core service system, and is responsible for settlement of claims, supervision and delivery, channel settlement, and the like.
Step S402: the first service system stores the produced service data into a first local file, and records the synchronization state in the first local file. Taking the insurance system as an example, the service data is policy data, and the first local file may be a policy table stored in the first service system. In an embodiment, the policy data may include: policy number, order number, product number, time of application, time of endorsement, policy validation day, policy expiration day, payment method, information on the person to be insured, premium, payment information, etc.
In an embodiment, the policy table may include: all policy data, synchronization status, creation time, update time, version number. And storing the policy data into a policy table, namely adding a data record of the policy data in the policy table, wherein the data record contains the initial synchronization state of the policy data. The synchronous state comprises a storage state and a feedback state, and the storage state is Y at the beginning and represents that the service data is sent; the feedback state is N.
Step S403: the first business system sends the business data to the first message queue, and the first message queue sends the business data to a second business system which subscribes the business data. The first business system pushes the policy data to a first message queue Q1. The first message queue Q1 sends the service data to a second service system that subscribes to the service data.
Step S404: the second service system determines whether the second local file has service data, and if the second local file does not have service data, step S404 is executed; if the second local file has the service data, step S405 is performed. In an embodiment, the second local file may be a policy table stored in the second service system. The specific contents of the policy table may be the same as the policy table of the first service system. And the second service system judges whether policy data exist in the policy table of the second service system or not, and performs different processing according to the judgment result.
Step S405: and the second service system stores the service data into a second local file. When there is no policy data in the policy table of the second service system, the policy data needs to be stored in the policy table in the same transaction.
Step S406: and the second service system generates corresponding feedback information and sends the feedback information to the first service system subscribed with the feedback information from the second message queue. If the policy data exists in the policy table of the second service system or the policy data does not exist in the policy table of the second service system but is stored in the policy table, the second service system generates corresponding feedback information for the policy data and pushes the feedback information to the second message queue. In an embodiment, the feedback information may include: warranty number, processing result code, processing result text description and processing time. And the second message queue sends the feedback information to the first service system subscribed with the feedback information.
Step S407: and the first service system updates the synchronization state of the service data in the first local file. And after receiving the feedback information corresponding to the service data, the first service system updates the synchronization state of the service data in the policy table, namely, the feedback state is updated to be fed back. For example, the feedback status of the service data in the policy table is updated to Y. If the synchronization state and the feedback state are Y, the policy data is successfully stored in the policy table, and the feedback information is successfully sent, which indicates that the synchronization is successful. If any one of the two environments of storing the policy table and sending the feedback information fails, the synchronization fails, and the policy table rolls back.
Step S408: the first service system scans the first local file at regular time to acquire the current synchronization state of the service data, so as to automatically retransmit the service data or send alarm information according to the current synchronization state. In order to implement real-time processing on the service data which fails to be synchronized, the first service system may scan the first local file at regular time to obtain a current synchronization state of the service data, and if a feedback state in the current synchronization state is unrevealed and the synchronization time is greater than a set time threshold, the service data is re-sent to the first message queue. The synchronization time can be obtained by the difference between the current system time and the time for sending the service data. If the synchronization time is greater than the time threshold, the service data can be automatically retransmitted. It should be noted that the present embodiment does not limit the execution sequence of the steps, and as long as the timing time is reached, the steps may be executed in any one of the above-mentioned flows.
In another preferred embodiment, in the case of no feedback after timeout, in order to determine whether synchronization fails due to a failure of the second service system, the first service system may scan the first local file to obtain current synchronization states of the plurality of service data; then counting the number of data records of which the feedback state in the current synchronization state is unrevealed and the synchronization time is greater than a time threshold; comparing the number of the data records with the set alarm threshold value, and if the number of the data records is greater than or equal to the alarm threshold value, sending alarm information; and if the number of the data records is less than the alarm threshold value, retransmitting the plurality of service data to the first message queue.
The alarm threshold value can be set by self-definition. For example, the alarm threshold is 100. And if the number of the data records is less than 100, the business data with the synchronization failure is pushed to the first message queue again. And if the number of the data records is more than or equal to 100, sending alarm information to inform system operation and maintenance personnel to check whether the second service system has a fault, receiving a manual instruction after the fault is eliminated, and pushing the service data which fails in synchronization to the first message queue again.
It should be noted that the embodiment of the present invention does not limit the number of the first message queue Q1 and the second message queue Q2, that is, the first message queue Q1 and the second message queue Q2 may include a plurality of sub message queues, and the sub message queues implement the synchronization function.
According to the information synchronization method, the message sending party subscribes the feedback information of the produced service data to the second message queue, the message receiving party generates feedback information after receiving the service data and sends the feedback information to the message sending party through the second message queue, so that the message sending party can acquire the synchronization result in time and the subsequent processing is convenient; the synchronization state comprises a storage state and a feedback state of the service data, and whether the synchronization is successful can be determined according to the values of the two states, so that the method is simple to implement; the local file is scanned at regular time, and whether the service data is not synchronized to a message receiver after timeout is determined, so that the subsequent automatic resending is facilitated, and the data consistency is ensured; and counting the number of the data records which are not synchronized overtime, and carrying out alarm processing or automatic retry according to the number of the data records and the size of a set alarm threshold value to ensure the data consistency.
Fig. 5 is a schematic diagram of main blocks of an information synchronization apparatus (message sender) according to an embodiment of the present invention. As shown in fig. 5, an information synchronization apparatus 500 of a message sender in the embodiment of the present invention mainly includes:
an initializing module 501, configured to store the produced service data into a first local file, initialize a synchronization state of the service data, and record the initialized synchronization state to the first local file. The message sender produces the service data, stores the service data into a local file of the message sender, and records the synchronous state of the service data in the local file. The synchronous state comprises a storage state and a feedback state, and during initialization, the storage state of the service data is set to be stored, and the feedback state of the service data is set to be not fed back. In one embodiment, custom characters may be used to indicate various states, such as the letter Y indicating sent, fed back, and the letter N indicating not sent, not fed back.
A sending module 502, configured to send the service data to a first message queue, so that the first message queue sends the service data to a message recipient subscribing to the service data. And a first message queue is established in advance, and a message receiving party subscribes service data from the first message queue. And the message sending party sends the service data to the first message queue. And then the first message queue sends the service data to a message receiver subscribing the service data. And after receiving the service data, the message receiver generates corresponding feedback information and sends the feedback information to the second message queue.
An updating module 503, configured to update the synchronization status when receiving the pre-subscribed feedback information from the second message queue. The feedback information is generated by the message receiving party when the service data exists in the second local file, and then is sent to the second message queue. And a second message queue is pre-established, and a message sender subscribes feedback information of the service data from the second message queue. The second message queue sends the feedback information to the message sender who subscribes to the feedback information. And then the message receiver can update the synchronization state of the service data in the local file, namely, the feedback state of the service data is updated to be fed back.
A retransmission module 504, configured to scan the first local file to obtain a current synchronization state of the service data, and retransmit the service data to the first message queue according to the current synchronization state. The message sending party can scan the local file regularly or irregularly, obtain the current synchronization state of the service data produced by the message sending party from the local file, if the feedback state in the current synchronization state is not feedback and the synchronization time is greater than the set time threshold, the message receiving party can be considered to consume the service data abnormally, and the service data is pushed to the first message queue again to be sent to the message receiving party again.
In addition, the retransmission module 504 of the embodiment of the present invention includes: an automatic retry module and a monitoring alarm module (not shown in fig. 5). The automatic retry module is configured to scan the first local file and obtain a current synchronization state of the service data; and if the feedback state in the current synchronization state is not feedback and the synchronization time is greater than a set time threshold, resending the service data to the first message queue.
The monitoring alarm module is used for scanning the first local file and acquiring the current synchronous states of the plurality of service data; counting the number of data records of which the feedback state in the current synchronization state is unrevealed and the synchronization time is greater than a set time threshold; and sending alarm information or resending a plurality of service data to the first message queue according to the number of the data records.
Fig. 6 is a schematic diagram of main blocks of an information synchronization apparatus (message recipient) according to an embodiment of the present invention. As shown in fig. 6, an information synchronization apparatus 600 of a message recipient in the embodiment of the present invention mainly includes:
the query module 601 is configured to receive service data from a first message queue subscribed in advance, and query a second local file according to a set dimension field of the service data. And a first message queue is established in advance, and a message receiving party subscribes service data from the first message queue. And after the message sending party generates the service data, the service data is sent to the first message queue, and the first message queue is sent to the message receiving party. And the message receiver inquires the local file according to the set dimension field of the service data and judges whether the service data exists in the local file of the message receiver. For example, whether the service data exists in the local file of the user is queried through the service identification of the service data.
A synchronization module 602, configured to store the service data in the second local file when it is determined that the service data does not exist in the second local file. If the message receiver does not inquire the service data in the local file, the message receiver stores the service data in the local file, that is, adds the data record of the service data in the local file, and then executes the processing procedure of the feedback module 603. If the message receiver inquires the service data in its local file, the message receiver directly executes the processing procedure of the feedback module 603.
A feedback module 603, configured to generate corresponding feedback information for the service data, and send the feedback information to a message sender subscribing to the feedback information in advance using a second message queue, so that the message sender updates a synchronization state of the service data stored in a first local file. And a second message queue is pre-established, and a message sender subscribes feedback information of the service data from the second message queue. And the message receiving party generates feedback information for the service data and sends the feedback information to the second message queue. And then the second message queue sends the feedback information to the message sender. And the message receiver can update the synchronization state of the service data in the local file after receiving the feedback information.
As can be seen from the above description, the message sending side subscribes to the feedback information of the service data generated by the message sending side in the second message queue, and the message receiving side generates a feedback information after receiving the service data and sends the feedback information to the message sending side through the second message queue, so that the message sending side can obtain the synchronization result in time, and the subsequent processing is facilitated; the synchronization state comprises a storage state and a feedback state of the service data, and whether the synchronization is successful can be determined according to the values of the two states, so that the method is simple to implement; the first local file is scanned regularly to determine whether the service data is not synchronized to a message receiver overtime, so that the subsequent automatic retransmission is facilitated, and the data consistency is ensured; and counting the number of the data records which are not synchronized overtime, and carrying out alarm processing or automatic retry according to the number of the data records and the size of a set alarm threshold value to ensure the data consistency.
Fig. 7 shows an exemplary system architecture 700 to which the information synchronization method or the information synchronization apparatus of the embodiments of the present invention can be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like, may be installed on the terminal devices 701, 702, and 703.
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server that provides various services, such as a background management server that an administrator processes using policy requests sent by the terminal devices 701, 702, and 703. The background management server can generate policy data, perform synchronous processing on the policy data, and feed back a processing result (such as synchronization success information) to the terminal device.
It should be noted that the information synchronization method provided in the embodiment of the present application is generally executed by the server 705, and accordingly, the information synchronization apparatus is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides an electronic device and a computer readable medium according to the embodiment of the invention.
The electronic device of the present invention includes: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement an information synchronization method according to an embodiment of the present invention.
The computer-readable medium of the present invention has stored thereon a computer program which, when executed by a processor, implements an information synchronization method of an embodiment of the present invention.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use in implementing an electronic device of an embodiment of the present invention. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the computer system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, the processes described above with respect to the main step diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program containing program code for performing the method illustrated in the main step diagram. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an initialization module, a sending module, and an update module. The names of these modules do not limit the modules themselves in some cases, for example, the initialization module may be further described as a module that stores the produced service data in a first local file, initializes the synchronization state of the service data, and records the service data in the first local file.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: storing the produced service data into a first local file, initializing the synchronous state of the service data and recording the synchronous state of the service data into the first local file; sending the service data to a first message queue so that the first message queue sends the service data to a message receiver subscribing the service data; updating the synchronization state when receiving pre-subscribed feedback information from a second message queue; the feedback information is generated by the message receiving party when the service data exists in a second local file, and then is sent to the second message queue; and scanning the first local file to acquire the current synchronization state of the service data, and resending the service data to the first message queue according to the current synchronization state.
As can be seen from the above description, the message sending side subscribes to the feedback information of the service data generated by the message sending side in the second message queue, and the message receiving side generates a feedback information after receiving the service data and sends the feedback information to the message sending side through the second message queue, so that the message sending side can obtain the synchronization result in time, and the subsequent processing is facilitated; the synchronization state comprises a storage state and a feedback state of the service data, and whether the synchronization is successful can be determined according to the values of the two states, so that the method is simple to implement; the first local file is scanned regularly to determine whether the service data is not synchronized to a message receiver overtime, so that the subsequent automatic retransmission is facilitated, and the data consistency is ensured; and counting the number of the data records which are not synchronized overtime, and carrying out alarm processing or automatic retry according to the number of the data records and the size of a set alarm threshold value to ensure the data consistency.
The product can execute the method provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiment of the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. An information synchronization method, comprising:
storing the produced service data into a first local file, initializing the synchronous state of the service data and recording the synchronous state of the service data into the first local file;
sending the service data to a first message queue so that the first message queue sends the service data to a message receiver subscribing the service data;
updating the synchronization state when receiving pre-subscribed feedback information from a second message queue; the feedback information is generated by the message receiving party when the service data exists in a second local file, and then is sent to the second message queue;
and scanning the first local file to acquire the current synchronization state of the service data, and resending the service data to the first message queue according to the current synchronization state.
2. The method of claim 1, wherein the synchronization state comprises a storage state and a feedback state; initializing a synchronization state of the service data, including:
setting the storage state of the service data to be stored, and setting the feedback state of the service data to be not fed back;
updating the synchronization state, including: and updating the feedback state of the service data to be fed back.
3. The method of claim 2, wherein re-sending the traffic data to the first message queue according to the current synchronization status comprises:
and if the feedback state in the current synchronization state is unrevealed and the synchronization time is greater than a set time threshold, resending the service data to the first message queue.
4. The method of claim 2, wherein the service data is plural; according to the current synchronization state, resending the service data to the first message queue comprises:
counting the number of data records of which the feedback state in the current synchronization state is unrevealed and the synchronization time is greater than a set time threshold;
and sending alarm information or resending a plurality of service data to the first message queue according to the number of the data records.
5. The method of claim 4, wherein sending alarm information or resending a plurality of the service data to the first message queue according to the number of data records comprises:
comparing the data record quantity with a set alarm threshold value;
if the number of the data records is larger than or equal to the alarm threshold value, sending alarm information;
and if the number of the data records is smaller than the alarm threshold value, retransmitting the plurality of service data to the first message queue.
6. An information synchronization method, comprising:
receiving pre-subscribed service data from a first message queue, and inquiring a second local file according to a set dimension field of the service data; the service data is generated by a message sending party and then sent to the first message queue;
when the business data do not exist in the second local file, storing the business data into the second local file;
and generating corresponding feedback information for the service data, and sending the feedback information to a message sender subscribing the feedback information in advance by using a second message queue so that the message sender updates the synchronization state of the service data stored in the first local file.
7. An information synchronization apparatus, comprising:
the initialization module is used for storing the produced service data into a first local file, initializing the synchronous state of the service data and recording the synchronous state of the service data into the first local file;
the sending module is used for sending the service data to a first message queue so that the first message queue sends the service data to a message receiving party subscribing the service data;
the updating module is used for updating the synchronous state when receiving the pre-subscribed feedback information from the second message queue; the feedback information is generated by the message receiving party when the service data exists in a second local file, and then is sent to the second message queue;
and the retransmission module is used for scanning the first local file to acquire the current synchronization state of the service data and retransmitting the service data to the first message queue according to the current synchronization state.
8. An information synchronization apparatus, comprising:
the query module is used for receiving pre-subscribed service data from the first message queue and querying a second local file according to the set dimension field of the service data; the service data is generated by a message sending party and then sent to the first message queue;
the synchronization module is used for storing the service data into the second local file when the second local file is determined not to have the service data;
and the feedback module is used for generating corresponding feedback information for the service data, and sending the feedback information to a message sending party subscribing the feedback information in advance by using a second message queue so as to enable the message sending party to update the synchronization state of the service data stored in the first local file.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911106603.9A CN111030784A (en) | 2019-11-13 | 2019-11-13 | Information synchronization method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911106603.9A CN111030784A (en) | 2019-11-13 | 2019-11-13 | Information synchronization method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111030784A true CN111030784A (en) | 2020-04-17 |
Family
ID=70205431
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911106603.9A Pending CN111030784A (en) | 2019-11-13 | 2019-11-13 | Information synchronization method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111030784A (en) |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111611308A (en) * | 2020-06-11 | 2020-09-01 | 上海乾臻信息科技有限公司 | Information processing method, device and system |
CN111813868A (en) * | 2020-08-13 | 2020-10-23 | 中国工商银行股份有限公司 | Data synchronization method and device |
CN111913911A (en) * | 2020-07-15 | 2020-11-10 | 杭州鸿泉物联网技术股份有限公司 | Service data forwarding method and server |
CN112134657A (en) * | 2020-09-12 | 2020-12-25 | 安阳师范学院 | Two-way asynchronous message transmission method based on perception and retransmission |
CN113177178A (en) * | 2021-04-30 | 2021-07-27 | 北京深演智能科技股份有限公司 | Message processing method and device, nonvolatile storage medium and processor |
CN113220435A (en) * | 2021-05-27 | 2021-08-06 | 深圳市商汤科技有限公司 | Task processing method and related product |
CN113379556A (en) * | 2021-07-02 | 2021-09-10 | 上海豹云网络信息服务有限公司 | Dynamic monitoring method, device and equipment for service data |
CN113760628A (en) * | 2020-06-05 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method and device for monitoring data processing |
CN113760566A (en) * | 2020-11-10 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method, device, system and storage medium for distributed transaction processing |
CN113837636A (en) * | 2021-09-29 | 2021-12-24 | 平安养老保险股份有限公司 | Service data acquisition method, device, equipment and storage medium |
CN114124871A (en) * | 2021-11-24 | 2022-03-01 | 中国银行股份有限公司 | Message information processing method and device of MQ message queue |
CN114168554A (en) * | 2022-02-14 | 2022-03-11 | 山东信通电子股份有限公司 | Point cloud annotation file synchronization method and device based on power transmission line |
WO2022068596A1 (en) * | 2020-09-30 | 2022-04-07 | 华为技术有限公司 | Metadata management method, and electronic device |
CN115174682A (en) * | 2022-06-17 | 2022-10-11 | 中国银联股份有限公司 | Data distribution method, system, center, device and computer readable storage medium |
CN116521622A (en) * | 2023-06-30 | 2023-08-01 | 中邮消费金融有限公司 | Method and system for automatically managing data based on data snapshot |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105338093A (en) * | 2015-11-16 | 2016-02-17 | 中国建设银行股份有限公司 | Data synchronizing method and system |
CN108614877A (en) * | 2018-04-27 | 2018-10-02 | 携程商旅信息服务(上海)有限公司 | The monitoring method and system of data reproduction process based on token bucket |
CN110232097A (en) * | 2019-06-21 | 2019-09-13 | 北京奇艺世纪科技有限公司 | A kind of method of data synchronization and device |
CN110413425A (en) * | 2019-07-24 | 2019-11-05 | 深圳乐信软件技术有限公司 | Third party's message callback method, device, server and storage medium |
-
2019
- 2019-11-13 CN CN201911106603.9A patent/CN111030784A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105338093A (en) * | 2015-11-16 | 2016-02-17 | 中国建设银行股份有限公司 | Data synchronizing method and system |
CN108614877A (en) * | 2018-04-27 | 2018-10-02 | 携程商旅信息服务(上海)有限公司 | The monitoring method and system of data reproduction process based on token bucket |
CN110232097A (en) * | 2019-06-21 | 2019-09-13 | 北京奇艺世纪科技有限公司 | A kind of method of data synchronization and device |
CN110413425A (en) * | 2019-07-24 | 2019-11-05 | 深圳乐信软件技术有限公司 | Third party's message callback method, device, server and storage medium |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113760628A (en) * | 2020-06-05 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method and device for monitoring data processing |
CN111611308A (en) * | 2020-06-11 | 2020-09-01 | 上海乾臻信息科技有限公司 | Information processing method, device and system |
CN111913911A (en) * | 2020-07-15 | 2020-11-10 | 杭州鸿泉物联网技术股份有限公司 | Service data forwarding method and server |
CN111813868A (en) * | 2020-08-13 | 2020-10-23 | 中国工商银行股份有限公司 | Data synchronization method and device |
CN111813868B (en) * | 2020-08-13 | 2023-11-10 | 中国工商银行股份有限公司 | Data synchronization method and device |
CN112134657A (en) * | 2020-09-12 | 2020-12-25 | 安阳师范学院 | Two-way asynchronous message transmission method based on perception and retransmission |
WO2022068596A1 (en) * | 2020-09-30 | 2022-04-07 | 华为技术有限公司 | Metadata management method, and electronic device |
CN113760566A (en) * | 2020-11-10 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method, device, system and storage medium for distributed transaction processing |
CN113760566B (en) * | 2020-11-10 | 2024-10-18 | 北京沃东天骏信息技术有限公司 | Distributed transaction processing method, device, system and storage medium |
CN113177178A (en) * | 2021-04-30 | 2021-07-27 | 北京深演智能科技股份有限公司 | Message processing method and device, nonvolatile storage medium and processor |
CN113220435A (en) * | 2021-05-27 | 2021-08-06 | 深圳市商汤科技有限公司 | Task processing method and related product |
CN113379556A (en) * | 2021-07-02 | 2021-09-10 | 上海豹云网络信息服务有限公司 | Dynamic monitoring method, device and equipment for service data |
CN113837636A (en) * | 2021-09-29 | 2021-12-24 | 平安养老保险股份有限公司 | Service data acquisition method, device, equipment and storage medium |
CN114124871A (en) * | 2021-11-24 | 2022-03-01 | 中国银行股份有限公司 | Message information processing method and device of MQ message queue |
CN114168554A (en) * | 2022-02-14 | 2022-03-11 | 山东信通电子股份有限公司 | Point cloud annotation file synchronization method and device based on power transmission line |
CN115174682A (en) * | 2022-06-17 | 2022-10-11 | 中国银联股份有限公司 | Data distribution method, system, center, device and computer readable storage medium |
CN116521622A (en) * | 2023-06-30 | 2023-08-01 | 中邮消费金融有限公司 | Method and system for automatically managing data based on data snapshot |
CN116521622B (en) * | 2023-06-30 | 2023-09-22 | 中邮消费金融有限公司 | Method and system for automatically managing data based on data snapshot |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111030784A (en) | Information synchronization method and device | |
US11711442B2 (en) | Push notification delivery system | |
RU2507580C2 (en) | Coordination and intermediate processing using information exchange archives | |
CN112073395B (en) | File distribution method and device | |
CN111341039B (en) | Card-retaining processing method and system, client and server | |
CN114513762A (en) | Service processing method and device, electronic equipment and computer readable medium | |
CN112241866B (en) | Service processing method and device, computer readable medium and electronic equipment | |
CN110798495A (en) | Method and server for end-to-end message push in cluster architecture mode | |
CN108076110B (en) | Electronic data exchange system and apparatus comprising an electronic data exchange system | |
CN113783913A (en) | Message pushing management method and device | |
CN113783666B (en) | Method and device for processing business | |
CN111401819B (en) | Intersystem data pushing method and system | |
CN113157461B (en) | Method and device for transmitting message in task list execution process | |
CN112836201A (en) | Method, device, equipment and computer readable medium for multi-platform information intercommunication | |
CN110019671B (en) | Method and system for processing real-time message | |
CN113238808A (en) | Message pushing method and device | |
CN113766437B (en) | Short message sending method and device | |
CN115334466B (en) | Message sending method and device, electronic equipment and storage medium | |
CN111581244B (en) | Method, system and equipment for orderly synchronizing service transaction data of heterogeneous system | |
CN114979308A (en) | Message processing method and device | |
CN113496366B (en) | Information processing method and system, server side and user side | |
CN112215529B (en) | Method, system, device and computer readable medium for acquiring data | |
CN109889590B (en) | Message processing method, device, client and computer readable medium | |
CN118396716A (en) | Order processing method and device | |
CN114866538A (en) | File submission method and device, electronic equipment and computer readable medium |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200417 |