Message queue connection method and device, electronic equipment and storage medium

By reading and assembling URL information from the configuration file during the NOVA service startup, the Nova service cannot connect to the RabbitMQ message queue, and realize the stable connection between the Nova service and the RabbitMQ message queue to ensure the normal operation of the Nova service.

CN119342084APending Publication Date: 2025-01-21BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411365910.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, if the Nova service does not obtain URL information from the configuration file when it is started, it will directly use the local IP address to connect to the Rabbitmq message queue, resulting in the problem of being unable to connect, especially when the Rabbitmq message queue is not deployed on the local server.

Method used

When the Nova service starts, read the configuration information for connecting the RabbitMQ message queue from the Nova configuration file to determine whether the URL information and the connection information are empty. If the URL information is empty but the connection information is not empty, the IP address and the port number are accessible to accessable URL links, and the link and verification information are connected based on this link.

Benefits of technology

The problem that the Nova service cannot connect to the RabbitMQ message queue is effectively solved, especially when the RabbitMQ message queue is not deployed to the local server, ensuring that the Nova service can start and operate normally.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342084A_ABST
    Figure CN119342084A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message queue connection method and device, electronic equipment and a storage medium, and the method comprises the steps: reading configuration information for connecting a Rabbitmq message queue from a Nova configuration file when a Nova service is started; judging whether URL information and connection information in the configuration information are empty or not; wherein the connection information comprises an IP address, a port number and verification information; when it is judged that the URL information is empty and the connection information is not empty, the IP address and the port number are assembled into an accessible URL link; and connecting the Nova service with the Rabbitmq message queue based on the URL link and the verification information. According to the technical scheme, the connection with the Rabbitmq message queue can be realized by using the connection information in the Nova configuration file under the condition that the URL information cannot be acquired to perform the Rabbitmq message queue connection when the Nova service is started, and compared with the prior art, the problem that the connection cannot be performed by using a local IP address when the Rabbitmq message queue is not deployed in a local server is effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, electronic device and storage medium for connecting a message queue. Background Art

[0002] In the OpenStack project, Nova is responsible for computing resource management. The Rabbitmq message queue is the message agent for communication between Nova services in Nova. In actual applications, each Nova service needs to connect to the Rabbitmq message queue when it starts to ensure the normal startup and operation of each Nova service.

[0003] In the existing Rabbitmq message queue connection technology, when the Nova service is started, the Rabbitmq message queue will be connected through the oslo_messaaging python class library. Due to the code logic defects of the oslo_messaaging python class library itself, when the Nova service is started, if the URL information is not obtained from the Nova configuration file, the local IP address of the server where the Nova service is located will be used directly to connect to the Rabbitmq message queue. If the Rabbitmq message queue is not deployed on the local server but deployed on other servers, the Nova service will be unable to connect to the Rabbitmq message queue, which will cause the Nova service to start abnormally and cannot run normally.

[0004] As can be seen from the above, the Rabbitmq message queue connection method in the prior art has the technical problem of being unable to connect. Summary of the invention

[0005] In view of this, in order to solve the technical problem that the Rabbitmq message queue connection method in the prior art cannot be connected, the embodiments of the present application provide a method, device, electronic device and storage medium for connecting a message queue.

[0006] In a first aspect, an embodiment of the present application provides a method for connecting a message queue, the method comprising:

[0007] When the Nova service starts, the configuration information for connecting to the Rabbitmq message queue is read from the Nova configuration file;

[0008] Determine whether the URL information and connection information in the configuration information are empty; wherein the connection information includes an IP address, a port number, and verification information;

[0009] When it is determined that the URL information is empty and the connection information is not empty, assembling the IP address and the port number into an accessible URL link;

[0010] The Nova service is connected to the Rabbitmq message queue based on the URL link and the verification information.

[0011] Optionally, as in the aforementioned method, connecting the Nova service with the Rabbitmq message queue based on the URL link and the verification information includes:

[0012] Obtaining a connection interface to the Rabbitmq message queue based on the URL link;

[0013] The verification information is input into the connection interface so that the server of the Rabbitmq message queue receives the verification information and verifies the verification information. If the verification information is successfully verified, the Nova service is connected to the Rabbitmq message queue.

[0014] Optionally, as in the aforementioned method, the method further comprises:

[0015] In the case where it is determined that the URL information is not empty and the connection information is not empty, determining whether the URL information is consistent with the connection information;

[0016] When it is determined that the URL information is consistent with the connection information, connecting the Nova service to the Rabbitmq message queue based on the URL information;

[0017] When it is determined that the URL information is inconsistent with the connection information, first connection failure information is generated.

[0018] Optionally, as in the aforementioned method, the URL information includes a target IP address, a target port number and target verification information;

[0019] The connecting the Nova service with the Rabbitmq message queue based on the URL information includes:

[0020] Obtaining target verification information from the URL information;

[0021] Obtaining a connection interface to the Rabbitmq message queue based on a target URL link consisting of a target IP address and a target port number in the URL;

[0022] The target verification information is input into the connection interface so that the server of the Rabbitmq message queue receives the target verification information and verifies the target verification information. If the verification of the target verification information is successful, the Nova service is connected to the Rabbitmq message queue.

[0023] Optionally, as in the aforementioned method, the method further comprises:

[0024] When it is determined that the URL information is empty and the connection information is empty, second connection failure information is generated.

[0025] Optionally, as in the aforementioned method, the method further comprises:

[0026] When it is determined that the URL information is not empty and the connection information is empty, a step of connecting the Nova service to the Rabbitmq message queue based on the URL information is performed.

[0027] Optionally, as in the aforementioned method, the connection information being empty means that at least one of the IP address, the port number and the verification information is empty.

[0028] In a second aspect, an embodiment of the present application provides a device for connecting a message queue, the device comprising:

[0029] The reading module is used to read the configuration information for connecting to the Rabbitmq message queue from the Nova configuration file when the Nova service is started;

[0030] A judgment module, used to judge whether the URL information and connection information in the configuration information are empty; wherein the connection information includes an IP address, a port number and verification information;

[0031] An assembly module, for assembling the IP address and the port number into an accessible URL link when it is determined that the URL information is empty and the connection information is not empty;

[0032] A connection module is used to connect the Nova service with the Rabbitmq message queue based on the URL link and the verification information.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, which includes: a processor and a memory, the processor is used to execute a message queue connection program stored in the memory to implement the above-mentioned message queue connection method.

[0034] In a fourth aspect, an embodiment of the present application provides a storage medium, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned message queue connection method.

[0035] In an embodiment of the present invention, when the Nova service is started, the configuration information for connecting to the Rabbitmq message queue is read from the Nova configuration file; it is determined whether the URL information and the connection information in the configuration information are empty; wherein the connection information includes an IP address, a port number, and verification information; when it is determined that the URL information is empty and the connection information is not empty, the IP address and the port number are assembled into an accessible URL link; the Nova service is connected to the Rabbitmq message queue based on the URL link and the verification information. The above technical scheme can use the IP address, port number, and verification information included in the connection information in the Nova configuration file to achieve connection with the Rabbitmq message queue when the Nova service is started and the URL information cannot be obtained for connecting to the Rabbitmq message queue. Compared with the method in the prior art that the Rabbitmq message queue can only be connected through the local IP address when the URL information cannot be obtained, it effectively overcomes the problem in the prior art that the Rabbitmq message queue is not deployed on the local server and cannot be connected through the local IP address. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0038] Figure 1 A flow chart of an embodiment of a message queue connection method provided in an embodiment of the present application;

[0039] Figure 2 A flowchart of another message queue connection method provided by another embodiment of the present application;

[0040] Figure 3 A schematic diagram of a connection interface provided for an application example of the present application;

[0041] Figure 4 A flowchart of another message queue connection method provided by another embodiment of the present application;

[0042] Figure 5 A block diagram of an embodiment of a message queue connection device provided in an embodiment of the present application;

[0043] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0045] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0046] According to one aspect of an embodiment of the present application, a method for connecting a message queue is provided. Optionally, in this embodiment, the above-mentioned method for connecting a message queue can be applied to a server deployed by a Nova service for implementation. The above-mentioned Nova service is a Nova-API (Application Programming Interface) service for receiving user requests in Nova, a Nova-Compute service for creating and managing virtual machine instances, a Nova-Conductor service responsible for interacting with the Nova database, or a Nova-Scheduler service for scheduling instances to be assigned to specific computing nodes. It can be understood that the servers deployed by each Nova service can use the message queue connection method provided in this application to realize the connection between the Nova service and the Rabbitmq message queue.

[0047] Based on the above description, Figure 1A message queue connection method provided in an embodiment of the present application is applied to a server deploying a Nova service, and includes the following steps:

[0048] Step 101, when the Nova service is started, read the configuration information for connecting to the Rabbitmq message queue from the Nova configuration file;

[0049] Nova is a core module of the OpenStack system, which is mainly responsible for the lifecycle management of virtual machine instances, network management, storage volume management, user management and other related cloud platform management functions. In the Nova architecture, each Nova service uses the Rabbitmq message queue to complete the system message transmission and information sharing to achieve asynchronous deployment between tasks, modules and interfaces, and complete the cloud service requests of terminal users. Therefore, the Nova configuration file contains configuration information related to the Rabbitmq message queue, including the configuration information of the Rabbitmq message queue connection to ensure that the Nova service can correctly interact with the Rabbitmq message queue connection, and also includes the rule information of the Rabbitmq message queue to ensure that Nova services can effectively communicate and work together.

[0050] In summary, in order to ensure that the Nova service can correctly communicate with the Rabbitmq message queue and implement various functions of the OpenStack cloud platform, it is necessary to read the configuration information used to connect to the Rabbitmq message queue from the Nova configuration file.

[0051] Step 102, determine whether the URL information and connection information in the configuration information are empty;

[0052] The URL information can be understood as the transport_url whose format follows the AMQP (Advanced MessageQueuing Protocol) protocol standard of the Rabbitmq message queue. The transport_url is used to specify the Rabbitmq message queue connection information to ensure that the Nova service can correctly communicate with the Rabbitmq message queue, thereby achieving asynchronous consistent communication and efficient task scheduling. Therefore, setting the URL information in the Nova configuration file can help ensure smooth communication between the Nova service and other OpenStack service components, thereby ensuring the normal operation of the entire cloud environment.

[0053] The connection information is also information used to indicate the connection with the Rabbitmq message queue. The connection information specifically includes an IP (Internet Protocol) address, a port number, and verification information, wherein the IP address is used to specify the address of the server where the Rabbitmq message queue is located, for example, it is specifically configured as rabbit_hosts:192.168.136.10 in the Nova configuration file; the port number is used to specify the communication port of the server where the Rabbitmq message queue is located, for example, it is specifically configured as rabbit_port:5672 in the Nova configuration file; the verification information is authentication information used to connect to the Rabbitmq message queue to ensure the correctness of the connection, and the verification information includes but is not limited to a user name and / or a password. Taking the verification information including a user name and a password as an example, in the Nova configuration file, the user name is specifically configured as rabbit_user=123, and the password is specifically configured as rabbit_password=456. The specific configuration content of the above connection information can be set according to actual needs and is not limited here.

[0054] In summary, in order to ensure that the Nova service can communicate smoothly with the Rabbitmq message queue, it is necessary to configure the URL information and / or connection information in the Nova configuration file. In this embodiment, in order to determine which information is specifically configured in the Nova configuration file, it is necessary to further determine whether the URL information and connection information in the configuration information are empty after reading the configuration information. It can be understood that if the URL information is empty and the connection information is not empty, only the connection information is configured in the Nova configuration file, if the URL information is not empty and the connection information is empty, only the URL information is configured in the Nova configuration file, if the URL information is not empty and the connection information is not empty, then both the URL information and the connection information are configured in the Nova configuration file, if the URL information is empty and the connection information is empty, then neither the URL information nor the connection information is configured in the Nova configuration file, for the above different situations, the following embodiments will give specific implementation plans, which will not be described in detail one by one here.

[0055] Specifically, it is determined whether the URL information and the connection information in the configuration information are empty, specifically, it is determined whether the information in the URL information and the connection information is complete. If the information is complete, it means it is not empty, and if the information is incomplete, it means it is empty.

[0056] Step 103, when it is determined that the URL information is empty and the connection information is not empty, assemble the IP address and the port number into an accessible URL link;

[0057] When it is determined that the URL information is empty and the connection information is not empty, it indicates that only the connection information is configured in the Nova configuration file. In this case, if the existing Rabbitmq message queue connection method is used to directly connect to the Rabbitmq message queue using the local IP address of the server where the Nova service is located, the Nova service and the Rabbitmq message queue may not be able to connect because the Rabbitmq message queue is not deployed on the local server. To solve the above problem, in this embodiment, when the URL information is not read, the Rabbitmq message queue is not directly connected to the local IP address of the server where the Nova service is located. Instead, the connection information pre-configured in the Nova configuration file is used to connect to the Rabbitmq message queue. This method can fully ensure that whether the Rabbitmq message queue is deployed on the server where the Nova service is located can be connected to the Rabbitmq message queue, so that the Nova service can start normally without abnormalities.

[0058] In actual application, the format of the connection information configured in the Nova configuration file does not follow the AMQP protocol standard of the Rabbitmq message queue. This results in the inability to communicate with the server deployed by the Rabbitmq message queue by directly using the connection information. Therefore, in the process of using the connection information to connect the Nova service to the Rabbitmq message queue, it is necessary to assemble the IP address and port number into an accessible URL link, that is, assemble the IP address and port number in the connection information into a URL that meets the AMQP protocol standard. For example, the IP address is rabbit_hosts:192.168.136.10; the port number is rabbit_port:5672, and the accessible URL link after assembly is: http: / / 192.168.136.10:5672.

[0059] Step 104: Connect the Nova service to the Rabbitmq message queue based on the URL link and the verification information.

[0060] Since the IP address and port number of the connection information configured in the Nova configuration file are the information corresponding to the real network address and communication port of the server where the Rabbitmq message queue is located, when the URL information cannot be obtained, the connection information can be used to connect to the Rabbitmq message queue deployed on any server. Compared with the prior art, when the URL information is not available, the method of only using the local IP address to connect to the Rabbitmq message queue deployed on the local server greatly reduces the probability of Rabbitmq message queue connection failure.

[0061] Through the method in this embodiment, when the Nova service is started and the URL information cannot be obtained for connecting to the Rabbitmq message queue, the IP address, port number and verification information included in the connection information in the Nova configuration file can be used to connect to the Rabbitmq message queue. Compared with the method in the prior art that can only connect to the Rabbitmq message queue through the local IP address when the URL information cannot be obtained, this method effectively overcomes the problem in the prior art that the Rabbitmq message queue is not deployed on the local server and cannot be connected through the local IP address.

[0062] like Figure 2 As shown, as an optional implementation, as in the aforementioned method, step 104 connects the Nova service to the Rabbitmq message queue based on the URL link and the verification information, including the following steps:

[0063] Step 201, obtaining the connection interface of the Rabbitmq message queue based on the URL link;

[0064] The connection interface of the Rabbitmq message queue can be accessed by using the HTTP request of the URL link. It can be understood that the server of the Rabbitmq message queue sends the connection interface corresponding to the URL link to the server deployed by the Nova service. The process of obtaining the interface through the link is an existing process and will not be repeated here.

[0065] Step 202, input the verification information into the connection interface, so that the server of the Rabbitmq message queue receives the verification information, verifies the verification information, and connects the Nova service to the Rabbitmq message queue when the verification information is successfully verified.

[0066] When authentication is required to connect to the Rabbitmq message queue, the connection interface usually includes an input control for authentication information, so that the corresponding authentication information can be entered in the input control for identity authentication to ensure the correct connection between the Nova service and the Rabbitmq message queue. For ease of understanding, take the example of authentication information including user name and password, the connection interface is as follows Figure 3As shown, the connection interface 300 includes a user name input control 301 and a password input control 302. After the user name and password are input through the user name input control 301 and the password input control 302 respectively, the server of the Rabbitmq message queue can receive the verification information and verify the input verification information, specifically, whether the input verification information is consistent with the verification information pre-set on the server side of the Rabbitmq message queue. If the information is consistent, the verification information verification is successful, then the Nova service can be connected to the Rabbitmq message queue, so that the Nova service can start and run normally.

[0067] Through the method in this embodiment, the connection between the Nova service and the Rabbitmq message queue deployed on any server can be realized based on the accessible URL link and verification information assembled in the connection information.

[0068] The present application embodiment provides another message queue connection method. Figure 1 See on the basis of Figure 4 , Figure 4 A flowchart of another method for connecting message queues provided in an embodiment of the present application. Figure 4 The process shown may include the following steps:

[0069] Step 401, when the Nova service is started, read the configuration information for connecting to the Rabbitmq message queue from the Nova configuration file;

[0070] Step 402, determining whether the URL information and connection information in the configuration information are empty; wherein the connection information includes an IP address, a port number, and verification information;

[0071] Step 403, when it is determined that the URL information is empty and the connection information is not empty, assemble the IP address and the port number into an accessible URL link;

[0072] Step 404, connecting the Nova service to the Rabbitmq message queue based on the URL link and the verification information;

[0073] Specifically, the implementation process of step 401 to step 404 of the embodiment of the present invention is the same as step 101 to step 104. For the specific process, please refer to Figure 1 The relevant description in the method embodiment will not be repeated here.

[0074] Step 405, when it is determined that the URL information is not empty and the connection information is not empty, determine whether the URL information is consistent with the connection information;

[0075] When it is determined that the URL information is not empty and the connection information is not empty, it indicates that the URL information and the connection information are configured in the Nova configuration file. Since the Nova configuration file is a file that can be modified manually, and the connection information and the URL information are manually input and set, in order to avoid the inconsistency between the URL information and the connection information caused by human modification errors or negligence in the configuration information process, in this embodiment, when it is determined that the URL information and the connection information in the configuration information are not empty, it is necessary to further obtain the target IP address and the target port number included in the URL information to execute the judgment of whether the target IP address is consistent with the IP address in the connection information in step 406, and whether the target port number is consistent with the port number in the connection information.

[0076] The above URL information also includes information that can connect to the Rabbitmq message queue, that is, the target IP address for specifying the address of the server where the Rabbitmq message queue is located, the target port number for specifying the communication port of the server where the Rabbitmq message queue is located, and the target verification information for authentication required to connect to the Rabbitmq message queue.

[0077] Specifically, determining whether the URL information is consistent with the connection information is to determine whether the target IP address is consistent with the IP address in the connection information, whether the target port number is consistent with the port number in the connection information, and whether the target verification information is consistent with the verification information in the connection information.

[0078] When it is determined that the URL information is consistent with the connection information, that is, it is determined that the target IP address is consistent with the IP address in the connection information, the target port number is consistent with the port number in the connection information, and the target verification information is consistent with the verification information in the connection information, it indicates that the URL information configured in the Nova configuration file is exactly the same as the connection information. In this embodiment, it is only necessary to connect the Nova service to the Rabbitmq message queue based on the URL information, that is, execute step 406.

[0079] When it is determined that the URL information is inconsistent with the connection information, that is, there is at least one inconsistency between the target IP address and the IP address in the connection information, the target port number and the port number in the connection information, and the target verification information and the verification information in the connection information, it is determined that the URL information and the connection information are inconsistent, indicating that the URL information configured in the Nova configuration file is different from the connection information. In this embodiment, since there is an error in the information configuration, step 407 needs to be executed.

[0080] Step 406, connecting the Nova service to the Rabbitmq message queue based on the URL information;

[0081] The specific process of connecting the Nova service to the Rabbitmq message queue based on the URL information is as follows: obtain the target verification information from the URL information; obtain the connection interface of the Rabbitmq message queue based on the target URL link composed of the target IP address and target port number in the URL; input the target verification information into the connection interface so that the server of the Rabbitmq message queue receives the target verification information and verifies the target verification information. When the target verification information is successfully verified, the Nova service is connected to the Rabbitmq message queue.

[0082] Because the format of the target URL link composed of the target IP address and the target port number in the URL information complies with the AMQP protocol standard of the Rabbitmq message queue, there is no need to assemble the IP address and the port number first, as in the method of connecting the Nova service to the Rabbitmq message queue based on the connection information. When connecting the Nova service to the Rabbitmq message queue based on the URL information, the target URL link composed of the target IP address and the target port number in the URL information can be directly used to access the connection interface of the Rabbitmq message queue through an HTTP request. This connection interface is the same as Figure 3 The interface shown is not described in detail here. After obtaining the connection interface, the target verification information is input on the connection interface through the verification information input control on the connection interface, so that the server of the Rabbitmq message queue receives the target verification information and verifies the input target verification information. Specifically, it verifies whether the input target verification information is consistent with the verification information pre-set on the server side of the Rabbitmq message queue. If the information is consistent, the target verification information verification is successful, then the Nova service can be connected to the Rabbitmq message queue, so that the Nova service can start and run normally.

[0083] Step 407, generating first connection failure information;

[0084] The first connection failure information can specifically be a prompt message indicating a connection failure due to inconsistency between the URL information and the connection information. In a possible implementation, the generated first connection failure information can be displayed on a display device to prompt relevant personnel to correct the URL information and the connection information to facilitate the subsequent connection between the Nova service and the Rabbitmq message queue.

[0085] The specific display device can be the display corresponding to the server deployed by the Nova service, or the smart terminal used by relevant personnel, such as mobile phones, tablets, computers and other terminal devices with display screens. There is no limitation here. After the server deployed by the Nova service generates the first connection failure information, the first connection failure information can be sent to the display or smart terminal for display.

[0086] Step 408, when it is determined that the URL information is empty and the connection information is empty, generating second connection failure information;

[0087] The second connection failure information can specifically be a prompt message indicating that both the URL information and the connection information are empty. In a possible implementation, the generated second connection failure information can also be displayed on the above-mentioned display device to prompt relevant personnel to configure the URL information and the connection information to facilitate the subsequent connection between the Nova service and the Rabbitmq message queue.

