CN112788551B - Message processing method and device, terminal equipment and storage medium - Google Patents
Message processing method and device, terminal equipment and storage medium Download PDFInfo
- Publication number
- CN112788551B CN112788551B CN202011627639.4A CN202011627639A CN112788551B CN 112788551 B CN112788551 B CN 112788551B CN 202011627639 A CN202011627639 A CN 202011627639A CN 112788551 B CN112788551 B CN 112788551B
- Authority
- CN
- China
- Prior art keywords
- message
- middleware
- target
- message middleware
- attribute
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/12—Messaging; Mailboxes; Announcements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application is applicable to the technical field of pedestal operation and maintenance, and provides a message processing method, terminal equipment and a storage medium, wherein the message processing method comprises the following steps: receiving a target message processing request, wherein the target message processing request comprises a target message subscription request and/or a target message publishing request, and the target message processing request comprises a target message identifier; determining a message attribute corresponding to the target message identifier in a corresponding relation between pre-stored message identifiers and message attributes; the message attribute comprises owner information, a message name and message routing information, and the owner information corresponds to at least one message middleware; determining a target message middleware with load meeting preset requirements in at least one message middleware according to the owner information; based on the message name and message routing information in the target message, the target message middleware initiates the subscription and/or publication of the message, so that the publishing terminal and the subscribing terminal realize the subscription/publication of the message based on the better message middleware, and the successful subscription and/or publication of the message is ensured.
Description
Technical Field
The present application relates to the field of base frame operation and maintenance technologies, and in particular, to a method and an apparatus for processing a message, a terminal device, and a storage medium.
Background
At present, a number of architectures based on EDA (Event Driven APP) are available, but most of them are applied to the periphery of the core system, and usually do some peripheral auxiliary support. Traditional EDA design relatively focuses on the design and implementation of the publishing side and the subscribing side, focusing on the high availability and load balancing implementation of the two sides. The publishing and subscribing of the message are realized based on pre-designated message middleware, that is, one message middleware is pre-designated for the publishing and subscribing of the message, and the pre-designated message middleware is usually invariable, so that the requirements of the subscribing and/or publishing of the message cannot be met, and therefore, the subscribing and/or publishing of the message cannot be realized by a publishing terminal and a subscribing terminal.
Disclosure of Invention
In view of this, embodiments of the present application provide a message processing method, an apparatus, a terminal device, and a computer-readable storage medium, so as to solve the problem that a publisher and a subscriber cannot subscribe and publish messages due to the fact that a pre-specified message middleware in the prior art cannot meet requirements for subscribing and publishing messages.
A first aspect of an embodiment of the present application provides a message processing method, including:
receiving an input target message processing request, wherein the target message subscription request comprises a target message identifier, and the target message processing request comprises a target message subscription request and/or a target message publishing request;
determining the message attribute corresponding to the target message identifier in the corresponding relation between the pre-stored message identifier and the message attribute; the message attribute comprises owner information, a message name and message routing information, and the owner information corresponds to at least one message middleware;
determining a target message middleware with load meeting preset requirements in the at least one message middleware according to the owner information;
initiating, by the target message middleware, subscription and/or publication of messages based on the message name and the message routing information.
In an implementation manner of the first aspect, the determining, according to the owner information, a target message middleware whose load meets a preset requirement in the at least one message middleware includes:
determining an address identifier of each message middleware in the at least one message middleware according to the owner information, and establishing communication connection with each message middleware based on the address identifier;
calculating the load of each message middleware;
and determining the message middleware with the load value meeting the preset requirement in each message middleware as the target message middleware.
In an implementation manner of the first aspect, the method further includes:
when the target message middleware is detected to be abnormal, determining standby message middleware based on owner information of the target message;
connecting the standby message middleware, and continuing to subscribe and/or publish the message based on the message name and the message routing information.
In an implementation manner of the first aspect, the determining, based on the owner information of the target message, a backup message middleware includes:
determining the address identification of the optional message middleware according to the owner information, and establishing communication connection with each optional message middleware based on the address identification; wherein the optional message middleware is a message middleware except the target message middleware in the at least one message middleware;
calculating the load of each optional message middleware;
and determining the optional message middleware with the lowest load value in each optional message middleware as the standby message middleware.
In an implementation manner of the first aspect, the method further includes:
and under the condition that the standby message middleware cannot be determined, continuing to subscribe and/or publish the message through the first preset message middleware based on the message name and the message routing information.
In an implementation manner of the first aspect, the method further includes:
when detecting that the flow rate required by subscribing and/or publishing the target message is greater than a threshold value, continuing subscribing and/or publishing the message through second preset message middleware;
wherein the data transmission channel of the second preset message middleware is independent of the data transmission channel of each of the at least one message middleware.
In an implementation manner of the first aspect, the method further includes:
receiving an input message attribute file, wherein the message attribute file comprises a plurality of-to-one corresponding message identifications and message attributes;
and establishing a corresponding relation between the message identification and the message attribute based on the many-to-one corresponding message identification and the message attribute.
A second aspect of an embodiment of the present application provides a message processing apparatus, including:
the receiving module is used for receiving an input target message subscription request, and the target message subscription request comprises a target message identifier;
the message attribute determining module is used for determining the message attribute corresponding to the target message identifier in the corresponding relationship between the pre-stored message identifier and the message attribute; the message attribute comprises owner information, a message name and message routing information, and the owner information corresponds to at least one message middleware;
the message middleware determining module is used for determining a target message middleware with load meeting preset requirements in the at least one message middleware according to the owner information;
and the message processing module is used for initiating the subscription and/or the publishing of the message through the target message middleware based on the message name and the message routing information.
A third aspect of embodiments of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the terminal device, where the processor implements the steps of the message processing method provided in the first aspect when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the steps of the message processing method provided by the first aspect.
A fifth aspect of embodiments of the present application provides a computer program product, which, when run on a terminal device, causes the terminal device to execute the steps of the message processing method provided in the first aspect.
The message processing method, the message processing device, the terminal equipment and the computer readable storage medium provided by the embodiment of the application have the following beneficial effects that:
the message processing method provided in the embodiment of the present application may determine, according to a target message identifier in a target message processing request and a pre-stored correspondence, a message attribute corresponding to the target message identifier, where the target message processing request includes a target message subscription request and/or a target message publishing request, and the message attribute includes owner information, and the owner information may correspond to at least one message middleware, so that a target message middleware whose load meets a preset requirement may be determined from at least one message middleware corresponding to the master information, and based on a message name and message routing information, a subscription and/or a publishing of a message is initiated through the target message middleware.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of a system to which a message processing method provided in an embodiment of the present application is applicable;
fig. 2 is a flowchart of an implementation of a message processing method according to an embodiment of the present application;
fig. 3 is a flowchart of an implementation of a message processing method according to another embodiment of the present application;
fig. 4 is a flowchart illustrating an implementation of a message processing method according to yet another embodiment of the present application;
fig. 5 is a flowchart illustrating an implementation of a message processing method according to yet another embodiment of the present application;
fig. 6 is a flowchart illustrating an implementation of a message processing method according to yet another embodiment of the present application;
fig. 7 is a flowchart illustrating an implementation of a message processing method according to yet another embodiment of the present application;
fig. 8 is a block diagram illustrating a structure of a message processing apparatus according to an embodiment of the present application;
fig. 9 is a block diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
At present, EDA-based architectures are not few, but most of them are applied to the periphery of the core system, and usually some peripheral auxiliary support is provided. Traditional EDA design focuses on high availability and load balancing implementation of both ends, as compared to design and implementation of a focused publisher and subscriber. The publishing and subscribing of the message are mostly predefined, that is, it is preset to which message middleware the message is published, and the corresponding relationship between the subscribing terminal and the message middleware, and the predefined message middleware can not meet the requirements of subscribing and publishing the message, so that the subscribing terminal and the subscribing terminal can not subscribe/publish the message.
Based on the above problems, the present application provides a message processing method, an apparatus, a terminal device, and a storage medium, where the method determines a message attribute corresponding to a target message identifier according to the target message identifier in a received target message processing request and a pre-stored correspondence, the target message processing request includes a target message subscription request and/or a target message publishing request, and the message attribute includes owner information, and the owner information may correspond to at least one message middleware, so that a target message middleware whose load meets a preset requirement may be determined in at least one message middleware corresponding to the master information, and the target message middleware is connected to the target message middleware and initiates and/or publishing of a message based on a corresponding message name and message routing information.
In addition, for the situation that the predefined message middleware may have an abnormality, the message processing method can also determine the standby message middleware based on the owner information of the target message when detecting that the target message middleware has a fault, connect the standby message middleware and continue to subscribe and/or publish the message based on the message name and the message routing information in the standby message, so that the standby message middleware can be adopted to continue to subscribe and/or publish the message when the message middleware has an abnormality.
By way of example, the embodiments of the present application may be applied to a system as shown in fig. 1. In the system, the message subscriber terminal 10 and the message publisher terminal 20 subscribe and/or publish messages through the message processing device 30. The message subscriber terminal 10 receives a target message subscription request input by a user and sends the target message subscription request to the message processing device 30; the message processing device 30 extracts the target message identifier in the target message subscription request, determines the message attribute corresponding to the target message identifier in the pre-stored correspondence between the message identifier and the message attribute, determines the target message middleware with the load meeting the preset requirement according to the owner information, connects the message subscription terminal 10 and the message distribution terminal 20 with the target message middleware, and initiates subscription/distribution of the message based on the message name and the message routing information in the message attribute.
The message processing method of the present application is described in detail below with reference to fig. 1.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a message processing method according to an embodiment of the present application.
Step S101, receiving an input target message processing request, wherein the target message subscribing request comprises a target message identifier, and the target message processing request comprises a target message subscribing request and/or a target message publishing request.
The target message identifier is used to characterize a target message to be subscribed/published by the user through the target message subscription request, for example, the message identifier may be a message name and the like.
For example, a configuration file (e.g., an XML file, a Property file, etc.) carrying the attribute of the target message may be input to the message processing device, and the message processing device extracts the attribute of the target message from the configuration file.
For example, the attributes of the target message may be entered by the user in a visualization interface of the message processing device.
And step S102, determining the message attribute corresponding to the target message identifier in the corresponding relationship between the pre-stored message identifier and the message attribute.
The message attribute comprises owner information, a message name and message routing information, and the owner information corresponds to at least one message middleware.
For example, the owner information of a message indicates the function module to which the message belongs, and a message may belong to one function module or a plurality of function modules, and each function module corresponds to a message middleware, wherein each message middleware has an address identifier (e.g., IP) and a port.
In this embodiment, the correspondence between the message identifier and the message attribute may include a plurality of pairs of one-to-one corresponding message identifiers and message attributes, the target message identifier is matched with each message identifier in the correspondence, and if there is a message identifier successfully matched with the target message identifier, the message attribute corresponding to the message identifier is used as the message attribute of the target message identifier.
In an application scenario, referring to table 1, the correspondence between the message identifier and the message attribute may include: the correspondence between message id 1 and message attribute 1, the correspondence between message id 2 and message attribute 2, \8230;, the correspondence between message id n and message attribute n. After the target message identifier is obtained in step S102, the target message identifier is matched with each message identifier in table 1, a message identifier i (i is greater than or equal to 1 and less than or equal to n) that is the same as the target message identifier is determined, and a message attribute i corresponding to the message identifier i is used as a message attribute corresponding to the target message identifier.
TABLE 1 correspondence of message identifications and message attributes
Step S103, determining a target message middleware with load meeting preset requirements in the at least one message middleware according to the owner information.
The target message middleware can be used for providing a data transmission channel between the message publishing terminal and the message subscribing terminal, the message subscribing terminal can send the message subscription request to the message publishing terminal through the target message middleware, the message publishing terminal publishes a corresponding message based on the message subscription request, and the message is transmitted to the message subscribing terminal through the target message middleware.
It should be noted that, in the message subscription stage and the message publishing stage, different target message middleware may be corresponded. For example, in the message subscription stage, a first target message middleware may be adopted, and at this time, the message subscription end and the message publishing end transmit data through the first target message middleware; in the message publishing stage, a second target message middleware may be adopted, for example, when the first target message middleware is abnormal, the message subscribing terminal and the message publishing terminal transmit data through the second target message middleware.
In this step, the load meeting the preset requirement may be: the load is smaller than the threshold, or the load meets the requirement of certain information subscription/publication, for example, the load is located in a preset range, and the like.
Referring to fig. 3, in some embodiments, step S103 may include the steps of:
step S1031, determining the address identification of each message middleware in the at least one message middleware according to the owner information, and establishing communication connection with each message middleware based on the address identification.
Step S1032 calculates the load of each of the message middlewares.
Step S1033, determining the message middleware with the load meeting the preset requirement in each message middleware as the target message middleware.
Each message middleware is provided with an address identifier (such as an address IP) and a port, so that the address identifier of each message middleware corresponding to the owner information can be determined.
Illustratively, for m message middlewares, m is an integer greater than or equal to 2, the address identifier corresponding to the message middlewares 1 is IP1, the address identifier corresponding to the message middlewares 2 is IP2, \ 8230 \ 8230, and the address identifier corresponding to the message middlewares m is IPm. And establishing communication connection with the m message middlewares respectively according to the addresses IP1 to IPm to perform load test, and calculating the load corresponding to each message middleware according to the test data. And after the load of the m message middleware is obtained through calculation, the message middleware with the load meeting the preset requirement is used as the target message middleware. For example, the message middleware with the minimum load may be used as the target message middleware, or the message middleware with the load within a preset range may be used as the target message middleware.
If there are multiple message middleware with loads in the preset range, any message middleware in the multiple message middleware with loads in the preset range can be used as a target message middleware, and other message middleware can be used as a standby message, so that the message middleware needs to be replaced when the target message middleware is abnormal.
Step S104, connecting the target message middleware, and initiating the subscription and/or publication of the message based on the message name and the message routing information.
The message attribute comprises a message name and a message route, and the message can be subscribed and published according to the two pieces of information, so that after the connection with the target message middleware is established, the message can be subscribed and published through the target message middleware according to the message name and the message route information in the message attribute.
It can be seen from the above that, in the above message processing method, according to the target message identifier in the target message processing request and the pre-stored correspondence, the message attribute corresponding to the target message identifier is determined, where the message attribute includes owner information, and the owner information may correspond to at least one message middleware, so that a target message middleware whose load meets a preset requirement may be determined in at least one message middleware corresponding to the owner information, and a subscription and/or publication of a message is initiated based on a corresponding message name and message routing information, and because the target message middleware is a message middleware whose load meets the preset requirement, for example, the load is low or the load meets the requirement of subscription/publication of some information, the subscription and/or publication of a message can be better achieved by the publishing terminal and the subscribing terminal, and the successful completion of the subscription and/or publication of the message is ensured.
Referring to fig. 4, fig. 4 is a flowchart illustrating an implementation of a message processing method according to another embodiment of the present application. With respect to the embodiment corresponding to fig. 2, the message processing method provided in this embodiment further includes step S105 and step S106 after step S104, which are detailed as follows:
step S105, when the target message middleware is detected to have abnormity, determining standby message middleware based on owner information of the target message.
And step S106, based on the message name and the message routing information, continuing to subscribe and/or publish the message through the standby message middleware.
The target message middleware is capable of detecting the target message middleware and determining whether the target message middleware is abnormal or not, wherein the message is possibly abnormal in the process of subscribing and/or publishing the message through the message middleware, and the message can not be subscribed or published any more if the target message middleware is abnormal.
For example, detecting whether the target message middleware has an exception may specifically be: detecting whether the load of the target message middleware is greater than a threshold value so as to determine whether the load of the target message middleware is too large to influence the subscription/publication of the message; or detecting whether other functions of the target message middleware are normal or not. In addition, the detection frequency can be set according to specific situations, and the detection frequency preferably does not affect the subscription and/or the publication of the message and does not occupy system resources too much.
Referring to fig. 5, in some embodiments, the determining, in step S105, the backup message middleware based on the owner information of the target message may include:
step S1051, confirm the address label of the middleware of the optional message according to the said owner information, and set up the communication connection with each said middleware of the optional message on the basis of the said address label.
Wherein the optional message middleware is a message middleware except the target message middleware in the at least one message middleware.
Step S1052, calculating the load of each optional message middleware.
Step S1053, determining the optional message middleware with the lowest load value among the optional message middleware as the standby message middleware.
In this embodiment, the message middleware except the target message middleware in the message middleware corresponding to the owner information in step 102 is used as an optional message middleware and is used as a candidate set of the standby message middleware. And respectively establishing communication connection with each optional message middleware based on the address identification of each optional message middleware in the candidate set, carrying out load test, and calculating the load corresponding to each optional message middleware according to the test data. And after the load of each optional message middleware is calculated, the optional message middleware with the lowest load is used as a standby message middleware, and the subscription and/or the publication of the message are continued.
Optionally, for a case that the backup message middleware cannot be determined, the message processing method may further include:
and in the case that the standby message middleware cannot be determined, continuing subscribing and/or publishing the message through the first preset message middleware based on the message name and the message routing information.
In step 102, when there is no other message middleware except the target message middleware in the message middleware corresponding to the owner information, or when there is an abnormality in other message middleware, etc., a first preset message middleware may be connected, and then based on the message name and the message routing information, subscription/publication of the message is continued through the first preset message middleware.
In this embodiment, the first preset message middleware may be created by default for the system, and the first preset message middleware is invoked to subscribe/publish the message when the standby message middleware cannot be determined.
Referring to fig. 6, fig. 6 is a flowchart illustrating an implementation of a message processing method according to still another embodiment of the present application. With respect to the embodiment corresponding to fig. 2, the message processing method provided by this embodiment further includes step S107 after step S104. The details are as follows:
step S107, when detecting that the flow rate required for subscribing/publishing the target message is greater than a threshold value, continuing to subscribe and/or publish the message to the target message through a second preset message middleware;
wherein the data transmission channel of the second preset message middleware is independent of the data transmission channel of each of the at least one message middleware.
In this embodiment, the second preset message middleware and other message middleware are independent from each other, and do not occupy data transmission channels of other message middleware, so that data transmission of other message middleware is not affected. After the message is connected to the second preset message middleware, both the message subscribing terminal and the message publishing terminal are switched to the second preset message middleware to subscribe and/or publish the message.
Referring to fig. 7, fig. 7 is a flowchart illustrating an implementation of a message processing method according to still another embodiment of the present application. With respect to the embodiment corresponding to fig. 2, the message processing method provided in this embodiment further includes step S108 and step S109 before step S102. The details are as follows:
step S108, receiving an input message attribute file, wherein the message attribute file comprises a plurality of-to-one corresponding message identifications and message attributes.
Step S109, establishing the corresponding relation between the message identification and the message attribute based on the many-to-one corresponding message identification and message attribute.
In this embodiment, the message attribute file may be a configuration file containing a message attribute, such as an XML file, a Property file, and the like, where the message attribute file may contain a message identifier, a data object (e.g., class in java) corresponding to the message, a priority of the message, message routing information, message authority, owner information, and the like.
Exemplarily, an XML file or Property file carrying the message attribute may be input into the message processing device, and the message processing device extracts the attribute of the target message from the XML file or Property file; alternatively, the message attributes may be entered by the user in the visualization interface and stored in the database.
Exemplarily, a many-to-one corresponding message identifier 1 \8230 \ 8230and a message attribute 1 \8230 \ 8230, l, which are integers greater than or equal to 2, in the message attribute file may be extracted, and a corresponding relationship between the message identifier and the message attribute is obtained according to a corresponding relationship between each pair of one-to-one corresponding message identifier i (i is greater than or equal to 1 and less than or equal to l) and the message attribute i, as shown in table 2.
TABLE 2 correspondence of message identifications and message attributes
The correspondence between the message identifier and the message attribute in table 1 specifically includes: the correspondence between message identity 1 and message attribute 1, the correspondence between message identity 2 and message attribute 2, \8230;, the correspondence between message identity l and message attribute l. After the target message identifier is obtained in step S102, the target message identifier is matched with each message identifier in table 1, a message identifier i that is the same as the target message identifier is determined, and a message attribute i corresponding to the message identifier i is used as a message attribute corresponding to the target message identifier.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 8 shows a block diagram of a message processing apparatus according to the embodiment of the present application, where only the relevant parts of the message processing apparatus according to the embodiment of the present application are shown for convenience of description.
Referring to fig. 8, the message processing apparatus in this embodiment includes units for executing the steps in the embodiments corresponding to fig. 2 to 7. Please refer to fig. 2 to 7 and fig. 2 to 7 for a related description of embodiments. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 8, the message processing apparatus 200 may include: a receiving module 201, a message attribute determining module 202, a message middleware determining module 203, and a message processing module 204, wherein:
a receiving module 201, configured to receive an input target message processing request, where the target message subscription request includes a target message identifier, and the target message processing request includes a target message subscription request and/or a target message publishing request;
a message attribute determining module 202, configured to determine, in a pre-stored correspondence between a message identifier and a message attribute, a message attribute corresponding to the target message identifier; the message attribute comprises owner information, a message name and message routing information, and the owner information corresponds to at least one message middleware;
a message middleware determining module 203, configured to determine, according to the owner information, a target message middleware whose load meets a preset requirement in the at least one message middleware;
and the message processing module 204 is configured to connect to the target message middleware, and initiate subscription and/or publication of a message based on the message name and the message routing information.
As an embodiment of the present application, the message middleware determining module 203 may specifically be configured to:
determining an address identifier of each message middleware in the at least one message middleware according to the owner information, and establishing communication connection with each message middleware based on the address identifier;
calculating the load of each message middleware;
and determining the message middleware with the load value meeting the preset requirement in each message middleware as the target message middleware.
As an embodiment of the present application, the message processing apparatus 200 may further include:
the fault detection module is used for determining a standby message middleware based on owner information of the target message when the target message middleware is detected to have a fault;
and the standby subscription/publishing module is used for connecting the standby message middleware and continuing to subscribe and/or publish the message based on the message name and the message routing information in the standby message.
As an embodiment of the present application, the message processing module 204 may be specifically configured to:
determining the address identification of the optional message middleware according to the owner information, and establishing communication connection with each optional message middleware based on the address identification; wherein the optional message middleware is a message middleware except the target message middleware in the at least one message middleware;
calculating the load of each optional message middleware;
and determining the optional message middleware with the lowest load value in the optional message middleware as the standby message middleware.
As an embodiment of the present application, the message processing apparatus 200 may further include:
and the second message processing module is used for continuing subscribing and/or publishing the message through the first preset message middleware based on the message name and the message routing information in the standby message under the condition that the standby message middleware cannot be determined.
As an embodiment of the present application, the message processing apparatus 200 may further include:
the flow detection module is used for continuing to subscribe and/or publish the target message through second preset message middleware when the flow required by subscribing and/or publishing the target message is detected to be larger than a threshold value;
wherein the data transmission channel of the second preset message middleware is independent of the data transmission channel of each of the at least one message middleware.
As an embodiment of the present application, the message processing apparatus 200 may further include:
the file receiving module is used for receiving an input message attribute file, and the message attribute file comprises a plurality of-to-one corresponding message identifications and message attributes;
and the corresponding relation establishing module is used for establishing the corresponding relation between the message identification and the message attribute based on the many-to-one corresponding message identification and the message attribute.
It should be noted that, because the above-mentioned information interaction between the modules, the execution process, and other contents are based on the same concept, specific functions, and technical effects brought by the method embodiment of the present application may be specifically referred to a part of the method embodiment, and are not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. For the specific working processes of the units and modules in the system, reference may be made to the corresponding processes in the foregoing method embodiments, which are not described herein again.
Fig. 9 is a block diagram of a terminal device according to another embodiment of the present application. As shown in fig. 9, the terminal device 30 of this embodiment includes: a processor 31, a memory 32 and a computer program 33, such as a program of a message processing method, stored in said memory 32 and executable on said processor 31. The processor 31 implements the steps in the above-described embodiments of the message processing methods, such as S101 to S104 shown in fig. 2, when executing the computer program 33. Alternatively, when the processor 31 executes the computer program 33, the functions of the units in the embodiment corresponding to fig. 8, for example, the functions of the modules 201 to 204 shown in fig. 8, are implemented, for which reference is specifically made to the description in the embodiment corresponding to fig. 8, which is not repeated herein.
Illustratively, the computer program 33 may be divided into one or more units, which are stored in the memory 32 and executed by the processor 31 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 33 in the terminal device 30. For example, the computer program 33 may be divided into a receiving module, a message attribute determining module, a message middleware determining module, and a message processing module, each of which functions specifically as described above.
Those skilled in the art will appreciate that fig. 9 is merely an example of a terminal device 30 and does not constitute a limitation of terminal device 30 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the turntable device may also include input-output devices, network access devices, buses, etc.
The Processor 31 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 32 may be an internal storage unit of the terminal device 30, such as a hard disk or a memory of the terminal device 30. The memory 32 may also be an external storage device of the terminal device 30, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the terminal device 30. Further, the memory 32 may also include both an internal storage unit and an external storage device of the terminal device 30. The memory 32 is used for storing the computer program and other programs and data required by the turntable device. The memory 32 may also be used to temporarily store data that has been output or is to be output.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the embodiments of the message processing method described above.
The embodiment of the present application provides a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the embodiments of the message processing method when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described or recited in any embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present application, and they should be construed as being included in the present application.
Claims (10)
1. A message processing method, comprising:
receiving an input target message processing request, wherein the target message processing request comprises a target message identifier, and the target message processing request comprises a target message subscription request and/or a target message publishing request;
determining the message attribute corresponding to the target message identifier in the corresponding relation between the pre-stored message identifier and the message attribute; the message attribute comprises owner information, a message name and message routing information, and the owner information corresponds to at least one message middleware;
determining a target message middleware with load meeting preset requirements in the at least one message middleware according to the owner information;
initiating, by the target message middleware, subscription and/or publication of messages based on the message name and the message routing information.
2. The message processing method according to claim 1, wherein the determining, according to the owner information, a target message middleware whose load meets a preset requirement in the at least one message middleware comprises:
determining an address identifier of each message middleware in the at least one message middleware according to the owner information, and establishing communication connection with each message middleware based on the address identifier;
calculating the load of each message middleware;
and determining the message middleware with the load meeting the preset requirement in each message middleware as the target message middleware.
3. The message processing method of claim 1, wherein the method further comprises:
when the target message middleware is detected to be abnormal, determining standby message middleware based on owner information of the target message;
continuing subscription and/or publication of messages through the standby message middleware based on the message name and the message routing information.
4. The message processing method of claim 3, wherein the determining backup message middleware based on the owner information of the target message comprises:
determining the address identification of the optional message middleware according to the owner information, and establishing communication connection with each optional message middleware based on the address identification; wherein the optional message middleware is a message middleware except the target message middleware in the at least one message middleware;
calculating the load of each optional message middleware;
and determining the optional message middleware with the lowest load value in each optional message middleware as the standby message middleware.
5. The message processing method of claim 4, wherein the method further comprises:
and under the condition that the standby message middleware cannot be determined, continuing subscribing and/or publishing the message through the first preset message middleware based on the message name and the message routing information.
6. The message processing method of claim 1, wherein the method further comprises:
when detecting that the flow required by subscribing and/or publishing the message is larger than a threshold value, continuing subscribing and/or publishing the message through second preset message middleware;
wherein the data transmission channel of the second preset message middleware is independent of the data transmission channel of each of the at least one message middleware.
7. The message processing method of claim 1, wherein the method further comprises:
receiving an input message attribute file, wherein the message attribute file comprises a message identifier and a message attribute which correspond to each other in a many-to-one manner;
and establishing a corresponding relation between the message identification and the message attribute based on the many-to-one corresponding message identification and the message attribute.
8. A message processing apparatus, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving an input target message processing request, the target message processing request comprises a target message identifier, and the target message processing request comprises a target message subscription request and/or a target message publishing request;
the message attribute determining module is used for determining the message attribute corresponding to the target message identifier in the corresponding relation between the pre-stored message identifier and the message attribute; the message attribute comprises owner information, a message name and message routing information, and the owner information corresponds to at least one message middleware;
the message middleware determining module is used for determining a target message middleware with load meeting preset requirements in the at least one message middleware according to the owner information;
and the message processing module is used for initiating the subscription and/or the publication of the message through the target message middleware based on the message name and the message routing information.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011627639.4A CN112788551B (en) | 2020-12-30 | 2020-12-30 | Message processing method and device, terminal equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011627639.4A CN112788551B (en) | 2020-12-30 | 2020-12-30 | Message processing method and device, terminal equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112788551A CN112788551A (en) | 2021-05-11 |
CN112788551B true CN112788551B (en) | 2023-04-07 |
Family
ID=75754596
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011627639.4A Active CN112788551B (en) | 2020-12-30 | 2020-12-30 | Message processing method and device, terminal equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112788551B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113778789A (en) * | 2021-08-15 | 2021-12-10 | 新华三大数据技术有限公司 | Alarm information processing method and device |
CN115827275B (en) * | 2022-12-14 | 2023-08-18 | 贝壳找房(北京)科技有限公司 | Message synchronization method, electronic device, storage medium, and computer program product |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102377686B (en) * | 2010-08-10 | 2015-07-01 | 阿里巴巴集团控股有限公司 | Message subscription system, method and device |
CN108270857A (en) * | 2018-01-15 | 2018-07-10 | 郑州云海信息技术有限公司 | A kind of cloud computing operating system load-balancing method and system |
CN109933439B (en) * | 2019-02-21 | 2024-06-11 | 深圳市珍爱捷云信息技术有限公司 | Message transmission method, device, computer equipment and storage medium |
CN111866045B (en) * | 2019-04-29 | 2023-05-30 | 京东科技控股股份有限公司 | Information processing method and device, computer system and computer readable medium |
CN111258775A (en) * | 2020-01-08 | 2020-06-09 | 南京领行科技股份有限公司 | Message processing method, device, equipment and storage medium |
-
2020
- 2020-12-30 CN CN202011627639.4A patent/CN112788551B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN112788551A (en) | 2021-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021008414A1 (en) | Alarm method for internet of things device, and related apparatus | |
CN110601880B (en) | Cloud platform, service processing method, command interface and computer equipment | |
CN112788551B (en) | Message processing method and device, terminal equipment and storage medium | |
WO2021008413A1 (en) | Fault prompting method for internet of things device, and related apparatus | |
CN111163130B (en) | Network service system and data transmission method thereof | |
CN106339222A (en) | Service implementing method and device | |
CN109582655B (en) | Method and device for positioning system log and computer readable storage medium | |
CN110851207B (en) | State transition management method and device, electronic equipment and storage medium | |
CN110290168B (en) | Data transmission method, device, server and storage medium | |
CN112035344A (en) | Multi-scenario test method, device, equipment and computer readable storage medium | |
CN112788128A (en) | Business information pushing method and device, storage medium and electronic device | |
CN111611249A (en) | Data management method, device, equipment and storage medium | |
CN111510326A (en) | Master-slave equipment configuration information synchronization method, system, terminal equipment and storage medium | |
CN109348434B (en) | Scene information sending method, sending device and terminal equipment | |
CN114189525A (en) | Service request method and device and electronic equipment | |
CN114268957A (en) | Abnormal business data processing method, device, server and storage medium | |
CN113177015B (en) | Frame header-based serial port communication method and serial port chip | |
CN114676205A (en) | Event information processing method and device | |
CN111130828B (en) | Intelligent network distribution method and device and terminal equipment | |
CN113032358B (en) | Water affair data processing method and device and terminal equipment | |
CN113132522A (en) | Test method, device, server and medium | |
CN115037653B (en) | Service flow monitoring method, device, electronic equipment and storage medium | |
CN115952003A (en) | Method, device, equipment and storage medium for cluster server load balancing | |
CN114418142A (en) | Equipment inspection method and device | |
CN109614246B (en) | Message processing method and device and message processing server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |