Message queue-based topic creation method and device, electronic equipment and medium

CN122249793APending Publication Date: 2026-06-19SIEMENS AG

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SIEMENS AG
Filing Date
2023-11-30
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In a multi-tenant environment, the prior art requires manually creating topics and enabling permissions for each tenant, resulting in high operational complexity and inefficiency.

Method used

By creating a registration topic in the message queue, the tenant can automatically publish registration information to the manager, based on which the manager automatically creates the tenant's message topic and gives permissions.

Benefits of technology

Data isolation between tenants is achieved, the complexity of manual creation and permission setting is reduced, and the efficiency of message queues is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122249793A_ABST
    Figure CN122249793A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, electronic device, and medium for creating topics based on a message queue. The method includes: enabling a message queue manager to create a registered topic in the message queue, wherein the publisher of the registered topic is a tenant of the message queue, and the subscriber of the registered topic is the manager; enabling the manager to receive registration information published by the tenant through the registered topic; and based on the registration information, enabling the manager to create a message topic for the tenant in the message queue, wherein the publisher of the message topic is the tenant, and the subscriber of the message topic is determined by subscription behavior related to the message topic. Based on a specially designed registered topic, tenant registration information can be automatically obtained, thereby automatically creating message topics and automatically assigning permissions to tenants, achieving data isolation between tenants, and improving the efficiency of the message queue.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, electronic device and medium for creating a topic based on a message queue Technical Field

[0001] The embodiments of the present invention relate to the technical field of message queue (MQ), and in particular to a method, device, electronic device and medium for creating a topic based on a message queue. Background Art

[0002] A message queue is a container that stores messages during transmission. Commonly used message queues include ActiveMQ, RabbitMQ, ZeroMQ, Kafka, MetaMQ, and RocketMQ, among others. Message queues typically include point-to-point and publish-subscribe models. In the point-to-point model, a message producer produces a message and sends it to a message queue. A message consumer then retrieves and consumes the message from the queue. Once consumed, the message is no longer stored in the queue. In the publish-subscribe model, a message producer (publisher) publishes a message to a topic, and multiple message consumers (subscribers) can retrieve and consume the message simultaneously.

[0003] Currently, when using message queues for data transmission in a multi-tenant environment, you need to manually create a separate topic for each tenant and manually enable permissions for each tenant to achieve data isolation between tenants.

[0004] Summary of the Invention

[0005] The embodiments of the present invention provide a method, device, electronic device and medium for creating a topic based on a message queue.

[0006] A topic creation method based on a message queue, comprising:

[0007] A manager of an enabling message queue creates a registered topic in the message queue, wherein the publisher of the registered topic is a tenant of the message queue, and the subscriber of the registered topic is the manager;

[0008] enabling the manager to receive registration information published by the tenant through the registration topic;

[0009] Based on the registration information, the manager is enabled to create a message topic for the tenant in the message queue, wherein the publisher of the message topic is the tenant, and the subscriber of the message topic is determined by a subscription behavior on the message topic.

[0010] Therefore, a registration topic is created in the message queue that can automatically obtain the registration information of the tenant. Message topics can be automatically created for the tenant based on the registration information. This not only achieves data isolation between tenants, but also eliminates the complexity of manually creating message topics for tenants, thereby improving the efficiency of the message queue.

[0011] In one embodiment, it includes:

[0012] After enabling the manager to create the tenant's message topic in the message queue, the manager is enabled to grant the tenant permission to publish messages in the message topic.

[0013] It can be seen that the tenant can be further automatically granted the permission to publish messages in the message topic, eliminating the complexity of manually granting permissions to the tenant and improving the efficiency of the message queue.

[0014] In one embodiment, it includes:

[0015] After enabling the manager to grant the tenant permission to publish messages in the message topic, the manager receives messages from the tenant via the message topic and sends the messages to subscribers of the message topic.

[0016] Therefore, after granting tenants the permission to publish messages in a message topic, they can publish messages to subscribers through the topic normally.

[0017] In one embodiment, the registration information includes an identifier of the tenant; and enabling the manager to create a message topic for the tenant in the message queue includes:

[0018] authenticating the tenant based on the tenant's identifier;

[0019] When the authentication is passed, a message topic of the tenant is created in the message queue, wherein a topic name of the message topic is generated based on the identifier of the tenant.

[0020] It can be seen that the topic name of the message topic can be automatically generated based on the tenant identifier, thereby improving the degree of automation.

[0021] In one embodiment, the registration information includes an identifier and a topic name of the tenant; and enabling the manager to create a message topic for the tenant in the message queue includes:

[0022] authenticating the tenant based on the tenant's identifier;

[0023] When the authentication is passed, a message topic of the tenant is created in the message queue, wherein the message topic is named based on the topic name.

[0024] It can be seen that the message topic can be named based on the topic name in the registration information, which implements the topic command based on user configuration and improves the configuration flexibility.

[0025] In one embodiment, the registration information includes the primary identifier and secondary identifier of the tenant;

[0026] The enabling the manager to create the tenant's message topic in the message queue includes:

[0027] authenticating the tenant based on the tenant's primary identification;

[0028] When the authentication is passed, a message topic of the tenant is created in the message queue, wherein a topic name of the message topic is generated based on the primary identifier and the secondary identifier of the tenant.

[0029] Therefore, the embodiments of the present invention also support multi-level identification, and generate topic names of message topics based on the multi-level identification, which facilitates topic management of multiple tenants.

[0030] A topic creation device based on a message queue, the device comprising:

[0031] A first module is configured to enable a manager of a message queue to create a registration topic in the message queue, where the publisher of the registration topic is a tenant of the message queue and the subscriber of the registration topic is the manager;

[0032] A second module is configured to enable the manager to receive registration information published by the tenant through the registration topic;

[0033] The third module is used to enable the manager to create a message topic for the tenant in the message queue based on the registration information, wherein the publisher of the message topic is the tenant, and the subscriber of the message topic is determined by the subscription behavior on the message topic.

[0034] Therefore, a registration topic is created in the message queue that can automatically obtain the registration information of the tenant. Message topics can be automatically created for the tenant based on the registration information. This not only achieves data isolation between tenants, but also eliminates the complexity of manually creating message topics for tenants, thereby improving the efficiency of the message queue.

[0035] In one embodiment, it includes:

[0036] The fourth module is used to enable the manager to grant the tenant the right to publish messages in the message topic after the third module enables the manager to create the tenant's message topic in the message queue.

[0037] It can be seen that the tenant can be further automatically granted the permission to publish messages in the message topic, eliminating the complexity of manually granting permissions to the tenant and improving the efficiency of the message queue.

[0038] In one embodiment, the fourth module is configured to receive a message from the tenant via the message topic and send the message to a subscriber of the message topic after enabling the manager to grant the tenant permission to publish a message in the message topic.

[0039] Therefore, after granting tenants the permission to publish messages in a message topic, they can publish messages to subscribers through the topic normally.

[0040] In one embodiment, the registration information includes an identifier of the tenant;

[0041] The third module is used to authenticate the tenant based on the tenant's identifier; when the authentication is passed, create a message topic for the tenant in the message queue, wherein a topic name of the message topic is generated based on the tenant's identifier.

[0042] It can be seen that the topic name of the message topic can be automatically generated based on the tenant identifier, thereby improving the degree of automation.

[0043] In one embodiment, the registration information includes the tenant's identifier and subject name;

[0044] The third module is configured to authenticate the tenant based on the tenant's identifier; when the authentication is successful, create a message topic for the tenant in the message queue, wherein the message topic is named based on the topic name.

[0045] It can be seen that the message topic can be named based on the topic name in the registration information, which implements the topic command based on user configuration and improves the configuration flexibility.

[0046] In one embodiment, the registration information includes the primary identifier and secondary identifier of the tenant;

[0047] The third module is used to authenticate the tenant based on the tenant's primary identifier; when the authentication is passed, a message topic for the tenant is created in the message queue, wherein the topic name of the message topic is generated based on the tenant's primary identifier and secondary identifier.

[0048] Therefore, the embodiments of the present invention also support multi-level identification, and generate topic names of message topics based on the multi-level identification, which facilitates topic management of multiple tenants.

[0049] An electronic device, comprising:

[0050] processor;

[0051] a memory for storing executable instructions of the processor;

[0052] The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the message queue-based topic creation method as described in any one of the above items.

[0053] A computer-readable storage medium stores computer instructions thereon, wherein when the computer instructions are executed by a processor, the method for creating a topic based on a message queue as described above is implemented.

[0054] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the method for creating a topic based on a message queue as described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, so that those skilled in the art will understand the above and other features and advantages of the present invention more clearly. In the accompanying drawings:

[0056] FIG1 is an architecture diagram of creating topics for tenants based on a message queue in the prior art.

[0057] FIG2 is an exemplary schematic diagram of a topic-based message publishing method in the prior art.

[0058] FIG3 is an exemplary flow chart of a method for creating topics for tenants based on a message queue according to an embodiment of the present invention.

[0059] FIG4 is an exemplary architecture diagram of creating topics for tenants based on a message queue according to an embodiment of the present invention.

[0060] FIG5 is an exemplary schematic diagram of creating a topic for a tenant based on a message queue according to an embodiment of the present invention.

[0061] FIG6 is an exemplary structural diagram of an apparatus for creating topics for tenants based on a message queue according to an embodiment of the present invention.

[0062] FIG7 is an exemplary structural diagram of an electronic device according to an embodiment of the present invention, wherein the reference numerals are as follows: DETAILED DESCRIPTION

[0063] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail with reference to the following examples.

[0064] For the sake of brevity and intuitiveness in description, the solution of the present invention is explained below by describing several representative implementations. A large number of details in the implementations are only used to help understand the solution of the present invention. However, it is obvious that the technical solution of the present invention may not be limited to these details when implemented. In order to avoid unnecessarily obscuring the solution of the present invention, some implementations are not described in detail, but only a framework is given. Hereinafter, "including" means "including but not limited to", and "according to..." means "at least according to..., but not limited to only according to...". Due to the language habits of Chinese, when the number of a component is not specifically specified below, it means that the component can be one or more, or can be understood as at least one.

[0065] Multi-tenancy (or Tenant) is a system architecture that enables a single platform to serve multiple tenants simultaneously. In this architecture, multiple tenants share the same hardware and applications, while maintaining data isolation. Currently, when using message queues for data transmission in a multi-tenant environment, data isolation between tenants requires manually creating separate topics for each tenant and enabling permissions for each tenant.

[0066] Figure 1 is an architecture diagram of creating topics for tenants based on a message queue in the prior art. Tenants 13 and 14 are new tenants of the message queue 10.

[0067] When the management user of the message queue learns that the message queue 10 has a new tenant 13, the management user manually adds the first message topic 11 of tenant 13 to the message queue 10 in the management interface of the message queue 10. Furthermore, the management user manually grants tenant 13 the permission to publish messages in the first message topic 11 in the management interface of the message queue 10, thereby completing the manual creation of a topic for tenant 13 and the manual enabling of permissions for tenant 13. Similarly, when the management user learns that the message queue 10 has a new tenant 14, the management user manually adds the second message topic 12 of tenant 14 to the message queue 10 in the management interface of the message queue 10. Furthermore, the management user manually grants tenant 14 the permission to publish messages in the second message topic 12 in the management interface of the message queue 10, thereby completing the manual creation of a topic for tenant 14 and the manual enabling of permissions for tenant 14.

[0068] FIG2 is an exemplary schematic diagram of a topic-based message publishing method in the prior art.

[0069] After the administrative user manually creates a first message topic 11 for tenant 13 and manually grants tenant 13 permission to publish messages in first message topic 11, one or more subscribers can initiate a subscription action to subscribe to first message topic 11. Tenant 13 then publishes message 15 to first message topic 11. The one or more subscribers subscribed to first message topic 11 can receive message 15 from first message topic 11.

