Multi-type message bus management method

By building and registering message models in a distributed architecture, binding message resources, and using the message bus SDK for verification and adaptation, the problem of growth in the number of message topics and message compatibility is solved, and transparency between message buses is achieved. Interoperability and process standardization.

CN114089990BActive Publication Date: 2024-09-03NETWORK INFORMATION RES INST INST OF SYST ENG ACAD OF MILITARY SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111233954.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2024-09-03
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

Under a distributed architecture, it is difficult for existing message middleware to establish a unified message management mechanism, limit the unlimited growth of the number of message topics, standardize the sending format of message messages, and be compatible with message sending and receiving between different types of message middleware. .

Method used

By writing and reviewing message bus usage applications, building and registering message models, binding message resources, using the message bus SDK for message model verification and middleware adaptation, message protocol conversion is realized, and message middleware switching is supported on demand.

Benefits of technology

Establish a message management audit mechanism in the production environment, standardize the message bus model definition and usage process, support the interoperability of different message middleware, and realize transparent sending and receiving between message buses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114089990B
    Figure CN114089990B
Patent Text Reader

Abstract

The present invention relates to the technical field of multi-type message service management, and in particular to a management method for messages of multiple business types. The multi-type message service management method of the present invention can establish a unified message management mechanism in a production environment, provide full-process management of message model definition, message bus registration review, and message bus development and use, and can switch the message middleware type according to the scenario in the production environment as needed, so that the standardization and scalability of the message service are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of multi-type message service management, and in particular to a multi-type message bus management method, platform and computer-readable storage medium for full life cycle management of messages of different business types. Background Art

[0002] Compared with the era of monolithic architecture, how to ensure efficient and reliable message transmission between systems in a distributed system architecture. We all know that the emergence of any technology is to solve problems, and the problem of "how messages flow" is solved through a universal software "bus", that is, a communication mechanism, to solve the heavy information communication work between applications. As a third-party service for message processing, the message bus can realize data storage and transmission, enabling cross-process remote message communication in a distributed architecture.

[0003] The message bus is mainly used to standardize message exchange between systems. The message flow within and between business system domains is defined by this message bus.

[0004] The definition of the message bus is designed in a message model-driven way. All messages are first defined in a message model protocol way, which clarifies the naming, format and other information of the message and specifies a series of ways in which the message flows in the message bus. In simple terms, the message bus refers to the use of an efficient and reliable message transmission mechanism for platform-independent data exchange, and the integration of distributed systems based on data communication.

[0005] There are many open source message middlewares on the market, which can have excellent features such as low latency, high concurrency, high reliability, asynchronous communication, system decoupling and traffic peak shaving under distributed architecture. The publisher and consumer of the message bus are fully decoupled. The publisher does not need to pay attention to whether there are consumers subscribing or whether the consumer has received the message. The consumer does not need to pay attention to which publisher produces and provides the information. The sending and receiving of messages are completely asynchronous and are not suitable for scenarios with synchronous waiting for response requirements.

[0006] The message bus is suitable for the following scenarios:

[0007] 1) Information interaction within the business service domain and between business services and professional services;

[0008] 2) Notification message interaction between foreground and background applications;

[0009] 3) Control message interaction between applications;

[0010] 4) Notification messages of large data volume changes, cooperating with data services to push data changes.

[0011] However, there are still some problems in the existing message middleware. For example, when the business types are relatively complex and the number of message topics is too large, how to establish a unified message management mechanism to limit the unlimited growth of the number of message topics and achieve the goal of reusable message topics of the same business type, how to standardize the sending format of message packets through verification methods, or how to convert message protocols so that consumers using different types of message middleware can receive messages without perception, so as to be compatible with the sending and receiving of messages between different types of message middleware. Summary of the invention

[0012] The purpose of the present invention is to provide a multi-type message bus management method to solve the problems raised in the above background technology.

[0013] To achieve the above object, the present invention provides a multi-type message bus management method, comprising the steps of:

[0014] Step S100, the step of writing and reviewing the message bus use application,

[0015] Step S200, building a message model and registering it in the message catalog for review, includes:

[0016] Step S300, a step of reviewing and publishing a message model;

[0017] Step S400, the step of registering, reviewing and publishing message resources;

[0018] Step S500, a step of developing services based on message resources;

[0019] Step S600 is a step of deploying and running the developed business on the message bus.

[0020] Furthermore, the step S100 includes:

