CN113301091B - Message processing method and device for distributed system, electronic equipment and medium - Google Patents

Message processing method and device for distributed system, electronic equipment and medium Download PDF

Info

Publication number
CN113301091B
CN113301091B CN202010759126.2A CN202010759126A CN113301091B CN 113301091 B CN113301091 B CN 113301091B CN 202010759126 A CN202010759126 A CN 202010759126A CN 113301091 B CN113301091 B CN 113301091B
Authority
CN
China
Prior art keywords
message
service process
message service
region
identification information
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
CN202010759126.2A
Other languages
Chinese (zh)
Other versions
CN113301091A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010759126.2A priority Critical patent/CN113301091B/en
Publication of CN113301091A publication Critical patent/CN113301091A/en
Application granted granted Critical
Publication of CN113301091B publication Critical patent/CN113301091B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The embodiment of the disclosure discloses a message processing method and device for a distributed system, electronic equipment and a medium. The message processing method for the distributed system comprises the steps of receiving one or more first messages generated by a first process set of a first region; receiving one or more second messages sent by a second message service process of a second locale to a first message service process of the first locale; providing the first message and/or the second message to processes in the first set of processes, thereby enabling efficient message transfer between sets of processes in different regions.

Description

Message processing method and device for distributed system, electronic equipment and medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for processing a message in a distributed system.
Background
Cloud computing has become an important infrastructure in the present country, and social applications and business applications are largely built on the cloud computing. The high efficiency, stability and safety of cloud computing are very important for applications built on the cloud computing, and the cloud computing largely uses a remote architecture technology to build related centers in different regions and provide remote disaster recovery and remote multi-activity capabilities. The remote disaster recovery means that the same application programs are respectively constructed in different regions, so that the center of one region can take over service when a disaster occurs in the center of another region. The remote multi-activity means that the same application program is respectively constructed in different regions, so that network traffic needing to be processed can be scheduled according to the load condition of a cloud computing system or the principle of providing service nearby, and efficient and stable service is provided.
Message service processes are used by cloud computing-based applications to effect message transport between centers in different regions. With the expansion of the cloud computing scale, the amount of messages transmitted among different regions is also rapidly increased, and higher requirements are put on the performance of a message service process.
Disclosure of Invention
In order to solve the problems in the related art, embodiments of the present disclosure provide a message processing method and apparatus for a distributed system, an electronic device, and a medium.
In a first aspect, a message processing method for a distributed system is provided in the embodiments of the present disclosure.
Specifically, the message processing method for the distributed system includes:
receiving one or more first messages generated by a first set of processes in a first locale;
receiving, by a first message service process of the first locale, one or more second messages sent by a second message service process of a second locale;
providing the first message and/or the second message to a process of the first set of processes.
With reference to the first aspect, the present disclosure provides in a first implementation manner of the first aspect, the one or more second messages include all messages that are received by the second message service process but are not sent to the first message service process.
With reference to the first aspect, the present disclosure in a second implementation manner of the first aspect, wherein the one or more second messages include all messages, except for a message from the first message service process, that the second message service process receives but does not send to the first message service process.
With reference to the first aspect, in a third implementation manner of the first aspect, the message service process is configured to implement sending, receiving, and storing of a message.
With reference to the first aspect, in a fourth implementation manner of the first aspect, the disclosure:
said receiving one or more first messages generated by a first set of processes in a first locale comprises receiving said one or more first messages by a first message service process in said first locale;
the providing the first message and/or the second message to the processes in the first set of processes comprises providing the first message and/or the second message to the processes in the first set of processes through a first message service process in the first locale.
With reference to the first aspect, in a fifth implementation manner of the first aspect, the providing the first message and/or the second message to the processes in the first process set includes providing, to the processes in the first process set, respective messages in the first message and/or the second message according to message topics subscribed by the processes in the first process set.
With reference to the first aspect, the present disclosure provides in a sixth implementation manner of the first aspect:
the process in the first process set only sends a first message generated by the process to a first message service process in the first region;
processes in the first set of processes subscribe to messages only from a first message service process in the first locale.
With reference to the first aspect, in a seventh implementation manner of the first aspect, the method further includes:
adding first identification information and/or second identification information to a first initial message to generate the first message, wherein the first identification information is used for determining a region for processing the first initial message, and the second identification information is used for determining the region for generating the first initial message.
With reference to the seventh implementation manner of the first aspect, the present disclosure provides in an eighth implementation manner of the first aspect:
the adding of the first identification information and/or the second identification information to the first initial message to generate the first message comprises adding the first identification information and/or the second identification information to the first initial message by a process that produces the first initial message to generate the first message; and/or
The first identification information includes a service and/or a user associated with the first initial message.
With reference to the first aspect, in a ninth implementation manner of the first aspect, the method further includes:
sending, by the first message service process, a message that is received by the first message service process but not sent to the second message service process; or alternatively
Sending, by the first message service process, messages received by the first message service process but not sent to the second message service process, other than from the second message service process, to the second message service process.
With reference to the first aspect, in a tenth implementation manner of the first aspect, the method further includes:
sending, by the first message service process, a message that is received by the first message service process but is not sent to a third message service process in a third region to the third message service process; or
Sending, by the first message service process, messages received by the first message service process but not sent to the third message service process, other than from the third message service process, to the third message service process.
With reference to the tenth implementation manner of the first aspect, in an eleventh implementation manner of the first aspect, the second message includes a third message that is received by the second message service process from a third message service process in the third region.
With reference to the first aspect, in a twelfth implementation manner of the first aspect, the second message includes a second initial message, and further includes third identification information and/or fourth identification information, where the third identification information is used to determine a region where the second initial message is processed, and the fourth identification information is used to determine a region where the second initial message is generated.
With reference to the first aspect, the present disclosure provides in a thirteenth implementation manner of the first aspect, where the first message includes a first initial message and first identification information used for determining a region where the first initial message is processed, and the second message includes a second initial message and third identification information used for determining a region where the second initial message is processed, and the method further includes:
if the region for processing the first initial message is determined to be the first region according to the first identification information, sending the first message to a corresponding process in the first process set through the first message service process, otherwise, not sending the first message to the corresponding process in the first process set;
and if the region for processing the second initial message is determined to be the first region according to the third identification information, sending the second message to a corresponding process in the first process set through the first message service process, otherwise, not sending the second message to the corresponding process in the first process set.
With reference to the first aspect, in a fourteenth implementation manner of the first aspect, the second message includes a second initial message and fourth identification information used for determining a region where the second initial message is generated, and the method further includes:
and if the region for generating the second initial message is determined to be the first region according to the fourth identification information, the first message service process discards the second message.
With reference to the first aspect, in a fifteenth implementation manner of the first aspect, the method further includes:
before sending a message to the second message service process through the first message service process, determining whether the message is sent by the second message service process to the first message service process, if the message is sent by the second message service process to the first message service process, not sending the message to the second message service process, and if the message is not sent by the second message service process to the first message service process, sending the message to the second message service process.
In a second aspect, a message processing apparatus for a distributed system is provided in the disclosed embodiments.
Specifically, the message processing apparatus for a distributed system includes:
a first receiving module configured to receive one or more first messages generated by a first set of processes in a first locale;
a second receiving module configured to receive one or more second messages sent by a second message service process of a second region through a first message service process of the first region;
a providing module configured to provide the first message and/or the second message to processes of the first set of processes.
With reference to the second aspect, the present disclosure provides in a first implementation form of the second aspect, wherein the one or more second messages include all messages that are received by the second message service process but are not sent to the first message service process.
With reference to the second aspect, the present disclosure provides in a second implementation manner of the second aspect, wherein the one or more second messages include all messages, except for a message from the first message service process, that the second message service process has received but not sent to the first message service process.
With reference to the second aspect, in a third implementation manner of the second aspect, the message service process is configured to implement sending, receiving and storing of messages.
With reference to the second aspect, in a fourth implementation form of the second aspect:
the first receiving module is configured to receive the one or more first messages through a first message service process of the first locale;
the providing module is configured to provide the first message and/or the second message to processes of the first set of processes through a first message service process of the first locale.
With reference to the second aspect, in a fifth implementation manner of the second aspect, the providing the first message and/or the second message to the processes in the first process set includes providing respective ones of the first message and/or the second message to the processes in the first process set according to message topics subscribed by the processes in the first process set.
With reference to the second aspect, the present disclosure provides in a sixth implementation manner of the second aspect:
the process in the first process set only sends a first message generated by the process to a first message service process in the first region;
processes in the first set of processes subscribe to messages only from a first message service process in the first locale.
With reference to the second aspect, in a seventh implementation manner of the second aspect, the apparatus further includes:
the message processing device comprises an adding module and a sending module, wherein the adding module is configured to add first identification information and/or second identification information to a first initial message to generate the first message, the first identification information is used for determining a region for processing the first initial message, and the second identification information is used for determining a region for generating the first initial message.
With reference to the seventh implementation manner of the second aspect, in an eighth implementation manner of the second aspect:
the adding module is configured to add first identification information and/or second identification information to the first initial message through a process of generating the first initial message to generate the first message; and/or
The first identification information includes a service and/or a user associated with the first initial message.
With reference to the second aspect, in a ninth implementation manner of the second aspect, the apparatus further includes:
a first sending module configured to send, by the first message service process, a message received by the first message service process but not sent to the second message service process; or alternatively
A second sending module configured to send, by the first message service process, messages received by the first message service process but not sent to the second message service process, except for messages from the second message service process.
With reference to the second aspect, in a tenth implementation manner of the second aspect, the apparatus further includes:
a third sending module, configured to send, to the third message service process, a message that is received by the first message service process but is not sent to a third message service process in a third region through the first message service process; or
A fourth sending module configured to send, to the third message service process, a message, other than from the third message service process, that is received by the first message service process but not sent to the third message service process, through the first message service process.
With reference to the tenth implementation manner of the second aspect, in an eleventh implementation manner of the second aspect, the second message includes a third message that is received by the second message service process from a third message service process in the third region.
With reference to the second aspect, in a twelfth implementation manner of the second aspect, the second message includes a second initial message, and further includes third identification information and/or fourth identification information, where the third identification information is used to determine a region where the second initial message is processed, and the fourth identification information is used to determine a region where the second initial message is generated.
With reference to the second aspect, in a thirteenth implementation manner of the second aspect, the first message includes a first initial message and first identification information used for determining a region where the first initial message is processed, the second message includes a second initial message and third identification information used for determining a region where the second initial message is processed, and the providing module is further configured to:
if the region for processing the first initial message is determined to be the first region according to the first identification information, sending the first message to a corresponding process in the first process set through the first message service process, otherwise, not sending the first message to the corresponding process in the first process set;
and if the region for processing the second initial message is determined to be the first region according to the third identification information, sending the second message to a corresponding process in the first process set through the first message service process, otherwise, not sending the second message to the corresponding process in the first process set.
With reference to the second aspect, in a fourteenth implementation manner of the second aspect, the second message includes a second initial message and fourth identification information used for determining a region where the second initial message is generated, and the providing module is further configured to:
and if the region for generating the second initial message is determined to be the first region according to the fourth identification information, the first message service process discards the second message.
With reference to the second aspect, in a fifteenth implementation manner of the second aspect, the apparatus further includes:
a determination module configured to determine whether a message is sent by the second message service process to the first message service process before sending the message to the second message service process by the first message service process, to not send the message to the second message service process if the message is sent by the second message service process to the first message service process, and to send the message to the second message service process if the message is not sent by the second message service process to the first message service process.
In a third aspect, the present disclosure provides an electronic device, including a memory and a processor, where the memory is configured to store one or more computer instructions, where the one or more computer instructions are executed by the processor to implement the method according to any one of the first aspect, the first to fifteenth implementation manners of the first aspect.
In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, on which computer instructions are stored, and when executed by a processor, the computer instructions implement the method according to any one of the first aspect, the first to the fifteenth implementation manners of the first aspect.
According to the technical scheme provided by the embodiment of the disclosure, one or more first messages generated by a first process set of a first region are received, one or more second messages sent by a second message service process of a second region are received through the first message service process, and the first messages and/or the second messages are provided for the processes in the first process set, so that an efficient message transmission process is realized, user experience consistent with a common environment can be realized in disaster recovery in different places and multiple-live environments in different places, a user does not need to specially design aiming at multiple-region scenes when developing an application program, the development difficulty is simplified, and the development, operation and maintenance costs are reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments when taken in conjunction with the accompanying drawings. In the drawings:
FIG. 1 shows a schematic diagram of an application scenario according to an embodiment of the present disclosure;
FIG. 2 shows a schematic diagram of an application scenario according to another embodiment of the present disclosure;
FIG. 3 shows a flow diagram of a message processing method for a distributed system according to an embodiment of the present disclosure;
FIG. 4 shows a block diagram of a message processing apparatus for a distributed system according to an embodiment of the disclosure;
FIG. 5 shows a block diagram of an electronic device according to an embodiment of the disclosure;
FIG. 6 illustrates a block diagram of a computer system suitable for use to implement a message processing method for a distributed system according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. Also, for the sake of clarity, parts not relevant to the description of the exemplary embodiments are omitted in the drawings.
In the present disclosure, it is to be understood that terms such as "including" or "having," etc., are intended to indicate the presence of the disclosed features, numerals, steps, actions, components, parts, or combinations thereof in the specification, and are not intended to preclude the possibility that one or more other features, numerals, steps, actions, components, parts, or combinations thereof are present or added.
It should be further noted that the embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Cloud computing has become an important infrastructure in the country today, and social applications and business applications are largely built on the cloud computing. The stability and the safety of cloud computing are very important for applications built on the cloud computing, and the cloud computing uses a technology of remote architecture for the purpose, builds related centers in different regions and provides remote disaster recovery and remote multi-activity capabilities. Message service processes are used by cloud computing-based applications to effect message transport between centers in different regions. With the expansion of the cloud computing scale, the amount of messages transmitted among different regions is also rapidly increased, and higher requirements are put forward on the performance of a message service process.
For message transmission between centres in different regions, one possible implementation is for processes in each region to send messages to all other regions and subscribe to messages from all other regions. The implementation mode may have a plurality of problems, for example, the structure of the application program itself is complex, the operation efficiency is affected, and it is difficult to simultaneously compatible with single-region and multi-region application scenarios; when multiple processes need to consume the same message from another region at the same time, the transmission is repeated, repeated cross-regional traffic is generated, and the cost is increased.
The technical scheme provided by the embodiment of the disclosure receives one or more first messages generated by a first process set in a first region; receiving, by the first message service process, one or more second messages sent by a second message service process in a second locale; the first message and/or the second message are/is provided for the processes in the first process set, efficient message transmission is achieved, user experience consistent with a common environment can be achieved in disaster recovery in different places and multiple living environments in different places, a user does not need to design specially aiming at multiple places when developing an application program, development difficulty is simplified, and development, operation and maintenance cost is reduced.
Fig. 1 shows a schematic diagram of an application scenario according to an embodiment of the present disclosure.
According to the embodiment of the disclosure, a plurality of processes are respectively deployed in a first region and a second region. According to an embodiment of the present disclosure, the process may include, for example, a process of an application program or a process of a microservice, and may also include any other process. According to embodiments of the present disclosure, a single application may be implemented by a plurality of microservices, which may cooperate with each other to implement the functionality of the application.
According to an embodiment of the disclosure, the plurality of processes of the first locale constitutes a first set of processes and the plurality of processes of the second locale constitutes a second set of processes. To illustrate the relationship between these processes and the first message service process or the second message service process, the processes in the first set of processes or the second set of processes are shown in fig. 1 as the process sending messages and the process subscribing to messages, it being understood that the processes may both send messages and subscribe to messages and thus belong to both the process sending messages and the process subscribing to messages; the message may also be sent as a process that sends messages at a first time and received as a process that subscribes to messages at a second time.
As shown in FIG. 1, a first message service process or a second message service process provides message services to processes in a local set of processes. The process in the first locale can send a message generated by itself to the first message service process and receive a corresponding message from the first message service process in accordance with the message topic to which it subscribes. The process in the second locale can send a message generated by itself to the second message service process and receive a corresponding message from the second message service process in accordance with the message topic to which it subscribes. Message transmission can be performed between message service processes in different regions, for example, a first message service process in a first region can send a message to a second message service process in a second region, and can also receive a message sent by the second message service process. The message service process can also store the message locally and send the message of the corresponding topic to the local process according to the subscription topic of the local process.
According to the embodiment of the present disclosure, in the embodiment illustrated in fig. 1, two-way message transmission may be performed between the first message service process and the second message service process, but this is not necessary, and only one-way message transmission may be performed between the two message service processes. For example, where there are multiple message service processes for multiple locales, each message service process need not send or receive messages directly to or from each other message service process, as long as messages can be transmitted directly or indirectly to each other message service process.
Fig. 2 shows a schematic diagram of an application scenario according to another embodiment of the present disclosure.
For example, referring to the embodiment illustrated in fig. 2, the first message service process, the second message service process, and the third message service process do not need to transmit messages two-way to each other, the first message service process may transmit a message received from the local process and a message received from the second message service process to the second message service process, the second message service process may transmit a message received from the local process and a message received from the third message service process to the first message service process, and the third message service process may transmit a message received from the local process and a message received from the second message service process to the first message service process, so that message transmission among the first, second, and third message service processes may be achieved.
Fig. 3 shows a flow chart of a message processing method for a distributed system according to an embodiment of the present disclosure. As shown in fig. 3, the message processing method for the distributed system includes the following steps S310 to S330:
in step S310, receiving one or more first messages generated by a first set of processes in a first region;
in step S320, receiving, by a first message service process in the first region, one or more second messages sent by a second message service process in a second region;
in step S330, the first message and/or the second message is provided to the processes in the first set of processes.
The technical scheme provided by the embodiment of the disclosure receives one or more first messages generated by a first process set of a first region, receives one or more second messages sent by a second message service process of a second region through the first message service process of the first region, and provides the first messages and/or the second messages for the processes in the first process set, the process of each region only needs to send messages to the local message service process and subscribe messages to the local message service process, and cross-regional connection is not needed to obtain messages of other regions, so that user experience consistent with a common environment can be realized in disaster tolerance and multi-regional multi-activity environments, and a user does not need to specially design aiming at multi-regional scenes when developing an application program, thereby simplifying development difficulty, and reducing development and operation and maintenance costs. On the other hand, when a plurality of processes in each region consume the same message, the message does not need to be transmitted for a plurality of times across the regions, and network resources are saved. Moreover, the message service process in the existing cloud computing system can be utilized to realize message transmission between different places, a new service node does not need to be added, and the complexity of a system architecture is avoided being increased.
According to an embodiment of the present disclosure, the receiving one or more first messages generated by a first set of processes in a first locale comprises receiving the one or more first messages by a first message service process in the first locale; the providing the first message and/or the second message to the processes in the first set of processes comprises providing the first message and/or the second message to the processes in the first set of processes through a first message service process in the first locale.
According to the technical scheme provided by the embodiment of the disclosure, the one or more first messages are received through the first message service process in the first region, the first message and/or the second message are provided for the processes in the first process set through the first message service process in the first region, message transmission between different places can be realized through the message service process in the existing cloud computing system without adding a new network node, and the complexity of a system architecture is avoided being increased.
According to the embodiment of the disclosure, the message service process is used for realizing the receiving, sending and storing of the message.
According to the embodiment of the disclosure, after receiving the message sent by the local process, the message service process can consider that the message is successfully submitted and allow the local process to send other messages to the message service process, without waiting for the message to be transmitted to a different place before allowing the local process to send other messages to the message service process. Therefore, the main process of the application program caused by the remote transmission of the message can be effectively prevented from being blocked, so that the time delay of the application program and the performance reduction of a client system realized based on the application program are caused.
According to an embodiment of the present disclosure, the one or more second messages comprise all messages received by the second message service process but not sent to the first message service process.
According to an embodiment of the present disclosure, the second message service process may send all received messages to the first message service process in order to synchronize all messages of the second locale to the first locale. When the second message service process sends a message to the first message service process, all messages that have not been sent to the first message service process may be sent to the first message service process as second messages. On the other hand, messages that have already been sent to the first message service process may be determined by means of, for example, a flag, and are no longer sent to the first message service process, so as not to waste bandwidth resources.
According to the technical scheme provided by the embodiment of the disclosure, all messages of the second region can be synchronized to the first region through the one or more second messages including all messages which are received by the second message service process but are not sent to the first message service process.
According to an embodiment of the present disclosure, the one or more second messages comprise all messages received by the second message service process but not sent to the first message service process except for messages from the first message service process.
According to the embodiment of the present disclosure, on the basis of the foregoing embodiment, for the message sent by the first message service process to the second message service process, the message is not sent to the first message service process, and further, the waste of bandwidth resources is avoided.
According to the embodiment of the present disclosure, the providing the first message and/or the second message to the processes in the first process set includes providing the respective messages in the first message and/or the second message to the processes in the first process set according to the message topics subscribed by the processes in the first process set, so that the messages can be provided only to the processes in the first process set that subscribe to the topic, and the processes that do not subscribe do not provide the messages.
According to the embodiment of the disclosure, the processes in the first process set only send the first message generated by the processes to the first message service process in the first region, and do not provide the first message to other regions; processes in the first set of processes subscribe to messages only from the first message service process in the first locale and not from other locales.
According to an embodiment of the present disclosure, the method may further include sending, by the first message service process, a message received by the first message service process but not sent to the second message service process; or sending, by the first message service process, messages received by the first message service process but not sent to the second message service process, other than from the second message service process, to the second message service process.
According to the embodiment of the present disclosure, message transmission between the message service processes may be bidirectional, and the first message service process may receive the second message sent from the second message service process, or may send the local message to the second message service process in the second region, so as to implement message synchronization between the first region and the second region.
According to the embodiment of the present disclosure, the method may further include sending, by the first message service process, a message that is received by the first message service process but is not sent to a third message service process of a third region to the third message service process; or sending, by the first message service process, a message, other than a message from the third message service process, to the third message service process, the message being received by the first message service process but not sent to the third message service process.
According to an embodiment of the disclosure, the second message comprises a third message received by the second message service process from a third message service process in the third locale.
According to the embodiment of the disclosure, besides directly transmitting messages among the multiple regions, the messages can be transmitted through the third region. When there are three areas needing message synchronization, the areas do not necessarily all carry out bidirectional remote message transmission (6 connections are formed), but at least 3 single-cycle connections can be established, namely, a message transmission connection from the area A to the area B, a message transmission connection from the area B to the area C, and a message transmission connection from the area C to the area A. As shown in fig. 2, the first message service process, the second message service process and the third message service process do not need to transmit messages in two-way between each other, the first message service process may transmit a message received from the local process and a message received from the second message service process to the second message service process, the second message service process may transmit a message received from the local process and a message received from the third message service process to the first message service process, and the third message service process may transmit a message received from the local process and a message received from the second message service process to the first message service process, so that message transmission among the first, second and third message service processes may be implemented.
According to the embodiments of the present disclosure, by establishing a unidirectional cyclic message transmission connection between a plurality of regions, message synchronization between the plurality of regions can be achieved while significantly reducing network resource consumption, as compared to establishing a bidirectional message transmission connection between two of the plurality of regions.
According to an embodiment of the present disclosure, the method may further include: adding first identification information and/or second identification information to a first initial message to generate the first message, wherein the first identification information is used for determining a region for processing the first initial message, and the second identification information is used for determining the region for generating the first initial message.
According to the embodiment of the present disclosure, the adding of the first identification information and/or the second identification information to the first initial message to generate the first message includes adding the first identification information and/or the second identification information to the first initial message by a process that generates the first initial message to generate the first message.
According to the embodiment of the present disclosure, the region for processing the first initial message may be determined according to the first identification information, so that it may be convenient for all message service processes receiving the first message to determine whether the message needs to be processed. The region from which the first initial message is generated may be determined based on the second identification information so as to avoid repeated receipt of the message by a message service process of the region from which the message is generated.
According to an embodiment of the present disclosure, the first identification information includes a service and/or a user associated with the first initial message, so that the first identification information can be used to determine the user and/or the service to which the message belongs.
According to the embodiment of the present disclosure, the second message includes a second initial message, and further includes third identification information and/or fourth identification information, where the third identification information is used to determine a region where the second initial message is processed, and the fourth identification information is used to determine a region where the second initial message is generated.
According to the embodiment of the present disclosure, the region for processing the second initial message may be determined according to the third identification information, so that it may be convenient for all message service processes receiving the second message to determine whether the message needs to be processed. The region in which the second initial message is generated may be determined based on the fourth identification information so as to prevent the message from being repeatedly received by a message service process of the region in which the message is generated.
According to an embodiment of the present disclosure, the first message includes a first initial message and first identification information for determining a region in which the first initial message is processed, and the second message includes a second initial message and third identification information for determining a region in which the second initial message is processed, and the method may further include: if the region for processing the first initial message is determined to be the first region according to the first identification information, sending the first message to a corresponding process in the first process set through the first message service process, otherwise, not sending the first message to the corresponding process in the first process set; and if the region for processing the second initial message is determined to be the first region according to the third identification information, sending the second message to a corresponding process in the first process set through the first message service process, otherwise, not sending the second message to the corresponding process in the first process set.
According to the embodiment of the present disclosure, if it is determined that the region where the first initial message is processed is the first region according to the first identification information, it may be determined that the process that processes the first initial message is in the local first process set, and the first message service process may send the first message to a corresponding process in the first process set. If the area for processing the first initial message is determined not to be the first area according to the first identification information, the first initial message is processed by the processes in other areas, the local area does not process the first initial message, and the first message service process does not send the first message to the corresponding process in the first process set.
According to the embodiment of the disclosure, if the region for processing the second initial message is determined to be the first region according to the third identification information, it may be determined that the process for processing the second initial message is in the local first process set, and the first message service process may send the second message to a corresponding process in the first process set. If the area for processing the second initial message is determined not to be the first area according to the third identification information, the second initial message is processed by the processes in other areas, the local area does not process the second initial message, and the first message service process does not send the second message to the corresponding process in the first process set.
According to the technical scheme provided by the embodiment of the disclosure, the first message comprises a first initial message and first identification information used for determining a region for processing the first initial message, the second message comprises a second initial message and third identification information used for determining a region for processing the second initial message, and if the region for processing the first initial message is determined to be the first region according to the first identification information, the first message is sent to a corresponding process in the first process set, otherwise, the first message is ignored; if the area for processing the second initial message is determined to be the first area according to the third identification information, the second message is sent to the corresponding process in the first process set, otherwise, the second message is ignored, and the message needing local area processing can be conveniently identified without consuming unnecessary processing resources for the message not processed locally.
According to an embodiment of the present disclosure, the second message includes a second initial message and fourth identification information for determining a region where the second initial message is generated, and the method may further include the first message service process discarding the second message if it is determined that the region where the second initial message is generated is the first region according to the fourth identification information.
According to the embodiment of the present disclosure, if the region where the second initial message is generated is determined to be the first region according to the fourth identification information, that is, the second message is generated by the process in the first region, and returns to the first message service process in the first region after being forwarded for multiple times, the second message does not need to be processed at this time, and the first message service process may directly discard the message.
According to the technical scheme provided by the embodiment of the disclosure, the process is only connected to the message service process of the local area, and the message does not need to be sent across areas or subscribed across areas. By identifying the region where the message is generated and the region where the message is processed, it is ensured that the message is not repeatedly transmitted between a plurality of regions, and only the message that should be processed by the local region is sent to the corresponding process for processing, network transmission and system processing resources can be saved, and transmission of the message to a process that is not responsible for processing the message is effectively avoided.
According to the embodiment of the present disclosure, the method may further include, before sending a message to the second message service process through the first message service process, determining whether the message is sent to the first message service process by the second message service process, if the message is sent to the first message service process by the second message service process, not sending the message to the second message service process, and if the message is not sent to the first message service process by the second message service process, sending the message to the second message service process, so as to ensure that the message is not repeatedly transmitted between the two regions.
Fig. 4 shows a block diagram of a message processing apparatus for a distributed system according to an embodiment of the present disclosure. The apparatus may be implemented as part or all of an electronic device through software, hardware, or a combination of both.
As shown in fig. 4, the message processing apparatus 400 for a distributed system includes a first receiving module 410, a second receiving module 420, and a providing module 430.
A first receiving module 410 configured to receive one or more first messages generated by a first set of processes in a first locale;
a second receiving module 420 configured to receive, by a first message service process of the first locale, one or more second messages sent by a second message service process of a second locale;
a providing module 430 configured to provide the first message and/or the second message to processes of the first set of processes.
According to the technical scheme provided by the embodiment of the disclosure, the process of each region only needs to send messages to the local message service process and subscribe messages to the local message service process, cross-region connection is not needed for acquiring messages of other regions, user experience consistent with a common environment can be realized in remote disaster tolerance and remote multi-living environments, and a user does not need to specially design aiming at multi-region scenes when developing an application program, so that the development difficulty is simplified, and the development and operation and maintenance costs are reduced. On the other hand, when a plurality of processes in each region consume the same message, the message does not need to be transmitted for a plurality of times across the regions, and network resources are saved. Moreover, the embodiment of the disclosure can utilize the message service process in the existing cloud computing system to realize message transmission between different places without adding new network nodes, thereby avoiding increasing the complexity of the system architecture.
According to an embodiment of the present disclosure, the one or more second messages comprise all messages received by the second message service process but not sent to the first message service process in order to synchronize all messages of the second locale to the first locale. On the other hand, messages that have already been sent to the first message service process may be determined by means of, for example, a flag and are no longer sent to the first message service process, so as not to waste bandwidth resources.
According to an embodiment of the present disclosure, the one or more second messages include all messages received by the second message service process but not sent to the first message service process except for messages from the first message service process.
According to the embodiment of the present disclosure, on the basis of the foregoing embodiment, for the message sent by the first message service process to the second message service process, the message is not sent to the first message service process, and further, the waste of bandwidth resources is avoided.
According to the embodiment of the disclosure, the message service process is used for realizing the receiving, sending and storing of messages. After receiving the message sent by the local process, the message service process can consider that the message is successfully submitted and allow the local process to send other messages to the message service process without waiting for the message to be transmitted to a remote place and then allowing the local process to send other messages to the message service process. Therefore, the main process of the application program caused by the remote transmission of the message can be effectively prevented from being blocked, so that the time delay of the application program and the performance reduction of a client system realized based on the application program can be effectively avoided.
According to an embodiment of the present disclosure, the first receiving module 410 is configured to receive the one or more first messages through a first message service process of the first region; the providing module 430 is configured to provide the first message and/or the second message to processes of the first set of processes through a first message service process of the first locale.
The technical solution provided by the embodiment of the present disclosure is configured to receive the one or more first messages through a first message service process of the first region by the first receiving module; the providing module is configured to provide the first message and/or the second message to the processes in the first process set through the first message service process in the first region, so that message transmission between different places can be realized by using the message service processes in the existing cloud computing system without adding a new service node, and the complexity of a system architecture is avoided being increased.
According to the embodiment of the present disclosure, the providing the first message and/or the second message to the processes in the first process set includes providing the respective message in the first message and/or the second message to the processes in the first process set according to the message topic subscribed by the processes in the first process set, so that the message can be provided only to the processes in the first process set which subscribe to the topic, and the message is not provided to the processes which do not subscribe.
According to the embodiment of the disclosure, the processes in the first process set only send the first message generated by the processes to the first message service process in the first region, and do not provide the first message to other regions; processes in the first set of processes subscribe to messages only from a first message service process in the first locale and not from other locales.
As shown in fig. 4, according to the embodiment of the present disclosure, the apparatus 400 may further include an adding module 440 configured to add first identification information and/or second identification information to the first initial message to generate the first message, where the first identification information is used to determine a region where the first initial message is processed, and the second identification information is used to determine a region where the first initial message is generated.
According to an embodiment of the present disclosure, the adding module 440 is configured to add first identification information and/or second identification information to the first initial message through a process that generates the first initial message to generate the first message.
According to an embodiment of the present disclosure, the first identification information includes a service and/or a user associated with the first initial message, so that the first identification information can be used to determine the user and/or the service to which the message belongs.
According to the embodiment of the present disclosure, the region for processing the first initial message may be determined according to the first identification information, so that it may be convenient for all message service processes receiving the first message to determine whether the message needs to be processed. The region from which the first initial message is generated may be determined based on the second identification information so as to avoid repeated receipt of the message by a message service process of the region from which the message is generated.
As shown in fig. 4, according to an embodiment of the present disclosure, the apparatus 400 may further include:
a first sending module 450 configured to send, to the second message service process, messages received by the first message service process but not sent to the second message service process through the first message service process; or alternatively
A second sending module 460 configured to send, to the second message service process, messages other than those from the second message service process that were received by the first message service process but not sent to the second message service process through the first message service process.
According to the embodiment of the disclosure, message transmission between the message service processes may be bidirectional, and the first message service process may receive the second message sent from the second message service process, or may send the local message to the second message service process in the second region, so as to implement message synchronization between the first region and the second region.
As shown in fig. 4, according to an embodiment of the present disclosure, the apparatus 400 may further include:
a third sending module 470, configured to send, to the third message service process, a message that is received by the first message service process but is not sent to a third message service process in a third region through the first message service process; or alternatively
A fourth sending module 480 configured to send, to the third message service process, the message, other than the message from the third message service process, that is received by the first message service process but not sent to the third message service process through the first message service process.
According to an embodiment of the present disclosure, the second message comprises a third message received by the second message service process from a third message service process in the third locale.
According to the embodiments of the present disclosure, by establishing a one-way circulation message transmission connection between a plurality of regions, it is possible to achieve message synchronization between the plurality of regions while significantly reducing network resource consumption, as compared to establishing a two-way message transmission connection between two of the plurality of regions.
According to the embodiment of the present disclosure, the second message includes a second initial message, and further includes third identification information and/or fourth identification information, where the third identification information is used to determine a region where the second initial message is processed, and the fourth identification information is used to determine a region where the second initial message is generated.
According to the embodiment of the present disclosure, the region for processing the second initial message may be determined according to the third identification information, so that it may be convenient for all message service processes receiving the second message to determine whether the message needs to be processed. The region in which the second initial message is generated may be determined based on the fourth identification information so as to prevent the message from being repeatedly received by the message service process of the region in which the message is generated.
According to an embodiment of the present disclosure, the first message includes a first initial message and first identification information for determining a region in which to process the first initial message, the second message includes a second initial message and third identification information for determining a region in which to process the second initial message, the providing module is further configured to:
if the region for processing the first initial message is determined to be the first region according to the first identification information, sending the first message to a corresponding process in the first process set through the first message service process, otherwise, not sending the first message to the corresponding process in the first process set;
and if the region for processing the second initial message is determined to be the first region according to the third identification information, sending the second message to a corresponding process in the first process set through the first message service process, otherwise, not sending the second message to the corresponding process in the first process set.
According to the technical scheme provided by the embodiment of the disclosure, the message needing local area processing can be conveniently identified, and unnecessary processing resources do not need to be consumed for the message which is not processed locally.
According to an embodiment of the present disclosure, the second message includes a second initial message and fourth identification information for determining a region where the second initial message is generated, and the providing module is further configured to:
and if the region for generating the second initial message is determined to be the first region according to the fourth identification information, the first message service process discards the second message.
According to the technical scheme provided by the embodiment of the disclosure, the process is only connected to the message service process of the local area, and the message does not need to be sent across areas or subscribed across areas. By identifying the region where the message is generated and the region where the message is processed, it is ensured that the message is not repeatedly transmitted between a plurality of regions, and only the message that should be processed by the local region is sent to the corresponding process for processing, network transmission and system processing resources can be saved, and transmission of the message to a process that is not responsible for processing the message is effectively avoided.
According to the embodiment of the present disclosure, the apparatus 400 may further include a determining module 490 configured to determine whether a message is sent by the second message service process to the first message service process before the message is sent by the first message service process to the second message service process, if the message is sent by the second message service process to the first message service process, the message is not sent to the second message service process, and if the message is not sent by the second message service process to the first message service process, the message is sent to the second message service process, so as to ensure that the message is not repeatedly transmitted between two regions.
The present disclosure also discloses an electronic device, and fig. 5 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
As shown in fig. 5, the electronic device 500 comprises a memory 501 and a processor 502, wherein the memory 501 is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 502 to implement the following steps:
receiving one or more first messages generated by a first set of processes in a first locale;
receiving, by a first message service process of the first locale, one or more second messages sent by a second message service process of a second locale;
providing the first message and/or the second message to a process in the first set of processes.
According to an embodiment of the present disclosure, the one or more second messages comprise all messages received by the second message service process but not sent to the first message service process.
According to an embodiment of the present disclosure, the one or more second messages comprise all messages received by the second message service process but not sent to the first message service process except for messages from the first message service process.
According to the embodiment of the disclosure, the message service process is used for realizing the receiving, sending and storing of the message.
According to an embodiment of the disclosure: said receiving one or more first messages generated by a first set of processes for a first locale comprises receiving the one or more first messages by a first message service process for the first locale; the providing the first message and/or the second message to the processes in the first set of processes comprises providing the first message and/or the second message to the processes in the first set of processes through a first message service process in the first locale.
According to the embodiment of the present disclosure, the providing the first message and/or the second message to the processes in the first process set includes providing the respective message in the first message and/or the second message to the processes in the first process set according to the message topic subscribed by the processes in the first process set.
According to the embodiment of the disclosure, the processes in the first process set only send the first message generated by the processes to the first message service process in the first region; processes in the first set of processes subscribe to messages only from a first message service process in the first locale.
The one or more computer instructions, when executed by the processor 502, are further operable to implement:
adding first identification information and/or second identification information to a first initial message to generate the first message, wherein the first identification information is used for determining a region for processing the first initial message, and the second identification information is used for determining a region for generating the first initial message.
According to the embodiment of the present disclosure, the adding of the first identification information and/or the second identification information to the first initial message to generate the first message includes adding the first identification information and/or the second identification information to the first initial message by a process that generates the first initial message to generate the first message.
According to an embodiment of the present disclosure, the first identification information includes a service and/or a user associated with the first initial message.
The one or more computer instructions, when executed by the processor 502, are further operable to implement:
sending, by the first message service process, a message that is received by the first message service process but not sent to the second message service process; or
Sending, by the first message service process, messages received by the first message service process but not sent to the second message service process, other than from the second message service process, to the second message service process.
The one or more computer instructions, when executed by the processor 502, are further operable to implement:
sending, by the first message service process, a message that is received by the first message service process but is not sent to a third message service process in a third locale to the third message service process; or alternatively
Sending, by the first message service process, messages received by the first message service process but not sent to the third message service process, except from the third message service process.
According to an embodiment of the present disclosure, the second message comprises a third message received by the second message service process from a third message service process in the third locale.
According to the embodiment of the present disclosure, the second message includes a second initial message, and further includes third identification information and/or fourth identification information, where the third identification information is used to determine a region where the second initial message is processed, and the fourth identification information is used to determine a region where the second initial message is generated.
According to an embodiment of the present disclosure, the first message includes a first initial message and first identification information for determining a region where the first initial message is processed, and the second message includes a second initial message and third identification information for determining a region where the second initial message is processed, the method further includes:
if the region for processing the first initial message is determined to be the first region according to the first identification information, sending the first message to a corresponding process in the first process set through the first message service process, otherwise, not sending the first message to the corresponding process in the first process set;
and if the region for processing the second initial message is determined to be the first region according to the third identification information, sending the second message to a corresponding process in the first process set through the first message service process, otherwise, not sending the second message to the corresponding process in the first process set.
According to an embodiment of the present disclosure, the second message includes a second initial message and fourth identification information for determining a region where the second initial message is generated, and the method further includes:
and if the region for generating the second initial message is determined to be the first region according to the fourth identification information, the first message service process discards the second message.
The one or more computer instructions, when executed by the processor 502, are further operable to implement:
before sending a message to the second message service process through the first message service process, determining whether the message is sent by the second message service process to the first message service process, if the message is sent by the second message service process to the first message service process, not sending the message to the second message service process, and if the message is not sent by the second message service process to the first message service process, sending the message to the second message service process.
FIG. 6 illustrates a block diagram of a computer system suitable for use to implement a message processing method for a distributed system according to an embodiment of the present disclosure.
As shown in fig. 6, the computer system 600 includes a processing unit 601 which can execute various processes in the above-described embodiments according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The processing unit 601, the ROM602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary. The processing unit 601 may be implemented as a CPU, a GPU, a TPU, an FPGA, an NPU, or other processing units.
In particular, the methods described above may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the above-described method. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609 and/or installed from the removable medium 611.
According to an embodiment of the present disclosure, after a first message service process of a first region receives messages including messages sent from message service processes of other regions, for example, a second message service process of a second region, messages of the same topic may be aggregated, for example, messages of the same topic are sent together to processes in a first set of processes that subscribe to the topic. Therefore, the efficiency of sending the message can be improved, and the frequency of sending the message is effectively reduced.
According to the embodiment of the disclosure, the message can comprise the service charging message, and the technical scheme provided by the disclosure can timely and efficiently transmit the service charging message to the corresponding process for processing, thereby remarkably improving the timeliness of charging.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present disclosure may be implemented by software or by programmable hardware. The units or modules described may also be provided in a processor, and the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
As another aspect, the present disclosure also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the electronic device or the computer system in the above embodiments; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept. For example, the above features and the technical features disclosed in the present disclosure (but not limited to) having similar functions are replaced with each other to form the technical solution.

Claims (28)

1. A message processing method for a distributed system is applied to a cloud computing system and comprises the following steps:
a first message service process receives one or more first messages generated by a first set of processes in a first locale;
receiving, by a first message service process of the first locale, one or more second messages sent by a second message service process of a second locale;
providing the first message and/or the second message to a process of the first set of processes,
the one or more second messages including all messages received by the second message service process but not sent to the first message service process, or the one or more second messages including all messages received by the second message service process but not sent to the first message service process except for messages from the first message service process,
the process of each region sends the message to the local message service process and subscribes to the message service process; wherein, the message service process is used for realizing the receiving, sending and storing of the message.
2. The method of claim 1, wherein:
said receiving one or more first messages generated by a first set of processes in a first locale comprises receiving said one or more first messages by a first message service process in said first locale;
the providing the first message and/or the second message to the processes in the first set of processes comprises providing the first message and/or the second message to the processes in the first set of processes through a first message service process in the first locale.
3. The method of claim 1, wherein the providing the first message and/or the second message to the processes in the first set of processes comprises providing respective ones of the first message and/or the second message to the processes in the first set of processes according to message topics to which the processes in the first set of processes subscribe.
4. The method of claim 1, wherein:
the process in the first process set only sends a first message generated by the process to a first message service process in the first region;
processes in the first set of processes subscribe to messages only from a first message service process in the first locale.
5. The method of claim 1, further comprising:
adding first identification information and/or second identification information to a first initial message to generate the first message, wherein the first identification information is used for determining a region for processing the first initial message, and the second identification information is used for determining the region for generating the first initial message.
6. The method of claim 5, wherein:
the adding of the first identification information and/or the second identification information to the first initial message to generate the first message comprises adding the first identification information and/or the second identification information to the first initial message by a process that produces the first initial message to generate the first message; and/or
The first identification information includes a service and/or a user associated with the first initial message.
7. The method of claim 1, further comprising:
sending, by the first message service process, a message that is received by the first message service process but not sent to the second message service process; or
Sending, by the first message service process, messages received by the first message service process but not sent to the second message service process, other than from the second message service process, to the second message service process.
8. The method of claim 1, further comprising:
sending, by the first message service process, a message that is received by the first message service process but is not sent to a third message service process in a third locale to the third message service process; or
Sending, by the first message service process, messages received by the first message service process but not sent to the third message service process, other than from the third message service process, to the third message service process.
9. The method of claim 8, wherein the second message comprises a third message received by the second message service process from a third message service process in the third region.
10. The method according to claim 1, wherein the second message comprises a second initial message, further comprising third identification information for determining a region where the second initial message is processed and/or fourth identification information for determining a region where the second initial message is generated.
11. The method of claim 1, wherein the first message includes a first initial message and first identification information for determining a region in which to process the first initial message, and the second message includes a second initial message and third identification information for determining a region in which to process the second initial message, the method further comprising:
if the region for processing the first initial message is determined to be the first region according to the first identification information, sending the first message to a corresponding process in the first process set through the first message service process, otherwise, not sending the first message to the corresponding process in the first process set;
and if the region for processing the second initial message is determined to be the first region according to the third identification information, sending the second message to a corresponding process in the first process set through the first message service process, otherwise, not sending the second message to the corresponding process in the first process set.
12. The method of claim 1, wherein the second message includes a second initial message and fourth identification information for determining a region where the second initial message is generated, the method further comprising:
and if the region for generating the second initial message is determined to be the first region according to the fourth identification information, the first message service process discards the second message.
13. The method of claim 1, further comprising:
before sending a message to the second message service process via the first message service process, determining whether the message was sent by the second message service process to the first message service process, if the message was sent by the second message service process to the first message service process, not sending the message to the second message service process, if the message was not sent by the second message service process to the first message service process, sending the message to the second message service process.
14. A message processing device for a distributed system, applied to a cloud computing system, comprises:
a first receiving module configured to receive one or more first messages generated by a first set of processes in a first locale by a first message service process;
a second receiving module configured to receive one or more second messages sent by a second message service process of a second region through a first message service process of the first region;
a providing module configured to provide the first message and/or the second message to processes of the first set of processes,
the one or more second messages including all messages received by the second message service process but not sent to the first message service process, or the one or more second messages including all messages received by the second message service process but not sent to the first message service process except for messages from the first message service process,
the process of each region sends the message to the local message service process and subscribes to the message service process; wherein, the message service process is used for realizing the receiving, sending and storing of the message.
15. The apparatus of claim 14, wherein:
the first receiving module is configured to receive the one or more first messages through a first message service process of the first locale;
the providing module is configured to provide the first message and/or the second message to processes of the first set of processes through a first message service process of the first locale.
16. The apparatus of claim 14, wherein the providing the first message and/or the second message to the processes in the first set of processes comprises providing respective ones of the first message and/or the second message to the processes in the first set of processes according to message topics to which the processes in the first set of processes subscribe.
17. The apparatus of claim 14, wherein:
the process in the first process set only sends a first message generated by the process to a first message service process in the first region;
processes in the first set of processes subscribe to messages only from a first message service process in the first locale.
18. The apparatus of claim 14, further comprising:
the message processing device comprises an adding module and a sending module, wherein the adding module is configured to add first identification information and/or second identification information to a first initial message to generate the first message, the first identification information is used for determining a region for processing the first initial message, and the second identification information is used for determining a region for generating the first initial message.
19. The apparatus of claim 18, wherein:
the adding module is configured to add first identification information and/or second identification information to the first initial message through a process generating the first initial message to generate the first message; and/or
The first identification information includes a service and/or a user associated with the first initial message.
20. The apparatus of claim 14, further comprising:
a first sending module configured to send, by the first message service process, messages received by the first message service process but not sent to the second message service process; or
A second sending module configured to send, by the first message service process, messages received by the first message service process but not sent to the second message service process, except for messages from the second message service process.
21. The apparatus of claim 14, further comprising:
a third sending module, configured to send, to the third message service process, a message that is received by the first message service process but is not sent to a third message service process in a third region through the first message service process; or
A fourth sending module configured to send, to the third message service process, messages, other than those from the third message service process, that are received by the first message service process but not sent to the third message service process through the first message service process.
22. The apparatus of claim 21, wherein the second message comprises a third message received by the second message service process from a third message service process in the third region.
23. The apparatus of claim 14, wherein the second message comprises a second initial message, and further comprises third identification information for determining a region where the second initial message is processed and/or fourth identification information for determining a region where the second initial message is generated.
24. The apparatus of claim 14, wherein the first message comprises a first initial message and first identification information for determining a region in which to process the first initial message, the second message comprises a second initial message and third identification information for determining a region in which to process the second initial message, the provisioning module further configured to:
if the region for processing the first initial message is determined to be the first region according to the first identification information, sending the first message to a corresponding process in the first process set through the first message service process, otherwise, not sending the first message to the corresponding process in the first process set;
and if the region for processing the second initial message is determined to be the first region according to the third identification information, sending the second message to a corresponding process in the first process set through the first message service process, otherwise, not sending the second message to the corresponding process in the first process set.
25. The apparatus of claim 14, wherein the second message comprises a second initial message and fourth identification information for determining a region in which to generate the second initial message, the providing module further configured to:
and if the region for generating the second initial message is determined to be the first region according to the fourth identification information, the first message service process discards the second message.
26. The apparatus of claim 14, further comprising:
a determination module configured to determine whether a message is sent by the second message service process to the first message service process before sending the message to the second message service process by the first message service process, to not send the message to the second message service process if the message is sent by the second message service process to the first message service process, and to send the message to the second message service process if the message is not sent by the second message service process to the first message service process.
27. An electronic device comprising a memory and a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps of any of claims 1-13.
28. A readable storage medium having stored thereon computer instructions, characterized in that the computer instructions, when executed by a processor, carry out the method steps of any one of claims 1-13.
CN202010759126.2A 2020-07-31 2020-07-31 Message processing method and device for distributed system, electronic equipment and medium Active CN113301091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010759126.2A CN113301091B (en) 2020-07-31 2020-07-31 Message processing method and device for distributed system, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010759126.2A CN113301091B (en) 2020-07-31 2020-07-31 Message processing method and device for distributed system, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN113301091A CN113301091A (en) 2021-08-24
CN113301091B true CN113301091B (en) 2022-10-28

