CN111488166B - Method and device for upgrading software of management unit of double-core intelligent ammeter and storage medium - Google Patents

Method and device for upgrading software of management unit of double-core intelligent ammeter and storage medium Download PDF

Info

Publication number
CN111488166B
CN111488166B CN202010349975.0A CN202010349975A CN111488166B CN 111488166 B CN111488166 B CN 111488166B CN 202010349975 A CN202010349975 A CN 202010349975A CN 111488166 B CN111488166 B CN 111488166B
Authority
CN
China
Prior art keywords
upgrading
upgrade
file
original
instruction
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.)
Active
Application number
CN202010349975.0A
Other languages
Chinese (zh)
Other versions
CN111488166A (en
Inventor
石少青
李鹏
吴昊文
张乐平
张本松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Digital Grid Technology Guangdong Co ltd
Original Assignee
Southern Power Grid Digital Grid Research Institute Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Southern Power Grid Digital Grid Research Institute Co Ltd filed Critical Southern Power Grid Digital Grid Research Institute Co Ltd
Priority to CN202010349975.0A priority Critical patent/CN111488166B/en
Publication of CN111488166A publication Critical patent/CN111488166A/en
Application granted granted Critical
Publication of CN111488166B publication Critical patent/CN111488166B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1048Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using arrangements adapted for a specific error detection or correction feature
    • G06F11/1056Updating check bits on partial write, i.e. read/modify/write

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a method and a device for upgrading software of a management unit of a double-core intelligent ammeter and a storage medium. The method comprises the following steps: checking the original upgrade file; the original upgrading file is used for upgrading electric meter management unit software in the electric meter; if the verification is passed, converting the original upgrade file according to the upgrade format of the upgrade execution device to obtain a converted upgrade file; generating an upgrading instruction according to the conversion upgrading file; sending the upgrading instruction to an upgrading execution device; the upgrading instruction is used for indicating the upgrading execution device to determine the corresponding conversion upgrading file and executing the upgrading of the software of the electric meter management unit according to the determined conversion upgrading file, so that the upgrading efficiency of the software of the electric meter management unit can be improved.

Description

Method and device for upgrading software of management unit of double-core intelligent ammeter and storage medium
Technical Field
The application relates to the technical field of electric meters, in particular to a method and a device for upgrading management unit software of a double-core intelligent electric meter and a storage medium.
Background
The double-core intelligent ammeter comprises a metering core and a management core, wherein the metering core is responsible for legal metering functions of the ammeter, and the management core relates to functions of ammeter display, communication and the like. The functions of the two-core intelligent electric meter management core can be realized by electric meter management unit software (equivalent to an application program, also called as an application), and only the electric meter management core software is allowed to be upgraded online for the safety consideration of preventing the metering data manufactured by the electric energy meter from being tampered. In a traditional electric meter, each electric meter management unit software is integrated in an electric meter management unit software system as a whole; if the software of the electric meter management unit needs to be updated (for example, a new software of the electric meter management unit is installed in the electric meter or a communication protocol of the software of the electric meter management unit is updated), the whole electric meter needs to be replaced, which is equivalent to installing the software system of the whole electric meter management unit in other electric meters, and thus, the efficiency of updating the software of the electric meter management unit is not high.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, and a storage medium for upgrading dual-core smart meter management unit software, which can improve the efficiency of upgrading the meter management unit software.
A method for upgrading software of a management unit of a double-core intelligent ammeter is applied to an upgrading processing device and an upgrading execution device; the upgrading method comprises the following steps:
the upgrade processing device verifies an original upgrade file, converts the original upgrade file according to the upgrade format of the upgrade execution device after the verification of the original upgrade file passes, obtains a converted upgrade file, and sends an upgrade instruction to the upgrade execution device; the original upgrading file is used for upgrading electric meter management unit software in the electric meter, and the upgrading instruction is generated according to the conversion upgrading file;
and after receiving the upgrading instruction sent by the upgrading processing device, the upgrading execution device determines a corresponding conversion upgrading file and executes the upgrading of the software of the electric meter management unit according to the determined conversion upgrading file.
In one embodiment, when the upgrade processing device sends an upgrade instruction to the upgrade execution device, the method includes:
the upgrade processing device generates corresponding file description information according to the conversion upgrade file, wherein the file description information is used for determining the corresponding conversion upgrade file; obtaining the upgrading instruction according to the file description information; and sending the upgrading instruction to the upgrading execution device through an upgrading calling interface.
In one embodiment, when sending the upgrade instruction to the upgrade execution device, the upgrade processing device includes: and acquiring the current time, and if the current time accords with the preset upgrade activation time, sending the upgrade instruction to the upgrade execution device.
In one embodiment, the method further comprises the following steps:
and the upgrading processing device checks the legality of the sending end and the integrity of the original upgrading file according to an upgrading preparation request sent by the master station.
In one embodiment, the upgrade preparation request carries a preset check code and a preset byte amount;
the upgrade processing device checks the validity of the sending end and the integrity of the original upgrade file according to an upgrade preparation request sent by the master station, and the upgrade processing device comprises:
the upgrading processing device encrypts the original upgrading file to obtain an actual check code, and if the actual check code is consistent with the preset check code, the sending end of the original upgrading file is determined to be a legal master station; and calculating the actual byte quantity of the original upgrade file, if the actual byte quantity is consistent with the preset byte quantity, determining the original upgrade file as a complete upgrade file, and judging that the verification of the original upgrade file passes.
In one embodiment, the method further comprises the following steps:
the upgrading processing device returns a file missing response to a master station after determining that the original upgrading file is the upgrading file with data missing, and receives first missing data or second missing data returned by the master station aiming at the file missing response; the system comprises a master station, a plurality of electric meters, a plurality of data processing units and a plurality of data processing units, wherein the master station is connected with the plurality of electric meters, and the first missing data is returned by the master station in a point-to-point transmission mode after the master station determines that the file missing responses are one; and the second missing data is returned by the master station in a broadcast transmission mode after determining that a plurality of file missing responses are provided, and each file missing response corresponds to a different ammeter.
In one embodiment, the method further comprises the following steps:
and the virtual bus forwarding device receives an upgrade preparation request sent by the master station, and forwards the upgrade preparation request to an upgrade processing device corresponding to the data identifier according to the data identifier carried in the upgrade preparation request.
An upgrade processing device for software of a dual-core intelligent ammeter management unit comprises:
the file checking module is used for checking the original upgrading file; the original upgrading file is used for upgrading electric meter management unit software in the electric meter;
the file format conversion module is used for converting the original upgrade file according to the upgrade format of the upgrade execution device to obtain a conversion upgrade file if the verification is passed;
the instruction generating module is used for generating an upgrading instruction according to the conversion upgrading file;
the instruction sending module is used for sending the upgrading instruction to an upgrading execution device; and the upgrading instruction is used for indicating the upgrading execution device to determine a corresponding conversion upgrading file and executing the upgrading of the software of the electric meter management unit according to the determined conversion upgrading file.
In one of the embodiments, the first and second electrodes are,
the instruction generating module is also used for generating corresponding file description information according to the conversion upgrading file; obtaining the upgrading instruction according to the file description information; sending the upgrading instruction to the upgrading execution device through an upgrading calling interface; and the file description information is used for determining a corresponding conversion upgrading file.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
checking the original upgrade file; the original upgrading file is used for upgrading electric meter management unit software in the electric meter;
if the verification is passed, converting the original upgrade file according to the upgrade format of the upgrade execution device to obtain a converted upgrade file;
generating an upgrading instruction according to the conversion upgrading file;
sending the upgrading instruction to an upgrading execution device; the upgrading instruction is used for indicating the upgrading execution device to determine a corresponding conversion upgrading file and executing the upgrading of the software of the electric meter management unit according to the determined conversion upgrading file.
According to the method and the device for upgrading the software of the management unit of the double-core intelligent ammeter and the storage medium, the upgrading processing device and the upgrading execution device are arranged, the upgrading processing device is used for verifying and converting the format of an original upgrading file to obtain a converted upgrading file, and the original upgrading file is used for upgrading the software of the management unit of the ammeter; the upgrading processing device generates an upgrading instruction according to the conversion upgrading file and sends the upgrading instruction to the upgrading execution device, so that the upgrading execution device can determine the corresponding conversion upgrading file and execute the upgrading of the software of the electric meter management unit; the upgrading processing operation and the upgrading execution operation are respectively configured in the upgrading processing device and the upgrading execution device, so that the upgrading processing device can configure different ammeter communication protocols according to the actual conditions of all ammeters, the upgrading file of the ammeter management unit software is processed, the coupling between the ammeter management unit software is reduced, the upgrading efficiency of the ammeter management unit software is improved, the upgrading execution device can be suitable for other ammeters, the portability of the upgrading execution operation is improved, and the upgrading efficiency of the ammeter management unit software is improved.
Drawings
FIG. 1a is a diagram illustrating an exemplary environment in which a software upgrade method for a management unit of a two-core smart electricity meter may be implemented;
fig. 1b is an application environment diagram of the upgrading method of the software of the management unit of the dual-core intelligent ammeter in another embodiment;
FIG. 2 is a flowchart illustrating a method for upgrading software of a management unit of a dual-core smart electricity meter according to an embodiment;
fig. 3 is a schematic flow chart illustrating a method for upgrading software of a management unit of a dual-core smart electricity meter according to another embodiment;
FIG. 4 is a flowchart illustrating a method for upgrading software of an electric meter management unit according to another embodiment;
FIG. 5 is a flowchart illustrating a method for upgrading software of a meter management unit according to yet another embodiment;
FIG. 6 is a block diagram of the structure of an electricity meter in one embodiment;
FIG. 7 is a block diagram showing an example of an upgrade processing apparatus for electric meter management unit software;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Fig. 1a illustrates an application environment of the present application, in which an electricity meter may include an upgrade processing means and an upgrade execution means; the upgrade processing device may be configured to process an upgrade file, where processing the upgrade file may be, for example, format conversion of the upgrade file, and generating corresponding file description information according to the upgrade file (the file description information may be used to determine the upgrade file), and the upgrade execution device may be configured to execute an upgrade operation according to the processed upgrade file, for example, load an upgrade instruction in the processed upgrade file into the processor, so that the processor runs the upgrade instruction (the processed upgrade file may be the converted upgrade file); specifically, the method comprises the following steps: after the electric meter receives the original upgrading file, the upgrading processing device verifies the original upgrading file, and after the verification of the original upgrading file is passed, the original upgrading file is converted according to the upgrading format of the upgrading execution device to obtain a converted upgrading file; the upgrade processing device generates an upgrade instruction according to the converted upgrade file and sends the upgrade instruction to the upgrade execution device; and after receiving the upgrading instruction sent by the upgrading processing device, the upgrading execution device determines a corresponding conversion upgrading file and executes the upgrading of the software of the electric meter management unit according to the determined conversion upgrading file.
In some embodiments of the present application, a two-core smart meter is taken as an example for description, and it should not be understood here as a limitation on the upgrading method of the meter management unit software or the meter, etc. in the present application; the original upgrade file may be sent to the electricity meter by a computer device such as a server, and the server may be implemented by an independent server or a server cluster composed of a plurality of servers. Fig. 1b shows another application scenario of the present application, in which the server may be the master station, that is, the master station sends the original upgrade file to the electricity meter.
In one embodiment, as shown in fig. 2, a method for upgrading software of a management unit of a two-core smart meter is provided, which is described by taking the method as an example of being applied to the two-core smart meter (in the following description, it may be simply referred to as a meter) in fig. 1a, and includes the following steps:
step S202, the original upgrade file is verified; and the original upgrading file is used for upgrading the software of the electric meter management unit in the electric meter.
The original upgrade file may carry upgrade information for upgrading the electric meter management unit software (it may be understood that the corresponding electric meter management unit software may be referred to as electric meter management unit software to be upgraded); the original file may be generated according to an original communication protocol between the sender and the meter. The upgrading information can comprise information such as the version number of the electric meter management unit software to be upgraded, the document size, the storage path in the electric meter and the like; the upgrade execution device may determine the electricity meter management unit software to be upgraded according to the upgrade information, and execute the upgrade of the electricity meter management unit software.
In the step, a sending end (such as a master station) sends an original upgrading file to an electric meter, and an upgrading processing device in the electric meter checks the original upgrading file; verifying the content may include verifying whether a transmitting end that transmits the original upgrade file is legal and whether the original upgrade file is complete, that is, verifying the original upgrade file by the upgrade processing apparatus may include verifying the validity of the transmitting end and the integrity of the original upgrade file.
And step S204, if the verification is passed, converting the original upgrade file according to the upgrade format of the upgrade execution device to obtain a converted upgrade file.
Because the upgrade execution device does not encapsulate the communication protocol between the electric meters, the upgrade execution device cannot directly execute the upgrade according to the original upgrade file sent by the master station. Therefore, in this step, the upgrade processing device completes the verification of the original upgrade file, and after it is determined that the original upgrade file passes the verification, the upgrade processing device converts the original upgrade file according to the upgrade format of the upgrade execution device, and obtains a converted upgrade file conforming to the upgrade format of the upgrade execution device.
Furthermore, the upgrading processing device is packaged with a communication protocol between the electric meters, and the upgrading processing device can analyze the original upgrading file according to the packaged communication protocol to obtain upgrading information; the upgrade processing device can send the upgrade information to a format conversion function of the upgrade execution device for format conversion to obtain a conversion upgrade file; the format conversion function is preset with the upgrading format of the upgrading execution device and is used for converting the original upgrading file according to the upgrading format.
Specifically, the upgrade processing device analyzes the original upgrade file according to the communication protocol to obtain upgrade information, inputs the upgrade information to the format conversion function, and the format conversion function performs format conversion processing on the input upgrade information according to a preset upgrade format to obtain a conversion upgrade file and returns the conversion upgrade file to the upgrade processing device.
And step S206, generating an upgrading instruction according to the conversion upgrading file.
After the upgrade processing device obtains the conversion upgrade file, the conversion upgrade file can be directly loaded into the upgrade instruction, the conversion upgrade file can also be stored in a memory of the ammeter, file description information such as a storage path and a file name of the conversion upgrade file is obtained, and the upgrade instruction is generated according to the file description information.
And step S208, sending the upgrading instruction to an upgrading execution device.
The upgrading processing device generates an upgrading instruction according to the converted upgrading file and then sends the upgrading instruction to the upgrading execution device; after receiving the upgrading instruction, the upgrading execution device determines a corresponding conversion upgrading file according to the upgrading instruction, and because the conversion upgrading software conforms to the upgrading format of the upgrading execution device, the upgrading execution device can execute the upgrading of the software of the electric meter management unit according to the conversion upgrading file.
In some scenarios, when upgrading the software of the electric meter management unit, the upgrade execution device needs to upgrade according to the preset upgrade activation time, and therefore, in order to upgrade the upgrade execution device in accordance with the preset upgrade activation time, not in other time periods, the upgrade processing device may send the upgrade instruction to the upgrade execution device when the current time is in accordance with the preset upgrade activation time. Fig. 3 is a schematic flow chart illustrating that the upgrade processing device sends an upgrade instruction according to the upgrade activation time, and introduces a corresponding method with reference to fig. 3: step S302, after the electric meter receives preset upgrade activation time sent by a master station, step S304, an upgrade processing device of the electric meter judges whether the upgrade activation time is sent by a legal master station, step S306, if so, the upgrade processing device judges whether upgrade state characters are started image activation, step S308, if so, current time is obtained, step S310, the current time is judged to accord with the upgrade activation time, step S312, if accord with (the condition of being accordant with the upgrade activation time can comprise that the current time is accordant with the upgrade activation time, or the upgrade activation time is historical time relative to the current time), an upgrade instruction is sent to an upgrade execution device, so that the upgrade execution device can immediately execute the upgrade of management unit software of the electric meter; if not, the upgrade processing apparatus returns to step S306, continues to determine whether the upgrade state word is activated for the boot image, and reads the current time and determines whether the current time matches the upgrade activation time under the condition that the upgrade state word is activated for the boot image.
Furthermore, in order to further simplify the modules included in the upgrade processing apparatus, the upgrade processing apparatus may obtain the current time by calling a corresponding interface in the upgrade execution apparatus to obtain the corresponding interface and return the current time.
In the conventional method for upgrading the software of the electric meter management unit, because the software of the electric meter management unit for realizing each function is integrated in the software system of the electric meter management unit, the coupling between the software (or applications) of the electric meter management unit is strong, if a certain new software (also called as software) of the electric meter management unit needs to be installed in the electric meter, the whole electric meter needs to be replaced, which is equivalent to installing the software system of the electric meter management unit in other electric meters, and the upgrading efficiency is reduced. When upgrading the electricity meter management unit software, processing operation for an upgrade file (may be simply referred to as upgrade processing operation) and upgrade execution operation are involved. The inventor finds that: the upgrading processing operation relates to an electric meter communication protocol with a master station, and the electric meter communication protocol is generally used between an electric meter and an electric meter or between the electric meter and the master station, that is, the upgrading processing operation is not applicable to all electric meters due to the specificity of the electric meter communication protocol; the upgrading execution operation is used for executing the upgrading operation according to the processed upgrading file, has universality and is suitable for all electric meters; if the upgrade processing operation and the upgrade execution operation are integrated into one device, the device needs to configure the same upgrade execution operation for different electricity meters, that is, the portability of the upgrade execution operation in the device is reduced, resulting in a reduction in the efficiency of upgrading the electricity meter management unit software.
Based on the method, the electric meter and the method for upgrading the electric meter management unit software are provided, the upgrading processing device and the upgrading execution device are arranged, the upgrading processing device is used for verifying and converting the format of the original upgrading file to obtain a converted upgrading file, and the original upgrading file is used for upgrading the electric meter management unit software; the upgrading processing device generates an upgrading instruction according to the conversion upgrading file and sends the upgrading instruction to the upgrading execution device, so that the upgrading execution device can determine the corresponding conversion upgrading file and execute the upgrading of the software of the electric meter management unit; the upgrading processing operation and the upgrading execution operation are respectively configured in the upgrading processing device and the upgrading execution device, so that the upgrading processing device can configure different ammeter communication protocols according to the actual conditions of all ammeters, the upgrading file of the ammeter management unit software is processed, the coupling between the ammeter management unit software is reduced, the upgrading efficiency of the ammeter management unit software is improved, the upgrading execution device can be suitable for other ammeters, the portability of the upgrading execution operation is improved, and the upgrading efficiency of the ammeter management unit software is improved.
In some embodiments, the upgrade processing apparatus may use different upgrade state words to represent different processing stages during processing of the original upgrade file, so that other applications may know the current processing progress; for example, if the upgrade state word is to be checked, it indicates that the current processing stage is to be checked on the original upgrade file, and for example, if the upgrade state word is to be downloaded (or loaded), it indicates that the current processing stage is to be loaded on the data frame of the original upgrade file. It should be noted that, in some embodiments, the references to "download" and "load" may be used to mean the same thing, and may be used to refer to: acquiring data transmitted by other terminals (such as a master station); in addition, the master station can also be understood as a sending end because the master station can send the original upgrade file to the electric meter.
In some embodiments, the upgrade processing device may prepare for upgrading before receiving the original upgrade file, so as to verify the original upgrade file. In the process of preparing for upgrading by the upgrade processing device and the master station, data in the process of preparing for upgrading can be forwarded by a virtual bus forwarding device in the electric meter, wherein the virtual bus forwarding device is used for forwarding data between the upgrade processing device and the master station and other sending terminals. Specifically, after receiving an upgrade preparation request sent by a master station, a virtual bus forwarding device analyzes the upgrade preparation request to obtain a data identifier carried in the upgrade preparation request, determines a corresponding upgrade processing device according to the data identifier, and forwards an upgrade accurate request to the corresponding upgrade processing device; after receiving an upgrade preparation request sent by a virtual bus forwarding device, an upgrade processing device performs upgrade preparation according to an upgrade accurate request; the process of performing upgrade preparation according to the upgrade preparation request may include: and analyzing the upgrade preparation request, and checking the legality of the sending end and the integrity of the original upgrade file according to the preparation information (such as the size of a preset data frame, a preset check code and a preset byte amount) obtained by analysis.
When the master station sends the original upgrading file to the ammeter, the original upgrading file can be segmented into a plurality of data frames, then the original upgrading file is sent to the ammeter in a data frame mode, and correspondingly, an upgrading processing device of the ammeter receives the data frames of the original upgrading file sent by the master station; in order to avoid errors in the transmission process of the data frame of the original upgrade file, the upgrade processing device can verify the data frame of the original upgrade file, and after the verification is passed, the upgrade processing device sends a data frame receiving response to the master station to trigger the master station to send the next data frame of the original upgrade file. Fig. 4 shows a flow in which the upgrade processing apparatus receives a data frame of an original upgrade file. The process is described in connection with fig. 4:
step S402, the virtual bus forwarding device analyzes the upgrade preparation request to obtain a data identifier carried in the upgrade preparation request, determines a corresponding upgrade processing device according to the data identifier, and forwards the upgrade accurate request to the corresponding upgrade processing device;
step S404, the upgrading processing device analyzes the upgrading preparation request to obtain the size of a preset data frame;
step S406, after receiving the data frame of the original upgrade file sent by the master station, the virtual bus forwarding device forwards the data frame to the upgrade processing device, the upgrade processing device judges the integrity of the data frame according to the size of the preset data frame, and if the data frame is not complete, the virtual bus forwarding device sends a corresponding response to the master station so that the master station returns the complete data frame of the original upgrade file;
step S408, if the data frame is complete, the upgrading processing device analyzes the data frame of the original upgrading file, and in the analyzing process, the upgrading processing device judges the type of the control code read-write request of the data;
step S410, if the upgrade processing device confirms that the control code of the data is a write request, judging the legality of the write data;
step S412, if the upgrading processing device confirms that the written data is legal, the upgrading state word can be modified to be downloaded;
step S414, if not, the upgrade processing device determines whether the request is a read request, step S416, if so, the upgrade processing device determines that the data can be extracted according to the data identifier in the read state, and determines that the data is in a normal state, and step S418, the upgrade processing device generates a corresponding normal response frame and sends the normal response frame to the virtual bus forwarding device; the virtual bus forwarding device generates a data frame receiving response according to the normal response frame, sends the data frame receiving response to the master station, and sends the next data frame of the original upgrade file to the ammeter after the master station receives the data frame receiving response;
step S420, if the upgrade processing device confirms that the written data is illegal or confirms that the control code of the data is not a writing request or a reading request, the upgrade processing device confirms that the data is in an abnormal state, generates an abnormal response frame and sends the abnormal response frame to the virtual bus forwarding device; and the virtual bus forwarding device generates a data frame retransmission response according to the abnormal response frame, sends the data frame retransmission response to the master station, and sends the data frame of the original upgrade file to the ammeter again after receiving the data frame retransmission response.
In some embodiments, if the upgrade preparation request may carry a preset check code and a preset byte amount, the upgrade processing device may further obtain the preset check code and the preset byte amount after analyzing the upgrade preparation request, and the preset check code and the preset byte amount are used for checking the original upgrade file; fig. 5 shows a process of verifying an original upgrade file by the upgrade processing apparatus, specifically:
step S502, after the upgrade processing device records the data frame of the original upgrade file, step S504, determining whether the data frame is legal, the determination process of this step may refer to the description of fig. 4, which is not described herein;
step S506, if the file is legal, loading the next data frame of the original upgrade file, and judging the validity of the next data frame in the step S504;
step S508, if not legal, recording the serial number of the current data frame, and sending a file missing response to the master station, where the specific content of this step is described below and will not be described in detail herein;
step S510, the upgrading processing device judges whether all data frames of the original upgrading file are loaded or not;
step S512, if all data frames are loaded, the upgrading processing device can change the upgrading state words into the data frames to be checked;
step S514, the upgrade processing device checks the original upgrade file;
step S516, the upgrading processing device judges whether the verification is successful;
step S518, if yes, determining that the sending end of the original upgrade file is a legal master station, and modifying the upgrade state word into a verification success;
step S520, if not, the verification of the original upgrade file is determined to be failed, and the upgrade state word is modified to be failed.
In step S514, when the upgrade processing device verifies the original upgrade file, the upgrade processing device may encrypt all data frames of the original upgrade file to obtain an actual check code, determine whether the actual check code is consistent with a preset check code, and if so, determine that the transmitting end is a legal master station; the upgrade processing device can also calculate the actual byte amount of all data frames of the original upgrade file, and if the actual byte amount is consistent with the preset byte amount, the upgrade processing device can determine that the original upgrade file is a complete upgrade file; the upgrade processing device can also judge that the original upgrade file passes the verification after determining that the validity of the sending end and the original upgrade file are complete upgrade files.
In step S508, when the upgrade processing device determines that the current data frame is illegal, the upgrade processing device may record a serial number of the failed current data frame, use the serial number as missing information, and send the missing information to the virtual bus forwarding device, and the virtual bus forwarding device generates a file missing response according to the missing information and sends the file missing response to the master station; and after receiving the file missing response sent by the electric meter, the master station analyzes the file missing response to obtain missing information, determines a corresponding missing data frame according to the missing information, and sends the missing data frame serving as missing data to the electric meter so that the upgrading processing device receives the missing data.
In one scenario, if only one electric meter fails to be loaded, the master station can send the missing data to the electric meter in a point-to-point transmission mode; if the loading of a plurality of electric meters fails, the main station can send the missing data to the plurality of electric meters in a broadcast transmission mode. Specifically, after receiving a file missing response returned by the electric meter, the master station judges the number of the received file missing responses, if only one file missing response is confirmed, the corresponding missing data is sent to the corresponding electric meter in a point-to-point transmission mode, the missing data is sent to a specific electric meter in the point-to-point transmission mode, and transmission resources of a network are saved; if the file missing responses corresponding to different electric meters are confirmed, namely different file missing responses are sent by different electric meters, the master station can send the missing data to each electric meter in a broadcast transmission mode at the moment, so that the corresponding upgrading processing device can receive the missing data, and the upgrading efficiency of the electric meter management unit software can be improved by sending the missing data in the broadcast transmission mode.
In some application scenarios, in order to further improve the upgrading efficiency of the software of the electric meter management unit, the upgrading processing device sends an upgrading instruction to the upgrading execution device through an upgrading calling interface of the upgrading execution device; fig. 4 shows an interaction flow among the virtual bus forwarding device, the upgrade processing device, and the upgrade executing device in the electric meter, and a process of the upgrade processing device sending the upgrade instruction to the upgrade executing device through the upgrade invoking interface is introduced with reference to fig. 4:
(1) an upgrade preparation stage:
the virtual bus forwarding device receives an upgrade preparation request sent by the master station, and sends the upgrade preparation request to the upgrade processing device, the upgrade processing device reads and writes data and loads a current data frame after receiving the upgrade preparation request, and sends a data frame receiving response to the virtual bus forwarding device after the upgrade processing device finishes loading the data frame, and the virtual bus forwarding device forwards the data frame receiving response to the master station so that the master station sends the next data frame of an original upgrade file; after the upgrade processing device has loaded all the data frames of the original upgrade file, the upgrade processing device may be considered to complete the preparation for upgrade.
(2) And (3) checksum format conversion of the original upgrade file:
after the upgrade processing device completes the upgrade preparation, the original upgrade file is verified, and the specific verification process may refer to the descriptions of other embodiments, which are not described herein; after the upgrade processing device confirms that the original upgrade file passes the verification, the original upgrade file is converted according to the upgrade format of the upgrade execution device to obtain a converted upgrade file; then the upgrade processing device extracts file description information (such as name, storage path and the like of the conversion upgrade file) of the conversion upgrade file from the conversion upgrade file, and generates an upgrade instruction according to the file description information.
(3) Triggering the upgrade execution device to execute the upgrade operation:
the upgrade processing device acquires the current time and judges whether the current time accords with the upgrade activation time, if so, the upgrade processing device sends an upgrade instruction to the upgrade execution device through the upgrade calling interface; and after receiving the upgrading instruction, the upgrading instruction is analyzed by the upgrading execution device to obtain the file description information, the corresponding conversion upgrading file is determined according to the file description information, and the software of the electric meter management unit is upgraded according to the determined conversion upgrading file.
It should be understood that although the various steps in the flow charts of fig. 2-6 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-6 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 7, there is provided an upgrade processing apparatus 700 for software of a twin-core smart electricity meter management unit, including: a file checking module 702, a file format conversion module 704, an instruction generating module 706 and an instruction sending module 708, wherein:
a file checking module 702, configured to check an original upgrade file; the original upgrading file is used for upgrading the software of the electric meter management unit in the electric meter;
the file format conversion module 704 is used for converting the original upgrade file according to the upgrade format of the upgrade execution device to obtain a converted upgrade file if the verification is passed;
an instruction generating module 706, configured to generate an upgrade instruction according to the converted upgrade file;
an instruction sending module 708, configured to send the upgrade instruction to the upgrade execution device; the upgrading instruction is used for indicating the upgrading execution device to determine the corresponding conversion upgrading file and executing the upgrading of the software of the electric meter management unit according to the determined conversion upgrading file.
In an embodiment, the instruction generating module 706 is further configured to generate corresponding file description information according to the converted upgrade file, obtain an upgrade instruction according to the file description information, and send the upgrade instruction to the upgrade executing apparatus through the upgrade invoking interface; the file description information is used for determining a corresponding conversion upgrading file.
In an embodiment, the upgrade processing apparatus 700 is further configured to obtain a current time, and send an upgrade instruction to the upgrade execution apparatus if the current time matches a preset upgrade activation time.
In an embodiment, the upgrade processing apparatus 700 is further configured to check validity of the sending end and integrity of the original upgrade file according to the upgrade preparation request sent by the master station.
In one embodiment, the upgrade preparation request carries a preset check code and a preset byte amount; the upgrade processing device 700 is further configured to encrypt the original upgrade file to obtain an actual check code, and if the actual check code is consistent with a preset check code, determine that a sending end of the original upgrade file is a legal master station; and calculating the actual byte quantity of the original upgrade file, if the actual byte quantity is consistent with the preset byte quantity, determining the original upgrade file as a complete upgrade file, and judging that the verification of the original upgrade file is passed.
In one embodiment, the upgrade processing apparatus 700 is further configured to, after determining that the original upgrade file is an upgrade file with data missing, return a file missing response to the master station, and receive first missing data or second missing data returned by the master station in response to the file missing response; the master station is connected with a plurality of electric meters, and the first missing data is returned by the master station in a point-to-point transmission mode after the file missing response is determined to be one; and the second missing data is returned by the master station in a broadcast transmission mode after the file missing responses are determined to be multiple, and each file missing response corresponds to a different ammeter.
In one embodiment, the upgrade processing apparatus 700 is further configured to receive an upgrade preparation request forwarded by the virtual bus forwarding apparatus; and the virtual bus forwarding device is used for receiving the upgrading preparation request sent by the master station and forwarding the upgrading preparation request to the upgrading processing device corresponding to the data identifier according to the data identifier carried in the upgrading preparation request. For the specific limitation of the upgrade processing device, reference may be made to the above limitation on the upgrade method of the software of the electric meter management unit, and details are not described here. The modules in the upgrade processing apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be an electric meter or a server, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores upgrade data of an upgrade execution device, a computer program, and electricity meter management unit software. The internal memory provides an environment for the upgrade execution apparatus and the execution of the computer program in the nonvolatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement the steps in the various embodiments described above.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the respective embodiments described above.
It should be noted that, the steps executed by the processor in the computer device correspond to the steps described in the other embodiments of the present application, and the contents and the corresponding technical effects described in the embodiments are all applicable to the embodiments of the computer device, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for upgrading software of a management unit of a dual-core intelligent ammeter comprises the following steps:
the upgrading method comprises the steps that an upgrading processing device verifies an original upgrading file, after the original upgrading file passes the verification, the original upgrading file is converted according to the upgrading format of an upgrading execution device to obtain a converted upgrading file, and an upgrading instruction is sent to the upgrading execution device; the original upgrading file is used for upgrading management unit software in the electric meter, and the upgrading instruction is generated according to the conversion upgrading file;
after receiving the upgrading instruction sent by the upgrading processing device, the upgrading execution device determines a corresponding conversion upgrading file and executes the upgrading of the management unit software according to the determined conversion upgrading file;
when the upgrade processing device sends an upgrade instruction to the upgrade execution device, the method includes:
the upgrade processing device generates corresponding file description information according to the conversion upgrade file, wherein the file description information is used for determining the corresponding conversion upgrade file; obtaining the upgrading instruction according to the file description information; and sending the upgrading instruction to the upgrading execution device through an upgrading calling interface.
2. The upgrade method according to claim 1, wherein the upgrade processing apparatus, when sending the upgrade instruction to the upgrade execution apparatus, comprises: and the upgrade processing device acquires the current time, and sends the upgrade instruction to the upgrade execution device if the current time accords with the preset upgrade activation time.
3. The upgrade method according to claim 1, further comprising:
and the upgrading processing device checks the legality of the sending end and the integrity of the original upgrading file according to an upgrading preparation request sent by the master station.
4. The upgrade method according to claim 3, wherein the upgrade preparation request carries a preset check code and a preset byte amount;
the upgrade processing device checks the validity of the sending end and the integrity of the original upgrade file according to an upgrade preparation request sent by the master station, and the upgrade processing device comprises:
the upgrading processing device encrypts the original upgrading file to obtain an actual check code, and if the actual check code is consistent with the preset check code, the sending end of the original upgrading file is determined to be a legal master station; and calculating the actual byte quantity of the original upgrade file, if the actual byte quantity is consistent with the preset byte quantity, determining the original upgrade file as a complete upgrade file, and judging that the verification of the original upgrade file passes.
5. The upgrade method according to claim 4, further comprising:
the upgrading processing device returns a file missing response to a master station after determining that the original upgrading file is the upgrading file with data missing, and receives first missing data or second missing data returned by the master station aiming at the file missing response; the system comprises a master station, a plurality of electric meters, a plurality of data processing units and a plurality of data processing units, wherein the master station is connected with the plurality of electric meters, and the first missing data is returned by the master station in a point-to-point transmission mode after the master station determines that the file missing responses are one; and the second missing data is returned by the master station in a broadcast transmission mode after determining that a plurality of file missing responses are provided, and each file missing response corresponds to a different ammeter.
6. The upgrade method according to claim 3, further comprising:
and the virtual bus forwarding device receives an upgrade preparation request sent by the master station, and forwards the upgrade preparation request to an upgrade processing device corresponding to the data identifier according to the data identifier carried in the upgrade preparation request.
7. An upgrade processing device for software of a dual-core intelligent ammeter management unit comprises:
the file checking module is used for checking the original upgrading file; the original upgrading file is used for upgrading management unit software in the ammeter;
the file format conversion module is used for converting the original upgrade file according to the upgrade format of the upgrade execution device to obtain a conversion upgrade file if the verification is passed;
the instruction generating module is used for generating an upgrading instruction according to the conversion upgrading file;
the instruction sending module is used for sending the upgrading instruction to an upgrading execution device; the upgrading instruction is used for indicating the upgrading execution device to determine a corresponding conversion upgrading file and executing the upgrading of the management unit software according to the determined conversion upgrading file;
the instruction generating module is also used for generating corresponding file description information according to the conversion upgrading file; obtaining the upgrading instruction according to the file description information; sending the upgrading instruction to the upgrading execution device through an upgrading calling interface; and the file description information is used for determining a corresponding conversion upgrading file.
8. The upgrade processing device according to claim 7, wherein the instruction sending module is further configured to obtain a current time, and send the upgrade instruction to the upgrade execution device if the current time matches a preset upgrade activation time.
9. The upgrade processing apparatus according to claim 7, wherein the upgrade processing apparatus is configured to check validity of a sending end and integrity of the original upgrade file according to an upgrade preparation request sent by a master station.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202010349975.0A 2020-04-28 2020-04-28 Method and device for upgrading software of management unit of double-core intelligent ammeter and storage medium Active CN111488166B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010349975.0A CN111488166B (en) 2020-04-28 2020-04-28 Method and device for upgrading software of management unit of double-core intelligent ammeter and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010349975.0A CN111488166B (en) 2020-04-28 2020-04-28 Method and device for upgrading software of management unit of double-core intelligent ammeter and storage medium

Publications (2)

Publication Number Publication Date
CN111488166A CN111488166A (en) 2020-08-04
CN111488166B true CN111488166B (en) 2021-06-04

Family

ID=71813072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010349975.0A Active CN111488166B (en) 2020-04-28 2020-04-28 Method and device for upgrading software of management unit of double-core intelligent ammeter and storage medium

Country Status (1)

Country Link
CN (1) CN111488166B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035142B (en) * 2020-09-01 2023-08-18 中国银行股份有限公司 Data processing method, device and equipment based on software maintenance
CN112217795B (en) * 2020-09-07 2022-08-26 国家电网有限公司 Method and device for managing communication security of intelligent electric meter
CN112346904A (en) * 2020-10-20 2021-02-09 威胜集团有限公司 Smart electric meter calibration method and device, smart electric meter and storage medium
CN112395012B (en) * 2020-11-03 2024-02-27 南方电网数字电网科技(广东)有限公司 Data emptying method and device based on double-core intelligent ammeter and computer equipment
CN112506540B (en) * 2020-12-01 2021-08-27 南方电网电力科技股份有限公司 Electric energy meter application upgrading method, electric energy meter and system
CN112416408B (en) * 2020-12-08 2024-09-03 金卡智能集团股份有限公司 Firmware upgrading method, device, equipment and computer readable storage medium
CN112783541B (en) * 2021-01-21 2024-08-27 成都路行通信息技术有限公司 Equipment upgrading method, device and server
CN112994939B (en) * 2021-02-23 2022-02-18 合肥师范学院 Remote automatic upgrading method and system for equipment software of Internet of things
CN113688051A (en) * 2021-08-31 2021-11-23 南方电网科学研究院有限责任公司 Electric energy meter software upgrading test method and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101232679A (en) * 2008-02-25 2008-07-30 中兴通讯股份有限公司 Processing method of software upgrade information and software upgrade method
US10251032B2 (en) * 2014-01-20 2019-04-02 Samsung Electronics Co., Ltd. Electronic device for sharing data and method for controlling the same
CN109002303A (en) * 2017-05-26 2018-12-14 中兴通讯股份有限公司 A kind of intelligent electric meter firmware upgrade method, equipment and storage medium
CN110166554A (en) * 2019-05-22 2019-08-23 宁波三星医疗电气股份有限公司 Ammeter update device, method, concentrator and storage medium

Also Published As

Publication number Publication date
CN111488166A (en) 2020-08-04

Similar Documents

Publication Publication Date Title
CN111488166B (en) Method and device for upgrading software of management unit of double-core intelligent ammeter and storage medium
CN109474578B (en) Message checking method, device, computer equipment and storage medium
CN110764807B (en) Upgrading method, system, server and terminal equipment
CN106294102A (en) The method of testing of application program, client, server and system
CN109658542B (en) Diagnostic parameter data verification method, diagnostic parameter data verification device, vehicle diagnostic equipment and storage medium
CN113360301B (en) Message transmission system and method
CN110888838A (en) Object storage based request processing method, device, equipment and storage medium
CN111897846A (en) Cache data verification method, device, equipment and storage medium
CN114185808A (en) Automatic testing method and device, electronic equipment and computer readable storage medium
EP3805918B1 (en) Program update system, program transmission device, and program transmission method
CN112181822A (en) Test method and test method for starting time consumption of application program
CN112084114B (en) Method and apparatus for testing interfaces
CN110855718B (en) Enterprise user registration method and device, electronic equipment and computer readable medium
CN108763934B (en) Data processing method and device, storage medium and server
CN112446723A (en) Method, computer-readable storage medium, and apparatus for determining user invitation relationship
CN112187561B (en) Communication module testing method, device, computer equipment and storage medium
CN111459819B (en) Software testing method and device, electronic equipment and computer readable medium
CN114168108A (en) Code merging method and device, electronic equipment and computer readable storage medium
CN113283891A (en) Information processing method and device and electronic equipment
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN113778492B (en) Method, device, equipment and storage medium for issuing capability API
CN117332412B (en) Detection method and device for data security system and electronic equipment
CN117032727B (en) File compiling method, device, equipment, medium and product based on block chain
CN115712412A (en) Software package manufacturing method and device, electronic equipment and storage medium
CN110321274B (en) Application program testing method and device, computing equipment and storage medium

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
CB02 Change of applicant information

Address after: Room 86, room 406, No.1, Yichuang street, Zhongxin Guangzhou Knowledge City, Huangpu District, Guangzhou City, Guangdong Province

Applicant after: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

Address before: 511458 Room 1301, Chengtou Building, 106 Fengze East Road, Nansha District, Guangzhou City, Guangdong Province (self-compiled 1301-12159)

Applicant before: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230413

Address after: Full Floor 14, Unit 3, Building 2, No. 11, Middle Spectra Road, Huangpu District, Guangzhou, Guangdong 510700

Patentee after: China Southern Power Grid Digital Grid Technology (Guangdong) Co.,Ltd.

Address before: Room 86, room 406, No.1, Yichuang street, Zhongxin Guangzhou Knowledge City, Huangpu District, Guangzhou City, Guangdong Province

Patentee before: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

TR01 Transfer of patent right