[0070] Similarly, after the administrative user manually creates a second message topic 12 for tenant 14 and manually grants tenant 14 permission to publish messages in second message topic 12, one or more subscribers (which may be different from the subscribers of first message topic 11) can initiate a subscription action to subscribe to second message topic 12. Tenant 14 then publishes message 17 to second message topic 12. The one or more subscribers subscribed to second message topic 12 can receive message 17 from the second message topic 12.

[0071] As can be seen, in the prior art, it is necessary to manually create a separate topic for each tenant and manually enable permissions for each tenant, which has the disadvantage of being cumbersome. In an embodiment of the present invention, a carefully designed special topic (called a registration topic) is added to the message queue. The publisher of the registration topic is the tenant of the message queue, and the subscriber is the manager of the message queue. Therefore, via the registration topic, the registration information of each tenant can be sent to the registration topic. Based on the registration information, the manager can automatically create a topic for publishing messages for the tenant and activate the corresponding permissions.

[0072] The above disclosure details the technical defects in the prior art, the causes of these defects, and the analytical process for overcoming them. In reality, the understanding of these technical defects is not common knowledge in the field, but rather a novel discovery made by the applicant during their research. Furthermore, the tracing of the causes of these defects and the analytical process for overcoming them are the result of gradual analysis conducted by the applicant during their actual research and are not common knowledge in the field.

[0073] Figure 3 is an exemplary flow chart of a method for creating a topic for a tenant based on a message queue according to an embodiment of the present invention. As shown in Figure 3, the method for creating a topic based on a message queue includes:

[0074] Step 101: A manager of a message queue is enabled to create a registered topic in the message queue. The publisher of the registered topic is the tenant of the message queue, and the subscriber of the registered topic is the manager.

[0075] Here, the publisher of a registered topic is the message queue's tenant. This includes both existing tenants registered with the manager and new tenants not yet registered. Message queues can include ActiveMQ, RabbitMQ, ZeroMQ, Kafka, MetaMQ, and RocketMQ, among others.

[0076] Step 102: The enabling manager receives registration information published by the tenant through the registration topic.

[0077] Here, tenants can be notified through various means (e.g., email) to publish registration information via the Registration Topic. For example, the registration information can include tenant attributes such as the tenant's ID, name, and location. New tenants who have not yet registered with the manager publish registration information via the Registration Topic. Existing tenants who have already registered with the manager can ignore this notification and republish their registration information via the Registration Topic.

[0078] Step 103: Based on the registration information, the enabling manager creates a message topic of the tenant in the message queue, wherein the publisher of the message topic is the tenant, and the subscriber of the message topic is determined by the subscription behavior on the message topic.

[0079] The manager records the registration information of each tenant to complete the registration of each tenant. If the manager receives a tenant's registration message and finds that it has already recorded the tenant's registration information, it will determine that the tenant is an old tenant that has already registered. At this time, the manager can ignore the old tenant's registration message, or create the old tenant's message topic again based on the re-received old tenant's registration information, and delete the message topic previously created for the old tenant. If a new tenant appears, the new tenant first sends the new tenant's registration information to the registration topic. After receiving the new tenant's registration message, the manager finds that it has not recorded the tenant's registration information. Therefore, it determines that a new tenant has appeared in the message queue, automatically creates a message topic for the new tenant based on the new tenant's registration information, and activates the new tenant's permissions. In addition, the manager records the new tenant's registration information to complete the new tenant's registration.

[0080] Therefore, a registration topic is created in the message queue that can automatically obtain the registration information of the tenant. Message topics can be automatically created for the tenant based on the registration information. This not only achieves data isolation between tenants, but also eliminates the complexity of manually creating message topics for tenants, thereby improving the efficiency of the message queue.

[0081] In one embodiment, the method includes step 104: after the enabling manager creates a message topic of the tenant in the message queue, the enabling manager grants the tenant permission to publish messages in the message topic.

[0082] It can be seen that tenants can be automatically granted the permission to publish messages in the message topic, eliminating the complexity of manually granting permissions to tenants and improving the efficiency of the message queue.

