CN116560706A - Differential upgrading method and device for electric energy meter and server - Google Patents
Differential upgrading method and device for electric energy meter and server Download PDFInfo
- Publication number
- CN116560706A CN116560706A CN202310559616.1A CN202310559616A CN116560706A CN 116560706 A CN116560706 A CN 116560706A CN 202310559616 A CN202310559616 A CN 202310559616A CN 116560706 A CN116560706 A CN 116560706A
- Authority
- CN
- China
- Prior art keywords
- firmware
- target
- patch file
- software program
- upgrading
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 238000012545 processing Methods 0.000 claims abstract description 29
- 230000008569 process Effects 0.000 claims abstract description 14
- 238000004364 calculation method Methods 0.000 claims abstract description 6
- 238000012795 verification Methods 0.000 claims description 26
- 238000004422 calculation algorithm Methods 0.000 claims description 20
- 230000005540 biological transmission Effects 0.000 claims description 17
- 230000006870 function Effects 0.000 claims description 16
- 230000006835 compression Effects 0.000 claims description 8
- 238000007906 compression Methods 0.000 claims description 8
- 230000006837 decompression Effects 0.000 claims description 6
- 230000004044 response Effects 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/658—Incremental updates; Differential updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/08—Error detection or correction by redundancy in data representation, e.g. by using checking codes
- G06F11/10—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
- G06F11/1004—Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a differential upgrading method, a differential upgrading device and a server for an electric energy meter, which relate to the technical field of firmware upgrading of the electric energy meter and comprise the following steps: acquiring an upgraded firmware and an original firmware of a software program in the electric energy meter; determining a target patch file based on the original firmware and the updated firmware by a preset differential calculation model, wherein the target patch file comprises a part of the updated firmware, which is different from the original firmware; and sending the target patch file to a software program for firmware upgrading processing to obtain an updated target software program. The invention can simplify the firmware upgrading process of the electric energy meter and obviously improve the firmware upgrading efficiency.
Description
Technical Field
The invention relates to the technical field of firmware upgrading of electric energy meters, in particular to a differential upgrading method, device and server of an electric energy meter.
Background
An electric energy meter is a device for measuring and recording electric energy consumption, and is usually installed in a household or industrial electric system, and the electric energy meter needs to be frequently subjected to firmware upgrade, and a software program on the electric energy meter is updated, so that the function of the electric energy meter is improved, and a bug is repaired. At present, related technologies propose that firmware upgrading is required to be completed through a plurality of algorithms together, but ROM space occupied by the algorithms is larger, so that the scheme has lower efficiency and more complex flow of upgrading algorithms, and when the scheme faces malicious attack or data damage, the scheme lacks effective protection measures, and if the firmware is subjected to malicious attack or data damage in the process of upgrading, products are invalid, so that huge losses are caused.
Disclosure of Invention
Therefore, the invention aims to provide a differential upgrading method, a differential upgrading device and a server for an electric energy meter, which can simplify the firmware upgrading process of the electric energy meter and remarkably improve the firmware upgrading efficiency.
In a first aspect, an embodiment of the present invention provides a method for differentially upgrading an electric energy meter, where the method includes: acquiring an upgraded firmware and an original firmware of a software program in the electric energy meter; determining a target patch file based on the original firmware and the updated firmware by a preset differential calculation model, wherein the target patch file comprises a part of the updated firmware, which is different from the original firmware; and sending the target patch file to a software program for firmware upgrading processing to obtain an updated target software program.
In one embodiment, the step of determining the patch file based on the original firmware and the upgraded firmware by presetting a differential computing model includes: dividing the upgrading firmware into upgrading firmware subunit sets according to preset unit dividing sizes, and dividing the original firmware into original firmware subunit sets; performing differential compression processing on the upgrading firmware subunit set and the original firmware subunit set through a preset differential computing model to determine a patch file set, wherein the upgrading firmware subunit, the original firmware subunit and the patch file are in one-to-one correspondence; and respectively carrying out format coding processing on each patch file in the patch file set, adding the file length and the difference information corresponding to the patch files into the patch files, and determining the target patch files.
In one embodiment, after the step of determining the target patch file, the method further includes: acquiring crc check information; and adding the crc checking information to each upgrading firmware subunit and each original firmware subunit respectively, and determining a target upgrading firmware subunit set and a target original firmware subunit set.
In one embodiment, the step of sending the target patch file to the software program to perform firmware upgrade processing to obtain an updated target software program includes: the method comprises the steps of performing verification processing on a target patch file, sending a firmware upgrading instruction to a software program after verification is successful, enabling the software program to enter a state to be upgraded, calling a preset restoration algorithm function after the software program enters the state to be upgraded, importing a newly received program into a main program address, and deleting original firmware of the software program after the firmware is restored; circularly importing the target patch file and the target original firmware subunit set into a preset restoration algorithm function to obtain an upgraded target firmware; and updating the target firmware into a firmware area in the software program to obtain the updated target software program.
In one embodiment, the step of performing verification processing on the target patch file includes: after determining the target patch file, generating a firmware transmission initialization instruction; transmitting a firmware transmission initialization instruction to a software program; and when receiving a correct response fed back by the software program, sending the target patch file to the software program, and after the transmission of the target patch file is completed, sending a firmware verification instruction to the software program so that the software program performs MD5 verification on the target patch file.
In one embodiment, the step of circularly importing the target patch file and the target original firmware subunit set into a preset restoration algorithm function to obtain the updated target firmware includes: and circularly importing the target patch file and the target original firmware subunit set into a preset restoration algorithm function so as to enable a preset decompression model in the software program to perform firmware restoration processing on the target patch file and the target original firmware subunit set, thereby obtaining the updated target firmware.
In one embodiment, after the step of obtaining the upgraded target firmware, the method comprises: comparing the crc check information in the target firmware with the header information of the target patch file, wherein the header information comprises the crc check information in the target upgrading firmware subunit set and the target original firmware subunit set; if the comparison results are consistent, updating the target firmware to a firmware area in the software program to obtain an updated target software program; if the comparison results are inconsistent, the firmware upgrading process is exited.
In a second aspect, an embodiment of the present invention further provides an apparatus for differential upgrade of an electric energy meter, where the apparatus includes: the firmware acquisition module acquires the updated firmware and original firmware of a software program in the electric energy meter; the patch generation module is used for determining a target patch file based on the original firmware and the updated firmware through a preset differential calculation model, wherein the target patch file comprises a part of the updated firmware, which is different from the original firmware; and the firmware upgrading module is used for sending the target patch file to the software program to carry out firmware upgrading treatment to obtain an updated target software program.
In a third aspect, embodiments of the present invention also provide a server comprising a processor and a memory, the memory storing computer executable instructions executable by the processor, the processor executing the computer executable instructions to implement the method of any one of the first aspects.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of any one of the first aspects.
The embodiment of the invention has the following beneficial effects:
according to the differential upgrading method, device and server for the electric energy meter, after the upgrading firmware and the original firmware of the software program in the electric energy meter are obtained, the target patch file is determined based on the original firmware and the upgrading firmware through the preset differential computing model, and the target patch file is sent to the software program for firmware upgrading processing, so that the updated target software program is obtained.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a differential upgrading method of an electric energy meter according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a differential upgrading method of an electric energy meter according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another differential upgrading method of an electric energy meter according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electric energy meter differential upgrading device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described in conjunction with the embodiments, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
At present, when firmware of an electric energy meter is required to be upgraded because of bug or demand change, a traditional firmware upgrading mode needs to be participated in together through a plurality of algorithms, and the whole upgrading firmware is transmitted to the electric energy meter to enable the electric energy meter to be required to be upgraded regularly.
Referring to fig. 1, a flow chart of a differential upgrading method of an electric energy meter is shown, and the method mainly includes the following steps S102 to S106:
step S102, obtaining an upgrade firmware and an original firmware of a software program in the electric energy meter, wherein the original firmware is a firmware version used by the current electric energy meter, and the upgrade firmware is a firmware version to be upgraded.
In step S104, the target patch file is determined based on the original firmware and the updated firmware by presetting a differential calculation model, wherein the target patch file includes a portion of the updated firmware having a difference from the original firmware, and in one embodiment, the original file (old. Bin) and the new file (new. Bin) are imported into an upper computer or a web page including a differential compression method, so that the two files of the original firmware and the updated firmware are compared, and the target patch file is generated by using the difference portion, that is, the patch file is a small file which includes only a portion of the updated firmware different from the original firmware, and thus is much smaller than the complete updated firmware, so that the file can be updated without retransmitting the entire file.
Step S106, the target patch file is sent to a software program for firmware upgrading processing to obtain an updated target software program, and in one implementation mode, the target patch file can be transmitted to the software program in the electric energy meter through infrared transmission, 485 communication or wireless network and the like to obtain the target software program.
The differential upgrading method for the electric energy meter provided by the embodiment of the invention can simplify the firmware upgrading process of the electric energy meter and remarkably improve the firmware upgrading efficiency.
The embodiment of the invention also provides an implementation manner for determining the target patch file, which is specifically described in the following (1) to (3):
(1) According to the preset unit division size, dividing the upgrading firmware into an upgrading firmware subunit set and dividing the original firmware into an original firmware subunit set, wherein the preset unit division size is usually set to be 4K due to the fact that RAM resources of a singlechip are very small, so that RAM resources and efficiency are considered, in one implementation mode, the original firmware and the upgrading firmware are divided into small blocks (the upgrading firmware subunit set and the original firmware subunit set) of 4K, the divided 4K codes are respectively input into a differential compression method, and a patch file set is generated by using the differential compression method.
(2) And performing differential compression processing on the upgrading firmware subunit set and the original firmware subunit set through a preset differential computing model to determine a patch file set, wherein the upgrading firmware subunit, the original firmware subunit and the patch file are in one-to-one correspondence, and in one implementation mode, a 4K upgrading firmware subunit and a 4K original firmware subunit are selected for comparison to generate a corresponding patch file.
(3) And in another embodiment, after the step of determining the target patch file, the crc check information can be obtained and added to each upgrading firmware subunit and each original firmware subunit respectively, so as to determine the target upgrading firmware subunit set and the target original firmware subunit set.
The embodiment of the invention also provides an implementation mode for updating the target software program, which is specifically described in the following (A) to (C):
(A) Referring to a schematic diagram of a differential upgrading method of an electric energy meter shown in fig. 2, a target patch file is checked, and after the verification is successful, a firmware upgrading instruction is sent to a software program, so that the software program enters a state to be upgraded (the program jumps to a boot), wherein the software program calls a preset restoration algorithm function after entering the state to be upgraded, a newly received program is imported into a main program address, and original firmware of the firmware is deleted after the firmware is restored, and in one embodiment, the check process performed on the target patch file specifically includes the following steps (a) to (b):
(a) After the target patch file is determined, a firmware transmission initialization instruction is generated and sent to the software program, in one implementation mode, after the target patch file is determined, a new file name is generated according to preset rules, the firmware transmission initialization instruction is generated, firmware transmission is started, the electric energy meter firstly judges the validity of initialization information after receiving the firmware transmission initialization instruction, namely, judges whether the file name accords with the preset rules, and after confirming that the file name is correct, the next firmware verification is carried out.
(b) When a correct response fed back by the software program is received, the target patch file is sent to the software program, and after the transmission of the target patch file is completed, a firmware verification instruction is sent to the software program, so that the software program performs MD5 verification on the target patch file, in one implementation mode, the MD5 verification is used for verifying whether two values are identical, if the two values are identical, the transmitted data are complete and have not been tampered, and after the MD5 verification is correct, a verification success response is sent to the upper computer.
(B) Referring to the schematic diagram of another differential upgrading method of the electric energy meter shown in fig. 3, a target patch file and a target original firmware subunit set are circularly imported into a preset restoration algorithm function to obtain an upgraded target firmware, in one embodiment, after the target patch file and the target original firmware subunit set are circularly imported into the preset restoration algorithm function, a preset decompression model in a software program can be called to enable the preset decompression model in the software program to perform firmware restoration processing on the target patch file and the target original firmware subunit set, so as to obtain an upgraded target firmware, in another embodiment, after the program jumps to a boot, first header information (including verification information of original firmware and new firmware) of the patch file is read, the program first calculates whether verification of current firmware of the program is consistent with that in the header information, if the verification of the current firmware is inconsistent, the verification is incorrect, and directly exits the upgrading process; and the program circularly reads each 4k file of the original firmware, simultaneously inputs the 4k files and the patch files into a decompression algorithm for firmware restoration, and stores the restored correct firmware into a flash until all firmware restoration is completed, wherein the flash is a storage device in the electric energy meter and used for storing external programs, and the flash can be a storage chip.
(C) Updating the target firmware into a firmware area in the software program to obtain an updated target software program, and in one embodiment, after the updated target firmware is obtained, further verification is required to be performed on the updated target firmware, and the crc check information in the target firmware is compared with header information of the target patch file, wherein the header information comprises the crc check information in the target updated firmware subunit set and the target original firmware subunit set: if the comparison results are consistent, updating the target firmware to a firmware area in the software program to obtain an updated target software program; if the comparison result is inconsistent, exiting the firmware upgrading process, in another implementation mode, the program calculates the crc check of the new firmware in the flash, judges whether the crc check is consistent with the header information of the patch file, and if the crc check is inconsistent, exits the upgrading process; if the firmware is consistent with the firmware, updating the new firmware in the flash to the APP firmware area of the MCU, and thus completing the updating flow of the firmware.
In practical application, the original firmware used for testing is 380k, the original firmware (380 k) V1.0.0 is upgraded to the new firmware (380 k) V1.0.1, the generated patch file is only 722 bytes, and only 0.19% of the original firmware, so that the data volume of the upgraded file is greatly compressed, and the reliability of the firmware is improved by adding a verification algorithm.
In summary, the method for differential upgrading can only transmit the part of the upgraded firmware which is different from the original firmware, thereby greatly reducing the size and time of data transmission and realizing quick upgrading.
In addition, the integrity and the authenticity of the transmitted data are ensured by using technologies such as CRC and the like, the electric energy meter is protected from being threatened by malicious attack or data damage, the integrity of the data is ensured, the confidentiality of the transmitted data is ensured by using technologies such as encryption transmission and the like, the safety of the firmware upgrading process is further improved, and meanwhile, the size and the time of the transmitted data can be reduced by using the differential compression method, so that the cost of the firmware upgrading process can be effectively reduced, and the scheme can be better applied to a scene of firmware upgrading of the large-scale electric energy meter.
For the differential upgrading method of the electric energy meter provided in the foregoing embodiment, the embodiment of the present invention provides a differential upgrading device of the electric energy meter, referring to a schematic structural diagram of the differential upgrading device of the electric energy meter shown in fig. 4, the device includes the following parts:
a firmware acquisition module 402 for acquiring the upgraded firmware and the original firmware of the software program in the electric energy meter;
the patch generation module 404 determines a target patch file based on the original firmware and the upgrade firmware by presetting a differential calculation model, wherein the target patch file comprises a part of the upgrade firmware, which is different from the original firmware;
and the firmware upgrading module 406 sends the target patch file to the software program to perform firmware upgrading processing, so as to obtain an updated target software program.
The data processing device provided by the embodiment of the application can simplify the firmware upgrading process of the electric energy meter and remarkably improve the firmware upgrading efficiency.
In one embodiment, when performing the step of determining the patch file based on the original firmware and the updated firmware by the preset differential computing model, the patch generating module 404 is further configured to: dividing the upgrading firmware into upgrading firmware subunit sets according to preset unit dividing sizes, and dividing the original firmware into original firmware subunit sets; performing differential compression processing on the upgrading firmware subunit set and the original firmware subunit set through a preset differential computing model to determine a patch file set, wherein the upgrading firmware subunit, the original firmware subunit and the patch file are in one-to-one correspondence; and respectively carrying out format coding processing on each patch file in the patch file set, adding the file length and the difference information corresponding to the patch files into the patch files, and determining the target patch files.
In one embodiment, after the step of determining the target patch file, the patch generating module 404 is further configured to: acquiring crc check information; and adding the crc checking information to each upgrading firmware subunit and each original firmware subunit respectively, and determining a target upgrading firmware subunit set and a target original firmware subunit set.
In one embodiment, when performing the step of sending the target patch file to the software program to perform firmware upgrade processing, and obtaining the updated target software program, the firmware upgrade module 406 is further configured to: the method comprises the steps of performing verification processing on a target patch file, sending a firmware upgrading instruction to a software program after verification is successful, enabling the software program to enter a state to be upgraded, calling a preset restoration algorithm function after the software program enters the state to be upgraded, importing a newly received program into a main program address, and deleting original firmware of the software program after the firmware is restored; circularly importing the target patch file and the target original firmware subunit set into a preset restoration algorithm function to obtain an upgraded target firmware; and updating the target firmware into a firmware area in the software program to obtain the updated target software program.
In one embodiment, when performing the step of verifying the target patch file, the firmware upgrade module 406 is further configured to: after determining the target patch file, generating a firmware transmission initialization instruction; transmitting a firmware transmission initialization instruction to a software program; and when receiving a correct response fed back by the software program, sending the target patch file to the software program, and after the transmission of the target patch file is completed, sending a firmware verification instruction to the software program so that the software program performs MD5 verification on the target patch file.
In one embodiment, when performing the step of circularly importing the target patch file and the target original firmware subunit set into the preset restoration algorithm function to obtain the updated target firmware, the firmware upgrade module 406 is further configured to: and circularly importing the target patch file and the target original firmware subunit set into a preset restoration algorithm function so as to enable a preset decompression model in the software program to perform firmware restoration processing on the target patch file and the target original firmware subunit set, thereby obtaining the updated target firmware.
In one embodiment, after performing the step of obtaining the updated target firmware, the firmware upgrade module 406 is further configured to: comparing the crc check information in the target firmware with the header information of the target patch file, wherein the header information comprises the crc check information in the target upgrading firmware subunit set and the target original firmware subunit set; if the comparison results are consistent, updating the target firmware to a firmware area in the software program to obtain an updated target software program; if the comparison results are inconsistent, the firmware upgrading process is exited.
The device provided by the embodiment of the present invention has the same implementation principle and technical effects as those of the foregoing method embodiment, and for the sake of brevity, reference may be made to the corresponding content in the foregoing method embodiment where the device embodiment is not mentioned.
The embodiment of the invention provides electronic equipment, which comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method of any of the embodiments described above.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 100 includes: a processor 50, a memory 51, a bus 52 and a communication interface 53, the processor 50, the communication interface 53 and the memory 51 being connected by the bus 52; the processor 50 is arranged to execute executable modules, such as computer programs, stored in the memory 51.
The memory 51 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The communication connection between the system network element and at least one other network element is achieved via at least one communication interface 53 (which may be wired or wireless), and the internet, wide area network, local network, metropolitan area network, etc. may be used.
Bus 52 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 5, but not only one bus or type of bus.
The memory 51 is configured to store a program, and the processor 50 executes the program after receiving an execution instruction, and the method executed by the apparatus for flow defining disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 50 or implemented by the processor 50.
The processor 50 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware in the processor 50 or by instructions in the form of software. The processor 50 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal processor (Digital Signal Processing, DSP for short), application specific integrated circuit (Application Specific Integrated Circuit, ASIC for short), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA for short), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory 51 and the processor 50 reads the information in the memory 51 and in combination with its hardware performs the steps of the above method.
The computer program product of the readable storage medium provided by the embodiment of the present invention includes a computer readable storage medium storing a program code, where the program code includes instructions for executing the method described in the foregoing method embodiment, and the specific implementation may refer to the foregoing method embodiment and will not be described herein.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. A method for differential upgrading of an electric energy meter, the method comprising:
acquiring an upgraded firmware and an original firmware of a software program in the electric energy meter;
determining a target patch file based on the original firmware and the updated firmware through a preset differential computing model, wherein the target patch file comprises a part of the updated firmware, which is different from the original firmware;
and sending the target patch file to the software program for firmware upgrading processing to obtain an updated target software program.
2. The method of claim 1, wherein the step of determining a patch file based on the original firmware and the upgraded firmware by a preset differential computing model comprises:
dividing the upgrading firmware into an upgrading firmware subunit set according to a preset unit dividing size, and dividing the original firmware into an original firmware subunit set;
performing differential compression processing on the upgrading firmware subunit set and the original firmware subunit set through the preset differential computing model to determine a patch file set, wherein the upgrading firmware subunit, the original firmware subunit and the patch file are in one-to-one correspondence;
and respectively carrying out format coding processing on each patch file in the patch file set, adding the file length and the difference information corresponding to the patch file into the patch file, and determining the target patch file.
3. The method of claim 2, further comprising, after the step of determining the target patch file:
acquiring crc check information;
and adding the crc check information to each upgrading firmware subunit and each original firmware subunit respectively, and determining a target upgrading firmware subunit set and a target original firmware subunit set.
4. The method of claim 1, wherein the step of sending the target patch file to the software program for firmware upgrade processing to obtain an updated target software program comprises:
performing verification processing on the target patch file, and sending a firmware upgrading instruction to the software program after verification is successful, so that the software program enters a state to be upgraded, wherein the software program calls a preset restoration algorithm function after entering the state to be upgraded, guides a newly received program into a main program address, and deletes the original firmware of the software program after the firmware is restored;
circularly importing the target patch file and the target original firmware subunit set into the preset restoration algorithm function to obtain an upgraded target firmware;
and updating the target firmware to a firmware area in the software program to obtain the updated target software program.
5. The method of claim 4, wherein the step of verifying the target patch file comprises:
after determining the target patch file, generating a firmware transmission initialization instruction;
transmitting the firmware transmission initialization instruction to the software program;
and when receiving a correct response fed back by the software program, sending the target patch file to the software program, and after the transmission of the target patch file is completed, sending a firmware verification instruction to the software program so that the software program performs MD5 verification on the target patch file.
6. The method of claim 4, wherein the step of circularly importing the target patch file and the target original firmware subunit set into the preset restoration algorithm function to obtain the updated target firmware includes:
and circularly sending the target patch file and the target original firmware subunit set to the software program in a state to be upgraded so as to enable a preset decompression model in the software program to perform firmware restoration processing on the target patch file and the target original firmware subunit set to obtain the upgraded target firmware.
7. The method of claim 6, after the step of obtaining the upgraded target firmware, comprising:
comparing the crc check information in the target firmware with the header information of the target patch file, wherein the header information comprises the crc check information in a target upgrading firmware subunit set and a target original firmware subunit set;
if the comparison results are consistent, updating the target firmware to a firmware area in the software program to obtain the updated target software program;
if the comparison results are inconsistent, the firmware upgrading process is exited.
8. An electric energy meter differential upgrading device, the device comprising:
the firmware acquisition module acquires the updated firmware and original firmware of a software program in the electric energy meter;
the patch generation module is used for determining a target patch file based on the original firmware and the upgrading firmware through a preset differential calculation model, wherein the target patch file comprises a part, which is different from the original firmware, in the upgrading firmware;
and the firmware upgrading module is used for sending the target patch file to the software program to carry out firmware upgrading treatment to obtain an updated target software program.
9. A server comprising a processor and a memory, the memory storing computer executable instructions executable by the processor, the processor executing the computer executable instructions to implement the method of any one of claims 1 to 7.
10. A computer readable storage medium storing computer executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310559616.1A CN116560706A (en) | 2023-05-16 | 2023-05-16 | Differential upgrading method and device for electric energy meter and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310559616.1A CN116560706A (en) | 2023-05-16 | 2023-05-16 | Differential upgrading method and device for electric energy meter and server |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116560706A true CN116560706A (en) | 2023-08-08 |
Family
ID=87485881
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310559616.1A Pending CN116560706A (en) | 2023-05-16 | 2023-05-16 | Differential upgrading method and device for electric energy meter and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116560706A (en) |
-
2023
- 2023-05-16 CN CN202310559616.1A patent/CN116560706A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11501533B2 (en) | Media authentication using distributed ledger | |
CN108900364B (en) | Block chain network management method, block chain network management device, block chain network management medium and electronic equipment | |
CN105391717A (en) | APK signature authentication method and APK signature authentication system | |
KR20150054380A (en) | Method of updating firmware of near field communication chip and electronic system performing the same | |
US10853197B2 (en) | Data recovery with authenticity | |
CN104850427B (en) | A kind of code upgrade method and device | |
CN112286565B (en) | Embedded system differential upgrading method based on storage container | |
CN112380046B (en) | Calculation result verification method, system, device, equipment and storage medium | |
CN114185808A (en) | Automatic testing method and device, electronic equipment and computer readable storage medium | |
CN111176685A (en) | Upgrading method and device | |
CN110225044B (en) | Verification method and device on block chain | |
CN111259370A (en) | FPGA program security verification method, system, terminal and storage medium | |
CN116560706A (en) | Differential upgrading method and device for electric energy meter and server | |
CN109002710A (en) | A kind of detection method, device and computer readable storage medium | |
CN109800565B (en) | Software upgrading method and terminal equipment | |
CN113706131B (en) | Block chain transaction method, device and equipment based on encryption card | |
CN111639475B (en) | Product code generation method and device and electronic equipment | |
CN115185551A (en) | Application program installation method, device, system and storage medium | |
CN115129509A (en) | Data transmission method, device and medium | |
CN109472148B (en) | Method, device and storage medium for loading hot patch | |
CN110224839B (en) | Verification method and device applied to block chain | |
CN111740817A (en) | Code tampering detection method and system for concentrator in electric power data acquisition system | |
CN111400328A (en) | Data updating method and device and node server | |
CN110766407A (en) | Transaction verification method, accounting node and medium based on block chain | |
CN117272319A (en) | Automatic vulnerability restoration method and device based on artificial intelligence and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |