An extended MQ connection method based on proxy layer
By migrating certificate verification to the reverse proxy server nginx during the device registration process of the MQ message queue, and using the OpenResty platform to mount the proxy layer, the problems of traditional MQ's stability and slow authentication speed in high concurrency situations are solved, and more efficient inter-device communication and system maintenance are achieved.
Patent Information
- Application Number
- CN202210244587.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2042-03-14
AI Technical Summary
Traditional MQ message queues have problems such as poor stability and slow authentication speed in communication and data transmission between devices, especially in high concurrency situations, which can easily lead to system crashes and request failures.
Decoupling of certificate verification is achieved by migrating the certificate and private key verification of the API interface to the reverse proxy server nginx during the device registration process and splitting the parameter calls to the business message server EMQX. Use the OpenResty platform to carry the proxy layer, and integrate functions with third-party modules to achieve low-code processing and data flow support.
It improves the stability and concurrent processing capabilities of communication between devices, avoids system crashes and login failures, simplifies the operation process of MQ modification and registration of equipment, and improves the overall operating efficiency and maintenance convenience of the system.
Smart Images

Figure CN115250195B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer data processing, and its IPC classification number is G06F9 / 54, and in particular to an extended MQ connection method based on a proxy layer. Background Art
[0002] Traditional MQ message queues are used in Android devices such as mobile phones, platforms, and cash registers. When communicating and transmitting data with the API interface that receives messages, there are usually problems such as poor output transmission stability and slow authentication speed. It may even cause request failure and system crash due to instant traffic overload. By decoupling the modules, the data transmission association between modules is simplified, and the interface between device modules is indirectly called, the transmission load between modules can be better alleviated.
[0003] Patent CN202011589060 provides a system and method for dynamically changing the configuration of the reverse proxy server nginx based on Java. An API interface is established through a java application module to read and identify the configuration information of the reverse proxy server nginx, and to notify the supervision of updated data in the configuration information of the reverse proxy server nginx through a loop traversal.
[0004] Patent CN201810607070 provides an installation method, device, computer equipment and storage medium of nginx software, which improves the utilization rate of the reverse proxy server nginxx server and the speed of data processing by installing multiple reverse proxy server nginx software in the reverse proxy server nginx server.
[0005] However, the above patent does not involve the sending, receiving and communication problems between the reverse proxy server nginx and multiple devices, and cannot better solve the problem of information processing concurrency in practical applications. Therefore, it is urgent to introduce an extended MQ connection method based on the proxy layer. Summary of the invention
[0006] In response to the above-mentioned problems, the present invention provides an extended MQ (message queue) connection method based on the proxy layer, which specifically includes migrating the certificate and private key verification process of the API interface to the reverse proxy server nginx during the device registration process, and splitting the parameter call to the business message server EMQX, thereby realizing the decoupling operation of certificate verification during the device registration process.
[0007] Specifically, the reverse proxy server nginx, as a high-performance data transit processing server, can better alleviate the problem of high concurrency in the integration processing of multiple devices. By calling the API interfaces of multiple devices in the integration processing process, it can quickly verify the security of users and avoid system crashes and verification login failures caused by high throughput in parallel processing.
[0008] Preferably, the proxy layer establishes an OpenResty platform (ngx_openresty) platform to perform information interaction between the web (global wide area network) side and the reverse proxy server nginx during the device registration process.
[0009] Specifically, the OpenResty platform serves as a platform for the reverse proxy server nginx. It uses the Lua language to write and call programs. It integrates function libraries and third-party modules to quickly install required devices and implement corresponding functions, thereby realizing a low-code processing method.
[0010] Preferably, the OpenResty platform builds a stream (data stream) and combines it with the MQTT (Message Queuing Telemetry Transport) communication mode to support information sending and receiving and online and offline processing of clustered devices.
[0011] Preferably, the OpenResty platform transmits the device IP to the business message server EMQX (Erlang / Enterprise / Elastic MQTT Broker) through proxy and protocol instructions, and uses LUA script to store the device IP (Internet Protocol) and port certificate information into the redis module for application SSL authentication (SecureSockets Layer).
[0012] Preferably, in the stream data flow, stream.conf is established and the server certificate, client, jks (java key store), bks certificate and key are generated by configuring openssl instructions.
[0013] Preferably, the server certificate, client, jks, and bks certificates are stored in the ssl_certificate and ssl_certificate_key instructions of the reverse proxy server nginx for SSL one-way authentication.
[0014] Preferably, the one-way authentication performs a legality check of device registration through the cloud.
[0015] Specifically, the legitimacy verification is carried out by protecting the privacy and security of the device's security certificate and login key, and verifying the login protocol to avoid the leakage of personal privacy and the occurrence of network attacks. The legitimacy of device registration is verified through the cloud to improve data storage and processing capabilities and avoid login verification failures caused by limited data processing capabilities of the terminal server.
[0016] Preferably, the device registration specifically includes a certificate verification operation between the Android device and the Java server device.
[0017] Specifically, the Android device uses the SSL address and BKS certificate to connect to the reverse proxy server Nginx; the Java server uses the SSL address and JKS certificate to connect to the reverse proxy server Nginx.
[0018] Preferably, the decoupled operation of the certificate verification first calls the API interface of the device that needs to perform certificate verification, and transmits it to the reverse proxy server nginx through MQTT / SSL, and then transmits it to the business message server EMQX and redis (remote dictionary service) through the reverse proxy server nginx.
[0019] Preferably, the business message server EMQX communicates with the reverse proxy server nginx via an intranet, and at the same time, a non-encrypted method is used to increase the performance of the business message server EMQX component. The business message server EMQX communicates with the reverse proxy server nginx via an intranet, and at the same time, a non-encrypted method is used to increase the performance of the business message server EMQX component.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] Since traditional MQ and registration devices do not use reverse proxy server nginx and related verification, only certificate and hidden parameter verification are performed in the business message server EMQX. Based on the API interface certificate connection method, the present invention introduces a proxy layer based on the OpenResty platform. The proxy layer based on the OpenResty platform adopts a low-coupling design mode, so that when MQ is modified or additional registration devices are added, there is no need to modify the original registration devices and API interface certificates. The verification process is migrated to the reverse proxy server nginx, and the parameter verification is split to the business code server. In this way, the decoupling of device certificate verification is achieved, the operational procedures of MQ modification and registration device addition and deletion are simplified, the overall operation efficiency of the system is improved, and the later maintenance of the system is convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1Output a transmission flow chart for an extended MQ connection method based on the proxy layer. DETAILED DESCRIPTION
[0023] Embodiment 1:
[0024] The embodiment of the invention is a method for extending MQ connection based on proxy layer, such as Figure 1 As shown, the specific connection method is to first call the corresponding API interface of the login verification module in the Android device, and then transmit the API interface information to the reverse proxy server nginx through MQTT. A proxy layer based on the OpenResty platform is introduced in the reverse proxy server nginx. The proxy layer based on the OpenResty platform adopts a low-coupling design mode, so that when MQ is modified or additional registered devices are added, there is no need to modify the original registered devices. Due to the API interface certificate interface, the verification process is migrated to the reverse proxy server nginx, and the parameter verification is split into the business message server EMQX and redis, where redis is used to save the device IP information, device port information and device certificate information, and the business message server EMQX realizes the decoupling of device certificate verification.
[0025] Embodiment 2:
[0026] The extended MQ connection method based on the proxy layer described in this embodiment has the same specific implementation as Example 1, except that the Android device is replaced by a corresponding API interface that calls the login verification module in the Java server device to decouple the certificate verification during the device registration process.
Claims
1. An extended MQ connection method based on a proxy layer, characterized in that: Specifically, during the device registration process, the certificate and private key verification process of the API interface is migrated to the reverse proxy server nginx, and the parameter call is split to the business message server EMQX; The proxy layer establishes the OpenResty platform to perform information interaction between the web end and the reverse proxy server nginx during the device registration process; The OpenResty platform builds streams and combines them with the MQTT communication mode to support the information sending and receiving and online and offline processing of clustered devices; The OpenResty platform passes the device IP to the business message server EMQX through proxy and protocol instructions, and uses LUA script to store the device IP and port certificate information in the redis module for application SSL authentication; In the stream, create stream.conf and generate server certificate, client certificate, jks, bks certificate and key by configuring openssl instructions; Store the server certificate, client certificate, jks, and bks certificates in the ssl_certificate and ssl_certificate_key instructions of the reverse proxy server nginx for SSL one-way authentication; The one-way authentication is performed through the cloud to verify the legitimacy of device registration; The device registration specifically includes the certificate verification operation between the Android device and the Java server device; The certificate verification operation first calls the API interface of the device that needs to perform certificate verification, and transmits it to the reverse proxy server nginx through MQTT / SSL, and then transmits it to the business message server EMQX and redis through the reverse proxy server nginx.
Citation Information
Patent Citations
Installation method and device of Nginx software, computer equipment and storage medium
CN108920157A
A system and method for dynamically changing Nginx configuration based on Java
CN112506585B
Message transmission method and message transmission system
CN108494815A
System for requesting micro-service authentication optimization by upper application
CN112333201A
Client fingerprint extraction, identity recognition and network security detection method and device
CN113037746A