[0021] Step S110, write a message bus application and submit it for review. The content of the message bus application includes description information of the message resource, which includes the message resource name, message subject, message publisher and consumer, application mode, and message model used by the message resource. The message model defines the data structure of the message.

[0022] Step S120, a normative review of the message model is conducted according to the message use application, and the review content includes whether the message resource has a publisher and a consumer, whether the message resource has a data structure, and whether the message resource declares an application mode;

[0023] Step S130, if the review is passed, proceed to the next step, otherwise return to step S110.

[0024] Furthermore, the step S200 includes:

[0025] Step S210, constructing a message model according to the approved message use application, wherein constructing the message model includes constructing a data structure of the message model;

[0026] Step S220: register the message model into the message catalog.

[0027] Furthermore, the step S300 includes:

[0028] Step S310, determine whether there is authority to review the message catalog, if yes, proceed to the next step;

[0029] Step S320, reviewing the message model in the message catalog to see whether the data structure of the message model complies with the specification;

[0030] Step S330: publish the registration information of the message model that has passed the review.

[0031] Furthermore, the step S400 includes:

[0032] Step S410, binding the message resource and the message model according to the message bus usage application;

[0033] Step S420, registering the message resource bound to the message model into the message directory for review. The review object is the description information of the message resource. The review content includes whether the message resource is bound to the message model, whether the bound message model is a message model that has passed the review and release, whether the message resource has specified the publisher and consumer, and whether the message resource has declared the application mode.

[0034] Step S430: publish the description information of the message resources that have passed the review.

[0035] Furthermore, the step S500 includes:

[0036] Step S510, determine whether you have the authority to query the message catalog, if yes, proceed to the next step;

[0037] Step S520, query the description information of the message resources published in the message catalog, download the corresponding message bus SDK, the message bus SDK includes a message model verification module, a message encoding and decoding module and a message middleware adaptation module, the message model verification module is used to query the message catalog for verification when the message bus sends or receives a message, the message encoding and decoding module is used for encoding and decoding of the message, and the message middleware adaptation module is used to select the message middleware, and the message middleware includes Kafka and DDS;

[0038] Step S530: Perform business development based on the downloaded message bus SDK.

[0039] Furthermore, the step S600 includes:

[0040] Step S610, the message sender applies a step of sending a message, which includes:

[0041] Step S611, determine whether it is necessary to change the message middleware configuration used by the underlying application of the message sender, for example, if it is Kafka, it needs to be changed to DDS. If so, select the message middleware configuration used by the underlying application of the message sender through the message bus switch, and execute step S612. If not, execute step S613 to send the message;

[0042] Step S612, restart the message sender application, and use the message bus after the message middleware configuration is changed to execute step S613 to send the message;

[0043] Step S613: the message sender application calls the sending interface of the message bus SDK. Before sending, the message model verification module queries the message catalog to verify whether the message resource used by the message sender application has passed the review. If so, the message is sent using the message topic of the corresponding message resource. If not, the sending fails.

[0044] Step S620, the message bus forwards the message. In this step, it is determined whether the message models used by the message sender application and the message receiver application are the same. If they are different, the message bus parses the message entity data sent by the sender application and converts it into message entity data that can be recognized by the message receiver application through the protocol conversion module.

[0045] Step S630, the receiving application receives data, which includes:

[0046] Step S631, determining whether it is necessary to change the message middleware configuration used by the underlying application of the message receiver. If so, selecting the message middleware configuration used by the underlying application of the message receiver through the message bus switch, and executing step S632. If not, executing step S633 to receive the message.

[0047] Step S632, restart the message receiving application, and use the message bus after the message middleware configuration is changed to execute step S633 to receive the message;

[0048] Step S633, the message receiving application calls the receiving interface of the message bus SDK, and the message model verification module queries the message directory for verification during reception to verify whether the message resource used by the message receiving application is an approved message resource. If so, the message subject of the corresponding message resource is used to receive the message. If not, the reception fails.

[0049] Furthermore, in step S613, the pre-sending message model verification module queries the message catalog for verification and further includes: verifying whether the message model used by the sender exists, whether the format of the message is correct, and whether the publisher of the message is allowed to send the message; and / or

[0050] In step S633, the message model verification module during reception queries the message catalog for verification and also includes: verifying whether the message model of the recipient exists and whether the consumer of the message is allowed to receive the message.

[0051] The present invention also provides a multi-type message bus management platform, characterized in that it includes:

[0052] at least one processor; and,

[0053] a memory communicatively connected to the at least one processor; wherein,