[0088] Step 409, when it is determined that the URL information is not empty and the connection information is empty, a step of connecting the Nova service to the Rabbitmq message queue based on the URL information is executed.

[0089] When it is determined that the URL information is not empty and the connection information is empty, it indicates that only the URL information is configured in the Nova configuration file and no connection information is configured. At this time, the Nova service can be connected to the Rabbitmq message queue only through the URL information. The process of connecting the Nova service to the Rabbitmq message queue based on the URL information is the same as the process described in step 406, which will not be repeated here.

[0090] The above connection information is empty, which means that at least one of the IP address, port number and verification information is empty. If the verification information includes a user name and a password, the connection information is judged to be empty when at least one of the IP address, port number, user name and password is empty. If the verification information only includes a user name or a password, the connection information is judged to be empty when at least one of the IP address, port number, user name or password is empty.

[0091] Similarly, if the URL information is empty, at least one of the target IP address, the target port number, and the target verification information is empty.

[0092] Through the method in this embodiment, when only connection information is configured in the Nova configuration file, the connection between the Nova service and the Rabbitmq message queue can be realized based on the connection information, thereby effectively overcoming the problem in the prior art that the Rabbitmq message queue is not deployed on the local server and cannot be connected through the local IP address. In addition, when only URL information is configured in the Nova configuration file or both URL information and connection information are configured, the connection between the Nova service and the Rabbitmq message queue can be accurately realized based on the URL information. Through the above description, the method provided by this implementation can execute different connection methods between the Nova service and the Rabbitmq message queue according to different configuration information in the Nova configuration file, which greatly improves the robustness of the application service and effectively reduces the probability of connection failure of the Rabbitmq message queue.

[0093] See also Figure 5 , is a block diagram of an embodiment of a message queue connection device provided in an embodiment of the present application. Figure 5 As shown, the device comprises:

[0094] The reading module 501 is used to read the configuration information for connecting to the Rabbitmq message queue from the Nova configuration file when the Nova service is started;

[0095] The judging module 502 is used to judge whether the URL information and the connection information in the configuration information are empty; wherein the connection information includes an IP address, a port number and verification information;

[0096] An assembly module 503, configured to assemble the IP address and the port number into an accessible URL link when it is determined that the URL information is empty and the connection information is not empty;

[0097] The connection module 504 is used to connect the Nova service with the Rabbitmq message queue based on the URL link and the verification information.

[0098] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.

[0099] As an optional implementation, the connection module 504 includes:

[0100] A first interface acquisition module, used to acquire a connection interface to the Rabbitmq message queue based on the URL link;

[0101] The first information verification connection module is used to input the verification information into the connection interface so that the server of the Rabbitmq message queue receives the verification information and verifies the verification information. If the verification information is successfully verified, the Nova service is connected to the Rabbitmq message queue.

[0102] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.

[0103] As an optional implementation, the above device further includes:

[0104] An information determination module, configured to determine whether the URL information is consistent with the connection information when it is determined that the URL information is not empty and the connection information is not empty;

[0105] A first URL information connection module, configured to connect the Nova service with the Rabbitmq message queue based on the URL information when it is determined that the URL information is consistent with the connection information;

[0106] The first generating module is used to generate first connection failure information when it is determined that the URL information is inconsistent with the connection information.

[0107] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.

[0108] As an optional implementation manner, the URL information includes a target IP address, a target port number and target verification information; the URL information connection module includes:

[0109] A target verification information acquisition module, used to obtain target verification information from the URL information;

[0110] A second interface acquisition module, configured to acquire a connection interface to the Rabbitmq message queue based on a target URL link formed by a target IP address and a target port number in the URL;

[0111] The second information verification connection module is used to input the target verification information into the connection interface so that the server of the Rabbitmq message queue receives the target verification information and verifies the target verification information. If the target verification information is successfully verified, the Nova service is connected to the Rabbitmq message queue.

[0112] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.

[0113] As an optional implementation, the above device further includes:

[0114] The first generating module is used to generate second connection failure information when it is determined that the URL information is empty and the connection information is empty.

[0115] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.

[0116] As an optional implementation, the above device further includes:

[0117] The second URL information connection module is used to execute the step of connecting the Nova service with the Rabbitmq message queue based on the URL information when it is determined that the URL information is not empty and the connection information is empty.

[0118] Specifically, the specific process of each module in the device of the embodiment of the present invention realizing its function can be referred to the relevant description in the method embodiment, which will not be repeated here.

[0119] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Figure 6 The electronic device 600 shown includes: at least one processor 601, a memory 602, at least one network interface 604 and other user interfaces 603. The various components in the electronic device 600 are coupled together via a bus system 605. It is understood that the bus system 605 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 605 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 605 is not shown in FIG. Figure 6 Various buses are labeled as bus system 605 .

[0120] The user interface 603 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0121] It can be understood that the memory 602 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0122] In some implementations, the memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 6021 and an application 6022 .

[0123] The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 6022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 6022.

[0124] In the embodiment of the present application, by calling the program or instruction stored in the memory 602, specifically, the program or instruction stored in the application 6022, the processor 601 is used to execute the method steps provided by each method embodiment, for example, including:

[0125] When the Nova service starts, the configuration information for connecting to the Rabbitmq message queue is read from the Nova configuration file;

[0126] Determine whether the URL information and connection information in the configuration information are empty; wherein the connection information includes an IP address, a port number, and verification information;

[0127] When it is determined that the URL information is empty and the connection information is not empty, assembling the IP address and the port number into an accessible URL link;

[0128] The Nova service is connected to the Rabbitmq message queue based on the URL link and the verification information.

[0129] Optionally, as in the aforementioned method, connecting the Nova service with the Rabbitmq message queue based on the URL link and the verification information includes:

[0130] Obtaining a connection interface to the Rabbitmq message queue based on the URL link;

[0131] The verification information is input into the connection interface so that the server of the Rabbitmq message queue receives the verification information and verifies the verification information. If the verification information is successfully verified, the Nova service is connected to the Rabbitmq message queue.

[0132] Optionally, as in the aforementioned method, the method further comprises:

[0133] In the case where it is determined that the URL information is not empty and the connection information is not empty, determining whether the URL information is consistent with the connection information;

[0134] When it is determined that the URL information is consistent with the connection information, connecting the Nova service to the Rabbitmq message queue based on the URL information;

[0135] When it is determined that the URL information is inconsistent with the connection information, first connection failure information is generated.

[0136] Optionally, as in the aforementioned method, the URL information includes a target IP address, a target port number and target verification information;

[0137] The connecting the Nova service with the Rabbitmq message queue based on the URL information includes:

[0138] Obtaining target verification information from the URL information;

[0139] Obtaining a connection interface to the Rabbitmq message queue based on a target URL link consisting of a target IP address and a target port number in the URL;

[0140] The target verification information is input into the connection interface so that the server of the Rabbitmq message queue receives the target verification information and verifies the target verification information. If the verification of the target verification information is successful, the Nova service is connected to the Rabbitmq message queue.

[0141] Optionally, as in the aforementioned method, the method further comprises:

[0142] When it is determined that the URL information is empty and the connection information is empty, second connection failure information is generated.

[0143] Optionally, as in the aforementioned method, the method further comprises:

[0144] When it is determined that the URL information is not empty and the connection information is empty, a step of connecting the Nova service to the Rabbitmq message queue based on the URL information is performed.

[0145] Optionally, as in the aforementioned method, the connection information being empty means that at least one of the IP address, the port number and the verification information is empty.

[0146] The method disclosed in the above embodiment of the present application can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 501. The above processor 501 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.

[0147] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0148] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0149] The electronic device provided in this embodiment may be Figure 4 The electronic device shown in FIG. 1 may perform the following steps: Figure 1-2 , all steps of the message queue connection method in 4, and then implement Figure 1-2 , 4. For details, please refer to Figure 1-2 For the sake of brevity, the relevant description is not repeated here.

[0150] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0151] When one or more programs in the storage medium can be executed by one or more processors, the above-mentioned message queue connection method is implemented.

[0152] The processor is used to execute the message queue connection program stored in the memory to implement the steps of the following message queue connection method:

[0153] When the Nova service starts, the configuration information for connecting to the Rabbitmq message queue is read from the Nova configuration file;

[0154] Determine whether the URL information and connection information in the configuration information are empty; wherein the connection information includes an IP address, a port number, and verification information;

[0155] When it is determined that the URL information is empty and the connection information is not empty, assembling the IP address and the port number into an accessible URL link;

[0156] The Nova service is connected to the Rabbitmq message queue based on the URL link and the verification information.

[0157] Optionally, as in the aforementioned method, connecting the Nova service with the Rabbitmq message queue based on the URL link and the verification information includes:

[0158] Obtaining a connection interface to the Rabbitmq message queue based on the URL link;

[0159] The verification information is input into the connection interface so that the server of the Rabbitmq message queue receives the verification information and verifies the verification information. If the verification information is successfully verified, the Nova service is connected to the Rabbitmq message queue.

[0160] Optionally, as in the aforementioned method, the method further comprises:

[0161] In the case where it is determined that the URL information is not empty and the connection information is not empty, determining whether the URL information is consistent with the connection information;

[0162] When it is determined that the URL information is consistent with the connection information, connecting the Nova service to the Rabbitmq message queue based on the URL information;

[0163] When it is determined that the URL information is inconsistent with the connection information, first connection failure information is generated.

[0164] Optionally, as in the aforementioned method, the URL information includes a target IP address, a target port number and target verification information;

[0165] The connecting the Nova service with the Rabbitmq message queue based on the URL information includes:

[0166] Obtaining target verification information from the URL information;

[0167] Obtaining a connection interface to the Rabbitmq message queue based on a target URL link consisting of a target IP address and a target port number in the URL;

[0168] The target verification information is input into the connection interface so that the server of the Rabbitmq message queue receives the target verification information and verifies the target verification information. If the verification of the target verification information is successful, the Nova service is connected to the Rabbitmq message queue.

[0169] Optionally, as in the aforementioned method, the method further comprises:

[0170] When it is determined that the URL information is empty and the connection information is empty, second connection failure information is generated.

[0171] Optionally, as in the aforementioned method, the method further comprises:

[0172] When it is determined that the URL information is not empty and the connection information is empty, a step of connecting the Nova service to the Rabbitmq message queue based on the URL information is performed.

[0173] Optionally, as in the aforementioned method, the connection information being empty means that at least one of the IP address, the port number and the verification information is empty.

[0174] The professionals should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0175] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0176] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A message queue connection method, characterized in that: The method comprises: When the Nova service starts, the configuration information for connecting to the Rabbitmq message queue is read from the Nova configuration file; Determine whether the URL information and connection information in the configuration information are empty; wherein the connection information includes an IP address, a port number, and verification information; When it is determined that the URL information is empty and the connection information is not empty, assembling the IP address and the port number into an accessible URL link; The Nova service is connected to the Rabbitmq message queue based on the URL link and the verification information.

2. The method according to claim 1, characterized in that The connecting the Nova service with the Rabbitmq message queue based on the URL link and the verification information includes: Obtaining a connection interface to the Rabbitmq message queue based on the URL link; The verification information is input into the connection interface so that the server of the Rabbitmq message queue receives the verification information and verifies the verification information. If the verification information is successfully verified, the Nova service is connected to the Rabbitmq message queue.

3. The method according to claim 1, characterized in that The method further comprises: In the case where it is determined that the URL information is not empty and the connection information is not empty, determining whether the URL information is consistent with the connection information; When it is determined that the URL information is consistent with the connection information, connecting the Nova service to the Rabbitmq message queue based on the URL information; When it is determined that the URL information is inconsistent with the connection information, first connection failure information is generated.

4. The method according to claim 3, characterized in that The URL information includes the target IP address, target port number and target verification information; The connecting the Nova service with the Rabbitmq message queue based on the URL information includes: Obtaining target verification information from the URL information; Obtaining a connection interface to the Rabbitmq message queue based on a target URL link consisting of a target IP address and a target port number in the URL; The target verification information is input into the connection interface so that the server of the Rabbitmq message queue receives the target verification information and verifies the target verification information. If the verification of the target verification information is successful, the Nova service is connected to the Rabbitmq message queue.

5. The method according to claim 1, characterized in that The method further comprises: When it is determined that the URL information is empty and the connection information is empty, second connection failure information is generated.

6. The method according to claim 3, characterized in that The method further comprises: When it is determined that the URL information is not empty and the connection information is empty, a step of connecting the Nova service to the Rabbitmq message queue based on the URL information is performed.

7. The method according to claim 5 or 6, characterized in that: The connection information being empty means that at least one of the IP address, the port number and the verification information is empty.

8. A message queue connection device, characterized in that: The device comprises: The reading module is used to read the configuration information for connecting to the Rabbitmq message queue from the Nova configuration file when the Nova service is started; A judgment module, used to judge whether the URL information and connection information in the configuration information are empty; wherein the connection information includes an IP address, a port number and verification information; An assembly module, for assembling the IP address and the port number into an accessible URL link when it is determined that the URL information is empty and the connection information is not empty; A connection module is used to connect the Nova service with the Rabbitmq message queue based on the URL link and the verification information.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a message queue connection program stored in the memory to implement the message queue connection method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the message queue connection method according to any one of claims 1 to 7.