CN117519753A - Remote upgrading method, device and equipment of terminal equipment and storage medium - Google Patents
Remote upgrading method, device and equipment of terminal equipment and storage medium Download PDFInfo
- Publication number
- CN117519753A CN117519753A CN202311556736.2A CN202311556736A CN117519753A CN 117519753 A CN117519753 A CN 117519753A CN 202311556736 A CN202311556736 A CN 202311556736A CN 117519753 A CN117519753 A CN 117519753A
- Authority
- CN
- China
- Prior art keywords
- equipment
- target
- upgrade
- upgrade package
- information
- 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 47
- 238000012790 confirmation Methods 0.000 claims abstract description 12
- 238000012795 verification Methods 0.000 claims abstract description 9
- 238000011161 development Methods 0.000 claims description 30
- 238000004590 computer program Methods 0.000 claims description 16
- 230000006870 function Effects 0.000 claims description 8
- 125000004122 cyclic group Chemical group 0.000 claims description 4
- 238000009434 installation Methods 0.000 abstract description 7
- 239000000463 material Substances 0.000 abstract description 6
- 238000004891 communication Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 5
- 230000003993 interaction Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 239000003999 initiator Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/544—Remote
-
- 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
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention relates to the technical field of power grids, and discloses a remote upgrading method, device and equipment of end equipment and a storage medium. The method comprises the following steps: when an equipment upgrading instruction issued by a target client is detected, acquiring target equipment, and sending an equipment information inquiry command based on a modbus protocol; receiving target equipment information and forwarding the target equipment information to a cloud platform based on a curl protocol; when the verification passing information is detected, an upgrade package issued by the cloud platform is received, and upgrade prompt information is generated and sent to target end equipment; when a confirmation instruction is detected, an upgrade package is sent to target-end equipment; and when a successful restart notification is detected, determining that the upgrading of the target-end equipment is completed. According to the technical scheme, interconnection and intercommunication with the terminal equipment are realized by adopting a modbus protocol based on an OpenHarmony system, remote upgrading of the terminal equipment can be realized, an engineer can be prevented from going to an equipment installation site, manpower and material resources can be saved, and equipment upgrading efficiency can be improved.
Description
Technical Field
The present invention relates to the field of power grid technologies, and in particular, to a method, an apparatus, a device, and a storage medium for remote upgrade of an end device.
Background
With the continuous upgrading and adding of new functions of the power end equipment acquisition system, the concentrator which is already operated on site cannot meet the functional requirements of the system, so that continuous upgrading and transformation are required.
At present, the existing upgrading method of the power terminal equipment generally upgrades the terminal equipment on the installation site, and specifically, the power terminal equipment is connected with a personal computer host based on an RS485 interface or an RS232 interface; then, presetting waiting time in an operation program of the power end equipment, and in the preset waiting time, carrying out data interaction between the personal computer host and the end equipment by the personal computer host, wherein the data interaction comprises sending a handshake signal to the end equipment; after successful handshake, the personal computer host starts to send the upgrade file, and the terminal equipment enters a file receiving mode and performs equipment upgrade based on the upgrade file after receiving is completed. However, in the prior art, an engineer is required to go to the installation site of the equipment, so that manpower and material resources are wasted greatly, and the upgrading efficiency is low.
Disclosure of Invention
The invention provides a remote upgrading method, a device, equipment and a storage medium for end equipment, which can realize remote upgrading of power end equipment, can avoid the need of an engineer to go to an equipment installation site, can save manpower and material resources and can improve equipment upgrading efficiency.
According to an aspect of the present invention, there is provided a remote upgrade method of an end device, applied to an OpenHarmony development board, including:
when an equipment upgrading instruction issued by a target client is detected, acquiring target end equipment corresponding to the equipment upgrading instruction, and sending an equipment information inquiry command to the target end equipment based on a modbus protocol;
receiving target equipment information corresponding to the equipment information query command fed back by the target end equipment, and forwarding the target equipment information to a cloud platform based on a curl protocol so that the cloud platform performs validity check on the target equipment information;
when detecting that the verification passing information fed back by the cloud platform is detected, receiving an upgrade package issued by the cloud platform, and generating and sending upgrade prompt information to the target terminal equipment;
when a confirmation instruction corresponding to the upgrade prompt information fed back by the target end equipment is detected, sending the upgrade package to the target end equipment so that the target end equipment performs equipment upgrade based on the upgrade package;
and when a successful restarting notification sent by the target terminal equipment is detected, determining that the target terminal equipment is upgraded.
According to another aspect of the present invention, there is provided a remote upgrade apparatus for an end device, applied to an OpenHarmony development board, including:
the target end equipment acquisition module is used for acquiring target end equipment corresponding to the equipment upgrading instruction when the equipment upgrading instruction issued by the target client is detected, and sending an equipment information inquiry command to the target end equipment based on a modbus protocol;
the target equipment information forwarding module is used for receiving target equipment information corresponding to the equipment information query command fed back by the target end equipment, forwarding the target equipment information to a cloud platform based on a curl protocol, and enabling the cloud platform to perform validity check on the target equipment information;
the upgrade package receiving module is used for receiving the upgrade package issued by the cloud platform when detecting that the verification fed back by the cloud platform passes through the information, and generating and sending upgrade prompt information to the target terminal equipment;
the upgrade package sending module is used for sending the upgrade package to the target terminal equipment when detecting a confirmation instruction corresponding to the upgrade prompt information fed back by the target terminal equipment, so that the target terminal equipment performs equipment upgrade based on the upgrade package;
and the upgrading completion determining module is used for determining that the target end equipment is upgraded when a successful restarting notification sent by the target end equipment is detected.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform a remote upgrade method for an end device according to any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a remote upgrade method of an end device according to any embodiment of the present invention.
According to the technical scheme, the OpenHarmony development board is used for acquiring target end equipment corresponding to the equipment upgrading instruction after detecting the equipment upgrading instruction issued by the target client, and sending an equipment information inquiry command to the target end equipment based on a modbus protocol; then, receiving target equipment information corresponding to an equipment information query command fed back by target end equipment, and forwarding the target equipment information to a cloud platform based on a curl protocol so as to enable the cloud platform to perform validity check on the target equipment information; when checking passing information fed back by the cloud platform is detected, receiving an upgrade package issued by the cloud platform, and generating and sending upgrade prompt information to target end equipment; when a confirmation instruction corresponding to the upgrade prompt information fed back by the target end equipment is detected, an upgrade package is sent to the target end equipment, so that the target end equipment performs equipment upgrade based on the upgrade package; finally, when a successful restart notification sent by the target terminal equipment is detected, determining that the target terminal equipment is upgraded; through based on OpenHarmony system, adopt the interconnection intercommunication of modbus protocol realization and end equipment, can realize the remote upgrading of opposite terminal equipment, can avoid needing the engineer to go to the equipment installation scene, can save manpower and material resources, can promote equipment upgrading efficiency.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1A is a schematic diagram of a service framework to which embodiments of the present invention apply;
fig. 1B is a flowchart of a method for remote upgrade of an end device according to a first embodiment of the present invention;
fig. 2 is a schematic structural diagram of a remote upgrade apparatus for an end device according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device implementing a remote upgrade method of an end device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," "target," and the like in the description and claims of the present invention and in the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In order to facilitate understanding of the technical scheme of the present invention, an application scenario of the technical scheme of the present embodiment is first introduced. Specifically, the service framework applied in the technical solution of the present embodiment may be a C (Client)/S (Server) architecture as shown in fig. 1A; the development board based on OpenHarmony3.2Release is used as a Client terminal, electric power terminal equipment needing equipment upgrading is used as a Server terminal, the Client terminal can be remotely connected with a plurality of Server terminals through an RS-485 bus, and remote data communication with the plurality of Server terminals is realized by using a modbus protocol.
In this embodiment, the Client may be used as an initiator of device upgrade, perform data communication with the cloud platform based on a curl (command line) URL, and when detecting a device upgrade instruction, forward an upgrade file issued by the cloud platform to a Server that needs to perform device upgrade at present, where the Client may be provided with a failure retransmission mechanism, and may perform multiple retransmission attempts when transmission of the upgrade file fails. The Server end is used as an executive party of equipment upgrading, after receiving the upgrading file sent by the Client end, the Server end can analyze the upgrading file, can upgrade the equipment based on analysis content, and finally can answer the upgrading result to the Client end.
Example 1
Fig. 1B is a flowchart of a remote upgrade method of an end device according to an embodiment of the present invention, where the method may be performed by a remote upgrade apparatus of an end device, the remote upgrade apparatus of the end device may be implemented in hardware and/or software, the remote upgrade apparatus of the end device may be configured in an electronic device, and typically, the electronic device may be an OpenHarmony development board. As shown in fig. 1B, the method includes:
s110, when an equipment upgrading instruction issued by a target client is detected, acquiring target end equipment corresponding to the equipment upgrading instruction, and sending an equipment information inquiry command to the target end equipment based on a modbus protocol.
The target client can be an application program written based on preset program voice and used for controlling the terminal equipment to carry out system upgrading. In this embodiment, a target client may be installed in the OpenHarmony development board in advance, and the target client may support operations such as adding, deleting, information viewing, and device upgrading of the peer device. Specifically, the user may select an end device that needs to be upgraded in the target client, and click on the device upgrade button to send a device upgrade instruction. The device upgrade instruction may include information such as an end device identifier, an instruction type, and the like.
Specifically, after receiving the device upgrade instruction, the OpenHarmony development board may parse the device upgrade instruction to determine an end device that needs to perform device upgrade, that is, a target end device. Then, a device information query command may be sent to the target device over a pre-deployed RS-485 bus based on the modbus protocol. After receiving the device information query instruction, the target device may feed its own device information, for example, the current system version, device attribute, etc., back to the OpenHarmony development board.
S120, receiving target equipment information corresponding to the equipment information query command fed back by the target end equipment, and forwarding the target equipment information to a cloud platform based on a curl protocol so that the cloud platform performs validity check on the target equipment information.
Specifically, after receiving the target device information, the OpenHarmony development board may encapsulate the target device information and then send the target device information to the cloud platform through a curl protocol; after receiving the target device information, the cloud platform may perform validity verification on the target device information according to a locally preset validity verification rule, for example, determine whether stored information matched with the target device information exists locally. Then, if the cloud platform determines that the target device information successfully passes the validity check, the cloud platform can generate and send check passing information to the OpenHarmony development board, and can issue an upgrade package required to be used for upgrading the current device to the OpenHarmony development board.
Secondly, if the cloud platform detects that the target device information fails to pass the validity check, the cloud platform can generate and send check failure information to an OpenHarmony development board so as to indicate that the device information of the target device is abnormal.
S130, when checking passing information fed back by the cloud platform is detected, an upgrade package issued by the cloud platform is received, and upgrade prompt information is generated and sent to the target terminal equipment.
Specifically, after detecting the verification passing information fed back by the cloud platform, the OpenHarmony development board can download an upgrade package issued by the cloud platform to the local, and can generate rules according to preset prompt information, for example, take the upgrade package information as upgrade prompt information and the like, generate upgrade prompt information corresponding to the upgrade package, and further can send the upgrade prompt information to the target terminal device based on a modbus protocol. The target terminal equipment can be an information acquisition terminal in the electric power field.
After the target device receives the upgrade prompt information successfully, a confirmation instruction can be generated and fed back to the OpenHarmony development board so as to indicate that the device upgrade is ready.
And S140, when a confirmation instruction corresponding to the upgrade prompt information fed back by the target terminal equipment is detected, sending the upgrade package to the target terminal equipment, so that the target terminal equipment performs equipment upgrade based on the upgrade package.
Specifically, after receiving a confirmation instruction fed back by the target end device, the OpenHarmony development board may transmit an upgrade packet to the target end device based on a modbus protocol; after receiving the upgrade package, the target device may parse the content of the upgrade package based on the data structure of the modbus protocol to obtain upgrade data, and attempt to upgrade the device based on the upgrade data.
Wherein, the upgrade package is based on a modbus protocol, and each data frame is 2048 bytes; the method comprises the steps of setting a default initial value corresponding to a current upgrade package round field to be 1, wherein 2 bytes correspond to a register address field, 2 bytes correspond to a register number field, 2 bytes correspond to a total upgrade package round field, and 2 bytes correspond to the current upgrade package round field.
It should be noted that, the single frame data of the modbus protocol is limited to 256 bytes, and the upgrade package in this embodiment is generally larger, so that the transmission time will be increased. In order to solve the above problems, the present embodiment modifies the modbus protocol, and expands each frame of data to 2048 bytes by expanding the number of registers of the protocol, so that the transmission time of the upgrade package can be optimized to the same level as that of directly transmitting data through the serial port.
Optionally, the data frame may further include at least one of a destination device identification field, a function code field, a byte number field, an upgrade packet data field, and a cyclic redundancy check field.
In a specific example, the message structure of the modbus protocol data frame may be as shown in table 1. The target end equipment identification field consists of 1 byte, and the value range is 0x 01-0 x64, and respectively represents 1-100 end equipment; the function code field corresponds to 1 byte, and the value represents the function of the data frame and can be identified by the slave station; register address and number fields respectively corresponding to two bytes, wherein the values respectively represent the initial address of data and the number of registers and can be identified by the slave station; a byte number field, the value representing the total number of bytes of data; the total upgrade package round field corresponds to two bytes, and the value represents the total number of retries of upgrade failure; the current upgrade package corresponds to two bytes, and the value indicates the current time for transmitting the upgrade file; the upgrade package data field may correspond to N bytes, with a value representing the data content actually used to perform the device upgrade.
Table 1 message Structure of modbus protocol data frame
It should be noted that, the terminal device does not need to migrate the Libmodbus protocol stack, and only needs to receive data through the RS-485 bus, parse the modbus protocol data in a fixed format, and encapsulate the modbus protocol data packet to answer the OpenHarmony device.
And S150, when a successful restart notification sent by the target terminal equipment is detected, determining that the target terminal equipment is upgraded.
Specifically, after the target device performs device upgrade based on the received upgrade package, the target device needs to restart the device to take effect of the upgrade. After a successful restart, the target device may generate a successful restart notification to send to the OpenHarmony development board. When receiving a successful restart notification sent by the target device, the OpenHarmony development board can determine that the target device is successfully upgraded, and can send a notification message of the success upgrade to the target client.
Optionally, if the OpenHarmony development board does not receive the successful restart notification fed back by the target device within the preset time threshold, the OpenHarmony development board indicates that the device upgrade of the current round fails, and at this time, the upgrade package may be sent again according to the preset total upgrade package round until the successful restart notification fed back by the target device is received, or the total upgrade package round is reached.
According to the technical scheme, the OpenHarmony development board is used for acquiring target end equipment corresponding to the equipment upgrading instruction after detecting the equipment upgrading instruction issued by the target client, and sending an equipment information inquiry command to the target end equipment based on a modbus protocol; then, receiving target equipment information corresponding to an equipment information query command fed back by target end equipment, and forwarding the target equipment information to a cloud platform based on a curl protocol so as to enable the cloud platform to perform validity check on the target equipment information; when checking passing information fed back by the cloud platform is detected, receiving an upgrade package issued by the cloud platform, and generating and sending upgrade prompt information to target end equipment; when a confirmation instruction corresponding to the upgrade prompt information fed back by the target end equipment is detected, an upgrade package is sent to the target end equipment, so that the target end equipment performs equipment upgrade based on the upgrade package; finally, when a successful restart notification sent by the target terminal equipment is detected, determining that the target terminal equipment is upgraded; through based on OpenHarmony system, adopt the interconnection intercommunication of modbus protocol realization and end equipment, can realize the remote upgrading of opposite terminal equipment, can avoid needing the engineer to go to the equipment installation scene, can save manpower and material resources, can promote equipment upgrading efficiency.
In an optional implementation manner of this embodiment, sending the upgrade packet to the target end device may include:
acquiring a target byte corresponding to a current upgrade packet round field of each data frame in the upgrade packet, and acquiring byte content corresponding to the target byte;
judging whether the byte content corresponding to the target byte is a default initial value, if so, determining to send the upgrade package for the first time, and directly sending the upgrade package to the target terminal equipment.
Specifically, when the OpenHarmony development board sends an upgrade package, firstly, after receiving the upgrade package issued by the cloud platform, the OpenHarmony development board can search and obtain two bytes corresponding to a current upgrade package round field according to the data structure of the modbus protocol data frame, so as to serve as target bytes, and can read byte contents corresponding to the target bytes; then, if it is determined that the byte content is the default initial value of 1, it indicates that the upgrade package is currently transmitted for the first time, and at this time, it may be directly transmitted.
In another optional implementation manner of this embodiment, after directly sending the upgrade packet to the target end device, the method may further include:
if a successful restarting notification sent by the target terminal equipment is not detected within a preset time threshold, determining that the current upgrade package fails to upgrade, and acquiring a current upgrade package round value;
acquiring a total upgrade package round value corresponding to a total upgrade package round field of each data frame in the upgrade package, and judging whether the current upgrade package round value is smaller than or equal to the total upgrade package round value;
and if the current upgrade package round value is smaller than or equal to the total upgrade package round value, rewriting byte content corresponding to each target byte into the current upgrade package round value to obtain a current round upgrade package, and sending the current round upgrade package to the target terminal equipment.
Specifically, after the upgrade package is sent for the first time, if a successful restart notification fed back by the target device is not received within a preset time threshold (for example, 5 minutes, etc.), it indicates that a sending failure or an upgrade failure may occur, where a total upgrade package round value may be read from a byte corresponding to the total upgrade package round field, for example, the total upgrade package round value may be 5. Then, 1 can be added to the byte content corresponding to the target byte to be used as the current upgrade package round value, namely, the current upgrade package round value is 2; at this time, the current upgrade package round value 2 is smaller than the total upgrade package round value 5, and the upgrade package transmission can be continuously attempted.
The current upgrade package round value indicates the current time of sending the upgrade package. In this embodiment, before the upgrade package is retransmitted, the field value corresponding to the current upgrade package round field in the upgrade package may be rewritten to be always equal to the current upgrade package round value, so as to obtain the current round upgrade package; the current round of upgrade package may then be sent to the target device based on the modbus protocol to cause the target device to try again for device upgrades.
It may be appreciated that after the current round of upgrade package is sent, if a successful restart notification fed back by the target device is not received within the preset time threshold, the above process may be repeated until a successful restart notification fed back by the target device is detected, or the current round of upgrade package exceeds the total round of upgrade package, for example, 5 times of upgrade packages have been sent, and the current round of upgrade package is equal to 6, where the current round of upgrade package 6 is greater than the total round of upgrade package 5, so that sending of the upgrade package may be stopped, and prompt information of upgrade failure may be generated and sent to the target client.
Optionally, after determining whether the current upgrade package round value is less than or equal to the total upgrade package round value, the method may further include:
if the current upgrade package round value is determined to be larger than the total upgrade package round value, generating upgrade failure prompt information, and sending the upgrade failure prompt information to the target client.
In another case, the total upgrade package round value may be set to 1, i.e., failed retransmissions are not supported. At this time, after the upgrade package is sent for the first time, the current upgrade package round value is equal to 2, and the current upgrade package round value is greater than the total upgrade package round value, the OpenHarmony development board can determine that the equipment upgrade fails, and can generate upgrade failure prompt information to send to the target client. The upgrade failure prompt information may include information such as an end device identifier, a number of transmission failures, failure details, and the like.
Optionally, generating the upgrade prompt information may include:
acquiring the size and the check code of the upgrade package corresponding to the upgrade package, and generating upgrade prompt information according to the size and the check code of the upgrade package corresponding to the upgrade package;
the check code is used for enabling the target terminal equipment to check the upgrade package. The size of the upgrade package can be the size of the memory occupied by the upgrade package; the check code may be a cyclic redundancy check code.
Specifically, when generating the upgrade prompt information, the upgrade package size and the check code may be encapsulated based on the modbus protocol to generate the upgrade prompt information. Then, the OpenHarmony development board may send the upgrade prompt information to the target device, and after receiving the upgrade prompt information, the target device may decode the upgrade prompt information to obtain the upgrade package size and the check code. Further, if the target terminal device determines that the available memory is larger than the size of the upgrade package, the target terminal device can generate a response and send the response to the OpenHarmony development board, and when receiving the upgrade package sent by the OpenHarmony development board, the target terminal device can firstly use the check code to perform content check on the upgrade package, and when determining that the content check passes, the target terminal device can perform device upgrade based on the upgrade package.
Example two
Fig. 2 is a schematic structural diagram of a remote upgrade apparatus for an end device according to a second embodiment of the present invention. As shown in fig. 2, the apparatus is applied to an OpenHarmony development board, and may include: the device comprises a target end device acquisition module 210, a target device information forwarding module 220, an upgrade package receiving module 230, an upgrade package sending module 240 and an upgrade completion determining module 250; wherein,
the target end device obtaining module 210 is configured to obtain, when a device upgrade instruction issued by a target client is detected, a target end device corresponding to the device upgrade instruction, and send a device information query command to the target end device based on a modbus protocol;
the target device information forwarding module 220 is configured to receive target device information corresponding to the device information query command fed back by the target device, and forward the target device information to a cloud platform based on a curl protocol, so that the cloud platform performs validity check on the target device information;
the upgrade package receiving module 230 is configured to receive an upgrade package sent by the cloud platform when detecting that verification passing information fed back by the cloud platform passes, and generate and send upgrade prompt information to the target device;
the upgrade package sending module 240 is configured to send the upgrade package to the target device when detecting a confirmation instruction corresponding to the upgrade prompt information fed back by the target device, so that the target device performs device upgrade based on the upgrade package;
and the upgrade completion determining module 250 is configured to determine that the upgrade of the target device is completed when a successful restart notification sent by the target device is detected.
According to the technical scheme, the OpenHarmony development board is used for acquiring target end equipment corresponding to the equipment upgrading instruction after detecting the equipment upgrading instruction issued by the target client, and sending an equipment information inquiry command to the target end equipment based on a modbus protocol; then, receiving target equipment information corresponding to an equipment information query command fed back by target end equipment, and forwarding the target equipment information to a cloud platform based on a curl protocol so as to enable the cloud platform to perform validity check on the target equipment information; when checking passing information fed back by the cloud platform is detected, receiving an upgrade package issued by the cloud platform, and generating and sending upgrade prompt information to target end equipment; when a confirmation instruction corresponding to the upgrade prompt information fed back by the target end equipment is detected, an upgrade package is sent to the target end equipment, so that the target end equipment performs equipment upgrade based on the upgrade package; finally, when a successful restart notification sent by the target terminal equipment is detected, determining that the target terminal equipment is upgraded; through based on OpenHarmony system, adopt the interconnection intercommunication of modbus protocol realization and end equipment, can realize the remote upgrading of opposite terminal equipment, can avoid needing the engineer to go to the equipment installation scene, can save manpower and material resources, can promote equipment upgrading efficiency.
Optionally, the upgrade package is based on a modbus protocol, and each data frame is 2048 bytes; the method comprises the steps of setting a default initial value corresponding to a current upgrade package round field to be 1, wherein 2 bytes correspond to a register address field, 2 bytes correspond to a register number field, 2 bytes correspond to a total upgrade package round field, and 2 bytes correspond to the current upgrade package round field.
Optionally, the upgrade package sending module 240 is specifically configured to obtain a target byte corresponding to a current upgrade package round field of each data frame in the upgrade package, and obtain byte content corresponding to the target byte;
judging whether the byte content corresponding to the target byte is a default initial value, if so, determining to send the upgrade package for the first time, and directly sending the upgrade package to the target terminal equipment.
Optionally, the upgrade package sending module 240 is specifically configured to determine that the current upgrade package fails to be upgraded and obtain a current upgrade package round value if a successful restart notification sent by the target end device is not detected within a preset time threshold;
acquiring a total upgrade package round value corresponding to a total upgrade package round field of each data frame in the upgrade package, and judging whether the current upgrade package round value is smaller than or equal to the total upgrade package round value;
and if the current upgrade package round value is smaller than or equal to the total upgrade package round value, rewriting byte content corresponding to each target byte into the current upgrade package round value to obtain a current round upgrade package, and sending the current round upgrade package to the target terminal equipment.
Optionally, the upgrade package sending module 240 is specifically configured to generate upgrade failure prompt information if it is determined that the current upgrade package round value is greater than the total upgrade package round value, and send the upgrade failure prompt information to the target client.
Optionally, the upgrade package receiving module 230 is specifically configured to obtain an upgrade package size and a check code corresponding to the upgrade package, and generate upgrade prompt information according to the upgrade package size and the check code corresponding to the upgrade package;
the check code is used for enabling the target terminal equipment to check the upgrade package.
Optionally, the data frame further includes at least one of a destination device identification field, a function code field, a byte number field, an upgrade packet data field, and a cyclic redundancy check field.
The remote upgrading device of the terminal equipment provided by the embodiment of the invention can execute the remote upgrading method of the terminal equipment provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example III
Fig. 3 shows a schematic diagram of an electronic device 30 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 3, the electronic device 30 includes at least one processor 31, and a memory, such as a Read Only Memory (ROM) 32, a Random Access Memory (RAM) 33, etc., communicatively connected to the at least one processor 31, wherein the memory stores a computer program executable by the at least one processor, and the processor 31 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 32 or the computer program loaded from the storage unit 38 into the Random Access Memory (RAM) 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 may also be stored. The processor 31, the ROM 32 and the RAM 33 are connected to each other via a bus 34. An input/output (I/O) interface 35 is also connected to bus 34.
Various components in electronic device 30 are connected to I/O interface 35, including: an input unit 36 such as a keyboard, a mouse, etc.; an output unit 37 such as various types of displays, speakers, and the like; a storage unit 38 such as a magnetic disk, an optical disk, or the like; and a communication unit 39 such as a network card, modem, wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 31 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 31 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 31 performs the various methods and processes described above, such as remote upgrade methods for end devices.
In some embodiments, the remote upgrade method of an end device may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 38. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 30 via the ROM 32 and/or the communication unit 39. When the computer program is loaded into RAM 33 and executed by processor 31, one or more steps of the remote upgrade method of an end device described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to perform the remote upgrade method of the end device in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. The remote upgrading method of the end equipment is characterized by being applied to an OpenHarmony development board and comprising the following steps of:
when an equipment upgrading instruction issued by a target client is detected, acquiring target end equipment corresponding to the equipment upgrading instruction, and sending an equipment information inquiry command to the target end equipment based on a modbus protocol;
receiving target equipment information corresponding to the equipment information query command fed back by the target end equipment, and forwarding the target equipment information to a cloud platform based on a curl protocol so that the cloud platform performs validity check on the target equipment information;
when detecting that the verification passing information fed back by the cloud platform is detected, receiving an upgrade package issued by the cloud platform, and generating and sending upgrade prompt information to the target terminal equipment;
when a confirmation instruction corresponding to the upgrade prompt information fed back by the target end equipment is detected, sending the upgrade package to the target end equipment so that the target end equipment performs equipment upgrade based on the upgrade package;
and when a successful restarting notification sent by the target terminal equipment is detected, determining that the target terminal equipment is upgraded.
2. The method of claim 1, wherein the upgrade package is based on a modbus protocol, each data frame being 2048 bytes; the method comprises the steps of setting a default initial value corresponding to a current upgrade package round field to be 1, wherein 2 bytes correspond to a register address field, 2 bytes correspond to a register number field, 2 bytes correspond to a total upgrade package round field, and 2 bytes correspond to the current upgrade package round field.
3. The method of claim 2, wherein sending the upgrade package to the target end device comprises:
acquiring a target byte corresponding to a current upgrade packet round field of each data frame in the upgrade packet, and acquiring byte content corresponding to the target byte;
judging whether the byte content corresponding to the target byte is a default initial value, if so, determining to send the upgrade package for the first time, and directly sending the upgrade package to the target terminal equipment.
4. The method of claim 3, further comprising, after directly sending the upgrade package to the target end device:
if a successful restarting notification sent by the target terminal equipment is not detected within a preset time threshold, determining that the current upgrade package fails to upgrade, and acquiring a current upgrade package round value;
acquiring a total upgrade package round value corresponding to a total upgrade package round field of each data frame in the upgrade package, and judging whether the current upgrade package round value is smaller than or equal to the total upgrade package round value;
and if the current upgrade package round value is smaller than or equal to the total upgrade package round value, rewriting byte content corresponding to each target byte into the current upgrade package round value to obtain a current round upgrade package, and sending the current round upgrade package to the target terminal equipment.
5. The method of claim 4, further comprising, after determining whether the current upgrade package round value is less than or equal to the total upgrade package round value:
if the current upgrade package round value is determined to be larger than the total upgrade package round value, generating upgrade failure prompt information, and sending the upgrade failure prompt information to the target client.
6. The method of claim 1, wherein generating upgrade hints information comprises:
acquiring the size and the check code of the upgrade package corresponding to the upgrade package, and generating upgrade prompt information according to the size and the check code of the upgrade package corresponding to the upgrade package;
the check code is used for enabling the target terminal equipment to check the upgrade package.
7. The method of claim 2, wherein the data frame further comprises at least one of a destination device identification field, a function code field, a byte number field, an upgrade packet data field, and a cyclic redundancy check field.
8. A remote upgrade apparatus for an end device, applied to an OpenHarmony development board, comprising:
the target end equipment acquisition module is used for acquiring target end equipment corresponding to the equipment upgrading instruction when the equipment upgrading instruction issued by the target client is detected, and sending an equipment information inquiry command to the target end equipment based on a modbus protocol;
the target equipment information forwarding module is used for receiving target equipment information corresponding to the equipment information query command fed back by the target end equipment, forwarding the target equipment information to a cloud platform based on a curl protocol, and enabling the cloud platform to perform validity check on the target equipment information;
the upgrade package receiving module is used for receiving the upgrade package issued by the cloud platform when detecting that the verification fed back by the cloud platform passes through the information, and generating and sending upgrade prompt information to the target terminal equipment;
the upgrade package sending module is used for sending the upgrade package to the target terminal equipment when detecting a confirmation instruction corresponding to the upgrade prompt information fed back by the target terminal equipment, so that the target terminal equipment performs equipment upgrade based on the upgrade package;
and the upgrading completion determining module is used for determining that the target end equipment is upgraded when a successful restarting notification sent by the target end equipment is detected.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the remote upgrade method of the end device of any of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the method of remote upgrade of an end device according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311556736.2A CN117519753A (en) | 2023-11-20 | 2023-11-20 | Remote upgrading method, device and equipment of terminal equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311556736.2A CN117519753A (en) | 2023-11-20 | 2023-11-20 | Remote upgrading method, device and equipment of terminal equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117519753A true CN117519753A (en) | 2024-02-06 |
Family
ID=89764078
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311556736.2A Pending CN117519753A (en) | 2023-11-20 | 2023-11-20 | Remote upgrading method, device and equipment of terminal equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117519753A (en) |
-
2023
- 2023-11-20 CN CN202311556736.2A patent/CN117519753A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102510409A (en) | Method and system for quickly and remotely updating program of mobile terminal by using wireless network | |
CN112835616A (en) | Version upgrading method and device, electronic equipment and storage medium | |
CN109391673A (en) | A kind of method, system and the terminal device of management update file | |
CN113691602B (en) | Service processing method, system, device, equipment and medium based on cloud mobile phone | |
CN112087475B (en) | Message pushing method and device for cloud platform component application and message server | |
CN111405059A (en) | Data transmission method of cloud equipment, electronic equipment and Internet of things system | |
CN111124801A (en) | Intelligent system resource monitoring method and device and computer readable storage medium | |
EP2445171B1 (en) | File transfer protocol client and implementing method thereof | |
CN111800223B (en) | Method, device and system for generating sending message and processing receiving message | |
CN116962114A (en) | Equipment interconnection method, device, equipment and medium based on distributed soft bus | |
CN117519753A (en) | Remote upgrading method, device and equipment of terminal equipment and storage medium | |
CN116027226A (en) | Component testing method and device, electronic equipment and storage medium | |
CN113420275B (en) | Data connection processing method, related device and computer program product | |
CN115410580A (en) | Voice recognition method, device, equipment and medium for command scheduling system | |
CN114374686A (en) | File processing method, device and equipment based on browser | |
CN112333262A (en) | Data updating prompting method and device, computer equipment and readable storage medium | |
CN116760741B (en) | Data state monitoring method, device, equipment and medium | |
CN113596129B (en) | Restarting method, restarting device, restarting equipment and restarting storage medium of cloud mobile phone | |
CN118250341B (en) | Form request processing method, device, equipment and storage medium | |
CN113821248B (en) | Service method of vehicle-end software, vehicle-end software and related equipment thereof | |
CN114553894B (en) | Data synchronization method, device, system and storage medium | |
US8601106B2 (en) | Remote command execution over a network | |
CN114422638B (en) | Cloud mobile phone control method, device, equipment, medium and program product | |
CN116781690A (en) | File transmission method, device, equipment and storage medium | |
CN116095196A (en) | Data transparent transmission method, device, equipment and 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 |