[go: up one dir, main page]

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

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

Info

Publication number
CN118677909B
CN118677909B CN202411149150.9A CN202411149150A CN118677909B CN 118677909 B CN118677909 B CN 118677909B CN 202411149150 A CN202411149150 A CN 202411149150A CN 118677909 B CN118677909 B CN 118677909B
Authority
CN
China
Prior art keywords
message
local
node
remote
state mark
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202411149150.9A
Other languages
Chinese (zh)
Other versions
CN118677909A (en
Inventor
马明慧
朱红玉
李海南
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Metabrain Intelligent Technology Co Ltd
Original Assignee
Suzhou Metabrain Intelligent Technology 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 Suzhou Metabrain Intelligent Technology Co Ltd filed Critical Suzhou Metabrain Intelligent Technology Co Ltd
Priority to CN202411149150.9A priority Critical patent/CN118677909B/en
Publication of CN118677909A publication Critical patent/CN118677909A/en
Application granted granted Critical
Publication of CN118677909B publication Critical patent/CN118677909B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a message synchronization method, a device, equipment and a computer readable storage medium, relating to the technical field of computer application, comprising the following steps: generating a message synchronization request according to the message to be synchronized; acquiring a preset message execution sequence of a received message and a sent message; sending a message synchronization request to the inside auxiliary node and the outside auxiliary node according to the message execution sequence; receiving first reply information returned by the auxiliary node in the domain and second reply information returned by the node outside the domain; the second reply message is generated after the outside-domain node forwards a message synchronization request to the inside-domain master node and receives the third reply message returned by the inside-domain master node; and when the first reply information and the second reply information are the information updating completion, updating the information to be synchronized to the local. The invention improves and reduces the communication times, reduces the consumption of communication resources and improves the communication efficiency of message synchronization.

Description

Message synchronization method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to a method, an apparatus, a device, and a computer readable storage medium for synchronizing messages.
Background
Multi-controller complex systems are increasingly used in various fields, and in order to improve the performance and reliability of the system, it is necessary to synchronize messages with the multi-controllers.
At present, a common synchronization mechanism is adopted to synchronize messages among controllers, namely when one controller generates a message to be synchronized, the controller needs to synchronize the message to be synchronized to other controllers respectively, and when the message to be synchronized exists in a plurality of controllers, a plurality of message receiving and message sending tasks are generated in each controller. A large number of messages are generated on the communication channel, so that the number of messages to be sent, the number of times of sending and the communication time delay are greatly increased, the efficiency of message synchronization is reduced, and the complexity of message communication processing is increased.
In summary, how to effectively solve the problems of large message sending number and sending times, prolonged communication, low message synchronization efficiency, high complexity of message communication processing, etc. is an urgent need of those skilled in the art at present.
Disclosure of Invention
The invention aims to provide a message synchronization method, which improves and reduces the communication times, reduces the consumption of communication resources and improves the communication efficiency of message synchronization; it is a further object of the invention to provide a message synchronization device, a computer readable storage medium and a computer program product.
In order to solve the technical problems, the invention provides the following technical scheme:
A message synchronization method, comprising:
generating a message synchronization request according to the message to be synchronized;
acquiring a preset message execution sequence of a received message and a sent message;
sending a message synchronization request to the inside auxiliary node and the outside auxiliary node according to the message execution sequence;
receiving first reply information returned by the intra-domain auxiliary node and second reply information returned by the external node; the second reply message is generated after the external node forwards the message synchronization request to the internal main node and receives the third reply message returned by the internal main node;
and when the first reply information and the second reply information are both information updating completion, updating the information to be synchronized to the local.
In one embodiment of the present invention, after sending the message synchronization request to the inside secondary node and the outside secondary node in the order of execution of the messages, the method further includes:
generating a local transmission waiting state mark corresponding to the message to be synchronized;
Acquiring a state mark queue generated according to the message execution sequence and the existing message to be processed;
And inserting the local transmission waiting state mark into the state mark queue according to the message execution order.
In one embodiment of the present invention, after receiving the first reply message returned by the secondary node in the domain and the second reply message returned by the secondary node outside the domain, the method further includes:
generating a local in-process state mark corresponding to the message to be synchronized;
and replacing the local transmission waiting state mark corresponding to the message to be synchronized by using the local processing state mark.
In a specific embodiment of the present invention, after updating the message to be synchronized to the local, the method further includes:
and replacing the local in-process state mark corresponding to the message to be synchronized with a normal state mark.
In one embodiment of the present invention, after inserting the local transmission waiting status flag into the status flag queue according to the message execution order, before receiving the first reply message returned by the intra-domain secondary node and the second reply message returned by the external node, the method further includes:
When receiving the information sent by the external node and/or the internal master node, generating a conflict state mark;
and replacing the local transmission waiting state mark corresponding to the message to be synchronized by using the conflict state mark.
In a specific embodiment of the present invention, after replacing the local transmission waiting status flag corresponding to the message to be synchronized with the conflict status flag, the method further includes:
Searching whether a remote message state mark exists in the state mark queue;
If yes, generating a remote message waiting state mark corresponding to the message sent by the external node and/or the internal master node;
Inserting the remote message waiting status flag into the tail of the remote message status flag in the status flag queue;
Replacing conflict state marks corresponding to the message to be synchronized by using the local transmission waiting state marks;
If not, when the local transmission is determined to be processed preferentially according to the message execution sequence, generating a remote waiting superposition state mark in the local transmission;
replacing a conflict state mark corresponding to the message to be synchronized by using the remote waiting superposition state mark in the local processing;
When the message of the opposite terminal is determined to be processed preferentially according to the message execution sequence, a local ready superposition state mark in remote processing is generated;
and replacing the conflict state mark corresponding to the message to be synchronized by using the local ready superposition state mark in the remote processing.
In one embodiment of the present invention, the method further comprises:
Receiving a message to be forwarded sent by the node outside the domain;
Generating a local forwarding waiting state mark according to the message to be forwarded;
And adding the local forwarding waiting state flag to the state flag queue.
In one embodiment of the present invention, adding the local forwarding waiting status flag to the status flag queue includes:
searching whether a local message state mark exists in the state mark queue;
If yes, the local forwarding waiting state flag is added to the tail of the local message state flag in the state flag queue.
In one embodiment of the present invention, when it is determined that the status flag queue does not have a local message status flag, the method further includes:
judging whether a remote message state mark exists in the state mark queue;
if not, the local forwarding waiting state flag is added to the head of the state flag queue.
In one embodiment of the present invention, when it is determined that the status flag queue does not have a local message status flag but has a remote message status flag, the method further comprises:
Inserting the local forwarding waiting status flag into the head of the status flag queue when it is determined to prioritize local transmission according to the message execution order;
and when the priority processing of the opposite-end message is determined according to the message execution sequence, inserting the local forwarding waiting state mark into the tail part of the state mark queue.
In one embodiment of the present invention, the method further comprises:
after forwarding the message to be forwarded to the intra-domain secondary node, replacing the local forwarding waiting state flag with a local sending waiting far-end waiting superposition state flag;
When receiving a reply message returned by the intra-domain auxiliary node, converting the local sending waiting far-end superposition state mark into a local middle-far-end superposition state mark;
updating the message to be forwarded to the local, and converting the remote waiting superposition state mark in the local into a remote message waiting state mark;
returning a forwarding and updating completion reply message to the external node, and converting the remote message waiting state mark into a remote message processing state mark;
And when receiving the information receiving completion reply information returned by the external node, converting the state mark in the remote message processing into a normal state mark.
In one embodiment of the present invention, the method further comprises:
and processing each message to be processed in the state mark queue according to the message processing sequence of the remote end and the local end.
A message synchronization device, comprising:
A memory for storing a computer program;
A processor for implementing the steps of the message synchronization method as described above when executing the computer program.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of a message synchronization method as described above.
A computer program product comprising a computer program which, when executed by a processor, implements the steps of a message synchronization method as described above.
According to the message synchronization method provided by the invention, a message synchronization request is generated according to the message to be synchronized; acquiring a preset message execution sequence of a received message and a sent message; sending a message synchronization request to the inside auxiliary node and the outside auxiliary node according to the message execution sequence; receiving first reply information returned by the auxiliary node in the domain and second reply information returned by the node outside the domain; the second reply message is generated after the outside-domain node forwards a message synchronization request to the inside-domain master node and receives the third reply message returned by the inside-domain master node; and when the first reply information and the second reply information are the information updating completion, updating the information to be synchronized to the local.
According to the technical scheme, the information to be synchronized is respectively sent to the internal node and the external node, the information synchronization request is forwarded to the internal master node by using the way of forwarding by the external node, so that indirect information synchronization is realized, the current node is not required to send the information synchronization request to the internal master node, each node is in a bidirectional communication relationship with the corresponding external node, and is in a unidirectional communication relationship with the internal master node and the internal slave node, the information synchronization is realized on the basis of not damaging the synchronization mechanism of the original cyclic mirror image, the communication times are reduced, compared with the full-domain multi-communication mode, the consumption of communication resources is reduced, the communication efficiency of the information synchronization is improved, and the time delay of single-message communication caused by processing a plurality of information is reduced. The complexity of multi-communication message processing is reduced, maintainability is increased, and the maintenance cost of codes is reduced. By synchronizing the messages according to the order of message execution, orderly processing of the message synchronization is ensured.
Correspondingly, the invention further provides a message synchronization device, a computer readable storage medium and a computer program product corresponding to the message synchronization method, which have the technical effects described above and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the drawings without inventive effort for those skilled in the art.
FIG. 1 is a block diagram of a message synchronization structure for a four-controller cyclic backup in the related art;
FIG. 2 is a block diagram of a message synchronization structure of an isotactic mechanism in the related art;
FIG. 3 is a flow chart of an implementation of a message synchronization method according to an embodiment of the present invention;
FIG. 4 is a block diagram of a message synchronization system according to an embodiment of the present invention;
FIG. 5 is a flowchart of another implementation of a message synchronization method according to an embodiment of the present invention;
FIG. 6 is a state transition diagram of a multi-node communication in case of a transmission collision in accordance with an embodiment of the present invention;
FIG. 7 is a transition diagram of a transition from an added state to an original state and vice versa in a node according to an embodiment of the present invention;
FIG. 8 is a block diagram illustrating a message synchronization apparatus according to an embodiment of the present invention;
Fig. 9 is a block diagram of a message synchronization device according to an embodiment of the present invention;
Fig. 10 is a schematic diagram of a specific structure of a message synchronization device according to an embodiment of the present invention.
Detailed Description
Referring to fig. 1, fig. 1 is a block diagram of a message synchronization structure of a four-controller cyclic backup in the related art. In the related art, the data redundancy realized based on circularly synchronizing messages between nodes in four controllers to the next node is realized based on the link interconnection between the four controllers and can be realized on the basis of the software and hardware configuration of communication, but due to the software characteristic that the information synchronization is circularly and unidirectionally performed between the nodes, random communication between the nodes is not supported in a software function, and the message receiving and transmitting of the nodes needs to be unidirectionally performed according to a fixed sequence in the circulation.
Referring to fig. 2, fig. 2 is a block diagram of a message synchronization structure of an isotactic mechanism in the related art. At present, a common synchronization mechanism is adopted to synchronize messages among controllers, namely when one controller generates a message to be synchronized, the controller needs to synchronize the message to be synchronized to other controllers respectively, and when the message to be synchronized exists in a plurality of controllers, a plurality of message receiving and message sending tasks are generated in each controller. A large number of messages are generated on the communication channel, so that the number of messages to be sent, the number of times of sending and the communication time delay are greatly increased, the efficiency of message synchronization is reduced, and the complexity of message communication processing is increased.
Therefore, the message synchronization method provided by the application improves and reduces the communication times, reduces the consumption of communication resources and improves the communication efficiency of message synchronization.
In order to better understand the aspects of the present invention, the present invention will be described in further detail with reference to the accompanying drawings and detailed description. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of a message synchronization method according to an embodiment of the present invention, where the method may include the following steps:
S301: and generating a message synchronization request according to the message to be synchronized.
When the message to be synchronized exists, a message synchronization request is generated according to the message to be synchronized.
Referring to fig. 4, fig. 4 is a block diagram of a message synchronization system according to an embodiment of the present invention, where when a message to be synchronized exists in a node 1, the node 1 generates a message synchronization request according to the message to be synchronized.
S302: and acquiring a preset message execution sequence of the received message and the sent message.
The order of message execution for the received message and the transmitted message is preset, for example, when there is a remote message receiving task and a local message transmitting task, the remote message receiving task may be executed first and then the local message transmitting task may be executed, or the local message transmitting task may be executed first and then the remote message receiving task may be executed. After the message synchronization request is generated, a preset message execution order for the received message and the transmitted message is acquired.
S303: and sending message synchronization requests to the inside secondary node and the outside secondary node according to the message execution order.
After the message execution order is acquired, a message synchronization request is sent to the inside secondary node and the outside secondary node in the message execution order.
As shown in fig. 4, if the node 1 currently has a task of receiving a message sent by a remote node in addition to a task of synchronizing a message to be synchronized to the internal secondary node 2 and the external node 3, it is required to determine whether to synchronize the message to be synchronized to the internal secondary node 2 and the external node 3 or to receive the message sent by the remote node first according to a message execution order, and a message synchronization request is sent to the internal secondary node 2 and the external node 3 according to the message execution order, thereby implementing orderly processing of multiple messages.
S304: and receiving the first reply information returned by the auxiliary node in the domain and the second reply information returned by the node outside the domain.
The second reply message is generated after the outside-domain node forwards a message synchronization request to the inside-domain master node and receives the third reply message returned by the inside-domain master node.
After receiving the message synchronization request, the intra-domain auxiliary node can analyze the message synchronization request to obtain a message to be synchronized, update the message in the intra-domain auxiliary node according to the message to be synchronized, generate first reply information according to an update result, and return the first reply information to the generation node of the message to be synchronized. After receiving the message synchronization request, the external node forwards the message synchronization request to the internal master node, and the internal master node updates the message in the internal master node according to the received message to be synchronized and generates third reply information according to the updating result. After receiving the third reply message returned by the main node in the domain, the node outside the domain updates the message in the node outside the domain, generates second reply message according to the updating result, and returns the second reply message to the generating node of the message to be synchronized. And the generating node of the message to be synchronized receives the first reply message returned by the auxiliary node in the domain and the second reply message returned by the node outside the domain.
S305: and when the first reply information and the second reply information are the information updating completion, updating the information to be synchronized to the local.
After receiving the first reply information returned by the auxiliary node in the domain and the second reply information returned by the node outside the domain, the generating node of the message to be synchronized judges whether the first reply information and the second reply information are both the message updating completion, and when the first reply information and the second reply information are both the message updating completion, the message to be synchronized is updated to the local. After receiving the reply information replied by the internal auxiliary node and the external node, the generating node of the message to be synchronized updates the local message, thereby ensuring that the message to be synchronized is updated locally after the remote node is completed, ensuring that the remote node has been updated locally when the message to be synchronized is completed, and realizing the symmetry of the local and remote data information.
According to the technical scheme, the information to be synchronized is respectively sent to the internal node and the external node, the information synchronization request is forwarded to the internal master node by using the way of forwarding by the external node, so that indirect information synchronization is realized, the current node is not required to send the information synchronization request to the internal master node, each node is in a bidirectional communication relationship with the corresponding external node, and is in a unidirectional communication relationship with the internal master node and the internal slave node, the information synchronization is realized on the basis of not damaging the synchronization mechanism of the original cyclic mirror image, the communication times are reduced, compared with the full-domain multi-communication mode, the consumption of communication resources is reduced, the communication efficiency of the information synchronization is improved, and the time delay of single-message communication caused by processing a plurality of information is reduced. The complexity of multi-communication message processing is reduced, maintainability is increased, and the maintenance cost of codes is reduced. By synchronizing the messages according to the order of message execution, orderly processing of the message synchronization is ensured.
It should be noted that, based on the above embodiments, the embodiments of the present invention further provide corresponding improvements. The following embodiments relate to the same steps as those in the above embodiments or the steps corresponding to the steps may be referred to each other, and the corresponding beneficial effects may also be referred to each other, which will not be described in detail in the following modified embodiments.
Referring to fig. 5, fig. 5 is a flowchart illustrating another implementation of a message synchronization method according to an embodiment of the present invention, where the method may include the following steps:
S501: and generating a message synchronization request according to the message to be synchronized.
S502: and acquiring a preset message execution sequence of the received message and the sent message.
S503: and sending message synchronization requests to the inside secondary node and the outside secondary node according to the message execution order.
S504: and generating a local transmission waiting state mark corresponding to the message to be synchronized.
After sending a message synchronization request to the inside secondary node and the outside secondary node according to the message execution order, a LOCAL transmission waiting state flag (local_waiting) corresponding to the message to be synchronized is generated.
S505: a status flag queue generated from the order of execution of the messages and the existing pending messages is obtained.
A status flag queue generated from the order of execution of the messages and the existing pending messages is obtained. The status flag queue contains status flags of each existing message to be processed, and the status flags of each existing message to be processed are arranged according to the message execution order.
S506: the local transmit wait state flag is inserted into the state flag queue according to the order of message execution.
After a status flag queue generated from the message execution order and the existing pending messages is obtained, a local transmit wait status flag is inserted into the status flag queue according to the message execution order. Thereby achieving ordering of the execution order of the messages to be synchronized.
S507: and receiving the first reply information returned by the auxiliary node in the domain and the second reply information returned by the node outside the domain.
The second reply message is generated after the outside-domain node forwards a message synchronization request to the inside-domain master node and receives the third reply message returned by the inside-domain master node.
S508: and generating a local in-process state mark corresponding to the message to be synchronized.
After receiving the first reply message returned by the secondary node in the domain and the second reply message returned by the node outside the domain, generating a LOCAL in-process status flag (local_phase) corresponding to the message to be synchronized, and using the LOCAL in-process status flag to indicate that the message to be synchronized is being updated to the node generating the message to be synchronized.
S509: and replacing the local transmission waiting state mark corresponding to the message to be synchronized by using the local processing state mark.
After the local in-process state mark corresponding to the message to be synchronized is generated, the local in-process state mark is used for replacing the local sending waiting state mark corresponding to the message to be synchronized, so that the conversion of the state corresponding to the message to be synchronized is realized.
S510: and when the first reply information and the second reply information are the information updating completion, updating the information to be synchronized to the local.
S511: and replacing the local in-process state mark corresponding to the message to be synchronized with a normal state mark.
After the message to be synchronized is updated to the local, the local in-process status flag corresponding to the message to be synchronized is replaced with a normal flag (IDLE), thereby identifying that the node generating the message to be synchronized has recovered to an IDLE state.
The normal flag indicates an idle state without messaging, is a start state and an end state of all states, and has no remaining transition relation.
In a specific embodiment of the present invention, after step S506, before step S507, the method may further include the steps of:
Step one: when receiving a message sent by an external node and/or an internal master node, generating a conflict state mark;
Step two: and replacing the local transmission waiting state mark corresponding to the message to be synchronized by using the conflict state mark.
For convenience of description, the above two steps may be combined for explanation.
After inserting the local transmission waiting state flag into the state flag queue according to the message execution order, before receiving the first reply message returned by the secondary node in the domain and the second reply message returned by the primary node in the domain, when receiving the message sent by the primary node in the domain and/or the domain, for example, when receiving only the message sent by the primary node in the domain, or receiving both the message sent by the primary node in the domain and the message sent by the primary node in the domain, a conflict state flag (tier_break) is generated, and the local transmission waiting state flag corresponding to the message to be synchronized is replaced by the conflict state flag. The node generating the message to be synchronized is identified by the conflict state mark to have the message sending task and the message receiving task at present, so that the automatic triggered message execution sequence arbitration is convenient.
In a specific embodiment of the present invention, after replacing the local transmission waiting state flag corresponding to the message to be synchronized with the conflict state flag, the method may further include the steps of:
Step one: searching whether a remote message state mark exists in the state mark queue, if so, executing the second step, and if not, executing the fifth step;
Step two: generating a remote message waiting state mark corresponding to a message sent by an external node and/or an internal master node;
Step three: inserting a remote message waiting status flag into the tail of the remote message status flag in the status flag queue;
Step four: replacing conflict state marks corresponding to the message to be synchronized by using the local transmission waiting state marks;
step five: when the local transmission is determined to be preferentially processed according to the message execution sequence, generating a local middle-remote waiting superposition state mark;
Step six: replacing conflict state marks corresponding to the message to be synchronized by using a remote waiting superposition state mark in local processing;
Step seven: when the message of the opposite terminal is determined to be processed preferentially according to the message execution sequence, a local ready superposition state mark in remote processing is generated;
step eight: and replacing the conflict state mark corresponding to the message to be synchronized by using the local ready superposition state mark in the remote processing.
For convenience of description, the above eight steps may be combined for explanation.
Referring to fig. 6, fig. 6 is a state transition diagram of a multi-node communication under a receiving/transmitting collision in an embodiment of the present invention. After replacing the LOCAL transmission waiting state mark corresponding to the message to be synchronized by the conflict state mark, searching whether a REMOTE message state mark exists in the state mark queue, if yes, indicating that the node generating the message to be synchronized has the REMOTE message to be processed before, generating a REMOTE message waiting state mark (remote_pending) corresponding to the message transmitted by the outside node and/or the inside host node, inserting the REMOTE message waiting state mark into the tail part of the REMOTE message state mark in the state mark queue, replacing the conflict state mark corresponding to the message to be synchronized by the LOCAL transmission waiting state mark, thereby realizing the sequential processing of each REMOTE message by inserting the REMOTE message waiting state mark into the tail part of the REMOTE message state mark in the state mark queue, for example, for the state (remote_phase) of a node message to be received before, when the message to be processed is continuously received by other nodes, converting the state into a new state of the REMOTE waiting superposition state mark (remote_superposition_pending) corresponding to the message to be synchronized, if no other node generating the message to be synchronized exists, determining the priority of the REMOTE message to be superimposed by the LOCAL transmission waiting state mark according to the LOCAL superposition state, determining that the LOCAL superposition state is executed when the LOCAL superposition state is performed by the LOCAL message to be synchronized, determining the LOCAL superposition state of the LOCAL message to be superimposed by the LOCAL state in the LOCAL superposition state, the conflict state flag corresponding to the message to be synchronized is replaced with a LOCAL READY-to-stack state flag (remote_phase_local_ready) in the REMOTE processing. Therefore, local and remote message processing is realized according to a preset priority order, and orderly processing of a plurality of messages to be processed is ensured.
In one embodiment of the present invention, the method may further comprise the steps of:
Step one: receiving a message to be forwarded sent by an external node;
step two: generating a local forwarding waiting state mark according to the message to be forwarded;
step three: the local forwarding waiting status flag is added to the status flag queue.
For convenience of description, the above three steps may be combined for explanation.
The node generating the message to be synchronized may also receive the message to be forwarded sent by the node outside the domain, as shown in fig. 4, in addition to the node 1 actively sending data to the node 2 and the node 3, there may be a case that the node 3 acts as a master node to send the message to be forwarded to the node 1, and the node 1 is required to forward the message to be forwarded to the node 2. After receiving the message to be forwarded sent by the node outside the domain, the node generating the message to be synchronized generates a LOCAL forwarding waiting state flag (local_wait) according to the message to be forwarded, and adds the LOCAL forwarding waiting state flag to a state flag queue. By setting the local forwarding waiting state mark for the received message to be forwarded, the state mark of the message to be forwarded is conveniently distinguished from the state mark of the message to be synchronized initiated locally, the state conversion mechanism under the multi-message processing is simplified, the communication flow is more concise and controllable, and the maintenance is convenient.
In one embodiment of the present invention, adding a local forwarding waiting status flag to a status flag queue may include the steps of:
Step one: searching whether a local message state mark exists in the state mark queue, if so, executing the second step, and if not, executing the third step;
step two: adding a local forwarding waiting status flag to the tail of a local message status flag in a status flag queue;
step three: inserting a local forwarding waiting status flag into the head of the status flag queue when it is determined to prioritize local transmission according to the order of execution of the messages;
step four: when the priority processing of the opposite-end message is determined according to the message execution order, a local forwarding waiting state flag is inserted into the tail of the state flag queue.
For convenience of description, the above four steps may be combined for explanation.
When a local forwarding waiting state flag is added to a state flag queue, searching whether the state flag queue has a local message state flag, if so, indicating that a message sending task to be processed exists before receiving a message to be forwarded, adding the local forwarding waiting state flag to the tail part of the local message state flag in the state flag queue, otherwise, indicating that no message sending task to be processed exists before receiving the message to be forwarded, when the local sending is determined to be processed preferentially according to the message execution order, inserting the local forwarding waiting state flag into the head part of the state flag queue, and when the opposite-end message is determined to be processed preferentially according to the message execution order, inserting the local forwarding waiting state flag into the tail part of the state flag queue, thereby realizing local and far-end message processing according to the preset priority order and ensuring the orderly processing of a plurality of messages to be processed.
For example, for a message sent by a node, and the local state has been previously used as the superposition state of the sending end sending message and the receiving message, the new state is converted: the LOCAL transmission waiting REMOTE-end superposition status flag (local_forward_remote_superposition status) is converted into the LOCAL transmission waiting REMOTE-end superposition status flag (local_forward_remote_remote_superposition_status), the REMOTE-end superposition status flag (local_phase_remote_superposition) in the LOCAL transmission processing is converted into the LOCAL transmission processing, and the REMOTE-end superposition status flag (local_phase_remote_remote_superposition_superposition) in the LOCAL transmission processing is processed, and the status action preferentially processes the LOCAL, and then sequentially processes the request messages of the multiple nodes according to the receiving time after the processing is finished.
For another example, for a message sent by a node, and the local state has been previously used as the superposition state of the message sent by the sender, the state transition is newly added: the LOCAL transmission waiting and overlapping state flag (remote_phase_local_pending) in the REMOTE processing is converted into the LOCAL transmission waiting and overlapping state flag (remote_phase_remote_local_pending) in the REMOTE processing, the LOCAL READY and overlapping state flag (remote_phase_local_ready) in the REMOTE processing is converted into the LOCAL READY and overlapping state flag (remote_phase_remote_pending_local_ready) in the REMOTE processing, and the state actions are preferentially to sequentially process the request messages of the successively arriving REMOTE nodes, and then process the LOCAL.
In one embodiment of the present invention, the method may further comprise the steps of:
step one: after forwarding the message to be forwarded to the intra-domain secondary node, replacing the local forwarding waiting state flag with the local sending waiting far-end waiting superposition state flag;
Step two: when receiving a reply message returned by the intra-domain auxiliary node, converting the local transmission waiting far-end waiting superposition state mark into a local middle-far-end waiting superposition state mark;
Step three: updating the message to be forwarded to the local, and converting the remote waiting superposition state mark in the local processing into a remote message waiting state mark;
Step four: returning the forwarded and updated reply information to the external node, and converting the remote message waiting state mark into a state mark in remote message processing;
step five: and when receiving the information receiving completion reply information returned by the external node, converting the state mark in the remote message processing into a normal state mark.
For convenience of description, the above five steps may be combined for explanation.
After forwarding the message to be forwarded to the intra-domain secondary node, replacing the LOCAL forwarding waiting state flag with a LOCAL sending waiting REMOTE waiting overlay state flag (local_forwarding_remote_forwarding), converting the LOCAL sending waiting REMOTE waiting overlay state flag into a LOCAL in-process REMOTE waiting overlay state flag (local_phase_remote_forwarding), updating the message to be forwarded to the LOCAL, converting the LOCAL in-process REMOTE waiting overlay state flag into a REMOTE message waiting state flag (remote_forwarding), returning forwarding and updating completion reply information to the external node, converting the REMOTE message waiting state flag into a REMOTE in-process state flag (remote_phase), and converting the REMOTE message waiting state flag into a REMOTE in-process state flag (IDLE) when receiving the information reception completion reply information returned by the external node. Therefore, the processing of the message to be forwarded is realized, and the state identification is ensured to be consistent with the processing stage of the message to be forwarded.
In one embodiment of the present invention, the method may further comprise the steps of:
and processing each message to be processed in the state mark queue according to the message processing sequence of the remote end and the local end.
When each message to be processed in the state mark queue is processed, each message to be processed in the state mark queue is processed according to the message processing sequence of the remote end and the local end, so that the condition that all nodes wait for opposite ends to reply after the nodes send out the message and the message of the opposite ends is processed in a waiting state is avoided.
The embodiment of the invention processes the information synchronization for the four-controller system, can also be applied to the multi-controller scene with more than four controllers, and realizes the forwarding communication of the multi-control cluster by organizing and dividing the multi-controllers and setting arbitration forwarding among the organizations, for example, the four controllers are used as a group to carry out organizing and dividing and independently synchronizing in the organization. Therefore, under the condition that the number of controllers is relatively large, the consumption of communication resources is further reduced, the communication efficiency of message synchronization is improved, and the time delay of single message communication caused by processing a plurality of messages is reduced. The complexity of multi-communication message processing is reduced, maintainability is increased, and the maintenance cost of codes is reduced.
Referring to fig. 7, fig. 7 is a transition diagram of a transition from a new state to an original state in a node and vice versa in an embodiment of the present invention. The state transition process in the specific example applications described below can be seen in fig. 7.
In one embodiment, during four-control synchronization, a node sends two special messages to its corresponding internal secondary node and external node (the node may be in a state of sending and receiving superposition or non-superposition at this time), and after receiving replies from the two nodes, possible conversion states may include: the method comprises the steps of converting a REMOTE wait-for-LOCAL-transmission-in-REMOTE-process-wait-for-superposition-state flag (remote_phase_release_pending_local_pending) into a LOCAL-in-REMOTE-process-READY-superposition-state flag (local_phase_release_pending_local_ready), converting a LOCAL-transmission-wait-state flag (local_phase) into a LOCAL-in-process-state flag (local_phase), converting a LOCAL-transmission-wait-REMOTE-wait-superposition-state flag (local_phase_release_pending) into a LOCAL-in-process-REMOTE-wait-superposition-state flag (local_phase_release_pending), and converting a LOCAL-transmission-wait-REMOTE-wait-far-end-wait-superposition-state (local_phase_release_pending) into a LOCAL-in-process-far-wait-superposition-state (LOCAL-wait-REMOTE-wait-far-wait-state).
In another embodiment, during four-control synchronization, for a node that receives a special message sent by an external node, it is first determined whether to execute the forwarding flow performed by the node 3 in fig. 4, where the determination basis is: judging whether the source node of the transmitted message is an intra-domain master node, if the source node of the transmitted message is not the intra-domain master node, the source node is described as being out-of-domain synchronous, and the node is in a transmitting state or a transmitting and receiving superposition state, and the possible conversion states can comprise: transition from the LOCAL transmit WAIT state flag (local_forward_wait) to the LOCAL transmit WAIT LOCAL forward WAIT stack state flag (local_forward_wait), transition from the LOCAL in-process state flag (local_phase) to the LOCAL in-process LOCAL forward WAIT stack state flag (local_phase_local_wait), transition from the LOCAL transmit WAIT far-end WAIT stack state flag (local_forward_remote_wait) to the LOCAL transmit WAIT far-end WAIT stack state flag (local_forward_local_wait_remote_wait), transition from the LOCAL transmit WAIT far-end WAIT stack state flag (local_forward_wait_remote_wait) to the LOCAL transmit WAIT far-end WAIT stack state flag (local_forward_wait_wait), the state processing is now waiting for the message processing that has been sent locally to complete.
In another embodiment, during four-control synchronization, for a node that receives a special message sent by an external node, it is first determined whether to execute the forwarding flow performed by the node 3 in fig. 4, where the determination basis is: judging whether the source node of the sent message is an intra-domain master node, if not, describing that the source node is out-of-domain synchronization, and the node is in a receiving state, wherein possible conversion states can comprise: the REMOTE-in-process state flag (remote_phase) is converted into a LOCAL-forwarding-waiting-for-superposition state flag (remote_phase_local_wait) in the REMOTE process, and the REMOTE-in-process REMOTE-waiting-for-LOCAL-forwarding-waiting-superposition state flag (remote_phase_phase_forwarding) is converted into a REMOTE-in-process REMOTE-waiting-for-LOCAL-forwarding-waiting-superposition state flag (remote_phase_phase_local_wait), and the processing action in the state is related processing of forwarding after the REMOTE message processing is completed.
In another embodiment, during four-control synchronization, for a node that receives a special message sent by an external node, it is first determined whether to execute the forwarding flow performed by the node 3 in fig. 4, where the determination basis is: judging whether the source node of the sent message is a domain master node, if so, describing that the source node is domain synchronization, and if so, the node does not perform forwarding resynchronization operation, wherein possible conversion states can include: transition from LOCAL transmit wait state flag (local_wait) to LOCAL transmit wait REMOTE wait for stack state flag (local_wait_remote_wait), transition from LOCAL in-process state flag (local_phase) to LOCAL in-process REMOTE wait for stack state flag (local_phase_remote_wait) conversion to LOCAL by LOCAL send wait far-end wait for stack status flag (local_wait_remote_wait) send wait far wait far wait overlap status flag (local_wait_remote_wait_remote_remote_wait_remote_wait) the REMOTE processing state flag (REMOTE_PHASE) is converted into a REMOTE waiting state superposition flag (REMOTE_PHASE_REMOTE_PENDING) in the REMOTE processing.
For the state where the LOCAL transmit WAIT state flag (local_wait), the LOCAL in-process state flag (local_phase), and the LOCAL forward WAIT state flag (local_wait), and the REMOTE in-process state flag (remote_phase) are superimposed, there are the following transition and processing logic: in the processing procedure, the processing sequence is that the far end of the priority processing is processed, the LOCAL processing under the LOCAL transmission waiting state flag (local_wait) and the LOCAL in-process state flag (local_phase) is processed, and the LOCAL processing under the LOCAL forwarding waiting state flag (local_wait) is processed. The processing under the state conversion relation and the corresponding state is as follows: for the state of the LOCAL forwarding waiting REMOTE end WAIT for stack state flag (local_phase_wait_remote_stack) in LOCAL processing, the REMOTE message is preferentially processed, the state transitions to the LOCAL forwarding waiting LOCAL forward WAIT for stack state flag (remote_phase_local_stack_local_wait) in REMOTE processing/the LOCAL READY forwarding WAIT for stack state flag (remote_phase_local_ready_local_wait) in REMOTE processing, in this state, the REMOTE message is processed, after the processing is completed and replied, the LOCAL forwarding waiting and superimposing status flag (local_forwarding_local_wait)/LOCAL forwarding waiting and superimposing status flag (local_phase_local_wait) in the LOCAL processing is converted, at this time, the sending of the LOCAL message and the relevant processing after the reply are reprocessed, and after the processing is completed, the LOCAL forwarding waiting status flag (local_wait) is converted.
The state of the node when processing the LOCAL forwarding waiting state flag (local_wait) is usually in a forwarding state where only the LOCAL forwarding waiting state flag (local_wait) needs to be processed, in which case the state is not converted into a separate LOCAL forwarding waiting state flag (local_wait) state, but is converted into a LOCAL sending waiting far-end waiting superposition state flag (local_wait_remote_wait), and before converting to this state, the conversion is performed in the process of: 1) Sending out a forwarding message and waiting for a reply; 2) The content of the forwarded message is added into a queue for receiving the message at the same time, and the queue is used for executing the processing of replying to the master node after the node is used as a peer node to forward the special message; the above flow corresponds to the state of LOCAL sending waiting REMOTE waiting for superposition status flag (local_reply_remote_reply), in which the message flow can be sent by processing, then converted into LOCAL in-process REMOTE waiting for superposition status flag (local_phase_reply_reply), the LOCAL message end is converted into REMOTE message waiting status flag (remote_reply), then the REMOTE message waiting status flag (remote_reply) is converted into REMOTE message in-process status flag (remote_phase), and then the processing is converted into normal status flag (IDLE) as a reply action of the REMOTE to the master node sending the special message.
Corresponding to the above method embodiment, the present invention further provides a message synchronization device, and the message synchronization device described below and the message synchronization method described above can be referred to correspondingly.
Referring to fig. 8, fig. 8 is a block diagram illustrating a message synchronization apparatus according to an embodiment of the present invention, the apparatus may include:
A message synchronization request generation module 81, configured to generate a message synchronization request according to a message to be synchronized;
a message execution order acquisition module 82, configured to acquire a preset message execution order for a received message and a transmitted message;
a message synchronization request sending module 83, configured to send a message synchronization request to the inside secondary node and the outside secondary node according to the order of executing the message;
the reply information receiving module 84 is configured to receive a first reply information returned by the secondary node in the domain and a second reply information returned by the node outside the domain; the second reply message is generated after the outside-domain node forwards a message synchronization request to the inside-domain master node and receives the third reply message returned by the inside-domain master node;
And the message updating module 85 is configured to update the message to be synchronized to the local when the first reply message and the second reply message are both message updating completed.
According to the technical scheme, the information to be synchronized is respectively sent to the internal node and the external node, the information synchronization request is forwarded to the internal master node by using the way of forwarding by the external node, so that indirect information synchronization is realized, the current node is not required to send the information synchronization request to the internal master node, each node is in a bidirectional communication relationship with the corresponding external node, and is in a unidirectional communication relationship with the internal master node and the internal slave node, the information synchronization is realized on the basis of not damaging the synchronization mechanism of the original cyclic mirror image, the communication times are reduced, compared with the full-domain multi-communication mode, the consumption of communication resources is reduced, the communication efficiency of the information synchronization is improved, and the time delay of single-message communication caused by processing a plurality of information is reduced. The complexity of multi-communication message processing is reduced, maintainability is increased, and the maintenance cost of codes is reduced. By synchronizing the messages according to the order of message execution, orderly processing of the message synchronization is ensured.
In one embodiment of the present invention, the apparatus may further include:
the local transmission waiting state mark generation module is used for generating a local transmission waiting state mark corresponding to a message to be synchronized after sending a message synchronization request to the internal auxiliary node and the external node according to the message execution sequence;
the state mark queue acquisition module is used for acquiring a state mark queue generated according to the message execution sequence and the existing message to be processed;
The first flag inserting module is used for inserting the local transmission waiting state flag into the state flag queue according to the message execution sequence.
In one embodiment of the present invention, the apparatus may further include:
The local processing state mark generation module is used for generating a local processing state mark corresponding to the message to be synchronized after receiving the first reply message returned by the auxiliary node in the domain and the second reply message returned by the node outside the domain;
And the first mark replacing module is used for replacing the local transmission waiting state mark corresponding to the message to be synchronized by using the local in-process state mark.
In one embodiment of the present invention, the apparatus may further include:
And the second mark replacement module is used for replacing the local in-process state mark corresponding to the message to be synchronized with the normal state mark after the message to be synchronized is updated to the local.
In one embodiment of the present invention, the apparatus may further include:
the conflict state flag generation module is used for generating a conflict state flag when receiving a message sent by an external node and/or an internal main node before receiving first reply information returned by an internal auxiliary node and second reply information returned by the external node after inserting a local sending waiting state flag into a state flag queue according to a message execution sequence;
and the third mark replacement module is used for replacing the local transmission waiting state mark corresponding to the message to be synchronized by utilizing the conflict state mark.
In one embodiment of the present invention, the apparatus may further include:
The remote message state flag searching module is used for searching whether a remote message state flag exists in the state flag queue after replacing a local transmission waiting state flag corresponding to the message to be synchronized by using the conflict state flag;
The remote message waiting state mark generation module is used for generating a remote message waiting state mark corresponding to a message sent by an external node and/or an internal master node when the remote message waiting state mark exists in the state mark queue;
a second flag inserting module for inserting a remote message waiting status flag into the tail of the remote message status flag in the status flag queue;
A fourth flag replacing module, configured to replace a conflict state flag corresponding to the message to be synchronized with a local transmission waiting state flag;
The remote waiting superposition state mark generation module in local processing is used for generating a remote waiting superposition state mark in local processing when the state mark queue is determined to have no remote message state mark and local transmission is determined to be processed preferentially according to the message execution sequence;
a fifth mark replacement module, configured to replace a conflict state mark corresponding to the message to be synchronized with a remote-end waiting superposition state mark in local processing;
The local ready superposition state mark generation module in the remote processing is used for generating a local ready superposition state mark in the remote processing when the message of the opposite terminal is determined to be processed preferentially according to the message execution sequence;
And a sixth flag replacing module, configured to replace a conflict state flag corresponding to the message to be synchronized with the local ready superposition state flag in the remote processing.
In one embodiment of the present invention, the apparatus may further include:
the message to be forwarded receiving module is used for receiving the message to be forwarded sent by the node outside the domain;
The local forwarding waiting state flag generation module is used for generating a local forwarding waiting state flag according to the message to be forwarded;
and the local forwarding waiting state flag adding module is used for adding the local forwarding waiting state flag to the state flag queue.
In one embodiment of the present invention, the local forwarding waiting state flag adding module includes:
the local message state mark searching sub-module is used for searching whether a state mark queue has a local message state mark or not;
The first local forwarding waiting state flag adding sub-module is used for adding the local forwarding waiting state flag to the tail of the local message state flag in the state flag queue when the state flag queue is determined to have the local message state flag.
In a specific embodiment of the present invention, the local forwarding waiting state flag adding module may further include:
The judging submodule is used for judging whether the state mark queue has a remote message state mark or not when the state mark queue is determined to have no local message state mark;
And the second local forwarding waiting state flag adding sub-module is used for adding the local forwarding waiting state flag to the head of the state flag queue when the state flag queue is determined that the remote message state flag does not exist in the state flag queue.
In one embodiment of the present invention, the apparatus may further include:
The first local forwarding waiting state flag inserting module is used for inserting the local forwarding waiting state flag into the head of the state flag queue when the state flag queue is determined to have no local message state flag but a remote message state flag, and local transmission is determined to be processed preferentially according to the message execution sequence;
and the second local forwarding waiting state flag inserting module is used for inserting the local forwarding waiting state flag into the tail of the state flag queue when the state flag queue is determined to have no local message state flag but far-end message state flag, and the opposite-end message is determined to be processed preferentially according to the message execution sequence.
In one embodiment of the present invention, the apparatus may further include:
a seventh flag replacing module, configured to replace, after forwarding the message to be forwarded to the intra-domain secondary node, the local forwarding waiting state flag with the local sending waiting far-end waiting superposition state flag;
The first mark conversion module is used for converting a local sending far-end waiting superposition state mark into a local middle-end waiting superposition state mark when receiving a reply message returned by the intra-domain auxiliary node;
The second mark conversion module is used for updating the message to be forwarded to the local and converting the remote message waiting superposition state mark in the local into a remote message waiting state mark;
the third mark conversion module is used for returning the forwarded and updated reply information to the external node and converting the remote message waiting state mark into a state mark in the remote message processing;
And the fourth mark conversion module is used for converting the state mark in the remote message processing into a normal state mark when receiving the information receiving completion reply information returned by the external node.
In one embodiment of the present invention, the apparatus may further include:
And the message processing module is used for processing each message to be processed in the state mark queue according to the message processing sequence of the remote end and the local end.
Corresponding to the above method embodiment, referring to fig. 9, fig. 9 is a schematic diagram of a message synchronization device provided by the present invention, where the device may include:
A memory 332 for storing a computer program;
Processor 322, when executing the computer program, implements the steps of the message synchronization method of the method embodiments described above.
Specifically, referring to fig. 10, fig. 10 is a schematic diagram of a specific structure of a message synchronization device according to the present embodiment, where the message synchronization device may have a relatively large difference due to different configurations or performances, and may include a processor (central processing units, CPU) 322 (e.g., one or more processors) and a memory 332, where the memory 332 stores one or more computer programs 342 or data 344. Wherein the memory 332 may be transient storage or persistent storage. The program stored in memory 332 may include one or more modules (not shown), each of which may include a series of instruction operations in the data processing apparatus. Still further, the processor 322 may be configured to communicate with the memory 332 and execute a series of instruction operations in the memory 332 on the message synchronization device 301.
Message synchronization device 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input/output interfaces 358, and/or one or more operating systems 341.
The steps in the message synchronization method described above may be implemented by the structure of the message synchronization device.
Corresponding to the above method embodiments, the present invention also provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor, performs the steps of:
Generating a message synchronization request according to the message to be synchronized; acquiring a preset message execution sequence of a received message and a sent message; sending a message synchronization request to the inside auxiliary node and the outside auxiliary node according to the message execution sequence; receiving first reply information returned by the auxiliary node in the domain and second reply information returned by the node outside the domain; the second reply message is generated after the outside-domain node forwards a message synchronization request to the inside-domain master node and receives the third reply message returned by the inside-domain master node; and when the first reply information and the second reply information are the information updating completion, updating the information to be synchronized to the local.
The computer readable storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
For the description of the computer-readable storage medium provided by the present invention, refer to the above method embodiments, and the disclosure is not repeated here.
Corresponding to the above method embodiments, the present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the message synchronization method as before.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. The apparatus, device, computer-readable storage medium, and computer program product of the embodiments disclosed herein are relatively simple to describe as they correspond to the methods of the embodiments disclosed herein, and the relevant points are described in the methods section.
The principles and embodiments of the present invention have been described herein with reference to specific examples, but the description of the examples above is only for aiding in understanding the technical solution of the present invention and its core ideas. It should be noted that it will be apparent to those skilled in the art that the present invention may be modified and practiced without departing from the spirit of the present invention.