[0054] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the multi-type message bus management method.

[0055] The present invention also provides a computer-readable storage medium storing a computer program, characterized in that the computer program implements the multi-type message bus management method when executed by a processor.

[0056] Beneficial Effects

[0057] The multi-type message bus management method of the present invention can establish a message management and audit mechanism in a production environment, standardize the message bus model definition and usage process, and support switching of message middleware according to demand and scenario to cope with users using various message middleware in a distributed environment, and has the ability to send and receive messages between compatible different message buses. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 The flowchart of the multi-type message bus management method of the present invention.

[0059] Figure 2 This is a message bus architecture diagram of the multi-type message bus management method of the present invention.

[0060] Figure 3 The present invention provides a flowchart for developing messages for the multi-type message bus management method.

[0061] Figure 4 This is a message deployment and operation flow chart of the multi-type message bus management method of the present invention.

[0062] Figure 5The figure is a composition principle diagram of a multi-type message bus management platform according to an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The specific implementation modes of the present invention are described in detail below with reference to the accompanying drawings.

[0064] The multi-type message bus management method of the present invention can establish a message registration and audit mechanism in a production environment, standardize the message model definition and the message bus usage process, switch the message middleware according to the scenario as needed to cope with users who use various message middleware in a distributed environment, and have the ability to send and receive messages between different message buses.

[0065] like Figure 1 As shown, the multi-type message bus management method in the first specific embodiment of the present invention is executed in different positions and resources. Those skilled in the art will know that positions and resources vary according to needs, and are not intended to limit the method of the present invention. The multi-type message bus management method in this embodiment includes:

[0066] Step S100, the step of writing and reviewing the message bus use application, includes:

[0067] Step S110, the business designer writes a message bus application and submits it for review. The content of the message bus application includes description information of the message resource, which includes the message resource name, message subject, publisher and consumer of the message, application mode, and message model used by the message resource. The message model defines the data structure of the message; the message subject is the channel between the publisher and the consumer, or the message identifier;

[0068] Step S120: the real question framework team conducts a normative review of the message model based on the message use application. The review content includes whether the message resource has a publisher and a consumer, whether the message resource has a data structure, and whether the message resource declares an application mode.

[0069] Step S130, if the review is passed, the business framework group notifies the business designer to proceed to the next step, otherwise returns to step S110.

[0070] Step S200, building a message model and registering it in the message catalog for review, includes:

[0071] Step S210, the business designer constructs a message model according to the approved message use application, and constructing the message model includes constructing a data structure of the message model;

[0072] Step S220: The business designer registers the message model into the message catalog.

[0073] Step S300, reviewing and publishing the message model, includes:

[0074] Step S310, determining whether the logged-in person is a message catalog administrator with authority to review the message catalog, and if so, proceeding to the next step;

[0075] Step S320: The message catalog administrator reviews the message model in the message catalog to determine whether the data structure of the message model complies with the specification.

[0076] Step S330: publish the registration information of the message model that has passed the review.

[0077] Step S400, the step of registering, reviewing and publishing message resources, includes:

[0078] Step S410, the message catalog administrator binds the message resource to the message model according to the message bus usage application;

[0079] Step S420, register the message resource bound to the message model into the message catalog and have it reviewed by the message catalog administrator. The review object is the description information of the message resource. The review content includes whether the message resource is bound to the message model, whether the bound message model is a message model that has passed the review and release, whether the message resource has specified the publisher and consumer, and whether the message resource has declared the application mode.

[0080] Step S430: publish the description information of the message resources that have passed the review.

[0081] Step S500, a step of developing services based on message resources, includes:

[0082] Step S510, determine whether the business developer has the authority to query the message catalog, if yes, proceed to the next step;

[0083] Step S520: The business developer queries the description information of the message resources published in the message catalog and downloads the corresponding message bus SDK. The message bus SDK includes a message model verification module, a message encoding and decoding module, and a message middleware adaptation module. The message model verification module is used to query the message catalog for verification when the message bus sends or receives a message. The message encoding and decoding module is used for encoding and decoding of messages. The message middleware adaptation module is used to select a message middleware, which includes Kafka, DDS, etc.

[0084] Step S530: The service developer develops the service according to the downloaded message bus SDK.

[0085] Step S600, the step of deploying and running the developed business on the message bus, includes:

[0086] The message sender applies step S610 of sending a message, which includes:

[0087] Step S611, determine whether it is necessary to change the message middleware configuration used by the underlying application of the message sender, for example, if it is Kafka, it needs to be changed to DDS. If so, select the message middleware configuration used by the underlying application of the message sender through the message bus switch, and execute step S612. If not, execute step S613 to send the message;

[0088] Step S612, restart the message sender application, and use the message bus after the message middleware configuration is changed to execute step S613 to send the message;

[0089] Step S613: the message sender application calls the sending interface of the message bus SDK. Before sending, the message model verification module queries the message catalog to verify whether the message resource used by the message sender application has passed the review. If so, the message is sent using the message topic of the corresponding message resource. If not, the sending fails.

[0090] Step S620 of forwarding the message by the message bus, in which it is determined whether the message models used by the message sender application and the message receiver application are the same. If they are different, the message bus parses the message entity data sent by the sender application and converts it into message entity data that can be recognized by the message receiver application through the protocol conversion module;

[0091] The receiving party applies step S630 of receiving data, which includes:

[0092] Step S631, determining whether it is necessary to change the message middleware configuration used by the underlying application of the message receiver. If so, selecting the message middleware configuration used by the underlying application of the message receiver through the message bus switch, and executing step S632. If not, executing step S633 to receive the message.

[0093] Step S632, restart the message receiving application, and use the message bus after the message middleware configuration is changed to execute step S633 to receive the message;

[0094] Step S633, the message receiving application calls the receiving interface of the message bus SDK, and the message model verification module of the message bus SDK queries the message directory for verification to verify whether the message resource used by the message receiving application is an approved message resource. If so, the message subject of the corresponding message resource is used to receive the message. If not, the reception fails.

[0095] The implementation of the message bus interface of the present invention is transparent to the business, and the business unit only needs to program for the interface. The message bus provides an SDK interface, which is directly used by business applications. At the same time, the message bus SDK supports capabilities such as message model definition, model verification, and message middleware adaptation. It is part of the message bus mechanism, and its architecture design is as follows: Figure 2 shown.

[0096] The message development flow chart is as follows Figure 3 As shown in the figure, the publisher and consumer of the message query the message resources through the message catalog, obtain the data structure definition of the message model and the message subject and other information, and carry out offline development based on the message resources, fully realizing the development state decoupling between business parties.

[0097] During the deployment and operation of messages, the unified message bus SDK provided by the platform is used to perform relevant verification before publishing and consuming messages.

[0098] The message bus SDK queries the message model from the message catalog based on the resource name of the message passed in when the user calls the message bus SDK, or queries the message model from the local cache, and performs relevant verification on the model, including verifying whether the message model exists, whether the format of the message is correct, whether the publisher / consumer of the message is in the message allowed list, etc. If the message model verification fails, the message is not allowed to be sent. Only when the message model verification succeeds, the message is allowed to be sent. The running process of the message is as follows Figure 4 shown.

[0099] By using the adaptive message conversion in the background of the message bus, the message can be parsed and converted into entity data recognized by other message buses during the flow.

[0100] The multi-type message bus management method disclosed in the present invention facilitates rapid switching of message buses or adaptive message protocol conversion between multi-type message buses without changing the business code, and this approach is transparent to business users.

[0101] It will be appreciated by those skilled in the art from the above description that the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware.

[0102] like Figure 5 As shown, the second embodiment of the present invention relates to a multi-type message bus management platform, including at least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute the above-mentioned multi-type message bus management method.

[0103] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits through interfaces, which are all well known in the art. The interface provides an interface between the bus and the transceiver, such as a communication interface and a user interface. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium through an antenna, and further, the antenna also receives data and transmits the data to the processor.

[0104] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0105] A third embodiment of the present invention relates to a computer-readable storage medium storing a computer program, and the computer program implements the above method embodiment when executed by a processor.

[0106] Those skilled in the art can understand from the above description that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions for making a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes but is not limited to various media that can store program codes, such as USB flash drives, mobile hard disks, magnetic storage devices, and optical storage devices.

[0107] The above are only preferred embodiments of the invention and are not intended to limit the invention. Any modifications, equivalent substitutions, improvements, etc. made within the conceptual principles of the invention should be included in the protection scope of the invention.

Claims

