CN112631798A - Message synchronization method and device, computer equipment and storage medium - Google Patents

Message synchronization method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112631798A
CN112631798A CN202011524831.0A CN202011524831A CN112631798A CN 112631798 A CN112631798 A CN 112631798A CN 202011524831 A CN202011524831 A CN 202011524831A CN 112631798 A CN112631798 A CN 112631798A
Authority
CN
China
Prior art keywords
message
synchronized
identifier
synchronization
identification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011524831.0A
Other languages
Chinese (zh)
Inventor
焦连杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011524831.0A priority Critical patent/CN112631798A/en
Publication of CN112631798A publication Critical patent/CN112631798A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to the technical field of data monitoring, and discloses a message synchronization method, a message synchronization device, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a message to be synchronized according to a synchronization check request, and sending the message to be synchronized to a message middleware to obtain a synchronized message so as to synchronize the message to be synchronized; extracting the synchronized message identification in the synchronized message, and acquiring the synchronized message identification in the message middleware; comparing the synchronized message identification with the synchronization message identification; and acquiring the synchronous message identifier which is not contained in the synchronous message identifier, and synchronizing the message corresponding to the synchronous message identifier which is not contained to the message middleware, so that the lost message is synchronized again, the service influence is reduced, and meanwhile, the abnormal condition of the message can be found at the first time and repaired in time. Since the synchronized messages may also be stored in a blockchain, blockchain techniques are also involved.

Description

Message synchronization method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data monitoring technologies, and in particular, to a method and an apparatus for synchronizing messages, a computer device, and a storage medium.
Background
In software system development, data synchronization is often performed through message middleware in order to decouple a core system and a peripheral system and remove dependency between systems.
Message queues are an implementation of message middleware, which is to store message containers during the transmission of messages. After the producer generates the message, the message is pushed to the message middleware, the message is temporarily stored in the message queue, and according to the subscription relationship, the consumer obtains the message and consumes the message. In this mode, the producer is only responsible for generating the message and it is not clear whether the message was successfully consumed by the consumer. The possibility of data loss in this process mainly includes: the producer loses data, because the producer has defects, the application function processing scene is not enough, so that part of the message is not pushed, and the producer pushes the message to the message middleware, which is caused by abnormity, on the other hand, the method is as follows: the data loss of the consumer is caused by the fact that the message itself has problems due to the fact that an exception occurs in the process of consuming the message by the application instance, the process is terminated or the instance is restarted.
The information is not easy to perceive after being lost, a relatively serious production problem is often caused when the problem is found, the time for generating the problem data cannot be determined, no relevant log exists, and the problem troubleshooting difficulty is high.
Disclosure of Invention
The invention mainly aims to provide a message synchronization method, a message synchronization device, computer equipment and a storage medium, and aims to improve the timeliness of message synchronization.
In order to achieve the above object, the present invention provides a message synchronization method, which includes the following steps:
acquiring a synchronous verification request;
acquiring a message to be synchronized according to the synchronization check request, and sending the message to be synchronized to a message middleware to obtain a synchronized message so as to synchronize the message to be synchronized;
extracting the synchronized message identification in the synchronized message, and acquiring the synchronized message identification in the message middleware;
comparing the synchronized message identification with the synchronous message identification to judge whether the synchronous message identification contains the synchronized message identification;
and acquiring the synchronous message identification which is not contained in the synchronous message identification, and synchronizing the message corresponding to the synchronous message identification which is not contained to the message middleware.
Optionally, before the extracting the synchronized message identifier in the synchronized message and acquiring the synchronized message identifier in the message middleware, the method further includes:
acquiring a synchronized message and a synchronized message in message middleware, wherein the synchronized message is stored in a block chain;
marking the synchronized message in a first preset mode to obtain a synchronized message mark in the synchronized message;
and identifying the synchronous message in the message middleware in a second preset mode to obtain the synchronous message identification in the message middleware.
Optionally, the synchronized message identifier includes a service master key, and the synchronized message identifier includes a messageID;
the comparing the synchronized message identifier with the synchronized message identifier to determine whether the synchronized message identifier includes:
and comparing the service main key in the synchronized message identifier with the messageID in the synchronized message identifier to judge whether the synchronized message identifiers all contain the synchronized message identifier.
Optionally, the comparing the synchronized message identifier with the synchronization message identifier to determine whether the synchronization message identifiers all contain the synchronized message identifier includes:
judging whether the synchronized message identification is consistent with the synchronized message identification;
when the synchronized message identifier is inconsistent with the synchronized message identifier, acquiring the identifier type of the synchronized message identifier and the identifier type of the synchronized message identifier;
normalizing the identification type of the synchronized message identification and the identification type of the synchronized message identification to obtain a processed synchronized message identification and a processed synchronized message identification;
and judging whether the synchronous message identifications contain the synchronous message identifications or not according to the processed synchronous message identifications and the processed synchronous message identifications.
Optionally, the obtaining of the synchronization message identifier that is not included in the synchronization message identifier, and after synchronizing the message corresponding to the synchronization message identifier that is not included in the synchronization message identifier to the message middleware, further includes:
acquiring a synchronized target message identifier and a processed message identifier fed back by a message processing device;
comparing the fed back processed message identification with the synchronized target message identification to judge whether the message corresponding to the synchronized target message identification is processed or not, and obtaining a judgment result;
and determining whether to carry out synchronization again according to the judgment result.
Optionally, the obtaining of the synchronization message identifier that is not included in the synchronization message identifier, and after synchronizing the message corresponding to the synchronization message identifier that is not included in the synchronization message identifier to the message middleware, further includes:
acquiring a synchronized target message identifier, sending the synchronized target message identifier to a message processing device so that the message processing device acquires a processed message identifier, comparing the processed message identifier with the synchronized target message identifier to judge whether a message corresponding to the synchronized target message identifier is processed or not, acquiring a judgment result, and feeding back the judgment result;
and acquiring a judgment result fed back by the message processing device, and determining whether to carry out synchronization again according to the judgment result.
Optionally, the obtaining a judgment result fed back by the message processing apparatus, and after determining whether to perform synchronization again according to the judgment result, further includes:
when the judgment result is that the message corresponding to the synchronized target message identifier is not processed, acquiring an unsynchronized message;
and generating notification information according to the unsynchronized message, and sending the notification information to a mobile terminal corresponding to a preset user so as to remind the preset user.
In addition, to achieve the above object, the present invention also provides a computer device, including: a memory, a processor and a message synchronization program stored on the memory and executable on the processor, the message synchronization program configured to implement the steps of the message synchronization method as described above.
Furthermore, to achieve the above object, the present invention further provides a storage medium having a message synchronization program stored thereon, which when executed by a processor implements the steps of the message synchronization method as described above.
In addition, to achieve the above object, the present invention further provides a message synchronization apparatus, including:
the acquisition module is used for acquiring a synchronous verification request;
the synchronization module is used for acquiring a message to be synchronized according to the synchronization check request, and sending the message to be synchronized to a message middleware to obtain a synchronized message so as to synchronize the message to be synchronized;
the extraction module is used for extracting the synchronized message identifier in the synchronized message and acquiring the synchronized message identifier in the message middleware;
the comparison module is used for comparing the synchronized message identification with the synchronous message identification so as to judge whether the synchronous message identifications all contain the synchronized message identification;
the synchronization module is further configured to acquire an already-synchronized message identifier that is not included in the synchronization message identifier, and synchronize a message corresponding to the already-synchronized message identifier that is not included to the message middleware.
The message synchronization method provided by the invention obtains the synchronization check request; acquiring a message to be synchronized according to the synchronization check request, and sending the message to be synchronized to a message middleware to obtain a synchronized message so as to synchronize the message to be synchronized; extracting the synchronized message identification in the synchronized message, and acquiring the synchronized message identification in the message middleware; comparing the synchronized message identification with the synchronous message identification to judge whether the synchronous message identification contains the synchronized message identification; and acquiring the synchronous message identifier which is not contained in the synchronous message identifier, and synchronizing the message corresponding to the synchronous message identifier which is not contained to the message middleware, so that the lost message is synchronized again, the service influence is reduced, and meanwhile, the abnormal condition of the message can be found at the first time and repaired in time.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a message synchronization method according to the present invention;
FIG. 3 is a flowchart illustrating a message synchronization method according to a second embodiment of the present invention;
FIG. 4 is a flowchart illustrating a message synchronization method according to a third embodiment of the present invention;
fig. 5 is a functional block diagram of a message synchronization apparatus according to a first embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the apparatus may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may comprise a Display screen (Display), an input unit such as keys, and the optional user interface 1003 may also comprise a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and a message synchronization program.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting an external network and performing data communication with other network devices; the user interface 1003 is mainly used for connecting user equipment and performing data communication with the equipment; the device calls a message synchronization program stored in the memory 1005 through the processor 1001, and executes the message synchronization implementation method provided by the embodiment of the present invention.
Based on the above hardware structure, the embodiment of the message synchronization method of the present invention is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a message synchronization method according to the present invention, in the first embodiment, the message synchronization method includes the following steps:
step S10, a synchronization check request is obtained.
It should be noted that, the execution subject in this embodiment may be a server for data processing, and may also be other terminal devices that can implement the same or similar functions.
In this embodiment, the synchronous verification request may be a synchronous verification request automatically initiated within a preset period, for example, a day or 2h, and may also be other period parameters.
It can be understood that, when the message to be synchronized is acquired, after the message to be synchronized is synchronized to the message middleware, the service key of the message and the messageID returned by the message middleware are recorded, that is, the synchronized message can be obtained through the service key of the message, thereby realizing the identification of the synchronized message.
Step S20, obtaining the message to be synchronized according to the synchronization check request, and sending the message to be synchronized to a message middleware to obtain the synchronized message, so as to synchronize the message to be synchronized.
In this embodiment, the message middleware may be a message queue, which is used to store a message container in a message transmission process, and may also be in other forms.
In a specific implementation, when a message task is obtained, it is determined whether the message task needs to be synchronized, that is, whether a message attribute in the message task carries a message synchronization tag, and when the message attribute in the message task carries the message synchronization tag, a message carrying the message synchronization tag is used as a message to be synchronized.
It is emphasized that the synchronized message may also be stored in a node of a blockchain in order to further ensure privacy and security of the synchronized message.
Step S30, extracting the synchronized message identifier in the synchronized message, and acquiring the synchronized message identifier in the message middleware.
In this embodiment, the synchronized message identifier may be in the form of a service primary key, or may also be in other identifier forms, which is not limited in this embodiment, a form of a service primary key is taken as an example for description, for example, a message and a corresponding primary key identifier key1, where the synchronized message identifier in the message middleware may be identified in the form of a messageID, or may be identified in other forms, which is not limited in this embodiment.
In the specific implementation, after the message to be synchronized is synchronized to the message middleware, the service key of the message and the messageID returned by the message middleware are recorded, and the message middleware generates the corresponding messageID according to the synchronized message, so as to realize the identification of the synchronized message in the message middleware.
Step S40, comparing the synchronized message identifier with the synchronization message identifier to determine whether the synchronization message identifiers all contain the synchronized message identifier.
In this embodiment, the synchronized message identifier is an identifier corresponding to a data queue that needs to be synchronized in the message and is synchronized in the middleware, and the synchronized message identifier is an identifier of a data queue that is recorded in the middleware and is synchronized in the middleware.
In the specific implementation, whether the messageID fed back by the message middleware contains the service key for recording the message is judged by obtaining the messageID fed back by the message middleware and the service key for recording the message, for example, the messageID fed back by the middleware is 100-plus-200, the service key for recording the message contains the service key for recording the message in the messageID fed back by the message middleware, which indicates that the message is completely synchronized, the messageID fed back by the middleware is 100-plus-150, the service key for recording the message is 100-plus-200, and the message whose service key is 150-plus-200 does not contain all the service keys for recording the message in the messageID fed back by the message middleware, which indicates that the message is not synchronized, that an abnormal condition occurs, and the identification of the lost message is realized, thereby realizing the timely verification of data synchronization.
Step S50, acquiring an already-synchronized message identifier that is not included in the synchronization message identifier, and synchronizing a message corresponding to the already-synchronized message identifier that is not included to the message middleware.
In this embodiment, the un-synchronized data is subjected to complementary processing to reduce the service impact, that is, the un-included synchronized disappearance identifier in the middleware is obtained, and the un-included synchronized disappearance identifier is re-sent to the middleware for complementary processing, so as to implement timely repair of the lost message, for example, the message with the main service key of 150-.
According to the scheme, the synchronous verification request is acquired; acquiring a message to be synchronized according to the synchronization check request, and sending the message to be synchronized to a message middleware to obtain a synchronized message so as to synchronize the message to be synchronized; extracting the synchronized message identification in the synchronized message, and acquiring the synchronized message identification in the message middleware; comparing the synchronized message identification with the synchronous message identification to judge whether the synchronous message identification contains the synchronized message identification; and acquiring the synchronous message identifier which is not contained in the synchronous message identifier, and synchronizing the message corresponding to the synchronous message identifier which is not contained to the message middleware, so that the lost message is synchronized again, the service influence is reduced, and meanwhile, the abnormal condition of the message can be found at the first time and repaired in time.
In an embodiment, as shown in fig. 3, a second embodiment of the message synchronization method according to the present invention is proposed based on the first embodiment, in this embodiment, before the step S30, the method further includes:
step S301, the synchronized message and the synchronized message in the message middleware are acquired.
In this embodiment, the synchronized message is a message generated by a message generator, the synchronized message is a message in a message intermediate record, and the message generated by the message generator is compared with the message in the message intermediate record, so that the lost message and the unsynchronized message are located in time.
Step S302, the synchronized message is identified by adopting a first preset mode, and the synchronized message identification in the synchronized message is obtained.
It should be noted that the first preset manner is in the form of a message primary key, for example, key1, and may also be in other forms.
Step S303, identifying the synchronous message in the message middleware in a second preset mode to obtain the synchronous message identification in the message middleware.
It can be understood that the second preset manner is a form of a message identifier, for example, a messageID, and may also be another form.
In an embodiment, the synchronized message identifier includes a service master key, the synchronized message identifier includes a messageID, and the step S40 includes: and comparing the service main key in the synchronized message identifier with the messageID in the synchronized message identifier to judge whether the synchronized message identifiers all contain the synchronized message identifier.
In one embodiment, the step S40 includes:
judging whether the synchronized message identification is consistent with the synchronized message identification; when the synchronized message identifier is inconsistent with the synchronized message identifier, acquiring the identifier type of the synchronized message identifier and the identifier type of the synchronized message identifier; normalizing the identification type of the synchronized message identification and the identification type of the synchronized message identification to obtain a processed synchronized message identification and a processed synchronized message identification; and judging whether the synchronous message identifications contain the synchronous message identifications or not according to the processed synchronous message identifications and the processed synchronous message identifications.
In this embodiment, in order to implement the comparison between the synchronized message identifier and the synchronized message identifier, because the identifiers are defined differently, in order to ensure the accuracy of the comparison, the synchronized message identifier and the synchronized message identifier may be processed, so as to ensure that the synchronized message identifier is consistent with the synchronized message identifier, and then the comparison is performed according to the processed message, so that the system has checked and accounted the abnormal data, which is convenient for the analysis and the troubleshooting of the problem.
It can be understood that after the producer synchronizes the message to the message middleware, the message id returned by the message middleware and the service key of the message are recorded, after the consumer successfully consumes the message, the message id of the message is recorded, and the producer periodically synchronizes the message id of the successfully synchronized message.
According to the scheme provided by the embodiment, when the synchronized message identifier is inconsistent with the synchronized message identifier, the synchronized message identifier and the synchronized message identifier are subjected to normalization processing to obtain the processed synchronized message identifier and the processed synchronized message identifier, so that the synchronized message identifier is ensured to be consistent with the synchronized message identifier, and rapid message comparison is realized.
In an embodiment, as shown in fig. 4, a third embodiment of the message synchronization method according to the present invention is proposed based on the first embodiment or the second embodiment, and in this embodiment, based on the first embodiment, after the step S50, the method further includes:
step S501, obtain the synchronized target message identifier and the processed message identifier fed back by the message processing apparatus.
In this embodiment, the message processing apparatus may be a device to which the consumer belongs, or may also be a processing device engaged in other tasks, which is not limited in this embodiment.
Step S502, comparing the fed back processed message identification with the synchronized target message identification to judge whether the message corresponding to the synchronized target message identification is processed or not, and obtaining a judgment result.
In the specific implementation, the producer synchronizes the messageIDs of the messages which are successfully synchronized regularly, the consumer checks whether the messages are successfully consumed after receiving the messageIDs, and the messages which are not successfully consumed are returned to the producer to be synchronized again by the producer, so that the loss of the messages and the abnormity of the service are avoided.
And step S503, determining whether to carry out synchronization again according to the judgment result.
In this embodiment, the determination results may be unprocessed determination results and processed determination results, the unprocessed determination results are synchronized with the generator to be processed complementarily, and the synchronized determination results are not processed.
In an embodiment, after the step S50, the method further includes:
acquiring a synchronized target message identifier, sending the synchronized target message identifier to a message processing device so that the message processing device acquires a processed message identifier, comparing the processed message identifier with the synchronized target message identifier to judge whether a message corresponding to the synchronized target message identifier is processed or not, acquiring a judgment result, and feeding back the judgment result; and acquiring a judgment result fed back by the message processing device, and determining whether to carry out synchronization again according to the judgment result.
In this embodiment, the message processing apparatus may be a consumer side, the producer periodically synchronizes the messageids of messages that are successfully synchronized, the consumer receives the messageids and then checks whether the messages are successfully consumed, and the messageids that are not successfully consumed are returned to the producer for resynchronization by the producer.
In an embodiment, after obtaining the judgment result fed back by the message processing apparatus and determining whether to perform synchronization again according to the judgment result, the method further includes:
when the judgment result is that the message corresponding to the synchronized target message identifier is not processed, acquiring an unsynchronized message; and generating notification information according to the unsynchronized message, and sending the notification information to a mobile terminal corresponding to a preset user so as to remind the preset user.
It should be noted that the preset user may be a system administrator, or may also be a system affiliate, and when an unsynchronized message is obtained, the notification information is automatically generated and sent to the system affiliate, so that the system affiliate can know the system stability in time, and know the system abnormality at the first time, thereby improving the intelligence of message synchronization.
According to the scheme provided by the embodiment, besides the message synchronization is carried out through the message middleware, the secondary verification can be carried out through the message processing device, so that a timely message account checking mechanism is realized, the system regularly checks the message, the lost message is synchronized again, and the service influence is reduced.
The invention further provides a message synchronization device.
Referring to fig. 5, fig. 5 is a functional block diagram of a message synchronization apparatus according to a first embodiment of the present invention.
In a first embodiment of the message synchronization apparatus of the present invention, the message synchronization apparatus includes:
an obtaining module 10, configured to obtain the synchronization check request.
And the synchronization module 20 is configured to obtain a message to be synchronized according to the synchronization check request, and send the message to be synchronized to a message middleware to obtain a synchronized message, so as to synchronize the message to be synchronized.
The extracting module 30 is configured to extract the synchronized message identifier in the synchronized message, and acquire the synchronized message identifier in the message middleware.
A comparing module 40, configured to compare the synchronized message identifier with the synchronization message identifier, so as to determine whether the synchronization message identifiers all contain the synchronized message identifier.
The synchronization module 20 is further configured to acquire an already-synchronized message identifier that is not included in the synchronization message identifier, and synchronize a message corresponding to the already-synchronized message identifier that is not included to the message middleware.
In an embodiment, the obtaining module 10 is further configured to obtain a synchronized message and a synchronization message in the message middleware;
marking the synchronized message in a first preset mode to obtain a synchronized message mark in the synchronized message;
and identifying the synchronous message in the message middleware in a second preset mode to obtain the synchronous message identification in the message middleware.
In an embodiment, the synchronized message identification comprises a service master key, and the synchronized message identification comprises a messageID;
the comparing module 40 is further configured to compare the service primary key in the synchronized message identifier with the messageID in the synchronized message identifier, so as to determine whether the synchronized message identifier contains the synchronized message identifier.
In an embodiment, the comparing module 40 is further configured to determine whether the synchronized message identifier is consistent with the synchronization message identifier;
when the synchronized message identifier is inconsistent with the synchronized message identifier, acquiring the identifier type of the synchronized message identifier and the identifier type of the synchronized message identifier;
normalizing the identification type of the synchronized message identification and the identification type of the synchronized message identification to obtain a processed synchronized message identification and a processed synchronized message identification;
and judging whether the synchronous message identifications contain the synchronous message identifications or not according to the processed synchronous message identifications and the processed synchronous message identifications.
In an embodiment, the synchronization module 20 is further configured to obtain a synchronized target message identifier and a processed message identifier fed back by the message processing apparatus;
comparing the fed back processed message identification with the synchronized target message identification to judge whether the message corresponding to the synchronized target message identification is processed or not, and obtaining a judgment result;
and determining whether to carry out synchronization again according to the judgment result.
In an embodiment, the obtaining module 10 is further configured to obtain a synchronized target message identifier, and send the synchronized target message identifier to a message processing device, so that the message processing device obtains a processed message identifier, and compares the processed message identifier with the synchronized target message identifier to determine whether a message corresponding to the synchronized target message identifier is processed, obtain a determination result, and feed back the determination result;
and acquiring a judgment result fed back by the message processing device, and determining whether to carry out synchronization again according to the judgment result.
In an embodiment, the obtaining module 10 is further configured to obtain an unsynchronized message when the determination result indicates that the message corresponding to the synchronized target message identifier is not processed;
and generating notification information according to the unsynchronized message, and sending the notification information to a mobile terminal corresponding to a preset user so as to remind the preset user.
The message synchronization device of the present invention adopts all the technical solutions of all the embodiments described above, so that at least all the beneficial effects brought by the technical solutions of the embodiments described above are achieved, and no further description is given here.
In addition, to achieve the above object, the present invention also provides a computer device, including: a memory, a processor and a message synchronization program stored on the memory and executable on the processor, the message synchronization program configured to implement the steps of the message synchronization method as described above.
Furthermore, an embodiment of the present invention further provides a storage medium, where a message synchronization program is stored on the storage medium, and the message synchronization program is executed by a processor to perform the steps of the message synchronization method described above.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, and includes several instructions for enabling an intelligent terminal (which may be a mobile phone, a computer, a terminal, an air conditioner, or a network terminal) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A message synchronization method, characterized in that the message synchronization method comprises:
acquiring a synchronous verification request;
acquiring a message to be synchronized according to the synchronization check request, and sending the message to be synchronized to a message middleware to obtain a synchronized message so as to synchronize the message to be synchronized;
extracting the synchronized message identification in the synchronized message, and acquiring the synchronized message identification in the message middleware;
comparing the synchronized message identification with the synchronous message identification to judge whether the synchronous message identification contains the synchronized message identification;
and acquiring the synchronous message identification which is not contained in the synchronous message identification, and synchronizing the message corresponding to the synchronous message identification which is not contained to the message middleware.
2. The message synchronization method of claim 1, wherein before extracting the synchronized message identifier in the synchronized message and acquiring the synchronized message identifier in the message middleware, the method further comprises:
acquiring a synchronized message and a synchronized message in message middleware, wherein the synchronized message is stored in a block chain;
marking the synchronized message in a first preset mode to obtain a synchronized message mark in the synchronized message;
and identifying the synchronous message in the message middleware in a second preset mode to obtain the synchronous message identification in the message middleware.
3. The message synchronization method of claim 1, wherein the synchronized message identification comprises a service master key, the synchronized message identification comprises a messageID;
the comparing the synchronized message identifier with the synchronized message identifier to determine whether the synchronized message identifier includes:
and comparing the service main key in the synchronized message identifier with the messageID in the synchronized message identifier to judge whether the synchronized message identifiers all contain the synchronized message identifier.
4. The message synchronization method of claim 1, wherein the comparing the synchronized message identifier with the synchronization message identifier to determine whether the synchronization message identifiers all contain the synchronized message identifier comprises:
judging whether the synchronized message identification is consistent with the synchronized message identification;
when the synchronized message identifier is inconsistent with the synchronized message identifier, acquiring the identifier type of the synchronized message identifier and the identifier type of the synchronized message identifier;
normalizing the identification type of the synchronized message identification and the identification type of the synchronized message identification to obtain a processed synchronized message identification and a processed synchronized message identification;
and judging whether the synchronous message identifications contain the synchronous message identifications or not according to the processed synchronous message identifications and the processed synchronous message identifications.
5. The message synchronization method according to any one of claims 1 to 4, wherein the obtaining of the synchronized message identifier that is not included in the synchronization message identifier and synchronizing the message corresponding to the synchronized message identifier that is not included to the message middleware further comprises:
acquiring a synchronized target message identifier and a processed message identifier fed back by a message processing device;
comparing the fed back processed message identification with the synchronized target message identification to judge whether the message corresponding to the synchronized target message identification is processed or not, and obtaining a judgment result;
and determining whether to carry out synchronization again according to the judgment result.
6. The message synchronization method according to any one of claims 1 to 4, wherein the obtaining of the synchronized message identifier that is not included in the synchronization message identifier and synchronizing the message corresponding to the synchronized message identifier that is not included to the message middleware further comprises:
acquiring a synchronized target message identifier, sending the synchronized target message identifier to a message processing device so that the message processing device acquires a processed message identifier, comparing the processed message identifier with the synchronized target message identifier to judge whether a message corresponding to the synchronized target message identifier is processed or not, acquiring a judgment result, and feeding back the judgment result;
and acquiring a judgment result fed back by the message processing device, and determining whether to carry out synchronization again according to the judgment result.
7. The message synchronization method according to claim 6, wherein after obtaining the judgment result fed back by the message processing apparatus and determining whether to perform synchronization again according to the judgment result, the method further comprises:
when the judgment result is that the message corresponding to the synchronized target message identifier is not processed, acquiring an unsynchronized message;
and generating notification information according to the unsynchronized message, and sending the notification information to a mobile terminal corresponding to a preset user so as to remind the preset user.
8. A computer device, characterized in that the computer device comprises: memory, a processor and a message synchronization program stored on the memory and executable on the processor, the message synchronization program being configured to implement the steps of the message synchronization method as claimed in any one of claims 1 to 7.
9. A storage medium having stored thereon a message synchronization program which, when executed by a processor, implements the steps of the message synchronization method of any of claims 1 to 7.
10. A message synchronization apparatus, characterized in that the message synchronization apparatus comprises:
the acquisition module is used for acquiring a synchronous verification request;
the synchronization module is used for acquiring a message to be synchronized according to the synchronization check request, and sending the message to be synchronized to a message middleware to obtain a synchronized message so as to synchronize the message to be synchronized;
the extraction module is used for extracting the synchronized message identifier in the synchronized message and acquiring the synchronized message identifier in the message middleware;
the comparison module is used for comparing the synchronized message identification with the synchronous message identification so as to judge whether the synchronous message identifications all contain the synchronized message identification;
the synchronization module is further configured to acquire an already-synchronized message identifier that is not included in the synchronization message identifier, and synchronize a message corresponding to the already-synchronized message identifier that is not included to the message middleware.
CN202011524831.0A 2020-12-21 2020-12-21 Message synchronization method and device, computer equipment and storage medium Pending CN112631798A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011524831.0A CN112631798A (en) 2020-12-21 2020-12-21 Message synchronization method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011524831.0A CN112631798A (en) 2020-12-21 2020-12-21 Message synchronization method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112631798A true CN112631798A (en) 2021-04-09

Family

ID=75320762

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011524831.0A Pending CN112631798A (en) 2020-12-21 2020-12-21 Message synchronization method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112631798A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884975A (en) * 2022-04-29 2022-08-09 青岛海尔科技有限公司 Service message processing method and device, storage medium and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884975A (en) * 2022-04-29 2022-08-09 青岛海尔科技有限公司 Service message processing method and device, storage medium and electronic device
CN114884975B (en) * 2022-04-29 2024-03-22 青岛海尔科技有限公司 Service message processing method and device, storage medium and electronic device

Similar Documents

Publication Publication Date Title
CN108769212B (en) Data synchronization method and device, computer equipment and storage medium
CN110224855B (en) Registration method and device of micro service instance, computer equipment and storage medium
JP4788213B2 (en) Time stamp verification program and time stamp verification system
CN111726420A (en) Communication method, device, equipment and storage medium based on RPA
CN103064757A (en) Method and system for backing up data
CN112905536B (en) Data verification synchronization method and device based on block chain
CN112631798A (en) Message synchronization method and device, computer equipment and storage medium
CN113779153A (en) Data synchronization method and device, electronic equipment and storage medium
CN108228417B (en) Internet of vehicles log processing method and device
CN112306871A (en) Data processing method, device, equipment and storage medium
CN108881320B (en) Authentication processing method for user login, server and client
CN113904955B (en) Detection method, device and system of data transmission link
CN107566451B (en) Equipment networking method and system
CN115859319A (en) Signing and sealing method and device for electronic document and storage medium
CN115203697A (en) File detection method, device and equipment and readable storage medium
CN107832124B (en) Method and device for processing task in file processing system
CN112910595A (en) Real-time communication method and device
CN110674139B (en) Information processing method, system, resource management system and storage medium
CN112052184A (en) Automatic generation method and device for test script and storage medium
CN115632781A (en) Encryption algorithm compliance detection method and device, electronic equipment and storage medium
CN113138862A (en) Message processing method, server, device, system and storage medium
CN114584328B (en) API interface access method, computer device and computer storage medium
CN110569646B (en) File recognition method and medium
CN112737812B (en) Data transmission method and device
CN117216011B (en) File transmission method and device and electronic equipment

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