Server public network address monitoring method and system based on Internet of Things monitoring platform

By real-time monitoring and update of dynamic public network addresses on the Internet of Things monitoring platform, and forwarding new addresses to operation and maintenance personnel through WeChat open platform or MQTT protocol, the problem that operation and maintenance personnel cannot obtain new addresses in time after the server public network address changes is solved, ensuring that operation and maintenance personnel can manage the server in a timely manner.

CN119544670APending Publication Date: 2025-02-28PINGGAO GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411576493.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

After the public address of a server using a dynamic public network address is changed, the operation and maintenance personnel are unable to manage the server in time.

Method used

By obtaining the server's dynamic public network address every time a set period is achieved on the Internet of Things monitoring platform, comparing it in the cache and database, updating the public network address, and forwarding the new address to the operation and maintenance personnel through the WeChat open platform or the MQTT protocol.

Benefits of technology

It effectively solves the problem that operation and maintenance personnel cannot obtain new addresses in time after the server public network address changes, ensuring that operation and maintenance personnel can manage the server in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544670A_ABST
    Figure CN119544670A_ABST
Patent Text Reader

Abstract

The invention relates to a server public network address monitoring method and system based on an Internet of Things monitoring platform, and belongs to the field of public network address monitoring. According to the method, the dynamic public network address of the server is continuously obtained according to the set time interval, then the dynamic public network address is compared with the cache public network address in the cache, if the dynamic public network address is different from the cache public network address in the cache, the dynamic public network address is changed, and the cache public network address and the persistent public network address in the database are modified into the dynamic public network address. The dynamic public network address is forwarded to operation and maintenance personnel; and if the cache public network address does not exist in the cache, comparing the cache public network address with the persistent public network address, if the cache public network address is not the same as the persistent public network address, indicating that the dynamic public network address is changed, modifying the persistent public network address into the dynamic public network address, inserting the cache public network address which is the same as the dynamic public network address into the cache, and forwarding the dynamic public network address to operation and maintenance personnel. According to the invention, after the public network address of the server is changed, the changed public network address can be effectively sent to the operation and maintenance personnel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a server public network address monitoring method and system based on an Internet of Things monitoring platform, belonging to the field of public network address monitoring. Background Art

[0002] A public address, also known as a public IP (Internet Protocol) address or a globally unique address, is a unique identifier assigned by the Internet to a computer, server, or other network device. Currently, the number of static IPv4 addresses in widespread use is limited and the price is high. Since the rental fee of a dynamic public address is usually lower, for many companies, especially start-ups or companies with tight budgets, dynamic public addresses have become a cost-effective option for such companies.

[0003] However, servers using dynamic public network addresses will frequently change their public network addresses, and operation and maintenance personnel need to perform continuous testing to obtain the changed public network addresses in order to remotely manage the servers. Summary of the invention

[0004] The purpose of the present invention is to provide a server public network address monitoring method and system based on an Internet of Things monitoring platform, so as to solve the problem that operation and maintenance personnel cannot manage the server in time after the public network address of a server using a dynamic public network address is changed.

[0005] To achieve the above object, the solution of the present invention includes: The invention discloses a server public network address monitoring method based on an Internet of Things monitoring platform, comprising the following steps: obtaining a dynamic public network address of a server after a set time period, judging whether a cached public network address exists in a cache, and if so, judging whether the dynamic public network address is the same as the cached public network address; if not, modifying the cached public network address and a persistent public network address in a database into a dynamic public network address, and forwarding the dynamic public network address to an operation and maintenance personnel; and if not, judging whether the persistent public network address is the same as the dynamic public network address; if not, modifying the persistent public network address into a dynamic public network address, and inserting a cached public network address that is the same as the dynamic public network address into the cache, and then forwarding the dynamic public network address to the operation and maintenance personnel.

[0006] Furthermore, the dynamic public network address is forwarded to the operation and maintenance personnel by calling the API interface for pushing messages provided by the WeChat open platform.

[0007] Furthermore, an execution script is developed by using a crontab tool, and the execution script includes a program for executing to obtain a dynamic public network address of a server after each set time period.

[0008] Furthermore, after obtaining the dynamic public network address, the MQTT client in the server sends the dynamic public network address to the MQTT server in the Internet of Things monitoring platform.

[0009] Furthermore, the cache is Redis and the database is MySQL.

[0010] A server public network address monitoring system based on an Internet of Things monitoring platform comprises a processor, wherein the processor executes a computer program to implement the following steps: obtaining a dynamic public network address of a server after each set time period, determining whether a cached public network address exists in a cache, and if so, determining whether the dynamic public network address is identical to the cached public network address; if not, modifying the cached public network address and a persistent public network address in a database into a dynamic public network address, and forwarding the dynamic public network address to an operation and maintenance personnel; and if not, determining whether the persistent public network address is identical to the dynamic public network address; if not, modifying the persistent public network address into a dynamic public network address, inserting a cached public network address identical to the dynamic public network address into the cache, and then forwarding the dynamic public network address to the operation and maintenance personnel.

[0011] Furthermore, the dynamic public network address is forwarded to the operation and maintenance personnel by calling the API interface for pushing messages provided by the WeChat open platform.

[0012] Furthermore, an execution script is developed by using a crontab tool, and the execution script includes a program for executing to obtain a dynamic public network address of a server after each set time period.

[0013] Furthermore, after obtaining the dynamic public network address, the MQTT client in the server sends the dynamic public network address to the MQTT server in the Internet of Things monitoring platform.

[0014] Furthermore, the cache is Redis and the database is MySQL.

[0015] The beneficial effects of the present invention are as follows: the present invention is a pioneering invention, and the present invention continuously obtains the dynamic public network address of the server at a set time interval. For the sake of access speed, a cached public network address with the same value as the dynamic public network address will be stored in the cache, and then compared with the cached public network address in the cache. If they are not the same, it means that the dynamic public network address has changed, then the cached public network address and the persistent public network address in the database are modified to the dynamic public network address, and the dynamic public network address is forwarded to the operation and maintenance personnel; if there is no cached public network address in the cache, it is compared with the persistent public network address. If they are not the same, it means that the dynamic public network address has changed, then the persistent public network address is modified to the dynamic public network address, and the cached public network address with the same value as the dynamic public network address is inserted into the cache, and the dynamic public network address is forwarded to the operation and maintenance personnel. After the public network address of the server changes, the present invention can effectively send the changed public network address to the operation and maintenance personnel. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic diagram of an overall process of the present invention; Figure 2 It is a server processing logic schematic diagram of the present invention; Figure 3 It is a processing logic diagram of an Internet of Things monitoring platform of the present invention; Figure 4 It is a schematic diagram of WeChat open platform processing logic of the present invention. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0018] The idea of ​​the present invention is to compare the acquired dynamic public network address of the server with the public network address in the cache, and update it if they are inconsistent; if there is no public network address in the cache, compare it with the public network address in the database, and update it if they are inconsistent; and then send the dynamic public network address to the operation and maintenance personnel.

[0019] Method Example: This embodiment provides a server public network address monitoring method based on the Internet of Things monitoring platform. Figure 1As shown, since the public network address of the server changes dynamically, it is necessary to obtain the dynamic public network address of the server after a set time period, and then query whether the public network address exists in the cache. If so, the cached public network address in the cache is compared with the obtained dynamic public network address. If the comparison results are the same, no processing is performed. If the comparison results are different, the cached public network address in the cache and the persistent public network address in the database are updated, that is, they are changed to the obtained dynamic public network address, and then the obtained dynamic public network address is forwarded to the operation and maintenance personnel; if the cached public network address data does not exist in the cache, the persistent public network address stored in the database is read and compared with the obtained dynamic public network address. If the comparison results are the same, no processing is performed. If the comparison results are different, the persistent public network address in the database is updated, that is, it is changed to the obtained dynamic public network address, and the obtained dynamic public network address is inserted into the cache, and then the obtained dynamic public network address is forwarded to the operation and maintenance personnel. Among them, a persistent public network address is initialized in the database. The dynamic public network address, the cached public network address and the persistent public network address are all the public network addresses used by the server. If the public network address of the server has not changed, the dynamic public network address, the cached public network address and the persistent public network address are numerically the same. In order to distinguish the process, the present invention uses an alias for the public network address used by the server.

[0020] Furthermore, due to the popularity of WeChat, the present invention forwards the acquired dynamic public network address to the operation and maintenance personnel by calling the API interface for pushing messages provided by the WeChat open platform, so that the operation and maintenance personnel can be effectively notified.

[0021] Furthermore, in order to reduce manual involvement, the present invention develops an automatically executable script, which includes a program for executing to obtain the dynamic public network address of the server after each set time period.

[0022] Furthermore, after obtaining the dynamic public network address, the MQTT client in the server sends the dynamic public network address to the corresponding topic of the MQTT server in the Internet of Things monitoring platform. In this way, after the dynamic public network address is effectively sent to the MQTT server, the Internet of Things monitoring platform can obtain the dynamic public network address at any time by subscribing to the corresponding topic.

[0023] Furthermore, since Redis has high read and write efficiency, Redis is selected as the cache used in the present invention; since MySQL is good at persisting data, MySQL is selected as the database used in the present invention. It should be noted that the present invention does not limit the types of cache and database used, and corresponding selections can be made according to specific needs.

[0024] The process of the present invention is described in detail with a specific example below: like Figure 2 As shown, after the Linux server is started, the execution script developed by the crontab tool that can be used in the Linux environment is executed. In the execution script, after each set time period (for example, 30 seconds), a program developed based on the Python language is executed. The program obtains the dynamic public network address of the Linux server by calling the socket.gethostbyname(socket.gethostname()) method provided by the socket library. Then the MQTT Client (MQTT client) in the Linux server uploads the dynamic public network address of the Linux server to the MQTT Server (MQTT server) in the Internet of Things monitoring platform through the mqttClient.publish(topic, payload, qos) method. At this time, the Linux server completes the function of obtaining the dynamic public network address and uploading it to the Internet of Things monitoring platform. Among them, topic is the published topic " / pub / cn / ipaddress", payload is the published dynamic public network address, such as "39.98.**.**", and qos is the retransmission mechanism "0", which means sending a message once.

[0025] Furthermore, if Figure 3 As shown in the figure, the IoT monitoring platform receives the information published by the MQTT client in the Linux server through the MQTT server, and obtains the corresponding dynamic public network address from it. The IoT monitoring platform queries whether there is a cached public network address in Redis. If so, the dynamic public network address is compared with the cached public network address. If they are the same, it means that the public network address of the Linux server has not changed and no processing is performed. If they are different, it means that the public network address of the Linux server has changed. Then, the cached public network address and the persistent public network address in Redis and MySQL are updated respectively, that is, the value of the cached public network address and the value of the persistent public network address are changed to the value of the dynamic public network address, and then the dynamic public network address is sent to the WeChat Open Platform by calling the robot interface provided by the WeChat Open Platform; if the cached public network address does not exist in Redis, the persistent public network address in MySQL is queried, and the persistent public network address is compared with the dynamic public network address. If they are the same, it means that the public network address of the Linux server has not changed and no processing is performed. If they are different, it means that the public network address of the Linux server has changed, then the dynamic public network address is inserted into Redis and the persistent public network address in MySQL is updated, that is, the value of the persistent public network address is changed to the value of the dynamic public network address, and then the dynamic public network address is sent to the WeChat Open Platform by calling the robot interface provided by the WeChat Open Platform.

[0026] Furthermore, if Figure 4As shown, after the WeChat open platform receives the notification containing the dynamic public network address from the IoT monitoring platform, it calls the WeChat group interface to send an alarm notification of the change of the public network address including the dynamic public network address to all operation and maintenance personnel in the WeChat group.

[0027] System Example: This embodiment provides a server public network address monitoring system based on an Internet of Things monitoring platform. The system includes a processor for executing a computer program. The computer program is designed using the server public network address monitoring method based on an Internet of Things monitoring platform as described in the method embodiment. Since the introduction to the method is clear enough, it will not be repeated here.

[0028] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A server public network address monitoring method based on an Internet of Things monitoring platform, characterized in that: The method comprises the following steps: obtaining a dynamic public network address of a server after each set time period, judging whether a cached public network address exists in a cache, and if so, judging whether the dynamic public network address is the same as the cached public network address; if not, modifying the cached public network address and a persistent public network address in a database into a dynamic public network address, and forwarding the dynamic public network address to an operation and maintenance personnel; and if not, judging whether the persistent public network address is the same as the dynamic public network address; if not, modifying the persistent public network address into a dynamic public network address, and inserting a cached public network address that is the same as the dynamic public network address into the cache, and then forwarding the dynamic public network address to the operation and maintenance personnel.

2. The server public network address monitoring method based on the Internet of Things monitoring platform according to claim 1 is characterized in that: The dynamic public network address is forwarded to the operation and maintenance personnel by calling the API interface for pushing messages provided by the WeChat open platform.

3. The server public network address monitoring method based on the Internet of Things monitoring platform according to claim 1 is characterized in that: An execution script is developed by using a crontab tool, wherein the execution script includes a program for executing to obtain a dynamic public network address of a server after each set time period.

4. The server public network address monitoring method based on the Internet of Things monitoring platform according to claim 1 is characterized in that: After obtaining the dynamic public network address, the MQTT client in the server sends the dynamic public network address to the MQTT server in the Internet of Things monitoring platform.

5. The server public network address monitoring method based on the Internet of Things monitoring platform according to claim 1 is characterized in that: The cache is Redis and the database is MySQL.

6. A server public network address monitoring system based on an Internet of Things monitoring platform, comprising a processor, characterized in that: The processor executes a computer program to implement the following steps: obtaining a dynamic public network address of the server after each set time period, determining whether a cached public network address exists in the cache, and if so, determining whether the dynamic public network address is the same as the cached public network address; if not, modifying the cached public network address and the persistent public network address in the database to the dynamic public network address, and forwarding the dynamic public network address to an operation and maintenance personnel; if not, determining whether the persistent public network address is the same as the dynamic public network address; if not, modifying the persistent public network address to the dynamic public network address, and inserting a cached public network address that is the same as the dynamic public network address into the cache, and then forwarding the dynamic public network address to the operation and maintenance personnel.

7. The server public network address monitoring system based on the Internet of Things monitoring platform according to claim 6 is characterized in that: The dynamic public network address is forwarded to the operation and maintenance personnel by calling the API interface for pushing messages provided by the WeChat open platform.

8. The server public network address monitoring system based on the Internet of Things monitoring platform according to claim 6 is characterized in that: An execution script is developed by using a crontab tool, wherein the execution script includes a program for executing to obtain a dynamic public network address of a server after each set time period.

9. The server public network address monitoring system based on the Internet of Things monitoring platform according to claim 6 is characterized in that: After obtaining the dynamic public network address, the MQTT client in the server sends the dynamic public network address to the MQTT server in the Internet of Things monitoring platform.

10. The server public network address monitoring system based on the Internet of Things monitoring platform according to claim 6 is characterized in that: The cache is Redis and the database is MySQL.