Claims (15)

1. A method of message synchronization, comprising:
generating a message synchronization request according to the message to be synchronized;
acquiring a preset message execution sequence of a received message and a sent message;
sending a message synchronization request to the inside auxiliary node and the outside auxiliary node according to the message execution sequence;
Receiving first reply information returned by the intra-domain auxiliary node and second reply information returned by the external node; the second reply information is generated after the external node forwards the message synchronization request to the internal main node and receives the third reply information synchronously returned by the internal main node; the process of forwarding the message synchronization request to the intra-domain master node by the external node comprises the following steps: judging whether the source node of the message synchronization request is an intra-domain master node of the domain in which the external node is located; if not, the outside-domain node forwards the message synchronization request to the inside-domain master node; if yes, the outside-domain node does not forward the message synchronization request to the inside-domain master node;
and when the first reply information and the second reply information are both information updating completion, updating the information to be synchronized to the local.
2. The message synchronization method according to claim 1, further comprising, after transmitting a message synchronization request to the inside secondary node and the outside secondary node in the order of execution of the messages:
generating a local transmission waiting state mark corresponding to the message to be synchronized;
Acquiring a state mark queue generated according to the message execution sequence and the existing message to be processed;
And inserting the local transmission waiting state mark into the state mark queue according to the message execution order.
3. The message synchronization method according to claim 2, further comprising, after receiving the first reply message returned by the inside-domain secondary node and the second reply message returned by the outside-domain node:
generating a local in-process state mark corresponding to the message to be synchronized;
and replacing the local transmission waiting state mark corresponding to the message to be synchronized by using the local processing state mark.
4. A message synchronization method according to claim 3, characterized in that after updating the message to be synchronized locally, it further comprises:
and replacing the local in-process state mark corresponding to the message to be synchronized with a normal state mark.
5. The message synchronization method according to claim 3, further comprising, after inserting the local transmission wait status flag into the status flag queue according to the message execution order, before receiving the first reply message returned by the intra-domain secondary node and the second reply message returned by the external node:
When receiving the information sent by the external node and/or the internal master node, generating a conflict state mark;
and replacing the local transmission waiting state mark corresponding to the message to be synchronized by using the conflict state mark.
6. The message synchronization method according to claim 5, further comprising, after replacing a local transmission waiting state flag corresponding to the message to be synchronized with the collision state flag:
Searching whether a remote message state mark exists in the state mark queue;
If yes, generating a remote message waiting state mark corresponding to the message sent by the external node and/or the internal master node;
Inserting the remote message waiting status flag into the tail of the remote message status flag in the status flag queue;
Replacing conflict state marks corresponding to the message to be synchronized by using the local transmission waiting state marks;
If not, when the local transmission is determined to be processed preferentially according to the message execution sequence, generating a remote waiting superposition state mark in the local transmission;
replacing a conflict state mark corresponding to the message to be synchronized by using the remote waiting superposition state mark in the local processing;
When the message of the opposite terminal is determined to be processed preferentially according to the message execution sequence, a local ready superposition state mark in remote processing is generated;
and replacing the conflict state mark corresponding to the message to be synchronized by using the local ready superposition state mark in the remote processing.
7. The message synchronization method according to claim 2, further comprising:
Receiving a message to be forwarded sent by the node outside the domain;
Generating a local forwarding waiting state mark according to the message to be forwarded;
And adding the local forwarding waiting state flag to the state flag queue.
8. The message synchronization method of claim 7, wherein adding the local forwarding standby status flag to the status flag queue comprises:
searching whether a local message state mark exists in the state mark queue;
If yes, the local forwarding waiting state flag is added to the tail of the local message state flag in the state flag queue.
9. The message synchronization method of claim 8, further comprising, upon determining that the status flag queue does not have a local message status flag:
judging whether a remote message state mark exists in the state mark queue;
if not, the local forwarding waiting state flag is added to the head of the state flag queue.
10. The message synchronization method of claim 9, wherein when it is determined that the status flag queue does not have a local message status flag but has a remote message status flag, further comprising:
Inserting the local forwarding waiting status flag into the head of the status flag queue when it is determined to prioritize local transmission according to the message execution order;
and when the priority processing of the opposite-end message is determined according to the message execution sequence, inserting the local forwarding waiting state mark into the tail part of the state mark queue.
11. The message synchronization method according to any one of claims 7 to 10, characterized by further comprising:
after forwarding the message to be forwarded to the intra-domain secondary node, replacing the local forwarding waiting state flag with a local sending waiting far-end waiting superposition state flag;
When receiving a reply message returned by the intra-domain auxiliary node, converting the local sending waiting far-end superposition state mark into a local middle-far-end superposition state mark;
updating the message to be forwarded to the local, and converting the remote waiting superposition state mark in the local into a remote message waiting state mark;
returning a forwarding and updating completion reply message to the external node, and converting the remote message waiting state mark into a remote message processing state mark;
And when receiving the information receiving completion reply information returned by the external node, converting the state mark in the remote message processing into a normal state mark.
12. The message synchronization method according to claim 2, further comprising:
and processing each message to be processed in the state mark queue according to the message processing sequence of the remote end and the local end.
13. A message synchronization device, comprising:
A memory for storing a computer program;
processor for implementing the steps of the message synchronization method according to any of claims 1 to 12 when executing said computer program.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the message synchronization method according to any of claims 1 to 12.
15. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the message synchronization method according to any one of claims 1 to 12.
CN202411149150.9A 2024-08-21 2024-08-21 Message synchronization method, device, equipment and computer readable storage medium Active CN118677909B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411149150.9A CN118677909B (en) 2024-08-21 2024-08-21 Message synchronization method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411149150.9A CN118677909B (en) 2024-08-21 2024-08-21 Message synchronization method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN118677909A CN118677909A (en) 2024-09-20
CN118677909B true CN118677909B (en) 2024-11-19

Family

ID=92729292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411149150.9A Active CN118677909B (en) 2024-08-21 2024-08-21 Message synchronization method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN118677909B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114513525A (en) * 2022-04-19 2022-05-17 北京易鲸捷信息技术有限公司 Data consistency optimization method and system adopting cross-machine-room chain forwarding
CN116450415A (en) * 2023-04-20 2023-07-18 苏州浪潮智能科技有限公司 Controller back-cut control method, device, equipment, storage system and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109672712A (en) * 2017-10-17 2019-04-23 中兴通讯股份有限公司 Method of data synchronization, device, super controller, domain controller and storage medium
CN112187655B (en) * 2020-09-29 2022-12-20 苏州浪潮智能科技有限公司 Controller cluster of storage system, its message transmission method, and readable storage medium
CN116909759B (en) * 2023-09-12 2024-01-19 苏州浪潮智能科技有限公司 Information processing method, device and equipment, medium and controller cluster

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114513525A (en) * 2022-04-19 2022-05-17 北京易鲸捷信息技术有限公司 Data consistency optimization method and system adopting cross-machine-room chain forwarding
CN116450415A (en) * 2023-04-20 2023-07-18 苏州浪潮智能科技有限公司 Controller back-cut control method, device, equipment, storage system and storage medium

Also Published As