1. A multi-type message bus management method, characterized in that Includes steps: Step S100, the step of writing and reviewing the message bus use application, Step S200, building a message model and registering it in the message catalog for review; Step S300, a step of reviewing and publishing a message model; Step S400, the step of registering, reviewing and publishing message resources; Step S500, a step of developing services based on message resources; Step S600, a step of deploying and running the developed business on the message bus; The step S100 includes: Step S110, write a message bus application and submit it for review. The content of the message bus application includes description information of the message resource, which includes the message resource name, message subject, message publisher and consumer, application mode, and message model used by the message resource. The message model defines the data structure of the message. Step S120, a normative review of the message model is conducted according to the message use application, and the review content includes whether the message resource has a publisher and a consumer, whether the message resource has a data structure, and whether the message resource declares an application mode; Step S130, if the review is passed, proceed to the next step, otherwise return to step S110; The step S300 includes: Step S310, determine whether there is authority to review the message catalog, if yes, proceed to the next step; Step S320, reviewing the message model in the message catalog to see whether the data structure of the message model complies with the specification; Step S330, publishing the registration information of the message model that has passed the review; The step S400 includes: Step S410, binding the message resource and the message model according to the message bus usage application; Step S420, registering the message resource bound to the message model into the message directory for review. The review object is the description information of the message resource. The review content includes whether the message resource is bound to the message model, whether the bound message model is a message model that has passed the review and release, whether the message resource has specified the publisher and consumer, and whether the message resource has declared the application mode. Step S430: publish the description information of the message resources that have passed the review.

2. The multi-type message bus management method according to claim 1, characterized in that: The step S200 includes: Step S210, constructing a message model according to the approved message use application, wherein constructing the message model includes constructing a data structure of the message model; Step S220: register the message model into the message catalog.

3. The multi-type message bus management method according to claim 1, characterized in that: The step S500 includes: Step S510, determine whether you have the authority to query the message catalog, if yes, proceed to the next step; Step S520, query the description information of the message resources published in the message catalog, download the corresponding message bus SDK, the message bus SDK includes a message model verification module, a message encoding and decoding module and a message middleware adaptation module, the message model verification module is used to query the message catalog for verification when the message bus sends or receives a message, the message encoding and decoding module is used for encoding and decoding of the message, and the message middleware adaptation module is used to select the message middleware, and the message middleware includes Kafka and DDS; Step S530: Perform business development based on the downloaded message bus SDK.

4. The multi-type message bus management method according to claim 1, characterized in that: The step S600 includes: Step S610, the message sender applies a step of sending a message, which includes: Step S611, determining whether it is necessary to change the message middleware configuration used by the underlying application of the message sender, if yes, selecting the message middleware configuration used by the underlying application of the message sender through the message bus switch, and executing step S612, if no, executing step S613 to send the message; Step S612, restart the message sender application, and use the message bus after the message middleware configuration is changed to execute step S613 to send the message; Step S613: the message sender application calls the sending interface of the message bus SDK. Before sending, the message model verification module queries the message catalog to verify whether the message resource used by the message sender application has passed the review. If so, the message is sent using the message topic of the corresponding message resource. If not, the sending fails. Step S620, the message bus forwards the message. In this step, it is determined whether the message models used by the message sender application and the message receiver application are the same. If they are different, the message bus parses the message entity data sent by the sender application and converts it into message entity data that can be recognized by the message receiver application through the protocol conversion module. Step S630, the receiving application receives data, which includes: Step S631, determining whether it is necessary to change the message middleware configuration used by the underlying application of the message receiver. If so, selecting the message middleware configuration used by the underlying application of the message receiver through the message bus switch, and executing step S632. If not, executing step S633 to receive the message. Step S632, restart the message receiving application, and use the message bus after the message middleware configuration is changed to execute step S633 to receive the message; Step S633, the message receiving application calls the receiving interface of the message bus SDK, and the message model verification module queries the message directory for verification during reception to verify whether the message resource used by the message receiving application is an approved message resource. If so, the message subject of the corresponding message resource is used to receive the message. If not, the reception fails.

5. The multi-type message bus management method according to claim 4, characterized in that: In step S611, the message middleware configuration used by the underlying application of the message sender is originally Kafka, which needs to be replaced with DDS.

6. The multi-type message bus management method according to claim 4, characterized in that: In step S613, the pre-sending message model verification module queries the message catalog for verification, further comprising: verifying whether the message model used by the sender exists, whether the format of the message is correct, and whether the publisher of the message is allowed to send the message; and / or In step S633, the message model verification module during reception queries the message catalog for verification and also includes: verifying whether the message model of the recipient exists and whether the consumer of the message is allowed to receive the message.

7. A multi-type message bus management platform, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the multi-type message bus management method according to any one of claims 1 to 6.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the multi-type message bus management method according to any one of claims 1 to 6 is implemented.