Family

ID=77318242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010759126.2A Active CN113301091B (en) 2020-07-31 2020-07-31 Message processing method and device for distributed system, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN113301091B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109120732A (en) * 2018-07-18 2019-01-01 北京天融信网络安全技术有限公司 The hot insert method of business board, system and storage medium in distributed NAT system
CN109819023A (en) * 2018-12-29 2019-05-28 杭州励飞软件技术有限公司 Distributed transaction processing method and Related product
CN110191000A (en) * 2019-06-10 2019-08-30 中汇信息技术(上海)有限公司 A kind of data processing method, message tracing monitoring method and distributed system

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8255374B2 (en) * 2006-10-02 2012-08-28 Salesforce.Com, Inc. Method and system for selecting amongst a plurality of processes to send a message
CN100558080C (en) * 2006-12-12 2009-11-04 华为技术有限公司 Cluster message transmitting method and distributed cluster system
CN101370028A (en) * 2008-07-09 2009-02-18 中国网通集团宽带业务应用国家工程实验室有限公司 Method and system for implementing remote message synchronization
CN101547428B (en) * 2009-04-27 2010-09-22 华为技术有限公司 Service processing method and service processing device
CN101534263A (en) * 2009-04-28 2009-09-16 杭州华三通信技术有限公司 Method, system and equipment for interacting message
US8706822B2 (en) * 2010-06-23 2014-04-22 Microsoft Corporation Delivering messages from message sources to subscribing recipients
US9141681B2 (en) * 2012-11-29 2015-09-22 Red Hat, Inc. Creating a column family in a database
CN105472024B (en) * 2015-12-28 2018-09-28 北京赛思信安技术股份有限公司 A kind of cross-region method of data synchronization based on message push mode
CN107147690A (en) * 2016-07-12 2017-09-08 国家电网公司 A kind of electrical power system wide-area method for message transmission
CN106549857A (en) * 2016-11-30 2017-03-29 济南中维世纪科技有限公司 A kind of method and system of trans-regional PUSH message
CN107592364B (en) * 2017-09-22 2020-08-11 中汇信息技术(上海)有限公司 Distributed message exchange method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109120732A (en) * 2018-07-18 2019-01-01 北京天融信网络安全技术有限公司 The hot insert method of business board, system and storage medium in distributed NAT system
CN109819023A (en) * 2018-12-29 2019-05-28 杭州励飞软件技术有限公司 Distributed transaction processing method and Related product
CN110191000A (en) * 2019-06-10 2019-08-30 中汇信息技术(上海)有限公司 A kind of data processing method, message tracing monitoring method and distributed system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张晓禹 ; 金连甫.基于消息映射的服务器控制模式.《计算机工程》.2006, *
陆鑫 ; 翟桂锋 ; 孙超.一种轻量级消息总线的设计与实现.《工业控制计算机》.2019, *