[0083] In one embodiment, the method includes: after the enabling manager grants the tenant permission to publish messages in a message topic, receiving a message from the tenant via the message topic, and sending the message to a subscriber of the message topic. Therefore, after granting the tenant permission to publish messages in the message topic, the tenant can publish messages to subscribers via the topic normally.

[0084] In one embodiment, the registration information includes the tenant's identifier; enabling the manager to create the tenant's message topic in the message queue includes: authenticating the tenant based on the tenant's identifier; when the authentication is passed, creating the tenant's message topic in the message queue, wherein the topic name of the message topic is generated based on the tenant's identifier.

[0085] For example, suppose a new tenant moves into the industrial park: Technology Company A. Technology Company A hopes to use the message queue service of the industrial park. The park management platform (e.g., server) provides Technology Company A with a tenant ID of "Company 123." The park management platform pre-provides authentication information (e.g., authorization token) identified as "Company 123" to the message queue manager. This authentication information is used to indicate that the tenant identified as "Company 123" is a legitimate user. Then, Technology Company A (usually the network administrator) sends its own registration information to the registration topic, and the new tenant in the registration information is identified as "Company 123." After receiving the registration message from the new tenant, the manager finds that it has no record of the tenant's registration information, so the manager identifies the tenant as a new tenant. In addition, the manager also queries whether the local area has authentication information identified as "Company 123." If so, the authentication is deemed to be successful; otherwise, the authentication is deemed to be unsuccessful. After authentication is passed, a message subject is set for the new tenant, and the subject name of the message subject is associated with "Company 123", for example, the subject name is: "Company 123's message subject".

[0086] As can be seen, authenticating tenants based on their IDs further improves security. Furthermore, the topic name of the message topic can be automatically generated based on the tenant's ID, improving the degree of automation.

[0087] In one embodiment, the registration information includes the tenant's identifier and topic name; enabling the manager to create the tenant's message topic in the message queue includes: authenticating the tenant based on the tenant's identifier; when the authentication is passed, creating the tenant's message topic in the message queue, wherein the message topic is named based on the topic name.

[0088] For example, assume that a new tenant, Technology Company A, has moved into an industrial park. Technology Company A wishes to use the park's message queue service. The park management platform (e.g., a server) provides Technology Company A with the tenant ID "Company 123." The park management platform pre-delivers authentication information (e.g., an authorization token) for "Company 123" to the message queue manager. This authentication information indicates that the tenant identified as "Company 123" is a legitimate user. Technology Company A (typically the network administrator) then sends its registration information to the registration topic. The new tenant in the registration information is identified as "Company 123," and the topic name included in the registration information is "Meeting." Upon receiving the new tenant's registration message, the manager discovers that it has no records of the tenant's registration information and therefore identifies the tenant as new. Furthermore, the manager checks whether it has authentication information for "Company 123" locally. If so, authentication is deemed successful; otherwise, authentication is deemed unsuccessful. If authentication is successful, a message topic is set for the new tenant, with the topic name "Meeting."

[0089] As can be seen, tenant authentication based on their ID further improves security. In addition, message topics can be named based on the topic name in the registration information, implementing user-configured topic commands and improving configuration flexibility.

[0090] In one embodiment, the registration information includes the tenant's primary identifier and secondary identifier; enabling the manager to create a tenant's message topic in the message queue includes: authenticating the tenant based on the tenant's primary identifier; when the authentication is passed, creating the tenant's message topic in the message queue, wherein the topic name of the message topic is generated based on the tenant's primary identifier and secondary identifier.

[0091] For example, assume that a new tenant, Technology Company A, has moved into an industrial park. Technology Company A's Human Resources team wishes to use the industrial park's message queue service. The park management platform (e.g., a server) provides Technology Company A with the tenant ID "Company 123" and assigns the secondary identifier "Group 2" to the Human Resources team. The park management platform pre-delivers authentication information (e.g., an authorization token) with the identifier "Company 123" to the message queue manager. This authentication information indicates that the tenant with the primary identifier "Company 123" is a legitimate user. Technology Company A (typically the network administrator) then sends its registration information to the registration topic. The registration information includes the new tenant's primary identifier "Company 123" and the secondary identifier "Group 2." Upon receiving the new tenant's registration message, the manager discovers that it has no records of the tenant's registration information and therefore identifies the tenant as new. Furthermore, the manager checks whether it has local authentication information for the primary identifier "Company 123." If so, authentication is deemed successful; otherwise, authentication is deemed unsuccessful. After authentication is passed, a message topic associated with "Company 123" and "Group 2" is set for the new tenant, for example, the topic name is: "Message topic of Group 2 in Company 123".

[0092] Therefore, tenants are authenticated based on their identifiers, further improving security. Furthermore, the embodiments of the present invention also support multi-level identifiers and generate topic names for message topics based on the multi-level identifiers, facilitating topic management for multiple tenants.

[0093] Figure 4 is an architectural diagram of creating topics for tenants based on a message queue according to an embodiment of the present invention. A registered topic 23 is set in message queue 20. The publisher of registered topic 23 is any tenant of message queue 20, and the subscriber of registered topic 23 is the manager of message queue 20. Tenants 24 and 25 are new tenants of message queue 20.

[0094] Tenant 24 sends its registration information 26 to the manager via registration topic 23. After receiving registration message 26 from tenant 24, the manager discovers that it has not previously recorded tenant 24's registration information. Therefore, it determines that a new tenant (i.e., tenant 24) has appeared in message queue 20, automatically creates tenant 24's first message topic 21 (published by tenant 24), sets a topic name for first message topic 21 based on the identifier of tenant 24 contained in registration information 26, and activates tenant 24's permission to publish messages on first message topic 21. Subscribers interested in first message topic 21 can subscribe to first message topic 21 based on their respective subscription behaviors. Tenant 24 can send messages 28 to first message topic 21. Subscribers to first message topic 21 can obtain messages 28 from first message topic 21.

[0095] Similarly, tenant 25 sends its registration information 27 to the manager via registration topic 23. After receiving tenant 25's registration message 27, the manager discovers that it has not previously recorded tenant 25's registration information. Therefore, it determines that a new tenant (i.e., tenant 25) has appeared in message queue 20, automatically creates a second message topic 22 for tenant 25 (published by tenant 25), sets a topic name for second message topic 22 based on the identifier of tenant 25 contained in registration information 27, and activates tenant 25's permission to publish messages on second message topic 22. Subscribers interested in second message topic 22 can subscribe to second message topic 22 based on their respective subscription behaviors. Tenant 25 can send message 29 to second message topic 21. Subscribers to second message topic 22 can retrieve message 29 from second message topic 22.

[0096] In the above process, whether to automatically create a message topic is determined based on whether the manager records the tenant's registration information. In order to improve security, authentication can be further performed based on the tenant ID in the registration information before creating the message topic.

[0097] Figure 5 is a schematic diagram of creating a topic for a tenant based on a message queue according to an embodiment of the present invention. In Figure 5, taking tenant 24 as an example, an exemplary process of creating a topic for a tenant based on a message queue is described.

[0098] First, tenant 24 sends its registration message 26 to registration topic 23 in message queue 20. Registration message 26 carries tenant 24's identifier and topic name. Registration topic 23 then sends registration message 26 to its sole subscriber: the manager 30 of message queue 20. If manager 30 determines that tenant 24's registration message has not been previously recorded, it creates a message topic 31. The specific process of creating message topic 31 includes: creating tenant 24's message topic 21 in message queue 20 based on the topic name in registration message 26. Then, manager 30 of message queue 20 performs permission granting 32. In permission granting 32, manager 30 grants tenant 24 permission to publish messages in message topic 21. This completes tenant 24's topic creation process 40. Tenant 24 can then publish messages 28 to message topic 21. Subscribers to message topic 21 can retrieve messages 28 from message topic 21.

[0099] In summary, in the embodiment of the present invention, the message queue topic is automatically created and the corresponding permissions are activated, replacing manual operations. Moreover, by registering the topic and regularly receiving information from all tenants, heartbeat detection of all tenants can be achieved.

[0100] FIG6 is an exemplary structural diagram of an apparatus for creating topics for tenants based on a message queue according to an embodiment of the present invention. As shown in FIG6 , the apparatus 600 includes:

[0101] The first module 601 is used to enable the manager of the message queue to create a registered topic in the message queue. The publisher of the registered topic is the tenant of the message queue, and the subscriber of the registered topic is the manager.

[0102] The second module 602 is configured to enable the manager to receive registration information published by the tenant through the registration topic;

[0103] The third module 603 is used to enable the manager to create a tenant's message topic in the message queue based on the registration information, wherein the publisher of the message topic is the tenant, and the subscriber of the message topic is determined by the subscription behavior on the message topic.

[0104] In one embodiment, the apparatus 600 includes a fourth module 604 configured to enable the manager to grant the tenant permission to publish messages in the message topic after the third module 603 enables the manager to create a message topic of the tenant in the message queue.

[0105] In one embodiment, the fourth module 604 is configured to receive a message from the tenant via the message topic after the enabling manager grants the tenant permission to publish a message in the message topic, and send the message to a subscriber of the message topic.

[0106] In one embodiment, the registration information includes the tenant's identifier; the third module 603 is used to authenticate the tenant based on the tenant's identifier; when the authentication is passed, a message topic of the tenant is created in the message queue, wherein the topic name of the message topic is generated based on the tenant's identifier.

[0107] In one embodiment, the registration information includes the tenant's identifier and topic name; the third module 603 is used to authenticate the tenant based on the tenant's identifier; when the authentication is passed, the tenant's message topic is created in the message queue, where the message topic is named based on the topic name.

[0108] In one embodiment, the registration information includes the tenant's primary identifier and secondary identifier; the third module 603 is used to authenticate the tenant based on the tenant's primary identifier; when the authentication is passed, a message topic of the tenant is created in the message queue, where the topic name of the message topic is generated based on the tenant's primary identifier and secondary identifier.

[0109] The embodiment of the present invention also proposes an electronic device with a processor-memory architecture. Figure 7 is a structural diagram of an electronic device according to an embodiment of the present invention. As shown in Figure 7, the electronic device 700 includes a processor 701, a memory 702, and a computer program stored on the memory 702 and runnable on the processor 701. When the computer program is executed by the processor 701, it implements any of the above message queue-based topic creation methods. Among them, the memory 702 can be specifically implemented as a variety of storage media such as an electrically erasable programmable read-only memory (EEPROM), a flash memory (Flash memory), and a programmable read-only memory (PROM). The processor 701 can be implemented to include one or more central processing units or one or more field programmable gate arrays, wherein the field programmable gate array integrates one or more central processing unit cores. Specifically, the central processing unit or the central processing unit core can be implemented as a CPU, an MCU, or a DSP, etc.

[0110] It should be noted that not all steps and modules in the above processes and structure diagrams are required, and certain steps or modules can be omitted based on actual needs. The execution order of the steps is not fixed and can be adjusted as needed. The division of the modules is merely for the convenience of describing the functional division adopted. In actual implementation, a module can be implemented by multiple modules, and the functions of multiple modules can be implemented by the same module. These modules can be located in the same device or in different devices.

[0111] The hardware modules in each embodiment can be implemented mechanically or electronically. For example, a hardware module may include a specially designed permanent circuit or logic device (such as a dedicated processor, such as an FPGA or ASIC) for performing a specific operation. The hardware module may also include a programmable logic device or circuit (such as a general-purpose processor or other programmable processor) temporarily configured by software to perform a specific operation. As for whether to implement the hardware module mechanically, or using a dedicated permanent circuit, or using a temporarily configured circuit (such as configured by software), it can be decided based on cost and time considerations.

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

Claims

1. A method for creating a topic based on a message queue, characterized in that, it includes: Enabling (101) the manager of the message queue to create a registered topic in the message queue, where the publisher of the registered topic is the tenant of the message queue, and the subscriber of the registered topic is the manager; Enabling (102) the manager to receive the registration information published by the tenant through the registered topic; Based on the registration information, enabling (103) the manager to create the tenant's message topic in the message queue, where the publisher of the message topic is the tenant, and the subscriber of the message topic is determined by the subscription behavior regarding the message topic.

2. The method according to claim 1, characterized in that, it includes: After enabling (103) the manager to create the tenant's message topic in the message queue, enabling (104) the manager to grant the tenant the permission to publish messages in the message topic.

3. The method according to claim 2, characterized in that, it includes: After enabling (104) the manager to grant the tenant the permission to publish messages in the message topic, receiving the message from the tenant via the message topic and sending the message to the subscriber of the message topic.

4. The method according to any one of claims 1 to 3, characterized in that, the registration information includes the tenant's identifier; enabling (103) the manager to create the tenant's message topic in the message queue includes: Authenticating the tenant based on the tenant's identifier; After the authentication passes, creating the tenant's message topic in the message queue, where the topic name of the message topic is generated based on the tenant's identifier.

5. The method according to any one of claims 1 to 4, characterized in that, the registration information includes the tenant's identifier and topic name; enabling (103) the manager to create the tenant's message topic in the message queue includes: Authenticating the tenant based on the tenant's identifier; After the authentication passes, creating the tenant's message topic in the message queue, where the message topic is named based on the topic name.

6. The method according to any one of claims 1 to 5, characterized in that, the registration information includes the tenant's primary identifier and secondary identifier; enabling (103) the manager to create the tenant's message topic in the message queue includes: Authenticating the tenant based on the tenant's primary identifier; After the authentication passes, creating the tenant's message topic in the message queue, where the topic name of the message topic is generated based on the tenant's primary identifier and secondary identifier.

7. A device for creating a topic based on a message queue, characterized in that, the device includes: The first module (601) is used to enable the manager of the message queue to create a registered topic in the message queue, where the publisher of the registered topic is the tenant of the message queue, and the subscriber of the registered topic is the manager; A second module (602) for enabling the manager to receive the registration information published by the tenant through the registration topic; A third module (603) for enabling the manager to create a message topic for the tenant in the message queue based on the registration information, where the publisher of the message topic is the tenant, and the subscriber of the message topic is determined by the subscription behavior regarding the message topic.

8. The apparatus according to claim 7, wherein: It includes: A fourth module (604) for enabling the manager to grant the tenant the permission to publish messages in the message topic after the third module (603) enables the manager to create the message topic for the tenant in the message queue.

9. The apparatus according to claim 8, wherein: The fourth module (604) is for receiving messages from the tenant via the message topic after enabling the manager to grant the tenant the permission to publish messages in the message topic, and sending the messages to the subscribers of the message topic.

10. The apparatus according to any one of claims 7 to 9, wherein: The registration information includes the identifier of the tenant; The third module (603) is for authenticating the tenant based on the identifier of the tenant; After the authentication passes, creating the message topic for the tenant in the message queue, where the topic name of the message topic is generated based on the identifier of the tenant.

11. The apparatus according to any one of claims 7 to 10, wherein: The registration information includes the identifier and the topic name of the tenant; The third module (603) is for authenticating the tenant based on the identifier of the tenant; after the authentication passes, creating the message topic for the tenant in the message queue, where the message topic is named based on the topic name.

12. The apparatus according to any one of claims 7 to 11, wherein: The registration information includes the primary identifier and the secondary identifier of the tenant; The third module (603) is for authenticating the tenant based on the primary identifier of the tenant; After the authentication passes, creating the message topic for the tenant in the message queue, where the topic name of the message topic is generated based on the primary identifier and the secondary identifier of the tenant.

13. An electronic device, wherein: It includes: A processor (701); A memory (702) for storing the executable instructions of the processor (701); The processor (701) is for reading the executable instructions from the memory (702) and executing the executable instructions to implement the message queue-based topic creation method according to any one of claims 1 - 6.

14. A computer-readable storage medium, on which computer instructions are stored, wherein: When the computer instructions are executed by a processor, the message queue-based topic creation method according to any one of claims 1 - 6 is implemented.

15. A computer program product, wherein: Including a computer program which, when executed by a processor, implements the message queue-based topic creation method according to any one of claims 1-6.