A remote upgrade method and system for power meters based on intranet penetration technology
Through intranet penetration technology and FRP tools, a port mapping between local PC and remote gateway is established, and the instrument upgrade web page is provided, which solves the high risk and high cost problems of traditional power meters upgrades, and realizes a visual and transparent remote upgrade process.
Patent Information
- Application Number
- CN202211334635.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-10-28
AI Technical Summary
The traditional power meter upgrade method has high risks and high costs, and the traditional remote upgrade method lacks visualization and transparency, which makes it impossible for users to determine the status of the upgrade success.
The power instrument remote upgrade method based on intranet penetration technology is adopted, and the port mapping is implemented using the open source intranet penetration tool FRP, and the connection is established through MQTT threads and cloud servers, and the intranet penetration between the local PC client and the remote gateway is established. The instrument upgrade web page is provided to achieve visualization and transparent upgrades.
The visual and transparent upgrade of power meters has been achieved, which reduces the cost of manual upgrades, and improves the upgrade success rate and user experience.
Smart Images

Figure CN115913942B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent Internet of Things devices, and in particular to a method and system for remotely upgrading an electric power meter based on intranet penetration technology. Background Art
[0002] In the power system, a large number of power measuring instruments are used every year in the measurement, monitoring, control and regulation of primary electrical equipment such as generators, motors, transformers, circuit breakers and power cables, so as to adopt effective monitoring, analysis and diagnostic technologies, timely and accurately grasp the various operating conditions of primary electrical equipment, and thus ensure the normal operation of the power system. However, some power meters need software upgrades under specific circumstances. The traditional upgrade method is that engineers take computers to the site to upgrade the instruments, but this upgrade method requires wiring to the computer, which is particularly dangerous in an already operating power system, and power outages have particularly large restrictions. At the same time, because the instruments are relatively scattered, there is a large upgrade cost. Therefore, some remote upgrade systems for instruments have gradually appeared on the market. The general process:
[0003] 1. Place the upgrade package in the cloud server.
[0004] 2. The gateway establishes a long TCP connection with the cloud server to detect whether there is a new version.
[0005] 3. If there is a new version, the gateway downloads the upgrade package from the cloud server.
[0006] 4. The gateway sends the upgrade package to the instrument for upgrade.
[0007] The entire upgrade process is intelligent and requires no user interaction. However, this lacks visualization and carries significant upgrade risks. Users cannot determine whether the upgrade was successful or what the status of a failed upgrade is. This is unacceptable in power systems, leading engineers to often choose this upgrade method over on-site upgrades. Therefore, a visual and transparent upgrade method and system is urgently needed to address this issue. Summary of the Invention
[0008] In view of the problems and shortcomings of the prior art, the present invention provides a method and system for remote upgrading of electric power meters based on intranet penetration technology.
[0009] The present invention solves the above technical problems through the following technical solutions:
[0010] The present invention provides a method for remotely upgrading an electric power meter based on intranet penetration technology, which is characterized in that it includes the following steps:
[0011] S1. When the power meter needs to be upgraded, the remote gateway corresponding to the power meter sends a registration package containing the gateway serial number to the cloud server through the MQTT thread;
[0012] S2. The cloud server registers after receiving the registration package through the built-in MQTT server and records the gateway serial number and online status of the remote gateway;
[0013] S3. The local PC client obtains the gateway serial number and online status of the registered remote gateway from the cloud server through the MQTT thread.
[0014] S4. The local PC client sends a message to the remote gateway to start frp and runs the frpc program stored on it. The server runs the frps program and maps the port of the local PC client to the public network port of the cloud server.
[0015] S5. After receiving the topic message of starting frp from the local PC client, the remote gateway runs the frpc program stored in itself, and the server runs the frps program to map the port of the remote gateway to the public network port of the cloud server;
[0016] S6. The meter upgrade webpage built into the remote gateway obtains upgrade information of the power meter through the upgrade API;
[0017] S7. The local PC client accesses the meter upgrade webpage in the remote gateway through the mapped port to view the upgrade information of the power meter.
[0018] Preferably, in step S1, the remote gateway initializes global information: reads the configuration file of the remote gateway, obtains the port information of the remote gateway and the power meter information under the port, the remote gateway starts the MQTT thread to interact with the cloud server and the local PC client for data, and the remote gateway starts the webserver thread to provide an upgrade API for the meter upgrade webpage built into the remote gateway.
[0019] Preferably, in step S1, the remote gateway initializes MQTT configuration information;
[0020] The remote gateway sets a will subject message so as to send an offline message to the cloud server after the remote gateway goes offline;
[0021] The remote gateway connects to the MQTT server built into the cloud server through the MQTT thread. If the connection fails, it sleeps for 60 seconds and reconnects. If the connection is successful, it subscribes to the topic.
[0022] The remote gateway sends a registration package containing the gateway serial number to the cloud server through the MQTT thread;
[0023] The remote gateway determines whether the registration is successful. If the registration fails, it sleeps for 60 seconds and re-registers. If the registration is successful, it pushes the gateway status to the cloud server. The gateway status includes the gateway upgrade status and the gateway frp client status. The gateway upgrade status includes the unupgraded status, the upgrading status, and the upgraded status. The gateway frp client status includes the frp client started status and the frp client not started status.
[0024] Each time the gateway status of the remote gateway changes, the changed gateway status is pushed to the cloud server.
[0025] In step S5, after the remote gateway receives the subject message for starting frp from the local PC client, it extracts the cloud server IP and mapping port information from the subject message, rewrites the configuration file of the frpc program, and then runs the frpc program stored in itself (frp client program). Through the frpc program, it registers the accessible port of the gateway and the key used to verify the connection of the local PC client to the gateway with the cloud server. The server runs the frps program to map the port of the remote gateway to the public network port of the cloud server. At the same time, the remote gateway monitors the frpc program in real time and restarts the frpc program if the program is abnormal.
[0026] Preferably, in step S2, the cloud server reads the configuration file, connects to the MQTT server according to the configuration information, and then subscribes to the topic. The cloud server registers after receiving the registration package through the built-in MQTT server, and records the gateway serial number and online status of the remote gateway;
[0027] In the entire method process, when the cloud server receives the gateway status pushed by the remote gateway, it updates the gateway status of the remote gateway.
[0028] Preferably, in step S3, the local PC client connects to the MQTT server built into the cloud server. If the connection fails, it sleeps for 60 seconds and reconnects. If the connection is successful, it subscribes to the topic.
[0029] The local PC client obtains the gateway serial number and online status of the registered remote gateway from the cloud server through the MQTT thread;
[0030] After verifying the account and password of the local PC client, the cloud server sends the gateway serial number and online status of the remote gateway to the local PC client;
[0031] In step S7, the local PC client sends a topic for starting intranet penetration to the remote gateway via the MQTT thread;
[0032] The local PC client receives the key returned by the remote gateway and uses it to rewrite its own stored frpc configuration file, start the frpc program, and establish intranet penetration from the local PC client to the remote gateway. After the intranet penetration is successfully established, the local PC client can access the instrument upgrade webpage in the remote gateway.
[0033] Preferably, an upgrade button and an operation button are displayed on the meter upgrade webpage. The upgrade button includes a one-click upgrade button, a batch upgrade button, and a broadcast upgrade button. After clicking the upgrade button, the upgrade firmware is imported. After the import is successful, the power meter upgrade operation will be performed and the upgrade progress will be displayed in real time. The operation button includes function buttons for debugging such as entering IAP, entering APP, and obtaining version number;
[0034] After the meter upgrade webpage issues the upgrade command, the upgrade program of the remote gateway performs the upgrade according to the port information, device information, and upgrade file in the command: the upgrade program first obtains the port of the power meter to be upgraded, then issues the IAP instruction, then reads the upgrade file and sends it to the power meter to be upgraded one by one in separate packages. After the upgrade is completed, it enters the APP and finally obtains the version number for upgrade verification. At the same time, the meter upgrade webpage obtains power meter information in real time, including the current status of the power meter and upgrade progress information.
[0035] The present invention also provides a power meter remote upgrade system based on intranet penetration technology, which is characterized in that it includes multiple remote gateways, cloud servers and local PC clients;
[0036] The remote gateway corresponding to the power meter that needs to be upgraded is used to send a registration package containing the gateway serial number to the cloud server through the MQTT thread;
[0037] The cloud server is used to register after receiving the registration package through the built-in MQTT server, and record the gateway serial number and online status of the remote gateway;
[0038] The local PC client is used to obtain the gateway serial number and online status of the registered remote gateway from the cloud server through the MQTT thread;
[0039] The local PC client is used to send a topic message to start frp to the remote gateway and run the frpc program stored in itself. The server is used to run the frps program and map the port of the local PC client to the public network port of the cloud server.
[0040] The remote gateway is used to run the frpc program stored in itself after receiving the topic message of starting frp from the local PC client. The server is used to run the frps program and map the port of the remote gateway to the public network port of the cloud server.
[0041] The meter upgrade webpage built into the remote gateway is used to obtain upgrade information of the power meter through the upgrade API;
[0042] The local PC client is used to access the meter upgrade webpage in the remote gateway through the mapped port to view the upgrade information of the power meter.
[0043] Preferably, the remote gateway is used to initialize MQTT configuration information;
[0044] The remote gateway is used to set a will subject message so that an offline message is sent to the cloud server after the remote gateway goes offline;
[0045] The remote gateway is used to connect to the MQTT server built into the cloud server through the MQTT thread. If the connection fails, it will sleep for 60 seconds and reconnect. If the connection is successful, it will subscribe to the topic.
[0046] The remote gateway is used to send a registration package containing the gateway serial number to the cloud server through the MQTT thread;
[0047] The remote gateway is used to determine whether the registration is successful. If the registration fails, it will sleep for 60 seconds and re-register. If the registration is successful, it will push the gateway status to the cloud server. The gateway status includes the gateway upgrade status and the gateway frp client status. The gateway upgrade status includes the unupgraded status, the upgrading status, and the upgraded status. The gateway frp client status includes the frp client started status and the frp client not started status.
[0048] The remote gateway is used to push the changed gateway status to the cloud server every time the gateway status changes;
[0049] The remote gateway is used to extract the cloud server IP and mapping port information from the subject message after receiving the frp startup subject message sent by the local PC client, rewrite the configuration file of the frpc program, and then run the frpc program (frp client program) stored in itself. Through the frpc program, the gateway's accessible port and the key used to verify the local PC client's connection to the gateway are registered with the cloud server. The server is used to run the frps program and map the remote gateway's port to the cloud server's public network port. At the same time, the remote gateway monitors the frpc program in real time and restarts the frpc program if the program is abnormal.
[0050] Preferably, the cloud server is used to read the configuration file, connect to the MQTT server according to the configuration information, and then subscribe to the topic. The cloud server is used to register after receiving the registration package through the built-in MQTT server, and record the gateway serial number and online status of the remote gateway;
[0051] The cloud server is used to update the gateway status of the remote gateway when receiving the gateway status pushed by the remote gateway.
[0052] Preferably, the local PC client is used to connect to the MQTT server built into the cloud server. If the connection fails, it sleeps for 60 seconds and reconnects. If the connection is successful, it subscribes to the topic.
[0053] The local PC client is used to obtain the gateway serial number and online status of the registered remote gateway from the cloud server through the MQTT thread;
[0054] The cloud server verifies the account and password of the local PC client and sends the gateway serial number and online status of the remote gateway to the local PC client;
[0055] The local PC client is used to send a topic to start intranet penetration to the remote gateway through the MQTT thread;
[0056] The local PC client receives the key returned by the remote gateway, rewrites its own stored frpc configuration file, starts the frpc program, and establishes intranet penetration from the local PC client to the remote gateway. After the intranet penetration is successfully established, the local PC client can access the instrument upgrade webpage in the remote gateway.
[0057] On the basis of conforming to the common sense in this field, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present invention.
[0058] In response to the high cost of manual upgrades of power meters and the high risks of traditional remote upgrade methods, the present invention proposes a remote upgrade method and system for power meters based on intranet penetration technology. The present invention uses the open source intranet penetration tool frp to achieve intranet penetration. frp is a high-performance reverse proxy application focused on intranet penetration. It supports multiple protocols such as TCP, UDP, HTTP, HTTPS, and can expose intranet services to the public network in a safe and convenient manner through a transit with a public network IP node. The intranet penetration technology is used to map the gateway port to the cloud server port, and then map the local computer port to the cloud server port to achieve mapping of the local PC port to the remote gateway port. The local PC accesses the meter upgrade webpage embedded in the gateway through this port, realizing visualization and transparency of the meter upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a structural diagram of the remote upgrade system for power meters of the present invention.
[0060] Figure 2 This is a main thread flow chart of the remote gateway upgrade program of the present invention.
[0061] Figure 3This is a flowchart of the MQTT thread of the remote gateway upgrade program of the present invention.
[0062] Figure 4 This is a workflow diagram of the cloud server of the present invention.
[0063] Figure 5 This is a flowchart of the local PC client workflow of the present invention.
[0064] Figure 6 This is a diagram of the local PC client gateway status interface of the present invention.
[0065] Figure 7 This is the configuration interface diagram of the local PC client frp of the present invention.
[0066] Figure 8 This is a port information interface diagram of the built-in instrument upgrade webpage of the remote gateway of the present invention.
[0067] Figure 9 This is a diagram of the upgrade interface of the built-in instrument upgrade webpage of the remote gateway of the present invention. DETAILED DESCRIPTION
[0068] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying 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 of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0069] See also Figure 1 This embodiment provides a remote upgrade system for power meters based on intranet penetration technology, including a local PC client, a cloud server, and multiple remote gateways. During normal operation, the remote gateways interact with the power meters, collect and aggregate power data, and then send the data to the cloud server or data center.
[0070] A remote power meter upgrade method based on intranet penetration technology includes the following steps: When a power meter needs to be upgraded, the meter's corresponding remote gateway runs an upgrade program. This upgrade program sends a registration package containing the gateway's serial number to a cloud server via an MQTT (Message Queuing Telemetry Transport) thread. The cloud server registers the registration package via its built-in MQTT server and records the remote gateway's serial number and online status. A local PC client obtains the registered remote gateway's serial number and online status from the cloud server via an MQTT thread. The local PC client sends a message to the remote gateway requesting to start FRP and runs its own stored frpc program. The server then runs the frps program and maps the local PC client's port to the cloud server's public network port. After receiving the message to start FRP from the local PC client, the remote gateway runs its own stored frpc program. The server then runs the frps program and maps the remote gateway's port to the cloud server's public network port. This establishes a mapping between the local PC client's port and the remote gateway's port. The remote gateway's upgrade program also runs a webserver thread, providing an API (Application Programming Interface) for the gateway's built-in upgrade webpage. The meter upgrade webpage on the remote gateway uses the API to obtain meter upgrade information. The local PC client accesses the meter upgrade webpage on the remote gateway through a mapped port to view meter upgrade information.
[0071] See also Figure 2 Figure 2 shows the main thread flow of the remote gateway upgrade program. The program first initializes global information, reads the remote gateway configuration file, obtains the remote gateway's port information and the power meter information associated with the port, and stores and tags the meter information to facilitate subsequent upgrades and maintenance. The remote gateway also starts an MQTT thread to exchange data with the cloud server and local PC client. It also starts a webserver thread to provide an upgrade API for the meter upgrade webpage built into the remote gateway.
[0072] See also Figure 3The following is a flowchart of the MQTT thread in the remote gateway upgrade process. This thread is used to exchange data with the cloud server and the local PC client. During runtime, the remote gateway first initializes its MQTT configuration information, including its IP address, port number, account number, and password. It also sets a will topic message to send a disconnection message to the cloud server if the remote gateway loses connection. The remote gateway then connects to the cloud server's built-in MQTT server via the MQTT thread. If the connection fails, it sleeps for 60 seconds and then reconnects. If the connection is successful, it subscribes to the topic. The remote gateway then sends a registration packet containing the gateway serial number to the cloud server via the MQTT thread. The remote gateway determines whether registration is successful. If registration fails, it sleeps for 60 seconds and then reregisters. If registration is successful, it pushes the gateway status to the cloud server. The gateway status includes the gateway upgrade status (not upgraded, upgrading, and successful) and the gateway FRP client status (FRP client started and not started). The gateway status is then pushed to the cloud server. The gateway status is subsequently pushed to the cloud server every time the remote gateway status changes. Finally, it waits for the local PC client to send a topic message to start or stop frp. After receiving the topic message to start frp from the local PC client, the remote gateway extracts the cloud server IP and mapped port information from the topic message, rewrites the frpc program configuration file, and then runs the frpc program stored in its own storage (frp client program). Through the frpc program, it registers the gateway's accessible port and the key used to verify the local PC client's connection to the gateway with the cloud server. The server runs the frps program, mapping the remote gateway's port to the cloud server's public network port. At the same time, the remote gateway monitors the frpc program in real time and restarts the frpc program if the program is abnormal.
[0073] See also Figure 4 , which is a workflow diagram for the cloud server. The program design in the cloud server is divided into two parts. The first part is used to connect to the MQTT server for data exchange with the gateway and the local PC client. When the program runs, it first reads the configuration file, then connects to the MQTT server according to the configuration information, and then subscribes to the topic. After receiving the registration package through the built-in MQTT server, the cloud server registers and records the gateway serial number and online status of the remote gateway. When the cloud server receives the gateway status pushed by the remote gateway, it updates the gateway status of the remote gateway. At the same time, when it receives the topic of obtaining gateway information from the local PC client, it sends the information to the local PC client.
[0074] The second part is to start the frps program, which is the server program of frp. Through this program, the gateway registered port is mapped to the server port. At the same time, when other frp clients (such as local PC clients) connect to the gateway, they first verify the key. Only when the key is correct can the connection between the client and the gateway be established.
[0075] See also Figure 5 , is the workflow diagram of the local PC client. The local PC client connects to the MQTT server built into the cloud server. If the connection fails, it sleeps for 60 seconds and reconnects. If the connection is successful, it subscribes to the topic. Then the local PC client obtains the gateway serial number and online status of the remote gateway after registration from the cloud server through the MQTT thread. After the cloud server verifies the account and password of the local PC client, it sends the gateway serial number and online status of the remote gateway to the local PC client. Figure 6 As shown, the client can view the serial number and online and offline status of the gateway. Click on the online gateway to enter Figure 7 When intranet penetration is required, the local PC client first sends a topic to the remote gateway via the MQTT thread to start intranet penetration. The local PC client receives the key returned by the remote gateway and uses it to rewrite its own stored frpc configuration file, start the frpc program, and establish intranet penetration from the local PC client to the remote gateway. After the intranet penetration is successfully established, the local PC client can access the instrument upgrade webpage in the remote gateway through the browser.
[0076] See also Figure 8 and Figure 9 This is the meter upgrade webpage embedded in the remote gateway. After logging in with your username and password, the meter upgrade webpage displays the remote gateway's port information. Based on this port information, the remote gateway's upgrade program retrieves device information related to the port, such as ID, name, address, and status. The meter upgrade webpage also displays upgrade and operation buttons. These include one-click upgrade, batch upgrade, and broadcast upgrade. Clicking an upgrade button imports the upgrade firmware. Once successfully imported, the power meter upgrade begins, displaying the upgrade progress in real time. Operation buttons include debugging buttons such as Enter IAP, Enter App, and Get Version Number. After the upgrade command is issued from the meter upgrade webpage, the remote gateway's upgrade program performs the upgrade based on the port information, device information, and upgrade file contained in the command. The upgrade program first obtains the port of the power meter to be upgraded, then issues an Enter IAP command. It then reads the upgrade file and sends it to each meter individually. After the upgrade is complete, it enters the app. Finally, it retrieves the version number for upgrade verification. The meter upgrade webpage also retrieves real-time information about the power meter, including its current status and upgrade progress.
[0077] Although specific embodiments of the present invention have been described above, those skilled in the art will appreciate that these are merely illustrative and that the scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, and such changes and modifications are intended to fall within the scope of the present invention.
Claims
1. A remote upgrade method for power meters based on intranet penetration technology, characterized in that: It includes the following steps: S1. When the power meter needs to be upgraded, the remote gateway corresponding to the power meter sends a registration package containing the gateway serial number to the cloud server through the MQTT thread; S2. The cloud server registers after receiving the registration package through the built-in MQTT server and records the gateway serial number and online status of the remote gateway; S3. The local PC client obtains the gateway serial number and online status of the registered remote gateway from the cloud server through the MQTT thread. S4. The local PC client sends a message to the remote gateway to start frp and runs the frpc program stored on it. The server runs the frps program and maps the port of the local PC client to the public network port of the cloud server. S5. After receiving the topic message of starting frp from the local PC client, the remote gateway runs the frpc program stored in itself, and the server runs the frps program to map the port of the remote gateway to the public network port of the cloud server; S6. The meter upgrade webpage built into the remote gateway obtains upgrade information of the power meter through the upgrade API; S7. The local PC client accesses the meter upgrade webpage in the remote gateway through the mapped port to view the upgrade information of the power meter.
2. The method for remotely upgrading a power meter based on intranet penetration technology according to claim 1, characterized in that: In step S1, the remote gateway initializes global information: reads the configuration file of the remote gateway, obtains the port information of the remote gateway and the power meter information under the port, and starts the MQTT thread to interact with the cloud server and the local PC client for data. The remote gateway starts the webserver thread to provide an upgrade API for the meter upgrade webpage built into the remote gateway.
3. The method for remotely upgrading a power meter based on intranet penetration technology according to claim 1, characterized in that: In step S1, the remote gateway initializes MQTT configuration information; The remote gateway sets a will subject message so as to send an offline message to the cloud server after the remote gateway goes offline; The remote gateway connects to the MQTT server built into the cloud server through the MQTT thread. If the connection fails, it sleeps for 60 seconds and reconnects. If the connection is successful, it subscribes to the topic. The remote gateway sends a registration package containing the gateway serial number to the cloud server through the MQTT thread; The remote gateway determines whether the registration is successful. If the registration fails, it sleeps for 60 seconds and re-registers. If the registration is successful, it pushes the gateway status to the cloud server. The gateway status includes the gateway upgrade status and the gateway frp client status. The gateway upgrade status includes the unupgraded status, the upgrading status, and the upgraded status. The gateway frp client status includes the frp client started status and the frp client not started status. Each time the gateway status of the remote gateway changes, the changed gateway status is pushed to the cloud server. In step S5, after the remote gateway receives the subject message for starting frp from the local PC client, it extracts the cloud server IP and mapping port information from the subject message, rewrites the configuration file of the frpc program, and then runs the frpc program stored in itself. Through the frpc program, it registers the accessible port of the gateway and the key used to verify the connection of the local PC client to the gateway with the cloud server. The server runs the frps program to map the port of the remote gateway to the public network port of the cloud server. At the same time, the remote gateway monitors the frpc program in real time and restarts the frpc program if the program is abnormal.
4. The method for remotely upgrading a power meter based on intranet penetration technology according to claim 3 is characterized in that: In step S2, the cloud server reads the configuration file, connects to the MQTT server according to the configuration information, and then subscribes to the topic. After receiving the registration package through the built-in MQTT server, the cloud server registers and records the gateway serial number and online status of the remote gateway. In the entire method process, when the cloud server receives the gateway status pushed by the remote gateway, it updates the gateway status of the remote gateway.
5. The method for remotely upgrading a power meter based on intranet penetration technology according to claim 3 is characterized in that: In step S3, the local PC client connects to the MQTT server built into the cloud server. If the connection fails, it sleeps for 60 seconds and reconnects. If the connection is successful, it subscribes to the topic. The local PC client obtains the gateway serial number and online status of the registered remote gateway from the cloud server through the MQTT thread; After verifying the account and password of the local PC client, the cloud server sends the gateway serial number and online status of the remote gateway to the local PC client; In step S7, the local PC client sends a topic for starting intranet penetration to the remote gateway via the MQTT thread; The local PC client receives the key returned by the remote gateway and uses it to rewrite its own stored frpc configuration file, start the frpc program, and establish intranet penetration from the local PC client to the remote gateway. After the intranet penetration is successfully established, the local PC client can access the instrument upgrade webpage in the remote gateway.
6. The method for remotely upgrading a power meter based on intranet penetration technology according to claim 1, characterized in that: The meter upgrade webpage displays upgrade buttons and operation buttons. The upgrade buttons include one-click upgrade button, batch upgrade button, and broadcast upgrade button. After clicking the upgrade button, the upgrade firmware is imported. After the import is successful, the power meter upgrade operation will be carried out and the upgrade progress will be displayed in real time. The operation buttons include entering IAP, entering APP, and obtaining the version number, as well as function buttons for debugging. After the meter upgrade webpage issues the upgrade command, the upgrade program of the remote gateway performs the upgrade according to the port information, device information, and upgrade file in the command: the upgrade program first obtains the port of the power meter to be upgraded, then issues the IAP instruction, then reads the upgrade file and sends it to the power meter to be upgraded one by one in separate packages. After the upgrade is completed, it enters the APP and finally obtains the version number for upgrade verification. At the same time, the meter upgrade webpage obtains power meter information in real time, including the current status of the power meter and upgrade progress information.
7. A remote upgrade system for electric meters based on intranet penetration technology, characterized in that: It includes multiple remote gateways, cloud servers and local PC clients; The remote gateway corresponding to the power meter that needs to be upgraded is used to send a registration package containing the gateway serial number to the cloud server through the MQTT thread; The cloud server is used to register after receiving the registration package through the built-in MQTT server, and record the gateway serial number and online status of the remote gateway; The local PC client is used to obtain the gateway serial number and online status of the registered remote gateway from the cloud server through the MQTT thread; The local PC client is used to send a topic message to start frp to the remote gateway and run the frpc program stored in itself. The server is used to run the frps program and map the port of the local PC client to the public network port of the cloud server. The remote gateway is used to run the frpc program stored in itself after receiving the topic message of starting frp from the local PC client. The server is used to run the frps program and map the port of the remote gateway to the public network port of the cloud server. The meter upgrade webpage built into the remote gateway is used to obtain upgrade information of the power meter through the upgrade API; The local PC client is used to access the meter upgrade webpage in the remote gateway through the mapped port to view the upgrade information of the power meter.
8. The power meter remote upgrade system based on intranet penetration technology according to claim 7 is characterized in that: The remote gateway is used to initialize MQTT configuration information; The remote gateway is used to set a will subject message so that an offline message is sent to the cloud server after the remote gateway goes offline; The remote gateway is used to connect to the MQTT server built into the cloud server through the MQTT thread. If the connection fails, it will sleep for 60 seconds and reconnect. If the connection is successful, it will subscribe to the topic. The remote gateway is used to send a registration package containing the gateway serial number to the cloud server through the MQTT thread; The remote gateway is used to determine whether the registration is successful. If the registration fails, it will sleep for 60 seconds and re-register. If the registration is successful, the gateway status will be pushed to the cloud server. The gateway status includes the gateway upgrade status and the gateway frp client status. The gateway upgrade status includes the unupgraded status, the upgrading status, and the upgraded status. The gateway frp client status includes the frp client started status and the frp client not started status. The remote gateway is used to push the changed gateway status to the cloud server every time the gateway status changes; The remote gateway is used to extract the cloud server IP and mapping port information from the subject message after receiving the frp startup subject message sent by the local PC client, rewrite the configuration file of the frpc program, and then run the frpc program stored in itself. Through the frpc program, the gateway's accessible port and the key used to verify the local PC client's connection to the gateway are registered with the cloud server. The server is used to run the frps program and map the remote gateway's port to the cloud server's public network port. At the same time, the remote gateway monitors the frpc program in real time and restarts the frpc program if the program is abnormal.
9. The power meter remote upgrade system based on intranet penetration technology according to claim 8 is characterized in that: The cloud server is used to read the configuration file, connect to the MQTT server according to the configuration information, and then subscribe to the topic. The cloud server is used to register after receiving the registration package through the built-in MQTT server and record the gateway serial number and online status of the remote gateway; The cloud server is used to update the gateway status of the remote gateway when receiving the gateway status pushed by the remote gateway.
10. The power meter remote upgrade system based on intranet penetration technology according to claim 8, characterized in that: The local PC client is used to connect to the MQTT server built into the cloud server. If the connection fails, it will sleep for 60 seconds and reconnect. If the connection is successful, it will subscribe to the topic. The local PC client is used to obtain the gateway serial number and online status of the registered remote gateway from the cloud server through the MQTT thread; The cloud server verifies the account and password of the local PC client and sends the gateway serial number and online status of the remote gateway to the local PC client; The local PC client is used to send a topic to start intranet penetration to the remote gateway through the MQTT thread; The local PC client receives the key returned by the remote gateway, rewrites its own stored frpc configuration file, starts the frpc program, and establishes intranet penetration from the local PC client to the remote gateway. After the intranet penetration is successfully established, the local PC client can access the instrument upgrade webpage in the remote gateway.
Citation Information
Patent Citations
Method and system for upgrading equipment through IOT adapter, and IOT adapter
CN107222553A
Router gateway equipment management method and system based on MQTT
CN114938329A