Also Published As

Publication number Publication date
CN113301091A (en) 2021-08-24

Similar Documents

Publication Publication Date Title
CN111711663A (en) Processing method and device for publishing and subscribing services and electronic equipment
CN105407180A (en) Server message pushing method and device
CN113747373B (en) Message processing system, device and method
CN110875914B (en) Method and device for transmitting messages based on shared session link
CN111225046A (en) Method, device, medium and electronic equipment for internal and external network data transmission
CN108390919B (en) Message synchronization system and method for high-reliability dual-computer hot standby
CN113296976A (en) Message processing method, message processing device, electronic equipment, storage medium and program product
CN116382943A (en) Sequential message processing method, bus system, computer device, and storage medium
CN111770029A (en) Dynamic queue forwarding method, system and storage medium based on RabbitMQ and ActiveMQ
CN103037000A (en) Publish-subscribe system and notification message processing method thereof
De Araujo et al. A publish/subscribe system using causal broadcast over dynamically built spanning trees
CN114710571A (en) Data packet processing system
CN113301091B (en) Message processing method and device for distributed system, electronic equipment and medium
CN112714146B (en) Resource scheduling method, device, equipment and computer readable storage medium
CN105915910B (en) A kind of video transcoding method and device based on cloud platform
CN111711675A (en) Solution for concurrent message transmission in local area network
CN103685326A (en) WEB concurrent data transmission method and WEB application system
CN105743772A (en) Message processing method and system
US20040243721A1 (en) System and method for propagating data
CN115550438A (en) Internet of things message processing method, device, system, equipment and storage medium
KR102527601B1 (en) Method for chatting messages by topic based on subscription channel reference in server and user device
CN113301088B (en) Message processing method, device and system, electronic equipment and readable storage medium
CN114301980A (en) Method, device and system for scheduling container cluster and computer readable medium
CN107911477B (en) Data communication method, device and system
CN112799795A (en) Service implementation method, process management method, device, 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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40057997

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant