MQTT service generation method, server and MQTT proxy server
By automatically establishing an MQTT replica service, the problem of manual configuration and debugging of the existing MQTT protocol-based communication process is solved, simplifying the steps, reducing the error rate, and improving the efficiency of the communication process.
Patent Information
- Application Number
- CN202411929392.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The existing communication process based on the MQTT protocol requires manual configuration and debugging, which is time-consuming, labor-intensive, cumbersome, and prone to errors.
By receiving service requests from clients, the system identifies the target service object, obtains servers with resource utilization rates below a preset threshold and no MQTT replica service configured, generates a target address, and generates a replica request to automatically establish an MQTT replica service, thereby enabling data processing.
It eliminates the need for manual configuration and debugging, simplifies the process, reduces the error rate, and improves the efficiency of the communication flow.
Smart Images

Figure CN119728784B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server configuration technology, and more specifically, to an MQTT service generation method, a server, and an MQTT broker server. Background Technology
[0002] With the rapid development of IoT technology, MQTT (Message Queuing Telemetry Transport, a client-server message publish / subscribe protocol) has been widely used in smart homes, smart healthcare, smart agriculture, and other fields due to its lightweight, ease of implementation, and strong scalability. However, existing MQTT-based communication processes are relatively complex, especially when establishing dedicated line services, often requiring manual configuration and debugging, which is time-consuming, labor-intensive, cumbersome, and prone to errors. Summary of the Invention
[0003] The main purpose of this application is to provide an MQTT service generation method, server, and MQTT broker server, so as to at least solve the problem that the existing MQTT-based communication process requires manual configuration and debugging, which is time-consuming and labor-intensive.
[0004] To achieve the above objectives, according to one aspect of this application, an MQTT service generation method is provided, comprising: receiving a service request sent by a client; determining whether the client is a target service object, wherein the service request is used to request access to an MQTT service, the target service object is an object of the MQTT service, and the MQTT service is a service that performs data processing on an MQTT broker server; if the client is the target service object, obtaining the resource utilization rate of a server, identifying a server whose resource utilization rate is less than a preset threshold and which has not configured an MQTT replica service as a target server, and generating a target address of the target server, wherein the resource utilization rate represents the usage status of server resources, and the target address is the Internet Protocol address of the target server; generating a replica request based on the target address, and sending the replica request to the MQTT broker server, so that the MQTT broker server generates an MQTT replica service corresponding to the target address and sends it to the target server, so that the target server performs data processing on the client based on the MQTT replica service, wherein the replica request is used to request the generation of the MQTT replica service, and the MQTT replica service is a replica of the MQTT service.
[0005] Optionally, determining whether the client is a target service object includes: obtaining the client's Internet Protocol address and geographical location; and determining the client as the target service object if the client's Internet Protocol address is a preset address and the geographical location is a preset location.
[0006] Optionally, obtaining the resource utilization rate of the server and identifying the server whose resource utilization rate is less than a preset threshold and which is not configured with MQTT replica service as the target server includes: at least obtaining the memory utilization rate and processor utilization rate of the server; and identifying the server as the target server when the memory utilization rate is less than a preset memory threshold, the processor utilization rate is less than a preset processor threshold, and the server is not configured with MQTT replica service.
[0007] Optionally, after generating the target address, the method further includes: generating a target port and a service area, wherein the target port represents the communication port of the target server, and the service area represents the geographical area served by the target server.
[0008] According to another aspect of this application, an MQTT service generation method is provided, comprising: receiving a replica request sent by a target server, wherein the replica request is used to request the generation of an MQTT replica service, the MQTT replica service being a replica of an MQTT service, the MQTT service being a service performed on an MQTT broker server; generating an MQTT replica service corresponding to a target address and sending it to the target server, so that the target server performs data processing on a client based on the MQTT replica service, the target address being the Internet Protocol address of the target server, and the target server being a server whose resource utilization is less than a preset threshold and which has not configured the MQTT replica service.
[0009] Optionally, the target address is the Internet Protocol address of the target server generated after the target server is determined.
[0010] Optionally, before obtaining the resource utilization rate of the server, the client's Internet Protocol address and geographical location are obtained. If the client's Internet Protocol address is a preset address and the geographical location is a preset location, the client is determined to be the target service object.
[0011] Optionally, the server's resource utilization rate being less than a preset threshold includes at least the server's memory utilization rate being less than a preset memory threshold and its processor utilization rate being less than a preset processor threshold.
[0012] According to another aspect of this application, a server is provided, comprising: a determining unit, configured to receive a service request sent by a client and determine whether the client is a target service object, wherein the service request is for requesting access to an MQTT service, the target service object is an object of the MQTT service, and the MQTT service is a service that performs data processing on an MQTT broker server; a generating unit, configured to, when the client is the target service object, obtain the resource utilization rate of the server, determine the server whose resource utilization rate is less than a preset threshold and which has not configured the MQTT replica service as the target server, and generate a target address of the target server, wherein the resource utilization rate represents the usage status of server resources, and the target address is the Internet Protocol address of the target server; and a first sending unit, configured to generate a replica request based on the target address and send the replica request to the MQTT broker server, so that the MQTT broker server generates an MQTT replica service corresponding to the target address and sends it to the target server, so that the target server performs data processing on the client based on the MQTT replica service, wherein the replica request is for requesting the generation of the MQTT replica service, and the MQTT replica service is a replica of the MQTT service.
[0013] According to another aspect of this application, an MQTT broker server is provided, comprising: a receiving unit, configured to receive a replica request sent by a target server, wherein the replica request is used to request the generation of an MQTT replica service, the MQTT replica service being a replica of an MQTT service, the MQTT service being a service performed on the MQTT broker server; and a second sending unit, configured to generate an MQTT replica service corresponding to a target address and send it to the target server, so that the target server performs data processing on the client based on the MQTT replica service, wherein the target address is the Internet Protocol address of the target server, and the target server is a server whose resource utilization is less than a preset threshold and which has not configured the MQTT replica service.
[0014] The technical solution of this application receives a service request sent by a client and determines whether the client is the target service object. If the client is the target service object, the resource utilization rate of the server is obtained, and servers with resource utilization rates less than a preset threshold and without configured MQTT replica service are identified as target servers, and a target address of the target server is generated. A replica request is generated based on the target address and sent to the MQTT broker server, so that the MQTT broker server generates the MQTT replica service corresponding to the target address and sends it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. Compared with the prior art, which requires manual configuration and debugging of the MQTT protocol-based communication process, resulting in time-consuming, labor-intensive, cumbersome steps and easy errors, this application automatically establishes the MQTT replica service through the above steps to perform data processing on the target server based on the MQTT replica service, thus eliminating the need for manual configuration and debugging. Therefore, it can solve the problem of manual configuration and debugging required for the MQTT protocol-based communication process in the prior art, achieving the effect of simplified steps and reduced error rate. Attached Figure Description
[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0016] Figure 1 A flowchart illustrating an MQTT service generation method provided in an embodiment of this application is shown.
[0017] Figure 2 A flowchart illustrating another MQTT service generation method provided by an embodiment of this application is shown;
[0018] Figure 3 The illustration shows a flowchart of a specific MQTT service generation method provided by an embodiment of this application;
[0019] Figure 4 A structural block diagram of a server provided by an embodiment of this application is shown;
[0020] Figure 5 A block diagram of an MQTT broker server provided by an embodiment of this application is shown. Detailed Implementation
[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0022] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations 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 clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:
[0025] MQTT: Message Queuing Telemetry Transport, is a client-server based message publish / subscribe transport protocol.
[0026] As described in the background section, existing communication processes based on the MQTT protocol require manual configuration and debugging, which is time-consuming and labor-intensive. To address this issue, embodiments of this application provide an MQTT service generation method, a server, and an MQTT proxy server.
[0027] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0028] This embodiment provides a method for generating MQTT services that runs on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0029] Figure 1This is a flowchart of an MQTT service generation method according to an embodiment of this application. Figure 1 As shown, the method includes the following steps:
[0030] Step S201: Receive a service request sent by a client and determine whether the client is the target service object. The service request is used to request access to the MQTT service, the target service object is the object of the MQTT service, and the MQTT service is a service that performs data processing on the MQTT broker server.
[0031] Specifically, this application constructs a broker service system based on the MQTT protocol. MQTT (Message Queuing Telemetry Transport) is a client-server message publish / subscribe transport protocol. The system consists of an MQTT broker server, a dedicated line generation service, clients (which can be devices, users, etc.), and a database. The MQTT broker server is responsible for receiving, processing, and forwarding messages from clients. The dedicated line generation service is pre-configured with object-oriented information. In this embodiment, the execution entity is the server, or main server, used to monitor the resource configuration of the server cluster and configure the aforementioned dedicated line generation service. Clients typically log in via smart devices. When a client sends a service request, it is first transmitted to the MQTT broker server. The MQTT broker server then forwards the request to the server configuring the dedicated line generation service. The server determines whether the client is within the service target scope; if so, the client is the target service object.
[0032] Step S202: When the client is the target service object, obtain the resource utilization rate of the server, determine the server whose resource utilization rate is less than a preset threshold and which has not configured the MQTT replica service as the target server, and generate the target address of the target server, wherein the resource utilization rate represents the usage status of server resources, and the target address is the Internet Protocol address of the target server.
[0033] Specifically, when the client is within the service target range, the server monitors the resource utilization of each server in the MQTT broker server cluster in real time. Resource utilization can include key resource indicators such as memory utilization, CPU utilization, and physical memory usage. If the resource utilization is less than a preset threshold, it indicates that the server has a low load and sufficient resources, making it suitable for configuring MQTT service. It is also necessary to consider whether MQTT service has already been configured. Select a server resource with sufficient resources that has not been configured with MQTT service to obtain the target server, and provide the target address (id) and other service configurations of the target server. The service configuration mainly includes: 1. Dedicated line service object ID; 2. Dedicated line service IP group; 3. Dedicated line service geographical location range; 4. Service activation time.
[0034] Step S203: Generate a replica request based on the target address and send the replica request to the MQTT broker server, so that the MQTT broker server generates an MQTT replica service corresponding to the target address and sends it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. The replica request is used to request the generation of the MQTT replica service, and the MQTT replica service is a replica of the MQTT service.
[0035] Specifically, a replica request is generated based on the target address mentioned above. In practical applications, a more specific replica request can also be generated based on the four service configurations described above and sent to the MQTT broker server. The MQTT broker server generates the MQTT replica service and sends the result back to the server. The server executes the MQTT replica service (program) on the selected target server, generating a new MQTT broker service instance. This instance inherits the configuration and functionality of the main MQTT broker service and takes over the connection and data processing tasks for newly added device-side services within the configured service scope. The main MQTT broker service is the service that is executed directly on the MQTT broker server.
[0036] This embodiment receives a service request from a client and determines whether the client is the target service object. If the client is the target service object, the resource utilization rate of the server is obtained. Servers with resource utilization rates less than a preset threshold and without configured MQTT replica service are identified as target servers, and a target address for the target server is generated. A replica request is generated based on the target address and sent to the MQTT broker server. The MQTT broker server then generates an MQTT replica service corresponding to the target address and sends it to the target server, allowing the target server to process data from the client based on the MQTT replica service. Compared to existing technologies where MQTT-based communication processes require manual configuration and debugging, resulting in time-consuming, labor-intensive, cumbersome, and error-prone processes, this application automatically establishes an MQTT replica service through the above steps, enabling data processing on the target server based on the MQTT replica service. This eliminates the need for manual configuration and debugging, thus solving the problem of manual configuration and debugging required in existing MQTT-based communication processes, achieving simplified steps and reduced error rates.
[0037] In the specific implementation process, the above step S202, which determines whether the client is the target service object, can be achieved through the following steps: Step S2021: Obtain the client's Internet Protocol address and geographical location; Step S2022: If the client's Internet Protocol address is a preset address and the geographical location is a preset location, determine that the client is the target service object. This method determines whether the client is the target service object through the above steps, which allows for further service configuration for the client.
[0038] Specifically, the server's leased line generation service determines whether the client is within the pre-configured target audience and scope of the leased line service based on the IP address (Internet Protocol address) and geographical location reported by the client. If the Internet Protocol address is a preset address and the geographical location is a preset location, the client is determined to be the target service target.
[0039] In some optional implementations, step S202 above, which obtains the resource utilization rate of the server and identifies servers with resource utilization rates less than a preset threshold and without configured MQTT replica service as target servers, can be achieved through the following steps: Step S2023: Obtain at least the memory utilization rate and processor utilization rate of the server; Step S2024: If the memory utilization rate is less than a preset memory threshold, the processor utilization rate is less than a preset processor threshold, and the server is not configured with MQTT replica service, then identify the server as the target server. This method identifies target servers through the above steps, thus filtering out servers that meet the conditions for successful MQTT service configuration.
[0040] In the specific implementation process, resource pressure monitoring of the servers is used to determine whether the resource utilization rate meets the requirements for configuring the MQTT service. The dedicated line service monitors key resource indicators such as memory utilization, CPU utilization, and physical memory usage of each server in the MQTT broker server cluster in real time. Server resource pressure levels are as follows: 1. Low pressure level: Memory utilization below 20%, CPU utilization below 20%, and physical memory utilization below 30%. In this state, the server runs smoothly, resources are sufficient, and it can handle more connections and message load; the dedicated line service can be configured. 2. Medium pressure level: Memory utilization 20%-50%, CPU utilization below 20%-70%, and physical memory utilization 30%-70%. The server begins to feel some load but is still capable of handling increased requests. System performance monitoring may be required after the dedicated line service is generated. 3. High pressure level: Memory utilization exceeding 50%, CPU utilization exceeding 70%, and physical memory utilization exceeding 70%. The server load is high, and the generation of the dedicated line service may affect the service response time and stability.
[0041] In some alternative implementations, after generating the target address, the method further includes the following steps: generating a target port and a service area, wherein the target port represents the communication port of the target server, and the service area represents the geographical area served by the target server. This method generates configuration ports and regions through the above steps, thus generating specific ports and regions for service configuration to provide dedicated line services to clients.
[0042] In the specific implementation process, the configuration elements also include the service scope to which the target port is a fixed IP port and the service area is a fixed regional service.
[0043] Figure 2 This is a flowchart of another MQTT service generation method according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0044] Step S301: Receive a replica request sent by the target server, wherein the replica request is used to request the generation of an MQTT replica service, the MQTT replica service is a replica of the MQTT service, and the MQTT service is a service performed on the MQTT broker server;
[0045] Specifically, this application constructs a broker service system based on the MQTT protocol. MQTT (Message Queuing Telemetry Transport) is a client-server message publish / subscribe transport protocol. The system consists of an MQTT broker server, a leased line generation service, clients (which can be devices, users, etc.), and a database. The MQTT broker server is responsible for receiving, processing, and forwarding messages from clients, and the leased line generation service is pre-configured with object-oriented information. In this embodiment, the execution entity is the MQTT broker server. Clients typically log in via smart devices. When a client sends a service request, it is first transmitted to the MQTT broker server. The MQTT broker server then forwards the request to the server configuring the leased line generation service. The server determines whether the client is within the service target scope; if so, the client is the target service object.
[0046] Step S302: Generate an MQTT replica service corresponding to the target address and send it to the target server so that the target server can process data on the client based on the MQTT replica service. The target address is the Internet Protocol address of the target server. The target server is a server whose resource utilization is less than a preset threshold and which has not configured the MQTT replica service.
[0047] Specifically, when the client is within the scope of the service object, the server monitors the resource utilization of each server in the MQTT broker server cluster in real time. The resource utilization can include key resource indicators such as memory utilization, CPU utilization, and physical memory usage. If the resource utilization is less than a preset threshold, it indicates that the server has a low load and sufficient resources, making it suitable for configuring MQTT service. It is also necessary to consider whether MQTT service has already been configured.
[0048] The server generates a replica request based on the target address mentioned above. In practical applications, more specific replica requests can also be generated based on the four service configurations described above and sent to the MQTT broker server. The MQTT broker server generates an MQTT replica service and sends the result back to the server. The server executes the MQTT replica service (program) on the selected target server, generating a new MQTT broker service instance. This instance inherits the configuration and functionality of the main MQTT broker service and takes over the connection and data processing tasks for newly added device-side services within the configured service scope. The main MQTT broker service is the service that runs directly on the MQTT broker server.
[0049] The above step S302 of this application can be implemented through the following steps: the target address is the Internet Protocol address of the target server generated after the target server is determined. The method determines the target address through the above steps, so that the client can be allowed to access and perform leased line services through the target address.
[0050] In the specific implementation process, select server resources with sufficient resources that are not configured with MQTT service, obtain the target server, and provide the target address (id) and other service configurations of the target server. The service configurations mainly include: 1. Dedicated line service object ID; 2. Dedicated line service IP group; 3. Dedicated line service geographical location range; 4. Service effective time.
[0051] The above method also includes other implementation steps, such as: before obtaining the resource utilization rate of the server, obtaining the client's Internet Protocol address and geographical location; if the client's Internet Protocol address is a preset address and the geographical location is a preset location, determining that the client is the target service object. This method determines whether the client is within the service range through the above steps, thus determining whether to continue configuring the MQTT service.
[0052] Specifically, the server's leased line generation service determines whether the client is within the pre-configured target audience and scope of the leased line service based on the IP address (Internet Protocol address) and geographical location reported by the client. If the Internet Protocol address is a preset address and the geographical location is a preset location, the client is determined to be the target service target.
[0053] In some embodiments, the above method may include the following steps: the resource utilization rate of the server is less than a preset threshold, which includes at least the server's memory utilization rate being less than a preset memory threshold and the processor utilization rate being less than a preset processor threshold. The method determines the resource utilization rate of the server through the above steps, so as to determine the target server based on the resource utilization rate and ensure that the target server has sufficient operating resources.
[0054] In the specific implementation process, resource pressure monitoring of the servers is used to determine whether the resource utilization rate meets the requirements for configuring the MQTT service. The dedicated line service monitors key resource indicators such as memory utilization, CPU utilization, and physical memory usage of each server in the MQTT broker server cluster in real time. Server resource pressure levels are as follows: 1. Low pressure level: Memory utilization below 20%, CPU utilization below 20%, and physical memory utilization below 30%. In this state, the server runs smoothly, resources are sufficient, and it can handle more connections and message load; the dedicated line service can be configured. 2. Medium pressure level: Memory utilization 20%-50%, CPU utilization below 20%-70%, and physical memory utilization 30%-70%. The server begins to feel some load but is still capable of handling increased requests. System performance monitoring may be required after the dedicated line service is generated. 3. High pressure level: Memory utilization exceeding 50%, CPU utilization exceeding 70%, and physical memory utilization exceeding 70%. The server load is high, and the generation of the dedicated line service may affect the service response time and stability. The final configuration elements also include the service scope, the target port (i.e., a fixed IP port), and the service area (i.e., a fixed regional service).
[0055] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the MQTT service generation method of this application will be described in detail below with reference to specific embodiments.
[0056] This embodiment relates to a specific method for generating MQTT services, such as... Figure 3 As shown, it includes a smart device (client), an MQTT broker (server), and a leased line service (device), and includes the following steps:
[0057] Step S1: The smart device sends a request to the MQTT broker server to request a dedicated line service;
[0058] Step S2: The MQTT broker server schedules the dedicated line service and sends an application to the dedicated line server.
[0059] Step S3: The dedicated line server applies for dedicated line service scheduling;
[0060] Step S4: Determine if it falls within the service target scope;
[0061] Step S5: If so, analyze the service resources of the MQTT broker cluster server and whether there is a configured MQTT service. Request a server with sufficient resources and no configured MQTT service as the target server.
[0062] Step S6: Provide the target address for service generation, request the generation of a copy of the MQTT broker service corresponding to the leased line service, and request the MQTT broker server to generate a copy of the MQTT service.
[0063] Step S7: The MQTT broker server generates an MQTT broker replica service and starts it automatically;
[0064] Step S8: Provide the MQTT broker service replica address and port, and notify the dedicated line server of the generation result;
[0065] Step S9: The smart device sends an access request to request access to the MQTT broker service replica service.
[0066] This application also provides a server. It should be noted that the server in this application embodiment can be used to execute the MQTT service generation method provided in this application embodiment. This apparatus is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0067] The server provided in the embodiments of this application will be described below.
[0068] Figure 4 This is a schematic diagram of a server according to an embodiment of this application. For example... Figure 4 As shown, the device includes:
[0069] The determining unit 10 is used to receive a service request sent by a client and determine whether the client is a target service object. The service request is used to request access to the MQTT service, the target service object is an object of the MQTT service, and the MQTT service is a service that performs data processing on the MQTT broker server.
[0070] Specifically, this application constructs a broker service system based on the MQTT protocol. MQTT (Message Queuing Telemetry Transport) is a client-server message publish / subscribe transport protocol. The system consists of an MQTT broker server, a dedicated line generation service, clients (which can be devices, users, etc.), and a database. The MQTT broker server is responsible for receiving, processing, and forwarding messages from clients. The dedicated line generation service is pre-configured with object-oriented information. In this embodiment, the execution entity is the server, or main server, used to monitor the resource configuration of the server cluster and configure the aforementioned dedicated line generation service. Clients typically log in via smart devices. When a client sends a service request, it is first transmitted to the MQTT broker server. The MQTT broker server then forwards the request to the server configuring the dedicated line generation service. The server determines whether the client is within the service target scope; if so, the client is the target service object.
[0071] The generation unit 20 is configured to, when the client is the target service object, obtain the resource utilization rate of the server, determine the server whose resource utilization rate is less than a preset threshold and which has not configured the MQTT replica service as the target server, and generate the target address of the target server, wherein the resource utilization rate represents the usage status of server resources, and the target address is the Internet Protocol address of the target server;
[0072] Specifically, when the client is within the service target range, the server monitors the resource utilization of each server in the MQTT broker server cluster in real time. Resource utilization can include key resource indicators such as memory utilization, CPU utilization, and physical memory usage. If the resource utilization is less than a preset threshold, it indicates that the server has a low load and sufficient resources, making it suitable for configuring MQTT service. It is also necessary to consider whether MQTT service has already been configured. Select a server resource with sufficient resources that has not been configured with MQTT service to obtain the target server, and provide the target address (id) and other service configurations of the target server. The service configuration mainly includes: 1. Dedicated line service object ID; 2. Dedicated line service IP group; 3. Dedicated line service geographical location range; 4. Service activation time.
[0073] The first sending unit 30 is configured to generate a replica request based on the target address and send the replica request to the MQTT broker server, so that the MQTT broker server generates an MQTT replica service corresponding to the target address and sends it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. The replica request is used to request the generation of the MQTT replica service, and the MQTT replica service is a replica of the MQTT service.
[0074] Specifically, a replica request is generated based on the target address mentioned above. In practical applications, a more specific replica request can also be generated based on the four service configurations described above and sent to the MQTT broker server. The MQTT broker server generates the MQTT replica service and sends the result back to the server. The server executes the MQTT replica service (program) on the selected target server, generating a new MQTT broker service instance. This instance inherits the configuration and functionality of the main MQTT broker service and takes over the connection and data processing tasks for newly added device-side services within the configured service scope. The main MQTT broker service is the service that is executed directly on the MQTT broker server.
[0075] This embodiment receives a service request from a client and determines whether the client is the target service object. If the client is the target service object, the resource utilization rate of the server is obtained. Servers with resource utilization rates less than a preset threshold and without configured MQTT replica service are identified as target servers, and a target address for the target server is generated. A replica request is generated based on the target address and sent to the MQTT broker server. The MQTT broker server then generates an MQTT replica service corresponding to the target address and sends it to the target server, allowing the target server to process data from the client based on the MQTT replica service. Compared to existing technologies where MQTT-based communication processes require manual configuration and debugging, resulting in time-consuming, labor-intensive, cumbersome, and error-prone processes, this application automatically establishes an MQTT replica service through the above steps, enabling data processing on the target server based on the MQTT replica service. This eliminates the need for manual configuration and debugging, thus solving the problem of manual configuration and debugging required in existing MQTT-based communication processes, achieving simplified steps and reduced error rates.
[0076] In its specific implementation, the aforementioned generation unit includes a first acquisition module and a first determination module. The first acquisition module is used to acquire the client's Internet Protocol address and geographical location. The first determination module is used to determine that the client is the target service object if the client's Internet Protocol address is a preset address and the geographical location is a preset location. This method determines whether the client is the target service object through the above steps, which allows for further service configuration for the client.
[0077] Specifically, the server's leased line generation service determines whether the client is within the pre-configured target audience and scope of the leased line service based on the IP address (Internet Protocol address) and geographical location reported by the client. If the Internet Protocol address is a preset address and the geographical location is a preset location, the client is determined to be the target service target.
[0078] In some optional implementations, the generation unit further includes a second acquisition module and a second determination module. The second acquisition module is used to acquire at least the memory usage and processor usage of the server. The second determination module is used to determine the server as the target server when the memory usage is less than a preset memory threshold, the processor usage is less than a preset processor threshold, and the server is not configured with MQTT replication service. This method determines the target server through the above steps, thus filtering out servers that meet the conditions for successful MQTT service configuration.
[0079] In the specific implementation process, resource pressure monitoring of the servers is used to determine whether the resource utilization rate meets the requirements for configuring the MQTT service. The dedicated line service monitors key resource indicators such as memory utilization, CPU utilization, and physical memory usage of each server in the MQTT broker server cluster in real time. Server resource pressure levels are as follows: 1. Low pressure level: Memory utilization below 20%, CPU utilization below 20%, and physical memory utilization below 30%. In this state, the server runs smoothly, resources are sufficient, and it can handle more connections and message load; the dedicated line service can be configured. 2. Medium pressure level: Memory utilization 20%-50%, CPU utilization below 20%-70%, and physical memory utilization 30%-70%. The server begins to feel some load but is still capable of handling increased requests. System performance monitoring may be required after the dedicated line service is generated. 3. High pressure level: Memory utilization exceeding 50%, CPU utilization exceeding 70%, and physical memory utilization exceeding 70%. The server load is high, and the generation of the dedicated line service may affect the service response time and stability.
[0080] In some alternative implementations, after generating the target address, the server further includes a generation unit for generating a target port and a service area, wherein the target port represents the communication port of the target server, and the service area represents the geographical area served by the target server. This method generates configuration ports and regions through the above steps, thus generating specific ports and regions for service configuration to provide dedicated line services to clients.
[0081] In the specific implementation process, the configuration elements also include the service scope to which the target port is a fixed IP port and the service area is a fixed regional service.
[0082] The server includes a processor and a memory. The aforementioned determining unit, generating unit, and first sending unit are all stored as program units in the memory, and the processor executes these program units stored in the memory to achieve the corresponding functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.
[0083] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can resolve issues. In existing technologies, communication processes based on the MQTT protocol require manual configuration and debugging, which is time-consuming and labor-intensive.
[0084] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0085] This application also provides an MQTT broker server. It should be noted that the MQTT broker server in this application can be used to execute the MQTT service generation method provided in this application. This apparatus is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0086] The following describes the MQTT broker server provided in the embodiments of this application.
[0087] Figure 5 This is a schematic diagram of a server according to an embodiment of this application. For example... Figure 5 As shown, the device includes:
[0088] The receiving unit 40 is configured to receive a replica request sent by the target server, wherein the replica request is used to request the generation of an MQTT replica service, the MQTT replica service is a replica of the MQTT service, and the MQTT service is a service performed on the MQTT broker server;
[0089] Specifically, this application constructs a broker service system based on the MQTT protocol. MQTT (Message Queuing Telemetry Transport) is a client-server message publish / subscribe transport protocol. The system consists of an MQTT broker server, a leased line generation service, clients (which can be devices, users, etc.), and a database. The MQTT broker server is responsible for receiving, processing, and forwarding messages from clients, and the leased line generation service is pre-configured with object-oriented information. In this embodiment, the execution entity is the MQTT broker server. Clients typically log in via smart devices. When a client sends a service request, it is first transmitted to the MQTT broker server. The MQTT broker server then forwards the request to the server configuring the leased line generation service. The server determines whether the client is within the service target scope; if so, the client is the target service object.
[0090] The second sending unit 50 is used to generate an MQTT replica service corresponding to the target address and send it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. The target address is the Internet Protocol address of the target server, and the target server is a server whose resource utilization rate is less than a preset threshold and which has not configured the MQTT replica service.
[0091] Specifically, when the client is within the scope of the service object, the server monitors the resource utilization of each server in the MQTT broker server cluster in real time. The resource utilization can include key resource indicators such as memory utilization, CPU utilization, and physical memory usage. If the resource utilization is less than a preset threshold, it indicates that the server has a low load and sufficient resources, making it suitable for configuring MQTT service. It is also necessary to consider whether MQTT service has already been configured.
[0092] The server generates a replica request based on the target address mentioned above. In practical applications, more specific replica requests can also be generated based on the four service configurations described above and sent to the MQTT broker server. The MQTT broker server generates an MQTT replica service and sends the result back to the server. The server executes the MQTT replica service (program) on the selected target server, generating a new MQTT broker service instance. This instance inherits the configuration and functionality of the main MQTT broker service and takes over the connection and data processing tasks for newly added device-side services within the configured service scope. The main MQTT broker service is the service that runs directly on the MQTT broker server.
[0093] The target address mentioned in this application is the Internet Protocol address of the target server generated after the target server is determined. This method determines the target address through the above steps, so that clients can be allowed to access and perform leased line services through the target address.
[0094] In the specific implementation process, select server resources with sufficient resources that are not configured with MQTT service, obtain the target server, and provide the target address (id) and other service configurations of the target server. The service configurations mainly include: 1. Dedicated line service object ID; 2. Dedicated line service IP group; 3. Dedicated line service geographical location range; 4. Service effective time.
[0095] Before obtaining the resource utilization rate of the server, the method obtains the client's Internet Protocol address and geographical location. If the client's Internet Protocol address matches a preset address and the geographical location matches a preset location, the client is determined to be the target service object. This method determines whether the client is within the service range through the above steps, thus determining whether to continue configuring the MQTT service.
[0096] Specifically, the server's leased line generation service determines whether the client is within the pre-configured target audience and scope of the leased line service based on the IP address (Internet Protocol address) and geographical location reported by the client. If the Internet Protocol address is a preset address and the geographical location is a preset location, the client is determined to be the target service target.
[0097] In some embodiments, the resource utilization rate of the server described above being less than a preset threshold includes at least the server's memory utilization rate being less than a preset memory threshold and the processor utilization rate being less than a preset processor threshold. The method determines the server's resource utilization rate through the above steps, so as to determine the target server based on the resource utilization rate and ensure that the target server has sufficient operating resources.
[0098] In the specific implementation process, resource pressure monitoring of the servers is used to determine whether the resource utilization rate meets the requirements for configuring the MQTT service. The dedicated line service monitors key resource indicators such as memory utilization, CPU utilization, and physical memory usage of each server in the MQTT broker server cluster in real time. Server resource pressure levels are as follows: 1. Low pressure level: Memory utilization below 20%, CPU utilization below 20%, and physical memory utilization below 30%. In this state, the server runs smoothly, resources are sufficient, and it can handle more connections and message load; the dedicated line service can be configured. 2. Medium pressure level: Memory utilization 20%-50%, CPU utilization below 20%-70%, and physical memory utilization 30%-70%. The server begins to feel some load but is still capable of handling increased requests. System performance monitoring may be required after the dedicated line service is generated. 3. High pressure level: Memory utilization exceeding 50%, CPU utilization exceeding 70%, and physical memory utilization exceeding 70%. The server load is high, and the generation of the dedicated line service may affect the service response time and stability. The final configuration elements also include the service scope, the target port (i.e., a fixed IP port), and the service area (i.e., a fixed regional service).
[0099] This invention provides a computer-readable storage medium including a stored program, wherein the program, when running, controls the device where the computer-readable storage medium is located to execute the MQTT service generation method.
[0100] Specifically, the methods for generating MQTT services include:
[0101] Step S201: Receive a service request sent by a client and determine whether the client is the target service object. The service request is used to request access to the MQTT service, the target service object is the object of the MQTT service, and the MQTT service is a service that performs data processing on the MQTT broker server.
[0102] Specifically, this application constructs a broker service system based on the MQTT protocol. MQTT (Message Queuing Telemetry Transport) is a client-server message publish / subscribe transport protocol. The system consists of an MQTT broker server, a dedicated line generation service, clients (which can be devices, users, etc.), and a database. The MQTT broker server is responsible for receiving, processing, and forwarding messages from clients. The dedicated line generation service is pre-configured with object-oriented information. In this embodiment, the execution entity is the server, or main server, used to monitor the resource configuration of the server cluster and configure the aforementioned dedicated line generation service. Clients typically log in via smart devices. When a client sends a service request, it is first transmitted to the MQTT broker server. The MQTT broker server then forwards the request to the server configuring the dedicated line generation service. The server determines whether the client is within the service target scope; if so, the client is the target service object.
[0103] Step S202: When the client is the target service object, obtain the resource utilization rate of the server, determine the server whose resource utilization rate is less than a preset threshold and which has not configured the MQTT replica service as the target server, and generate the target address of the target server, wherein the resource utilization rate represents the usage status of server resources, and the target address is the Internet Protocol address of the target server.
[0104] Specifically, when the client is within the service target range, the server monitors the resource utilization of each server in the MQTT broker server cluster in real time. Resource utilization can include key resource indicators such as memory utilization, CPU utilization, and physical memory usage. If the resource utilization is less than a preset threshold, it indicates that the server has a low load and sufficient resources, making it suitable for configuring MQTT service. It is also necessary to consider whether MQTT service has already been configured. Select a server resource with sufficient resources that has not been configured with MQTT service to obtain the target server, and provide the target address (id) and other service configurations of the target server. The service configuration mainly includes: 1. Dedicated line service object ID; 2. Dedicated line service IP group; 3. Dedicated line service geographical location range; 4. Service activation time.
[0105] Step S203: Generate a replica request based on the target address and send the replica request to the MQTT broker server, so that the MQTT broker server generates an MQTT replica service corresponding to the target address and sends it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. The replica request is used to request the generation of the MQTT replica service, and the MQTT replica service is a replica of the MQTT service.
[0106] Specifically, a replica request is generated based on the target address mentioned above. In practical applications, a more specific replica request can also be generated based on the four service configurations described above and sent to the MQTT broker server. The MQTT broker server generates the MQTT replica service and sends the result back to the server. The server executes the MQTT replica service (program) on the selected target server, generating a new MQTT broker service instance. This instance inherits the configuration and functionality of the main MQTT broker service and takes over the connection and data processing tasks for newly added device-side services within the configured service scope. The main MQTT broker service is the service that is executed directly on the MQTT broker server.
[0107] This invention provides an electronic device, including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0108] Step S201: Receive a service request sent by a client and determine whether the client is the target service object. The service request is used to request access to the MQTT service, the target service object is the object of the MQTT service, and the MQTT service is a service that performs data processing on the MQTT broker server.
[0109] Specifically, this application constructs a broker service system based on the MQTT protocol. MQTT (Message Queuing Telemetry Transport) is a client-server message publish / subscribe transport protocol. The system consists of an MQTT broker server, a dedicated line generation service, clients (which can be devices, users, etc.), and a database. The MQTT broker server is responsible for receiving, processing, and forwarding messages from clients. The dedicated line generation service is pre-configured with object-oriented information. In this embodiment, the execution entity is the server, or main server, used to monitor the resource configuration of the server cluster and configure the aforementioned dedicated line generation service. Clients typically log in via smart devices. When a client sends a service request, it is first transmitted to the MQTT broker server. The MQTT broker server then forwards the request to the server configuring the dedicated line generation service. The server determines whether the client is within the service target scope; if so, the client is the target service object.
[0110] Step S202: When the client is the target service object, obtain the resource utilization rate of the server, determine the server whose resource utilization rate is less than a preset threshold and which has not configured the MQTT replica service as the target server, and generate the target address of the target server, wherein the resource utilization rate represents the usage status of server resources, and the target address is the Internet Protocol address of the target server.
[0111] Specifically, when the client is within the service target range, the server monitors the resource utilization of each server in the MQTT broker server cluster in real time. Resource utilization can include key resource indicators such as memory utilization, CPU utilization, and physical memory usage. If the resource utilization is less than a preset threshold, it indicates that the server has a low load and sufficient resources, making it suitable for configuring MQTT service. It is also necessary to consider whether MQTT service has already been configured. Select a server resource with sufficient resources that has not been configured with MQTT service to obtain the target server, and provide the target address (id) and other service configurations of the target server. The service configuration mainly includes: 1. Dedicated line service object ID; 2. Dedicated line service IP group; 3. Dedicated line service geographical location range; 4. Service activation time.
[0112] Step S203: Generate a replica request based on the target address and send the replica request to the MQTT broker server, so that the MQTT broker server generates an MQTT replica service corresponding to the target address and sends it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. The replica request is used to request the generation of the MQTT replica service, and the MQTT replica service is a replica of the MQTT service.
[0113] Specifically, a replica request is generated based on the target address mentioned above. In practical applications, a more specific replica request can also be generated based on the four service configurations described above and sent to the MQTT broker server. The MQTT broker server generates the MQTT replica service and sends the result back to the server. The server executes the MQTT replica service (program) on the selected target server, generating a new MQTT broker service instance. This instance inherits the configuration and functionality of the main MQTT broker service and takes over the connection and data processing tasks for newly added device-side services within the configured service scope. The main MQTT broker service is the service that is executed directly on the MQTT broker server.
[0114] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0115] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the methods described in various embodiments of this application:
[0116] Step S201: Receive a service request sent by a client and determine whether the client is the target service object. The service request is used to request access to the MQTT service, the target service object is the object of the MQTT service, and the MQTT service is a service that performs data processing on the MQTT broker server.
[0117] Specifically, this application constructs a broker service system based on the MQTT protocol. MQTT (Message Queuing Telemetry Transport) is a client-server message publish / subscribe transport protocol. The system consists of an MQTT broker server, a dedicated line generation service, clients (which can be devices, users, etc.), and a database. The MQTT broker server is responsible for receiving, processing, and forwarding messages from clients. The dedicated line generation service is pre-configured with object-oriented information. In this embodiment, the execution entity is the server, or main server, used to monitor the resource configuration of the server cluster and configure the aforementioned dedicated line generation service. Clients typically log in via smart devices. When a client sends a service request, it is first transmitted to the MQTT broker server. The MQTT broker server then forwards the request to the server configuring the dedicated line generation service. The server determines whether the client is within the service target scope; if so, the client is the target service object.
[0118] Step S202: When the client is the target service object, obtain the resource utilization rate of the server, determine the server whose resource utilization rate is less than a preset threshold and which has not configured the MQTT replica service as the target server, and generate the target address of the target server, wherein the resource utilization rate represents the usage status of server resources, and the target address is the Internet Protocol address of the target server.
[0119] Specifically, when the client is within the service target range, the server monitors the resource utilization of each server in the MQTT broker server cluster in real time. Resource utilization can include key resource indicators such as memory utilization, CPU utilization, and physical memory usage. If the resource utilization is less than a preset threshold, it indicates that the server has a low load and sufficient resources, making it suitable for configuring MQTT service. It is also necessary to consider whether MQTT service has already been configured. Select a server resource with sufficient resources that has not been configured with MQTT service to obtain the target server, and provide the target address (id) and other service configurations of the target server. The service configuration mainly includes: 1. Dedicated line service object ID; 2. Dedicated line service IP group; 3. Dedicated line service geographical location range; 4. Service activation time.
[0120] Step S203: Generate a replica request based on the target address and send the replica request to the MQTT broker server, so that the MQTT broker server generates an MQTT replica service corresponding to the target address and sends it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. The replica request is used to request the generation of the MQTT replica service, and the MQTT replica service is a replica of the MQTT service.
[0121] Specifically, a replica request is generated based on the target address mentioned above. In practical applications, a more specific replica request can also be generated based on the four service configurations described above and sent to the MQTT broker server. The MQTT broker server generates the MQTT replica service and sends the result back to the server. The server executes the MQTT replica service (program) on the selected target server, generating a new MQTT broker service instance. This instance inherits the configuration and functionality of the main MQTT broker service and takes over the connection and data processing tasks for newly added device-side services within the configured service scope. The main MQTT broker service is the service that is executed directly on the MQTT broker server.
[0122] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0123] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0125] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0126] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0127] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0128] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0129] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0130] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0131] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0132] 1) In the MQTT service generation method of this application, a service request sent by a client is received, and it is determined whether the client is the target service object. If the client is the target service object, the resource utilization rate of the server is obtained, and the server with a resource utilization rate less than a preset threshold and without configured MQTT replica service is identified as the target server, and a target address of the target server is generated. A replica request is generated according to the target address, and the replica request is sent to the MQTT broker server, so that the MQTT broker server generates the MQTT replica service corresponding to the target address and sends it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. Compared with the prior art, which requires manual configuration and debugging of the MQTT protocol-based communication process, resulting in time-consuming, labor-intensive, cumbersome steps and easy errors, this application automatically establishes the MQTT replica service through the above steps, so that data processing can be performed on the target server based on the MQTT replica service, thus eliminating the need for manual configuration and debugging. Therefore, it can solve the problem of manual configuration and debugging required for the MQTT protocol-based communication process in the prior art, achieving the effect of simplified steps and reduced error rate.
[0133] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A method for generating MQTT services, characterized in that, include: The system receives a service request sent by a client and determines whether the client is the target service object. The service request is used to request access to the MQTT service, and the target service object is the object of the MQTT service. The MQTT service is a service that performs data processing on the MQTT broker server. When the client is the target service object, the resource utilization rate of the server is obtained, the server whose resource utilization rate is less than a preset threshold and which has not configured MQTT replica service is identified as the target server, and the target address of the target server is generated. The resource utilization rate represents the usage status of server resources, and the target address is the Internet Protocol address of the target server. A replica request is generated based on the target address, and the replica request is sent to the MQTT broker server, so that the MQTT broker server generates the MQTT replica service corresponding to the target address and sends it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. The replica request is used to request the generation of the MQTT replica service, and the MQTT replica service is a replica of the MQTT service.
2. The MQTT service generation method according to claim 1, characterized in that, Determining whether the client is the target service object includes: Obtain the client's Internet Protocol address and geographical location; If the client's Internet Protocol address is a preset address and the geographical location is a preset location, then the client is determined to be the target service object.
3. The MQTT service generation method according to claim 1, characterized in that, Obtain the resource utilization rate of the server, and identify the server whose resource utilization rate is less than a preset threshold and which is not configured with MQTT replication service as the target server, including: At least obtain the memory usage and processor usage of the server; If the memory usage is less than a preset memory threshold, the processor usage is less than a preset processor threshold, and the server is not configured with the MQTT replica service, then the server is determined to be the target server.
4. The MQTT service generation method according to claim 1, characterized in that, After generating the target address, the method further includes: Generate a target port and a service area, wherein the target port represents the communication port of the target server, and the service area represents the geographical area served by the target server.
5. A method for generating MQTT services, characterized in that, include: Receive a replica request sent by the target server, wherein the replica request is used to request the generation of an MQTT replica service, the MQTT replica service is a replica of the MQTT service, and the MQTT service is a service performed on the MQTT broker server; Generate an MQTT replica service corresponding to the target address and send it to the target server, so that the target server can process data on the client based on the MQTT replica service. The target address is the Internet Protocol address of the target server, and the target server is a server whose resource utilization is less than a preset threshold and which has not configured the MQTT replica service.
6. The MQTT service generation method according to claim 5, characterized in that, The target address is the Internet Protocol address of the target server, which is generated after the target server is determined.
7. The MQTT service generation method according to claim 6, characterized in that, Before obtaining the resource utilization rate of the server, the Internet Protocol address and geographical location of the client are obtained. If the Internet Protocol address of the client is a preset address and the geographical location is a preset location, the client is determined to be the target service object.
8. The MQTT service generation method according to claim 6, characterized in that, The server's resource utilization rate being less than a preset threshold includes at least the server's memory utilization rate being less than a preset memory threshold and the processor utilization rate being less than a preset processor threshold.
9. A server, characterized in that, include: The determining unit is used to receive a service request sent by a client and determine whether the client is a target service object. The service request is used to request access to the MQTT service, and the target service object is an object of the MQTT service. The MQTT service is a service that performs data processing on the MQTT broker server. The generation unit is configured to, when the client is the target service object, obtain the resource utilization rate of the server, determine the server whose resource utilization rate is less than a preset threshold and which has not configured MQTT replica service as the target server, and generate the target address of the target server, wherein the resource utilization rate represents the usage status of server resources, and the target address is the Internet Protocol address of the target server; The first sending unit is configured to generate a replica request based on the target address and send the replica request to the MQTT broker server, so that the MQTT broker server generates the MQTT replica service corresponding to the target address and sends it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. The replica request is used to request the generation of the MQTT replica service, and the MQTT replica service is a replica of the MQTT service.
10. An MQTT broker server, characterized in that, include: A receiving unit is configured to receive a replica request sent by a target server, wherein the replica request is used to request the generation of an MQTT replica service, the MQTT replica service is a replica of an MQTT service, and the MQTT service is a service performed on the MQTT broker server; The second sending unit is used to generate an MQTT replica service corresponding to the target address and send it to the target server, so that the target server can perform data processing on the client based on the MQTT replica service. The target address is the Internet Protocol address of the target server, and the target server is a server whose resource utilization is less than a preset threshold and which has not configured the MQTT replica service.
Citation Information
Patent Citations
Internet of Things message service system
CN106534107A
MQTT protocol message security processing method and system based on trusted computing
CN116846614A