Publication number Publication date
CN118677909A (en) 2024-09-20

Similar Documents

Publication Publication Date Title
EP3713195A1 (en) Log processing method, related device, and system
US11271714B2 (en) Time synchronization system, time master, management master, and time synchronization method
CN111858747A (en) Method for synchronizing MySQL database to Elasticissearch
CN109617821B (en) Transmission method, main control board and equipment of multicast message
CN111026813A (en) High-availability quasi-real-time data synchronization method based on MySQL
CN111813795B (en) Method and apparatus for confirming transactions in a blockchain network
CN104125150A (en) Protocol message processing method, device and system
CN118677909B (en) Message synchronization method, device, equipment and computer readable storage medium
CN111314213A (en) Communication gateway system of cross-local area network
US7707584B2 (en) Method and apparatus for synchronizing calls in a server and client system
CN112820092B (en) Method for collecting electricity consumption data, terminal equipment and storage medium
CN111866069B (en) Data processing method and device
CN106953761B (en) Server disaster recovery system and message processing method based on disaster recovery system
JP2011097124A (en) Vehicle-mounted network device
CN110865987A (en) File synchronization method, device, equipment and medium
EP3710929B1 (en) Optimized reconciliation in a controller switch network
CN113835467B (en) Clock synchronization system, method, electronic equipment and storage medium
US9509780B2 (en) Information processing system and control method of information processing system
WO2022111465A1 (en) Core cluster synchronization method, control method, device, cores, and medium
CN112994998A (en) Communication node, communication method, communication device and electronic equipment
CN102075315B (en) Data synchronization method and device among forwarding boards
CN114301924A (en) Application task scheduling method and node equipment for cloud edge collaborative environment
CN115801809B (en) Cross-network data synchronous control system, method and medium
CN115314510B (en) Block chain node synchronization method, device, electronic equipment and storage medium
CN115277733B (en) Block head synchronization method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant