Multi-module upgrading method, system and device of Internet of Things electric energy meter and storage medium

Through the collaborative work of IoT cloud main site, IoT APP, Mosquito server and module upgrade APP, the problem of low efficiency and high cost of upgrading modules of IoT power meter function is solved, and efficient, safe and convenient multi-mode is achieved Group upgrade reduces the risk of upgrade failure.

CN119002954APending Publication Date: 2024-11-22CSG SMART SCI&TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410975795.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

The upgrade method of the existing IoT meter functional module is inefficient and costly, and there is a risk of upgrade failure, resulting in unsafe upgrade and low success rate.

Method used

Using IoT cloud main site, IoT APP, Mosquito server and module upgrade APP to work together, through 4G network broadcast upgrade package, use the forwarding function of Mosquito server and the full-time module upgrade APP for unified management, and find out the firmware program The difference is upgraded to reduce manual operation and improve efficiency and safety.

Benefits of technology

It realizes the efficient, safe, convenient and low-cost multi-module upgrade of the IoT power meter functional module, reducing the risk of upgrade failure, improving the upgrade success rate, and reducing the amount of manual operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119002954A_ABST
    Figure CN119002954A_ABST
Patent Text Reader

Abstract

According to the multi-module upgrading method, system and device of the Internet of Things electric energy meter and the storage medium, a special module upgrading APP is designed through the forwarding function of the internal Mosquiito server and is responsible for unified upgrading management work on all the function modules, the Internet of Things cloud master station and the Internet of Things APP do not need to pay attention to the upgrading state of the current function module, and the upgrading efficiency is improved. Unified upgrading management is carried out by the module upgrading APP; according to the method, the master station needing to be upgraded and the function modules needing to be upgraded actually are controlled to be decoupled, and the problems that the cloud of things master station is unreliable in upgrading of the multiple function modules, low in upgrading efficiency and high in upgrading cost are solved on the premise that the upgrading environment is the same. Meanwhile, according to the logic mapping encryption algorithm based on the homomorphic encryption technology, the confidentiality, the integrity and the tamper-proofing performance of the sensitive data are guaranteed through the steps of mapping and confusion, encryption and diffusion, abstract and integrity verification and the like; and positive and beneficial effects are provided for information security of communication data of the multi-module upgrading method of the Internet of Things electric energy meter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things electric energy meters, and in particular to a multi-module upgrading method and system for an Internet of Things electric energy meter. Background Art

[0002] With the rapid development of science and technology, IoT electric energy meters, as a new type of intelligent power consumption metering equipment, are gradually becoming popular and applied in people's daily lives. At present, IoT electric energy meters have functions such as data collection, metering, communication, LCD display, anti-theft, and remote communication. The more functions they have, the more complex the system program is. Therefore, it is very important to maintain the stable operation of the functional modules of IoT electric energy meters. Once the functional modules in IoT electric energy meters fail, it will cause significant losses to IoT electric energy meter users and electric meter manufacturers. Therefore, when there is a fault in the functional module of IoT electric energy meter or a new function is added, it is necessary to upgrade the firmware program of the functional module in IoT electric energy meter. At present, there are two ways to burn the firmware program of the functional module in IoT electric energy meter. One is that the manufacturer uses JLINK tool to burn the whole package when the functional module in IoT electric energy meter leaves the factory. The other is to upgrade and burn the firmware program through U disk or local network when IoT electric energy meter is installed on site. However, the existing functional modules of IoT electric energy meters are still upgraded in a one-to-one manner when using a USB flash drive or Ethernet. This method requires that each functional module in each IoT electric energy meter be upgraded once in sequence. When there are a large number of IoT electric energy meters on site, it will consume a lot of manpower and time, resulting in a large workload, very low efficiency, and high upgrade costs. In addition, if the upgrade fails, the original program package will be damaged, causing the IoT electric energy meter to malfunction, which poses certain risks; and the whole package upgrade is a complete upgrade of the entire firmware program, with a large amount of upgrade data and a long duration. The huge data flow may cause upgrade errors and upgrade failures, ultimately resulting in an unsafe upgrade process for the functional modules in the IoT electric energy meter, a very low success rate, and a high upgrade cost. Summary of the invention

[0003] The multi-module upgrade method, device and storage medium of the Internet of Things electric energy meter proposed in the present invention can at least solve one of the technical problems in the background technology, especially a method for the power supply department to upgrade the firmware program of the functional module of the Internet of Things electric energy meter without the need for on-site operation.

[0004] To achieve the above object, the present invention adopts the following technical solutions:

[0005] A multi-module upgrade method for an IoT electric energy meter comprises setting up an IoT cloud master station, an IoT APP, a Mosquito server, a module upgrade APP, a hardware USB virtual port, a functional module, etc. to collaborate together to complete the upgrade.

[0006] Specifically, the present invention provides a multi-module upgrade method and system for an IoT electric energy meter, including: an IoT cloud master station, an IoT APP, a Mosquito server, a module upgrade APP, a hardware USB virtual port, and a functional module; wherein the IoT cloud master station establishes a data link with the IoT APP through 4G; at the same time, the IoT APP, the module upgrade APP and the Mosquito server establish a data link; the IoT APP subscribes to the "module upgrade APP data return topic" to the Mosquito server, and the module upgrade APP subscribes to the "IoT APP message release topic" to the Mosquito server; the method for the IoT cloud master station to upgrade multiple functional modules through the IoT electric energy meter includes the following steps:

[0007] The process of sending upgrade packages by IoT Cloud Master Station:

[0008] 1) When the IoT Cloud Master Station has an upgrade task, the IoT Cloud Master Station broadcasts the function module upgrade package and upgrade information to the IoT APP in the IoT power meter via 4G. At the same time, the IoT APP in the IoT power meter stores the received function module upgrade package locally in the IoT power meter. After receiving the function module upgrade package, it sends the "IoT APP publish message topic" to the Mosquito server. The topic includes the name of the IoT APP. The data model needs to include the message sequence number, message timestamp, upgrade request information, upgrade package storage path, upgrade package size, upgrade package verification code, etc.;

[0009] 2) The Mosquito server receives the "IoT APP publish message topic" and forwards it to the module upgrade APP;

[0010] 3) After receiving the "IoT APP release message topic", the module upgrade APP parses the release topic and compares it with its own APP name. If they are the same, it continues to parse the data model content; according to the upgrade request data model content requirements, it searches for the upgrade package in the corresponding path, verifies the legitimacy of the upgrade package, and compares the historical firmware program upgrade package. The difference upgrade data is sent to the functional module, and the upgrade result is returned after the functional module upgrade is completed.

[0011] The process of IoT Cloud master station receiving upgrade results:

[0012] 1) If the module upgrade APP upgrades the functional modules within a period of time, and the query module upgrade is successful, it sends the "module upgrade APP upgrade return topic" to the Mosquito server. The Mosquito server forwards it to the IoT APP to receive the "module upgrade APP upgrade return topic", parses the published topic, and compares it with its own APP name. If they are the same, it continues to parse the upgrade result data model content and forwards it to the IoT cloud master station via 4G;

[0013] 2) If the module upgrade APP completes the functional module upgrade and the query module upgrade fails, send the "module upgrade APP data return topic" to the Mosquito server,

[0014] 3) After the Mosquito server forwards the received "module upgrade APP upgrade data return topic" to the IoT APP, it parses the published topic and compares it with its own APP name. If they are the same, it continues to parse the module upgrade data model content and forwards it to the IoT cloud master station via 4G.

[0015] 4) On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.

[0016] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0017] It can be seen from the above technical scheme that the purpose of the present invention is to compare the contents of the historical upgraded firmware program through a dedicated module upgrade APP under the premise of the same existing environment, find out the difference between the new and old upgraded firmware programs, and upgrade the firmware program to solve the practical problems of unreliable upgrade of multi-module whole package in IoT electric energy meter, low upgrade efficiency, high upgrade cost, etc. The present invention provides a multi-module upgrade method for IoT electric energy meter, which can upgrade the functional modules of IoT electric energy meter in an efficient, safe, convenient and low-cost manner.

[0018] The beneficial effects of the present invention are as follows:

[0019] By adopting the method proposed in the present invention, a special module upgrade APP is designed through the forwarding function of the internal Mosquito server, which is responsible for unified upgrade management of all functional modules. The IoT cloud master station and IoT APP do not need to pay attention to the upgrade status of the current functional module, and the module upgrade APP performs unified upgrade management; the upgrade control of the main station that needs to be upgraded and the functional module that actually needs to be upgraded are decoupled, and under the premise of the same upgrade environment, the problem of unreliable upgrade of multiple functional modules by the IoT cloud master station, low upgrade efficiency, and high upgrade cost is solved. The above solution solves the practical problem of upgrading multiple functional modules under the hardware USB virtual port of an IoT electric energy meter.

[0020] At the same time, the logical mapping encryption algorithm based on homomorphic encryption technology in the embodiment of the present invention ensures the confidentiality, integrity and tamper-proofness of sensitive data through the steps of mapping and obfuscation, encryption and diffusion, and summary and integrity verification, providing a positive and beneficial effect on the information security of communication data in the multi-module upgrade method of the Internet of Things electric energy meter. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a structural block diagram of a module upgrade APP system of an IoT electric energy meter according to an embodiment of the present invention;

[0022] Figure 2 It is a block diagram of the overall communication process of the module upgrade APP system of the Internet of Things electric energy meter in the embodiment of the invention;

[0023] Figure 3 It is a flowchart of the module upgrade process of the module upgrade APP of the Internet of Things electric energy meter in the embodiment of the invention;

[0024] Figure 4 It is a flowchart of the module upgrade frame verification process of the module upgrade APP of the Internet of Things electric energy meter in the embodiment of the invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below 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.

[0026] Figure 1 This is a block diagram of a multi-module upgrade system for an IoT electric energy meter provided by an embodiment of the present invention, refer to Figure 1 , the upgraded system includes:

[0027] IoT cloud main station, IoT APP, Mosquito server, module upgrade APP, hardware USB virtual port, functional module. The IoT cloud main station is connected to the IoT APP through a 4G wireless network; the IoT APP is connected to the module upgrade APP through a Mosquito server; the module upgrade APP is connected to the functional module through a hardware USB virtual port; the IoT APP is used to receive upgrade data and upgrade instructions from the IoT cloud main station, and feedback the upgrade results of the module upgrade APP to the IoT cloud main station; the module upgrade APP is used to receive upgrade instructions from the IoT APP, and call the interface function of the hardware USB virtual port according to the IoT APP upgrade instructions; control the sending and receiving of the functional module upgrade data according to the interface function of the hardware USB virtual port. Adopt the upgrade method proposed in the present invention to design a dedicated module upgrade APP. Responsible for controlling the hardware USB virtual port. The IoT APP does not need to consider the upgrade status of the functional modules under the current hardware USB virtual port, and the module upgrade APP performs unified upgrade management; the functional modules that need to be upgraded are decoupled from the actual IoT cloud master station upgrade control. Without adding existing hardware equipment, it solves the problem of unreliable upgrade, low upgrade efficiency and high upgrade cost of an IoT cloud master station upgrading multiple functional modules through a hardware USB virtual port.

[0028] Mosquito server is an open source message agent software that implements the message push protocol MQTT v3.5. It was developed by Andy Stanford-Clark, one of the founders of the MQTT protocol. It provides a lightweight, publishable / subscribeable message push mode, making short message communication between devices simple. It has the advantages of simple protocol, compactness, strong scalability, and low traffic and power consumption.

[0029] The Mosquito server forwards the data model message of the end device in the form of a topic. The topic is the type of the message, which is a JSON string in UTF-8 format, and the MosquitoClientBroker function filters the message of each connected client. As long as the IoT APP or the module upgrade APP subscribes to this topic, it can receive the data model message of the topic. The format of the topic is separated by " / ". The format of the topic of the IoT APP is as follows: IotApp / action / request / mapUpgradeApp / ftrans, and the topic of the module upgrade APP data return is as follows: mapUpgradeApp / action / response / IotApp / ftrans.

[0030] Data Model message refers to the specific content of the message subscribed by the IoT APP.

[0031] At present, most embedded systems have operating systems that can meet the use of Mosquito servers. Port the Mosquito server on the operating system and establish a Mosquito server. Each application / APP acts as a client to establish a link with the Mosquito server and subscribe to relevant topics from the Mosquito server; the Mosquito server accepts various topics published by the client and forwards them to the subscribed users.

[0032] See also Figure 1 The embodiment of the present invention provides a method for connecting different types of functional modules to the USB virtual port of the IoT electric energy meter hardware. The actual upgrade communication implementation method is shown in the following figure. Figure 2 , Figure 3 Shown

[0033] The module upgrade APP manages the hardware USB virtual port, and at the same time establishes corresponding processing threads for the functional modules under the hardware USB virtual port, and establishes a "hardware USB virtual port-processing thread" relationship diagram. Each processing thread is responsible for managing the input and output of the corresponding hardware USB virtual port data.

[0034] Specifically, a multi-module upgrade method of an IoT electric energy meter according to an embodiment of the present invention is jointly completed by the IoT cloud master station, the IoT APP, the Mosquito message bus, the module upgrade APP, the hardware USB virtual port, and the functional module. Figure 1 , Figure 2 , Figure 3 .

[0035] In a first aspect, the multi-module upgrade method of the IoT electric energy meter comprises the following steps:

[0036] Step 1: The IoT Cloud Master Station and the IoT Electricity Meter establish a data link through 4G; the IoT APP and the module upgrade APP in the IoT Electricity Meter establish a data link with the Mosquito server; the IoT APP subscribes to the "Module Upgrade APP Data Return Topic" to the Mosquito server, and the Module Upgrade APP subscribes to the "IoT APP Published Message Topic" to the Mosquito server. When the IoT Cloud Master Station broadcasts the upgrade package to the IoT Electricity Meter, after the IoT APP receives the IoT Cloud Master Station upgrade package, the IoT APP publishes the "IoT APP Published Message Topic" and the functional module data model to the Mosquito server, and the Mosquito server forwards the IoT APP published topic and the functional module data model to the module upgrade APP; after the MosquitoClientBroker thread of the module upgrade APP receives the "IoT APP Published Message Topic", it parses the published topic and the functional module data model content, and compares it with the module upgrade APP name. If they are the same, it notifies the module upgrade data production thread in the module upgrade APP;

[0037] Step 2: The module upgrade data production thread in the module upgrade APP continuously compares the firmware upgrade package issued by the IoT Cloud Master Station with the historical firmware upgrade package of the functional module, finds the different places in the historical firmware package, marks the position number, and stores the different upgrade data in the upgrade package in the upgrade package queue in 1K size each time. On the other hand, the module upgrade data consumption thread in the module upgrade APP starts to send a request to start the upgrade frame to the functional module through the hardware USB virtual port (if the functional module does not reply within 3 seconds, the request to start the upgrade frame is resent; the start upgrade frame includes information such as module name, program version, program date, and program package verification); it is sent to the functional module through the hardware USB virtual port. After receiving the request to start the upgrade frame, the functional module compares it with the module's own name, version, and date. If the comparison is the same, a denial frame is replied to the module upgrade APP through the hardware USB virtual port, and the upgrade is completed. The module upgrade APP prepares for the next functional module upgrade; if the comparison is not the same, a confirmation frame is replied to the module upgrade APP through the hardware USB virtual port.

[0038] Step 3: The module upgrade data consumption thread in the module upgrade APP starts to continuously take out 1K upgrade frames and the position sequence number information of the upgrade frames from the upgrade package queue and compose upgrade frames (if the functional module does not reply within 3 seconds, the upgrade request frame is resent; the upgrade frame includes the upgrade frame address sequence number, upgrade frame data body and other information), and sends it to the functional module through the hardware USB virtual port. After the functional module receives the upgrade request frame, it stores the upgrade frame address sequence number, upgrade data body and other information into the upgrade area in the local DataFlash of the functional module, and repeats this cycle until there is no upgrade data in the upgrade package queue.

[0039] Step 4: After the module upgrade data consumption thread in the module upgrade APP sends the request upgrade frame, it starts to send the request execution upgrade frame (if the functional module does not reply within 3 seconds, the request execution upgrade frame will be resent; the execution upgrade frame includes information such as the upgrade execution time), and sends it to the functional module through the hardware USB virtual port. After the functional module receives the request execution upgrade frame and replies with the module upgrade confirmation frame through the hardware USB virtual port, and the functional module executes the internal program transfer process, it starts to back up the functional module MCU running area program package to the backup area of ​​DataFlash, and then the functional module program jumps to the Boot area, and starts to copy the upgrade area data in DataFlash to the running area of ​​the functional module MCU according to the upgrade frame address number. After the copy is completed, the program runs and updates the functional module upgrade version. On the other hand, the module upgrade data consumption thread in the module upgrade APP starts to send a request query upgrade version frame (if the functional module does not reply within 3 seconds, the request query upgrade version frame will be resent), which is sent to the functional module through the hardware USB virtual port. The functional module receives the request query upgrade version frame and replies with a functional module version confirmation frame through the hardware USB virtual port (the module version confirmation frame includes module name, version, date and other information).

[0040] Step 5: Repeat steps 1 to 4 to upgrade other function modules on the hardware USB virtual port.

[0041] Step 6: After all functional modules are upgraded, the module upgrade APP packages all received functional module upgrade version data into the form of "module upgrade APP data return topic" and functional module data model and sends it to the Mosquito server. If the functional module data is not received from the hardware virtual USB port due to timeout or the data that meets the data length is not received, it is sent to the Mosquito server in the form of "module upgrade APP data return topic", and the functional module data model includes the prompt information that the functional module data has not been received. At the same time, the Mosquito server forwards the received "module upgrade APP data return topic" to the IoT APP, and the IoT APP sends the final upgrade result to the IoT Cloud Master Station via 4G.

[0042] In the second aspect, the multi-module upgrade method of the IoT electric energy meter and the system also load a logic mapping encryption algorithm of homomorphic encryption technology, such as Figure 4 The logic mapping encryption algorithm based on homomorphic encryption technology uses logic mapping as the basis for key generation. The logic mapping generates a chaotic sequence through iterative operations to ensure the randomness and security of encryption.

[0043] The logical mapping formula is:

[0044]

[0045] In formula (1), R represents the logical mapping function, p is the value of the chaotic sequence, i is the index of the binary sequence, and m is the mapping parameter. After the logical mapping, the chaotic sequence is initialized, an appropriate initial value x is selected, and the length N of the chaotic sequence is set. At the same time, the original signal data is converted into binary form to obtain a binary signal sequence S[i] of length z, where i represents the index of the binary sequence. According to the initial value x of the chaotic sequence and the value S[i] of the binary signal sequence, the chaotic sequence value and the signal data are calculated and output through the confusion operation. The formula expression of the confusion operation is:

[0046]

[0047] In formula (2), M represents the confusion operation function, x is the initial value of the chaotic sequence, y is the confusion vertical node, z is the correction parameter, t is the key sequence, and e is the initial value of the chaotic sequence. N is the scrambled mapping of the signal data, N represents the length of the chaotic sequence; the scrambled mapping is a fixed or dynamically changing mapping table, and the signal data is replaced according to the extended key through the replacement function to change the order of the signal data; the replacement function formula is:

[0048]

[0049] In formula (3), ρ is the replacement function, α is the inverse parameter, θ is the initial linear gain update amount, and υ is the nonlinear gain update amount; the value of the signal data is changed by the replacement function, and after encryption, the signal data is transmitted and decrypted at the receiving end to obtain the original signal.

[0050] In a specific embodiment, the logic mapping encryption algorithm based on homomorphic encryption technology first maps the plaintext data to encrypted data through a series of mapping functions. These mapping functions are usually based on complex mathematical operations and logical operations, as well as randomly generated keys or parameters. The mapping function will confuse and transform various parts of the plaintext data, so that there is no direct correlation between the encrypted data and the original data.

[0051] After the mapping is completed, the logical mapping encryption algorithm based on homomorphic encryption technology will use a symmetric encryption algorithm to encrypt the mapped data. The encryption process uses a pre-negotiated key to perform block encryption and iterative encryption operations on the data. Through multiple cycles of encryption steps, the data blocks and keys are confused and diffused, making it more difficult for crackers to obtain plaintext information.

[0052] In order to ensure the integrity and non-tamperability of data, a hash function is usually used to perform summary calculation on the encrypted data in the logical mapping encryption algorithm based on homomorphic encryption technology. The hash function maps the encrypted data into summary information of a fixed length, namely the hash value. The receiver can verify whether the data has been tampered with during transmission by verifying the hash value.

[0053] In the specific implementation, the logical mapping encryption algorithm based on homomorphic encryption technology uses powerful encryption technology to protect sensitive data from unauthorized access. Only authorized parties with the correct key can decrypt and access the data, ensuring the confidentiality of the data during transmission and storage. In addition, the encrypted data is matched with its hash value, which can verify the integrity of the data and prevent the data from being tampered with. If the data is tampered with during transmission, the hash value will not match, and the receiver can immediately identify and reject the data. Secondly, the logical mapping encryption algorithm based on homomorphic encryption technology undergoes multi-level encryption operations, making it difficult for crackers to obtain the original data. Even if the attacker has the encrypted data, the original data cannot be restored without the correct key and mapping function. Finally, this type of logical mapping encryption algorithm based on homomorphic encryption technology can be compatible with various existing communication protocols and data transmission methods. In the specific implementation, the test experimental data of the logical mapping encryption algorithm based on homomorphic encryption technology is shown in Table 3:

[0054] Table 3 Experimental data of logical mapping encryption algorithm based on homomorphic encryption technology

[0055] Experiment number Plaintext size (bytes) Key length (bits) Encryption time (milliseconds) Decryption time (milliseconds) 1 100 128 5 3 2 500 256 10 8 3 1000 256 15 12 4 5000 512 25 20 5 10000 512 40 35

[0056] Recording and comparing the performance of the logical mapping encryption algorithm based on homomorphic encryption technology under different experimental conditions through data table 3 can help evaluate the efficiency and feasibility of the algorithm.

[0057] In summary, the method proposed in the embodiment of the present invention is adopted, and a special module upgrade APP is designed through the forwarding function of the internal Mosquito server to be responsible for unified upgrade management of all functional modules. The IoT cloud master station and IoT APP do not need to pay attention to the upgrade status of the current functional module, and the module upgrade APP performs unified upgrade management; the upgrade control of the main station that needs to be upgraded and the functional module that actually needs to be upgraded are decoupled, and under the premise of the same upgrade environment, the problem of unreliable upgrade of multiple functional modules by the IoT cloud master station, low upgrade efficiency, and high upgrade cost is solved. The above solution solves the practical problem of upgrading multiple functional modules under the hardware USB virtual port of an IoT electric energy meter.

[0058] At the same time, the logical mapping encryption algorithm based on homomorphic encryption technology in the embodiment of the present invention ensures the confidentiality, integrity and tamper-proofness of sensitive data through the steps of mapping and obfuscation, encryption and diffusion, and summary and integrity verification, providing a positive and beneficial effect on the information security of communication data in the multi-module upgrade method of the Internet of Things electric energy meter.

[0059] On the other hand, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.

[0060] On the other hand, the present invention further discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0061] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the multi-module upgrade method of any IoT electric energy meter in the above-mentioned embodiments.

[0062] It is understandable that the system, device and storage medium provided in the embodiments of the present invention correspond to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the above methods.

[0063] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0064] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0065] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0066] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-module upgrade method for an IoT electric energy meter, characterized in that: Set up the IoT Cloud Master Station and the module upgrade APP. The method for the module upgrade APP to upgrade multiple IoT electric energy meter function modules through a hardware USB virtual port includes the process of the IoT Cloud Master Station sending the upgrade package: S1. When the IoT Cloud Master Station has an upgrade task, the IoT Cloud Master Station broadcasts the function module upgrade package and upgrade information to the IoT APP in the IoT power meter via 4G. At the same time, the IoT APP in the IoT power meter stores the received function module upgrade package locally in the IoT power meter. After receiving the function module upgrade package, it sends the "IoT APP publish message topic" to the Mosquito server. The topic includes the name of the IoT APP and the data model; the data model includes the message sequence number, message timestamp, upgrade request information, upgrade package storage path, upgrade package size, and upgrade package verification code; S2. Mosquito server receives the "IoT APP publish message topic" and forwards it to the module upgrade APP; S3. After receiving the "IoT APP release message topic", the module upgrade APP parses the release topic and compares it with its own APP name. If they are the same, it continues to parse the data model content; and according to the content requirements in the upgrade request data model, it searches for the upgrade package in the corresponding path, verifies the legitimacy of the upgrade package, and compares the historical firmware program upgrade package. The difference upgrade data is framed and sent to the functional module through the hardware USB virtual port for upgrading. After the functional module upgrade is completed, the upgrade result is returned.

2. The multi-module upgrade method of the IoT electric energy meter according to claim 1, characterized in that: It also includes the process of IoT Cloud master station receiving upgrade data: If the module upgrade APP upgrades the functional module within a period of time, and after querying the successful upgrade information of the functional module, it sends the "module upgrade APP upgrade return topic" to the Mosquito server. After the Mosquito server forwards it to the IoT APP and receives the "module upgrade APP upgrade return topic", the IoT APP receives the topic message of the module APP, parses the published topic, and compares it with its own APP name. If they are the same, it continues to parse the upgrade result data model content and forwards it to the IoT Cloud Master Station via 4G; If the module upgrade APP completes the function module upgrade and finds that the module upgrade fails, it sends the "module upgrade APP data return topic" to the Mosquito server. After the Mosquito server forwards the received "module upgrade APP upgrade data return topic" to the IoT APP, the IoT APP receives the topic message of the module APP, parses the published topic, and compares it with its own APP name. If they are the same, it continues to parse the module upgrade data model content and forwards it to the IoT cloud master station via 4G.

3. The multi-module upgrade method of the IoT electric energy meter according to claim 1, characterized in that: The upgrade method also loads a logic mapping encryption algorithm of homomorphic encryption technology. The encryption algorithm uses logic mapping as the basis for key generation. The logic mapping generates a chaotic sequence through iterative operations to ensure the randomness and security of encryption. The logic mapping formula is: In formula (1), R represents the logical mapping function, p is the value of the chaotic sequence, i is the index of the binary sequence, and m is the mapping parameter; after the logical mapping, the chaotic sequence is initialized, an initial value x is selected, and the length N of the chaotic sequence is set; at the same time, the original signal data is converted into binary form to obtain a binary signal sequence S[i] of length z, where i represents the index of the binary sequence; according to the initial value x of the chaotic sequence and the value S[i] of the binary signal sequence, the value of the chaotic sequence and the signal data are calculated and output through the confusion operation, and the formula expression of the confusion operation is: In formula (2), M represents the confusion operation function, x is the initial value of the chaotic sequence, y is the confusion vertical node, z is the correction parameter, t is the key sequence, and e is the initial value of the chaotic sequence. N is the scrambled mapping of the signal data, N represents the length of the chaotic sequence; the scrambled mapping is a fixed or dynamically changing mapping table, and the signal data is replaced according to the extended key through the replacement function to change the arrangement order of the signal data; The replacement function formula expression is: In formula (3), ρ is the replacement function, α is the inverse parameter, θ is the initial linear gain update amount, and υ is the nonlinear gain update amount; the value of the signal data is changed by the replacement function, and after encryption, the signal data is transmitted and decrypted at the receiving end to obtain the original signal.

4. A multi-module upgrade system for an IoT electric energy meter, which can implement the multi-module upgrade method for an IoT electric energy meter according to any one of claims 1 to 3, characterized in that: Including IoT Cloud Master Station, IoT APP, Mosquito Server, hardware USB virtual port, function module, and module upgrade APP; The IoT cloud master station is connected to the IoT electric energy meter via 4G; the IoT APP is connected to the module upgrade APP via the Mosquito server; the IoT APP is used to receive the function module upgrade package issued by the IoT cloud master station, and notify the module upgrade APP according to the upgrade instruction of the IoT cloud master station, and the module upgrade APP is used to receive the upgrade package reception completion instruction of the IoT APP, and call the hardware USB virtual port driver function according to the IoT APP upgrade instruction; A program that controls data communication of the hardware USB virtual port and upgrades functional modules according to the hardware USB virtual port driver function.

5. The multi-module upgrade system of the IoT electric energy meter according to claim 4, characterized in that: The IoT APP subscribes to the "Module Upgrade APP Data Return Topic" from the Mosquito server. The Module Upgrade APP subscribes to the "IoT APP Published Message Topic" from the Mosquito server. The Module Upgrade APP receives the upgrade data forwarded by the IoT APP and transmits it to the functional module through the hardware USB virtual port. The functional module returns the upgrade result information according to the upgrade frame format requirements.

6. A multi-module upgrade system for an IoT electric energy meter according to claim 5, characterized in that: After the IoT APP receives the IoT Cloud Master Station upgrade package and upgrade instructions, the IoT APP publishes the "IoT APP publish message topic" and the function module data model to the Mosquito server, and the Mosquito server forwards the IoT APP publish topic and the function module data model to the module upgrade APP.

7. The multi-module upgrade system of the IoT electric energy meter according to claim 6, characterized in that: After receiving the "IoT APP publish message topic", the Mosquito server forwards it to the module upgrade APP; After receiving the "module upgrade APP data return topic", the Mosquito server forwards it to the IoT APP.

8. The multi-module upgrade system of the IoT electric energy meter according to claim 7, characterized in that: After receiving the "IoT APP Publish Message Topic" through the MosquitoClientBroker thread, the module upgrade APP parses the publish topic and the functional module data model content, and compares it with its own APP name. If they are the same, it starts framing through the topic and data model content, and sends the upgrade frame message to the corresponding functional module; At the same time, after the hardware USB virtual port receives the upgrade reply frame of the functional module, it determines whether the received data meets the data length requirement. If so, it continues to send upgrade frames. After the upgrade is completed, the last received query upgrade version data is packaged into the form of a topic and functional module data model and sent as "module upgrade APP data return topic" and then forwarded to the Mosquito server.

9. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 8.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 8.