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.
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, aninformation synchronization apparatus 500 of a message sender in the embodiment of the present invention mainly includes:
aninitializing 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 sendingmodule 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.
Anupdating 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.
Aretransmission 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, theretransmission 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, aninformation synchronization apparatus 600 of a message recipient in the embodiment of the present invention mainly includes:
thequery 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.
Asynchronization 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 thefeedback module 603. If the message receiver inquires the service data in its local file, the message receiver directly executes the processing procedure of thefeedback module 603.
Afeedback 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 anexemplary 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, thesystem architecture 700 may includeterminal devices 701, 702, 703, anetwork 704, and aserver 705. Thenetwork 704 serves to provide a medium for communication links between theterminal devices 701, 702, 703 and theserver 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 theterminal devices 701, 702, 703 to interact with aserver 705 over anetwork 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 theterminal devices 701, 702, and 703.
Theterminal 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.
Theserver 705 may be a server that provides various services, such as a background management server that an administrator processes using policy requests sent by theterminal 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 theserver 705, and accordingly, the information synchronization apparatus is generally disposed in theserver 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 acomputer 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, thecomputer 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 astorage section 808 into a Random Access Memory (RAM) 803. In theRAM 803, various programs and data necessary for the operation of thecomputer system 800 are also stored. TheCPU 801,ROM 802, andRAM 803 are connected to each other via abus 804. An input/output (I/O)interface 805 is also connected tobus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; anoutput section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; astorage portion 808 including a hard disk and the like; and acommunication section 809 including a network interface card such as a LAN card, a modem, or the like. Thecommunication section 809 performs communication processing via a network such as the internet. Adrive 810 is also connected to the I/O interface 805 as necessary. Aremovable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on thedrive 810 as necessary, so that a computer program read out therefrom is mounted on thestorage 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 thecommunication section 809 and/or installed from theremovable 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.