CN109600451A - A kind of terminal device firmware upgrade method and system based on Websocket long connection - Google Patents

A kind of terminal device firmware upgrade method and system based on Websocket long connection Download PDF

Info

Publication number
CN109600451A
CN109600451A CN201811621190.3A CN201811621190A CN109600451A CN 109600451 A CN109600451 A CN 109600451A CN 201811621190 A CN201811621190 A CN 201811621190A CN 109600451 A CN109600451 A CN 109600451A
Authority
CN
China
Prior art keywords
firmware
upgrading
installation package
server
terminal device
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
Application number
CN201811621190.3A
Other languages
Chinese (zh)
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.)
Xiamen Central Intelligent Information Technology Co Ltd
Original Assignee
Xiamen Central Intelligent Information Technology 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 Xiamen Central Intelligent Information Technology Co Ltd filed Critical Xiamen Central Intelligent Information Technology Co Ltd
Priority to CN201811621190.3A priority Critical patent/CN109600451A/en
Publication of CN109600451A publication Critical patent/CN109600451A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0889Techniques to speed-up the configuration process
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of terminal device firmware upgrade method and system based on Websocket long connection, method include: to establish the Websocket long connection with server after terminal device networking;The server is stored with the first firmware installation kit and corresponding first download address of the first firmware installation kit, the first firmware identifiers and the first firmware version;The terminal device is stored with currently used corresponding second firmware identifiers of the second firmware installation kit and the second firmware version;Based on the Websocket long connection, the terminal device obtains first download address from the server, and downloads the first firmware installation kit according to first download address to be upgraded.Of the invention terminal device firmware upgrade method and system user based on Websocket long connection is experienced, and is operated conveniently, one side terminal device being capable of active transmission upgrade request;Another aspect server can actively issue upgrade command.

Description

Websocket long connection-based terminal equipment firmware upgrading method and system
Technical Field
The invention relates to the technical field of firmware upgrading of terminal equipment, in particular to a method and a system for upgrading firmware of terminal equipment based on Websocket long connection.
Background
The firmware is a program written in an EROM (erasable read only memory) or an EEPROM (electrically erasable programmable read only memory), and means that a device "driver" stored inside the device, such as an optical disc drive, a recorder, etc., has internal firmware, and an operating system can realize the operation of a specific machine according to standard device drivers through the firmware.
At present, in the fields of security, attendance, testimony of a witness, video and the like, most of firmware upgrading of terminal equipment still adopts manual upgrading, specifically, an installation package is stored in storage equipment such as a U disk and a hard disk to be burnt, then upgrading operation is carried out on the terminal equipment, or copying is carried out in a remote connection mode, and then upgrading operation is carried out on the terminal equipment. The whole firmware upgrading process is complicated, a large amount of human resources are consumed, the operation convenience is not enough, and the user experience is poor.
The existing scheme for acquiring the firmware installation package through the cloud platform server to automatically upgrade has the following problems: firstly, the server and the terminal equipment need to be connected through middleware equipment, so that on one hand, the hardware cost is increased, and on the other hand, the server and the terminal equipment cannot directly perform message interaction, so that messages are easy to lose and the safety risk is increased; secondly, an upgrade request can only be initiated to the server by the terminal device or/and the middleware device, the server cannot actively initiate an upgrade instruction to the internet of things terminal, on one hand, batch upgrade indication cannot be achieved, on the other hand, if the firmware installation currently used by the terminal device is defective, the server cannot actively issue the upgrade instruction in time, only the upgrade request message of the terminal device can be waited, and the timeliness is not strong.
Disclosure of Invention
The invention mainly aims to overcome the defects in the prior art and provides a method and a system for upgrading the firmware of terminal equipment based on Websocket long connection, which have good user experience and convenient operation, so that on one hand, the terminal equipment can actively send an upgrading request; and on the other hand, the server can actively issue the upgrading instruction.
The invention adopts the following technical scheme:
according to the first aspect of the invention, a terminal device firmware upgrading method based on Websocket long connection comprises the following steps:
after networking, terminal equipment establishes Websocket long connection with a server; the server stores a first firmware installation package and a first download address, a first firmware identification and a first firmware version corresponding to the first firmware installation package; the terminal equipment stores a second firmware identification and a second firmware version corresponding to a currently used second firmware installation package;
based on the Websocket long connection, the terminal equipment acquires the first download address from the server and downloads the first firmware installation package according to the first download address for upgrading.
According to an embodiment of the present invention, the acquiring, by the terminal device, the first download address from the server, and downloading the first firmware installation package according to the first download address for upgrading includes:
the server receives a request for upgrading the firmware of one or more terminal devices, and judges whether a first firmware installation package matched with the corresponding terminal device is stored or not; if yes, sending a first upgrading instruction message to the corresponding terminal equipment to instruct the terminal equipment to download the first firmware installation package; the first upgrade instruction message comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal equipment receives the first upgrading instruction message and downloads the first firmware installation package according to the first downloading address for upgrading.
According to an embodiment of the present invention, the receiving, by the terminal device, the first upgrade instruction message, and downloading the first firmware installation package according to the first download address for upgrading includes:
and the terminal equipment acquires the first firmware identification in the first upgrading instruction message, judges whether the first firmware identification is matched with a second firmware identification corresponding to a second firmware installation package currently used by the terminal equipment, and downloads the first firmware installation package according to the first downloading address for upgrading if the first firmware identification is matched with the second firmware identification.
According to an embodiment of the present invention, the first upgrade instruction message further includes a first forced upgrade flag, and if the first forced upgrade flag is negative, the terminal device receives the first upgrade instruction message, and downloads the first firmware installation package according to the first download address for upgrading, further including:
and the terminal equipment acquires a first firmware version in the first upgrading instruction message, judges whether the first firmware version is higher than a second firmware version corresponding to a currently used second firmware installation package, and downloads the first firmware installation package according to the first downloading address for upgrading if the first firmware version is higher than the second firmware version corresponding to the currently used second firmware installation package.
According to an embodiment of the present invention, the acquiring, by the terminal device, the first download address from the server, and downloading the first firmware installation package according to the first download address for upgrading includes:
the terminal equipment sends a second upgrading request message to the server; the second upgrade request message comprises a second firmware identification and a second firmware version corresponding to a second firmware installation package currently used by the terminal equipment;
the server receives the second upgrading request message and judges whether a first firmware identification matched with the second firmware identification and a first firmware installation package corresponding to the first firmware identification are stored or not; if yes, the server returns a response message of a second upgrading request to the terminal equipment; the response message of the second upgrade request comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal equipment receives the response message of the second upgrading request and downloads the first firmware installation package according to the first downloading address for upgrading.
According to an embodiment of the present invention, the response message of the second upgrade request further includes a second forced upgrade flag, and if the second forced upgrade flag is negative, the terminal device receives the response message of the second upgrade request, and downloads the first firmware installation package according to the first download address for upgrading, including:
and the terminal equipment acquires the first firmware version in the response message of the second upgrading request, judges whether the first firmware version is higher than the second firmware version corresponding to the currently used second firmware installation package, and downloads the first firmware installation package for upgrading if the first firmware version is higher than the second firmware version corresponding to the currently used second firmware installation package.
According to one embodiment of the invention, the first firmware identifier and the second firmware identifier are both character strings and include a character string part of a terminal equipment manufacturer identifier, a character string part of a firmware platform identifier and a character string part of a firmware type identifier; the first firmware version and the second firmware version are both strings and include a version number string portion.
According to one embodiment of the invention, the first firmware identification and the first firmware version are extracted from a name of the first firmware installation package; the second firmware identification and the second firmware version are extracted from a name of the second firmware installation package.
On the other hand, the invention relates to a terminal equipment firmware upgrading system based on Websocket long connection, which comprises the following steps:
the server is used for storing a first firmware installation package and a first download address, a first firmware identifier and a first firmware version corresponding to the first firmware installation package;
the terminal device is used for storing a second firmware identifier and a second firmware version corresponding to a currently used second firmware installation package; and establishing a Websocket long connection with the server after networking, acquiring the first download address from the server based on the Websocket long connection, and downloading and upgrading the first firmware installation package according to the first download address.
According to an embodiment of the present invention, the acquiring, by the terminal device, the first download address from the server, and downloading the first firmware installation package according to the first download address for upgrading includes:
the server receives a request for upgrading the firmware of one or more terminal devices, and judges whether a first firmware installation package matched with the corresponding terminal device is stored or not; if yes, sending a first upgrading instruction message to the corresponding terminal equipment to instruct the terminal equipment to download the first firmware installation package; the first upgrade instruction message comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal equipment receives the first upgrading instruction message and downloads the first firmware installation package according to the first downloading address for upgrading.
According to an embodiment of the present invention, the acquiring, by the terminal device, the first download address from the server, and downloading the first firmware installation package according to the first download address for upgrading includes:
the terminal equipment sends a second upgrading request message to the server; the second upgrade request message comprises a second firmware identification and a second firmware version corresponding to a second firmware installation package currently used by the terminal equipment;
the server receives the second upgrading request message and judges whether a first firmware identification matched with the second firmware identification and a first firmware installation package corresponding to the first firmware identification are stored or not; if yes, the server returns a response message of a second upgrading request to the terminal equipment; the response message of the second upgrade request comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal equipment receives the response message of the second upgrading request and downloads the first firmware installation package according to the first downloading address for upgrading.
As can be seen from the above description of the present invention, compared with the prior art, the present invention has the following advantages:
(1) the invention relates to a method and a system for upgrading firmware of terminal equipment based on Websocket long connection.A Websocket long connection with a server is established after the terminal equipment is networked; based on the Websocket long connection, the terminal equipment can acquire a first download address stored by a server from the server and download the first firmware installation package according to the first download address for upgrading; manual upgrade of each terminal device is avoided, and convenience in operation and user experience are improved;
(2) the invention relates to a terminal equipment firmware upgrading method and system based on Websocket long connection, on one hand, the terminal equipment can actively send an upgrading request to realize automatic upgrading; on the other hand, the server can actively issue an upgrading instruction, and can receive upgrading requests for one or more terminal devices or all terminal devices of a certain firmware type issued by the operation platform, so as to realize batch operation;
(3) the invention relates to a terminal equipment firmware upgrading method and system based on Websocket long connection.A message sent by a server to a terminal equipment comprises a forced upgrading identifier for indicating whether forced upgrading is carried out or not, when the forced upgrading is indicated to be yes, a first firmware version and a second firmware version do not need to be compared, and the terminal equipment needs to download a first firmware installation package for upgrading so as to correct possible defects of the currently used firmware version.
The above description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the description of the technical means more comprehensible.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Fig. 1 is a flowchart of a firmware upgrading method for a terminal device based on Websocket long connection according to an embodiment of the present invention;
FIG. 2 is a message flow diagram of a server issuing an upgrade instruction according to an embodiment of the present invention;
fig. 3 is a message flow chart of a terminal device actively requesting to obtain an upgrade installation package according to an embodiment of the present invention;
fig. 4 is a block diagram of a firmware upgrading system of a terminal device based on Websocket long connection according to an embodiment of the present invention;
fig. 5 is a block diagram of a hardware configuration of a server according to an embodiment of the present invention.
Detailed Description
The invention is further described below by means of specific embodiments.
Referring to fig. 1, on the one hand, the present invention provides a terminal device firmware upgrading method based on Websocket long connection, including:
s101, establishing Websocket long connection with a server after terminal equipment is networked; the server stores a first firmware installation package and a first download address, a first firmware identification and a first firmware version corresponding to the first firmware installation package; and the terminal equipment stores a second firmware identification and a second firmware version corresponding to a currently used second firmware installation package.
Specifically, the terminal device includes but is not limited to an attendance device, a security device, a witness identification (comparison) terminal, a door access machine, a video monitoring device, a collector and the like. And the terminal equipment stores a second firmware identification and a second firmware version corresponding to a currently used second firmware installation package.
The server may be one server, or a server cluster composed of a plurality of servers, or a cloud server. The cloud server is a super-large server cluster, is an important component of cloud computing service, and is a service platform for providing comprehensive business capability for various internet users. The server is provided with a firmware upgrading system, and when the server is a cloud server, the corresponding firmware upgrading system is the cloud upgrading system to realize the functions related to the server.
The first download address is an address for the server to notify the terminal device to download a first firmware installation package, the first firmware identifier/the second fixed identifier is used for identifying information such as a terminal device manufacturer identifier, a firmware platform identifier and a firmware type identifier to which the firmware is accessed, the first firmware version is used for identifying version information of the first firmware installation package, and the second firmware version is used for identifying version information of the second firmware installation package.
The first firmware installation package and the second firmware installation package can be understood as installation packages for installing firmware and can also be upgrade packages for upgrading firmware. And a first firmware installation package and a second firmware installation package in the first firmware installation package and the second firmware installation package are only used for distinguishing the installation package on the server from the installation package currently used on the terminal equipment, and the second firmware upgrade package is actually the first firmware installation package downloaded from the first download address by the terminal equipment. It should be noted that the firmware installation package for firmware upgrade of the terminal device is not limited to the installation package used in installing software and needing to be installed after decompression, and may also be a set of file data of firmware upgrade. The set comprises upgrading firmware, an algorithm file, a bottom layer drive file and the like or part of file data related to the firmware, the file data required by the terminal equipment is stored in a firmware installation package, and the firmware of the terminal equipment can be upgraded by downloading the first firmware installation package.
Specifically, after the terminal equipment is networked, the establishment of the Websocket long connection with the server is requested through a ws address (such as ws:// dcon.
And when the messages are interacted, the terminal equipment and the server interact through the message body in the Json format of the appointed field. The specific process can be as follows: the equipment terminal establishes a Websocket long connection with the server through a ws address request of the server firmware upgrading system; the public key and the private key are exchanged with the server to be used as keys for encrypting and decrypting subsequent interactive data, so that the data can be safely transmitted in a Websocket channel; acquiring a login password of a ws address of the server firmware upgrading system through verification; and finishing the establishment of the Websocket long connection after the login is successful. After the long Websocket connection is established, the terminal device needs to send a heartbeat regularly to maintain the long connection state.
In this embodiment, after the long Websocket connection is established, the terminal device needs to report device attributes including a device version number, a device type, and the like. The device version number includes the second firmware identification and a second firmware version, as follows:
wherein, XK represents the manufacturer identifier of the terminal device to which the firmware is accessed, ZMM2XX represents the firmware platform identifier, NF represents the firmware type identifier, the second firmware identifier is composed of the manufacturer identifier of the terminal device to which the firmware is accessed, the firmware platform identifier and the firmware type identifier, and the ver1.2.3 identifier is used for representing the second firmware version.
As can be seen from the above, the server at least includes an encryption/decryption module and a command processing module, wherein:
the message processing module is used for packaging the message to be sent (specifically, the message to be sent can be in a Json format), analyzing and executing the received decrypted message (in the Json format), and returning a result;
and the encryption/decryption module is used for encrypting the encapsulation message to be sent according to the secret key negotiated with the terminal equipment and decrypting the received message so as to realize the safe transmission of the data.
In addition, the server can also comprise an upgrade package uploading/downloading management module which is used for carrying out the safety certification of the authority of the uploading and downloading requests and preventing the illegal uploading and the illegal downloading of the user.
The server supports the uploading and/or downloading of the firmware installation package by the user through the security authentication. The server can receive the first firmware installation package uploaded by other version production servers and conduct safety certification. Specifically, the first firmware installation package may be an installation package in a cfg suffix format, and at least includes two nodes, namely, upgrade and firmware data. Wherein, upgrade package basic attribute node, the node at least includes FWVersion (firmware version) attribute, the attribute is used for server to read version number automatically, in order to process a series of upgrade information subsequently, other attributes can expand by oneself. The firmware data is specific upgrade package information, and the content of the upgrade package information is encrypted information.
S102, based on the Websocket long connection, the terminal equipment obtains the first download address from the server and downloads the first firmware installation package according to the first download address for upgrading.
Because the Websocket long connection is established between the terminal equipment and the server, the server can actively send messages to the terminal equipment, and the terminal equipment can also actively send messages to the server to realize downloading and upgrading of the firmware installation package.
Based on the Websocket long connection, the terminal equipment can acquire a first download address stored by a server from the server and download the first firmware installation package according to the first download address for upgrading; manual upgrade of each terminal device is avoided, and convenience of operation and user experience are improved.
Referring to fig. 2, according to an embodiment of the present invention, when a server actively sends a message to a terminal device, the terminal device obtains the first download address from the server, and downloads the first firmware installation package according to the first download address for upgrading, including:
s201, the server receives a request for upgrading the firmware of one or more terminal devices, and judges whether a first firmware installation package matched with the corresponding terminal device is stored; if yes, sending a first upgrading instruction message to the corresponding terminal equipment to instruct the terminal equipment to download the first firmware installation package; the first upgrade instruction message includes a first firmware identifier, a first firmware version, and a first download address corresponding to the first firmware installation package.
When firmware upgrading is required to be performed on one or more terminal devices, the terminal devices required to be subjected to firmware upgrading or all terminal devices of a certain firmware type and the like can be selected on a foreground interface of the firmware upgrading system, and then a firmware upgrading request message is issued. The application scene can be operated in batch, and the firmware upgrading efficiency can be improved. In addition, the application scenario is also suitable for the situation that when the firmware upgrade package currently used by the terminal device is found to have defects, batch replacement is required for reinstallation.
Specifically, if the server receives a request for firmware upgrade of one or more terminal devices, the server immediately pushes a first upgrade instruction to the device, which may be as follows:
wherein,http://xxxxxxx/xxx.cfgthe firmware version identification method comprises the steps of representing a first download address, XK representing a terminal equipment manufacturer identification accessed by firmware, ZMM2XX representing a firmware platform identification, NF representing a firmware type identification, wherein the first firmware identification is composed of the accessed terminal equipment manufacturer identification, the firmware platform identification and the firmware type identification, and Ver1.2.4 identification is used for representing a first firmware version.
The first firmware installation package matched with the corresponding terminal device may be matched with the first firmware identifier composed of a terminal device manufacturer identifier, a firmware platform identifier and a firmware type identifier, may also be matched with another firmware identifier, may also be matched with another self-defined identifier, as long as the corresponding terminal device or firmware type is selected, and then the corresponding first firmware version can be associated and issued to the corresponding terminal device, and the embodiment of the present invention is not particularly limited.
S202, the terminal equipment receives the first upgrading instruction message and downloads the first firmware installation package according to the first downloading address to upgrade.
According to an embodiment of the present invention, since the terminal device is an upgrade instruction initiated by the server actively, after receiving the first upgrade instruction message, the terminal device downloads the first firmware installation package according to the first download address for upgrading without making any judgment on the absolute trust of the delivered content.
According to an embodiment of the present invention, the receiving, by the terminal device, the first upgrade instruction message, and downloading the first firmware installation package according to the first download address for upgrading may further include:
after receiving the first upgrade instruction message, the terminal device still needs to determine the first firmware identifier to confirm that the message is not a message sent by the server by mistake or other malicious messages, and specifically includes: and the terminal equipment acquires the first firmware identification in the first upgrading instruction message, judges whether the first firmware identification is matched with a second firmware identification corresponding to a second firmware installation package currently used by the terminal equipment, and downloads the first firmware installation package according to the first downloading address for upgrading if the first firmware identification is matched with the second firmware identification. Here, matching is understood to mean that the first firmware identification and the second firmware identification are identical.
According to an embodiment of the present invention, in the first upgrade instruction message in the above example, the first upgrade instruction message further includes a first forced upgrade flag, and if the first forced upgrade flag is negative, the terminal device receives the first upgrade instruction message, and downloads the first firmware installation package according to the first download address for upgrading, further including:
and the terminal equipment acquires a first firmware version in the first upgrading instruction message, judges whether the first firmware version is higher than a second firmware version corresponding to a currently used second firmware installation package, and downloads the first firmware installation package according to the first downloading address for upgrading if the first firmware version is higher than the second firmware version corresponding to the currently used second firmware installation package.
And when the first forced upgrading identifier force is not (0), the identifier is not subjected to forced upgrading, at this time, the terminal equipment needs to further judge the firmware version, namely whether the first firmware version is higher than a second firmware version corresponding to a currently used second firmware installation package, if so, the first firmware installation package is downloaded according to the first download address for upgrading, and if not, the first firmware installation package is not downloaded at the first download address and is not upgraded.
And when the first forced upgrading identifier force is (1), forcibly upgrading the identifier, and at the moment, directly downloading the first firmware installation package by the first downloading address and upgrading without judging the firmware version by the terminal equipment. The situation can be applied to the situation that the second firmware installation package currently used by the terminal equipment has defects and needs to be replaced by a high version or backed to a low version.
The terminal device receives the first upgrade instruction message and needs to reply a message to the server, and the embodiments of the present invention are not specifically listed.
Referring to fig. 3, according to an embodiment of the present invention, when a terminal device actively sends a message to a server for automatic upgrade, the terminal device obtains the first download address from the server, and downloads the first firmware installation package according to the first download address for upgrade, including:
s301, the terminal equipment sends a second upgrading request message to the server; the second upgrade request message comprises a second firmware identification and a second firmware version corresponding to a second firmware installation package currently used by the terminal equipment;
specifically, the terminal device may send a second upgrade request message to the server at regular time to inquire whether a first firmware installation package with a high version is available, and if so, download and upgrade the first firmware installation package.
The second upgrade request message initiated by the device may be as follows:
wherein, XK represents the manufacturer identifier of the terminal device to which the firmware is accessed, ZMM2XX represents the firmware platform identifier, NF represents the firmware type identifier, the second firmware identifier is composed of the manufacturer identifier of the terminal device to which the firmware is accessed, the firmware platform identifier and the firmware type identifier, and the ver1.2.3 identifier is used for representing the second firmware version.
S302, the server receives the second upgrade request message, and judges whether a first firmware identifier matched with the second firmware identifier and a first firmware installation package corresponding to the first firmware identifier are stored; if yes, the server returns a response message of a second upgrading request to the terminal equipment; the response message of the second upgrade request includes a first firmware identifier, a first firmware version, and a first download address corresponding to the first firmware installation package.
As follows, if the server determines that the first firmware identifier matching the second firmware identifier and the first firmware installation package corresponding to the first firmware identifier are stored (here, matching may be understood as the same), the following response message is replied.
Wherein,http://xxxxxxx/xxx.cfgdenotes a first download address, XK denotes a terminal equipment vendor identification to which firmware is accessed, ZMM2XX denotes a firmware platform identification, NF denotes a firmware typeThe first firmware identification is composed of an accessed terminal equipment manufacturer identification, a firmware platform identification and a firmware type identification, and the Ver1.2.4 identification is used for representing a first firmware version.
As follows, if the server determines that the first firmware identifier matching the second firmware identifier and the first firmware installation package corresponding to the first firmware identifier are not stored, the server replies a response message as follows.
And S303, the terminal equipment receives the response message of the second upgrading request and downloads the first firmware installation package according to the first downloading address for upgrading.
And if the server replies a response message of 'no matched firmware upgrade package can be found', indicating that the terminal equipment does not have the latest version available at present, and the terminal equipment does not carry out upgrade processing.
According to an embodiment of the present invention, in the above example, when the server replies to the first download address, the response message of the second upgrade request further includes a second forced upgrade flag, and if the second forced upgrade flag is negative, the terminal device receives the response message of the second upgrade request, and downloads the first firmware installation package according to the first download address for upgrading, further including:
and the terminal equipment acquires the first firmware version in the response message of the second upgrading request, judges whether the first firmware version is higher than the second firmware version corresponding to the currently used second firmware installation package, and downloads the first firmware installation package for upgrading if the first firmware version is higher than the second firmware version corresponding to the currently used second firmware installation package.
And when the second mandatory upgrade identifier force is no (0), the identifier is not updated in a mandatory manner, at this time, the terminal device needs to further judge the firmware version, namely, whether the first firmware version is higher than a second firmware version corresponding to a currently used second firmware installation package, if so, the first firmware installation package is downloaded according to the first download address for upgrading, and if not, the first firmware installation package is not downloaded at the first download address and is not upgraded.
And when the second forced upgrading identifier force is (1), forcibly upgrading the identifier, and at the moment, directly downloading the first firmware installation package from the first download address and upgrading without judging the firmware version by the terminal equipment. The situation can be applied to the situation that the second firmware installation package currently used by the terminal equipment has defects and needs to be replaced by a high version or backed to a low version.
According to one embodiment of the present invention, as mentioned above, the first firmware identifier and the second firmware identifier are both character strings and include a character string part of a terminal equipment manufacturer identifier, a character string part of a firmware platform identifier, and a character string part of a firmware type; the first firmware version and the second firmware version are both strings and include a version number string portion. When the firmware identifiers are compared, whether the character string part of the terminal equipment manufacturer identifier, the character string part of the firmware platform identifier and the character string part of the firmware type of the first firmware identifier and the second firmware identifier are all the same or not needs to be compared one by one, if all the character string parts are the same, matching is judged, and otherwise, mismatching is judged. And comparing the first firmware version with the second firmware version from front to back when the first firmware version and the second firmware version are compared, and judging that the first firmware version is higher than the second firmware version if the first firmware version has a character string which is larger than the second firmware version, such as Ver1.2.4 and Ver1.2.3.
According to an embodiment of the present invention, on one hand, FWVersion firmware version attributes (including firmware identifier and firmware version) may be obtained from upgrade of a firmware installation package, and on the other hand, if the name of the firmware installation package includes the firmware identifier and firmware version, the first firmware identifier and the first firmware version may also be extracted from the name of the first firmware installation package; the second firmware identification and the second firmware version may be extracted from a name of the second firmware installation package. Specifically, the name of the first firmware installation package and the name of the second firmware installation package both include a string part of a terminal device manufacturer identifier, a string part of a firmware platform identifier, a string part of a firmware type, and a version number string part. In this case, the firmware installation package may not include the upgrade node.
Referring to fig. 4, according to another aspect of the present invention, there is provided a terminal device firmware upgrading system based on Websocket long connection, including:
the server 401 is configured to store a first firmware installation package and a first download address, a first firmware identifier, and a first firmware version corresponding to the first firmware installation package;
the terminal device 402 is configured to store a second firmware identifier and a second firmware version corresponding to a currently used second firmware installation package; and after networking, establishing a Websocket long connection with the server 401, acquiring the first download address from the server 401 based on the Websocket long connection, and downloading and upgrading the first firmware installation package according to the first download address.
According to an embodiment of the present invention, the acquiring, by the terminal device 402, the first download address from the server 401, and downloading the first firmware installation package according to the first download address for upgrading includes:
the server 401 receives a request for upgrading the firmware of one or more terminal devices 402, and judges whether a first firmware installation package matched with the corresponding terminal device 402 is stored; if yes, sending a first upgrade instruction message to the corresponding terminal device 402 to instruct the terminal device 402 to download the first firmware installation package; the first upgrade instruction message comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal device 402 receives the first upgrade instruction message, and downloads the first firmware installation package according to the first download address for upgrading.
According to an embodiment of the present invention, the acquiring, by the terminal device 402, the first download address from the server 401, and downloading the first firmware installation package according to the first download address for upgrading includes:
the terminal device 402 sends a second upgrade request message to the server 401; the second upgrade request message includes a second firmware identifier and a second firmware version corresponding to a second firmware installation package currently used by the terminal device 402;
the server 401 receives the second upgrade request message, and determines whether a first firmware identifier matched with the second firmware identifier and a first firmware installation package corresponding to the first firmware identifier are stored; if yes, the server 401 returns a response message of the second upgrade request to the terminal device 402; the response message of the second upgrade request comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal device 402 receives the response message of the second upgrade request, and downloads the first firmware installation package according to the first download address to upgrade.
Fig. 5 is a block diagram illustrating a hardware structure of a server according to an embodiment of the present invention, and referring to fig. 5, the server may include: a processor 501, a communication interface 502, a memory 503, and a communication bus 504; the processor 501, the communication interface 502, and the memory 503 are configured to communicate with each other via a communication bus 504.
Specifically, the communication interface 502 may be an interface of a communication module, such as an interface of a GSM module; a processor 501 for executing a program; a memory 503 for storing programs, data, and a first firmware installation package; the program may include program code including computer operating instructions. The processor 501 may be a central processing unit CPU, or an application specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present invention. The memory 503 may include a high-speed ram memory, and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory.
Among them, the procedure can be specifically used for:
and receiving a Websocket long connection request sent by the terminal equipment, and responding to the Websocket long connection request to establish the Websocket long connection.
May also be used to:
receiving a request for upgrading the firmware of one or more terminal devices, and judging whether a first firmware installation package matched with the corresponding terminal device is stored or not; and if so, sending a first upgrading instruction message to the corresponding terminal equipment to instruct the terminal equipment to download the first firmware installation package.
And can be used to:
receiving a second upgrading request message sent by terminal equipment, and judging whether a first firmware identification matched with the second firmware identification and a first firmware installation package corresponding to the first firmware identification are stored or not; and if so, returning a response message of the second upgrading request to the terminal equipment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (11)

1. A terminal device firmware upgrading method based on Websocket long connection is characterized by comprising the following steps:
after networking, terminal equipment establishes Websocket long connection with a server; the server stores a first firmware installation package and a first download address, a first firmware identification and a first firmware version corresponding to the first firmware installation package; the terminal equipment stores a second firmware identification and a second firmware version corresponding to a currently used second firmware installation package;
based on the Websocket long connection, the terminal equipment acquires the first download address from the server and downloads the first firmware installation package according to the first download address for upgrading.
2. The Websocket long connection-based terminal device firmware upgrading method according to claim 1, wherein the terminal device acquires the first download address from the server and downloads the first firmware installation package according to the first download address for upgrading, and the method includes:
the server receives a request for upgrading the firmware of one or more terminal devices, and judges whether a first firmware installation package matched with the corresponding terminal device is stored or not; if yes, sending a first upgrading instruction message to the corresponding terminal equipment to instruct the terminal equipment to download the first firmware installation package; the first upgrade instruction message comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal equipment receives the first upgrading instruction message and downloads the first firmware installation package according to the first downloading address for upgrading.
3. The Websocket long connection-based terminal device firmware upgrading method according to claim 2, wherein the terminal device receives the first upgrade instruction message, downloads the first firmware installation package according to the first download address for upgrading, and includes:
and the terminal equipment acquires the first firmware identification in the first upgrading instruction message, judges whether the first firmware identification is matched with a second firmware identification corresponding to a second firmware installation package currently used by the terminal equipment, and downloads the first firmware installation package according to the first downloading address for upgrading if the first firmware identification is matched with the second firmware identification.
4. The Websocket long connection-based terminal device firmware upgrading method according to claim 2 or 3, wherein the first upgrade instruction message further includes a first forced upgrade flag, if the first forced upgrade flag is negative, the terminal device receives the first upgrade instruction message, and downloads the first firmware installation package according to the first download address for upgrading, further including:
and the terminal equipment acquires a first firmware version in the first upgrading instruction message, judges whether the first firmware version is higher than a second firmware version corresponding to a currently used second firmware installation package, and downloads the first firmware installation package according to the first downloading address for upgrading if the first firmware version is higher than the second firmware version corresponding to the currently used second firmware installation package.
5. The Websocket long connection-based terminal device firmware upgrading method according to claim 1, wherein the terminal device acquires the first download address from the server and downloads the first firmware installation package according to the first download address for upgrading, and the method includes:
the terminal equipment sends a second upgrading request message to the server; the second upgrade request message comprises a second firmware identification and a second firmware version corresponding to a second firmware installation package currently used by the terminal equipment;
the server receives the second upgrading request message and judges whether a first firmware identification matched with the second firmware identification and a first firmware installation package corresponding to the first firmware identification are stored or not; if yes, the server returns a response message of a second upgrading request to the terminal equipment; the response message of the second upgrade request comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal equipment receives the response message of the second upgrading request and downloads the first firmware installation package according to the first downloading address for upgrading.
6. The Websocket long connection-based terminal device firmware upgrading method of claim 5, wherein the response message of the second upgrade request further includes a second forced upgrade flag, and if the second forced upgrade flag is negative, the terminal device receives the response message of the second upgrade request, and downloads the first firmware installation package according to the first download address for upgrading, including:
and the terminal equipment acquires the first firmware version in the response message of the second upgrading request, judges whether the first firmware version is higher than the second firmware version corresponding to the currently used second firmware installation package, and downloads the first firmware installation package for upgrading if the first firmware version is higher than the second firmware version corresponding to the currently used second firmware installation package.
7. The terminal equipment firmware upgrading method based on Websocket long connection as claimed in claim 1, wherein the first firmware identification and the second firmware identification are both character strings and comprise a character string part of a terminal equipment manufacturer identification, a character string part of a firmware platform identification and a character string part of a firmware type identification; the first firmware version and the second firmware version are both strings and include a version number string portion.
8. The Websocket long connection-based terminal device firmware upgrading method according to claim 7, wherein the first firmware identifier and the first firmware version are extracted from a name of the first firmware installation package; the second firmware identification and the second firmware version are extracted from a name of the second firmware installation package.
9. A terminal device firmware upgrading system based on Websocket long connection is characterized by comprising:
the server is used for storing a first firmware installation package and a first download address, a first firmware identifier and a first firmware version corresponding to the first firmware installation package;
the terminal device is used for storing a second firmware identifier and a second firmware version corresponding to a currently used second firmware installation package; and establishing a Websocket long connection with the server after networking, acquiring the first download address from the server based on the Websocket long connection, and downloading and upgrading the first firmware installation package according to the first download address.
10. The Websocket long connection-based terminal device firmware upgrading system of claim 9, wherein the terminal device obtains the first download address from the server, and downloads the first firmware installation package according to the first download address for upgrading, including:
the server receives a request for upgrading the firmware of one or more terminal devices, and judges whether a first firmware installation package matched with the corresponding terminal device is stored or not; if yes, sending a first upgrading instruction message to the corresponding terminal equipment to instruct the terminal equipment to download the first firmware installation package; the first upgrade instruction message comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal equipment receives the first upgrading instruction message and downloads the first firmware installation package according to the first downloading address for upgrading.
11. The Websocket long connection-based terminal device firmware upgrading system of claim 9, wherein the terminal device obtains the first download address from the server, and downloads the first firmware installation package according to the first download address for upgrading, including:
the terminal equipment sends a second upgrading request message to the server; the second upgrade request message comprises a second firmware identification and a second firmware version corresponding to a second firmware installation package currently used by the terminal equipment;
the server receives the second upgrading request message and judges whether a first firmware identification matched with the second firmware identification and a first firmware installation package corresponding to the first firmware identification are stored or not; if yes, the server returns a response message of a second upgrading request to the terminal equipment; the response message of the second upgrade request comprises a first firmware identification, a first firmware version and a first download address corresponding to the first firmware installation package;
and the terminal equipment receives the response message of the second upgrading request and downloads the first firmware installation package according to the first downloading address for upgrading.
CN201811621190.3A 2018-12-28 2018-12-28 A kind of terminal device firmware upgrade method and system based on Websocket long connection Pending CN109600451A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811621190.3A CN109600451A (en) 2018-12-28 2018-12-28 A kind of terminal device firmware upgrade method and system based on Websocket long connection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811621190.3A CN109600451A (en) 2018-12-28 2018-12-28 A kind of terminal device firmware upgrade method and system based on Websocket long connection

Publications (1)

Publication Number Publication Date
CN109600451A true CN109600451A (en) 2019-04-09

Family

ID=65963534

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811621190.3A Pending CN109600451A (en) 2018-12-28 2018-12-28 A kind of terminal device firmware upgrade method and system based on Websocket long connection

Country Status (1)

Country Link
CN (1) CN109600451A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110399136A (en) * 2019-06-18 2019-11-01 苏州浪潮智能科技有限公司 A kind of BMC firmware update, device, equipment and medium
CN113408015A (en) * 2021-06-15 2021-09-17 北京安天网络安全技术有限公司 Product operation and maintenance method and device of terminal equipment and storage medium
CN113596087A (en) * 2021-06-25 2021-11-02 海南视联大健康智慧医疗科技有限公司 Application upgrading method and device and computer readable storage medium
CN115242413A (en) * 2021-04-06 2022-10-25 中国移动通信有限公司研究院 Internet of things equipment firmware safety upgrading method and device, electronic equipment and medium
CN116048546A (en) * 2022-08-25 2023-05-02 荣耀终端有限公司 System upgrading method, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150058407A1 (en) * 2011-02-11 2015-02-26 Goinstant, Inc. Systems, methods, and apparatuses for implementing the simultaneous display of multiple browser client cursors at each browser client common to a shared browsing session
CN105279001A (en) * 2015-11-20 2016-01-27 杭州云柚科技有限公司 Software remote upgrading method for network terminal devices
CN106533807A (en) * 2016-12-27 2017-03-22 福建星网视易信息系统有限公司 Method and system for remotely upgrading terminal equipment
CN106878391A (en) * 2017-01-10 2017-06-20 厦门中控生物识别信息技术有限公司 The system and method for internet-of-things terminal firmware upgrade in LAN

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150058407A1 (en) * 2011-02-11 2015-02-26 Goinstant, Inc. Systems, methods, and apparatuses for implementing the simultaneous display of multiple browser client cursors at each browser client common to a shared browsing session
CN105279001A (en) * 2015-11-20 2016-01-27 杭州云柚科技有限公司 Software remote upgrading method for network terminal devices
CN106533807A (en) * 2016-12-27 2017-03-22 福建星网视易信息系统有限公司 Method and system for remotely upgrading terminal equipment
CN106878391A (en) * 2017-01-10 2017-06-20 厦门中控生物识别信息技术有限公司 The system and method for internet-of-things terminal firmware upgrade in LAN

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110399136A (en) * 2019-06-18 2019-11-01 苏州浪潮智能科技有限公司 A kind of BMC firmware update, device, equipment and medium
CN115242413A (en) * 2021-04-06 2022-10-25 中国移动通信有限公司研究院 Internet of things equipment firmware safety upgrading method and device, electronic equipment and medium
CN113408015A (en) * 2021-06-15 2021-09-17 北京安天网络安全技术有限公司 Product operation and maintenance method and device of terminal equipment and storage medium
CN113596087A (en) * 2021-06-25 2021-11-02 海南视联大健康智慧医疗科技有限公司 Application upgrading method and device and computer readable storage medium
CN116048546A (en) * 2022-08-25 2023-05-02 荣耀终端有限公司 System upgrading method, electronic equipment and computer readable storage medium
CN116048546B (en) * 2022-08-25 2023-10-31 荣耀终端有限公司 System upgrading method, electronic equipment and computer readable storage medium
CN117453245A (en) * 2022-08-25 2024-01-26 荣耀终端有限公司 System upgrading method, electronic equipment and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN109600451A (en) A kind of terminal device firmware upgrade method and system based on Websocket long connection
US9766914B2 (en) System and methods for remote maintenance in an electronic network with multiple clients
US11140162B2 (en) Response method and system in virtual network computing authentication, and proxy server
CN109804597B (en) Vehicle-mounted gateway and key management device
US20210211502A1 (en) Systems and methods for remote management of appliances
WO2015078407A1 (en) Method for sharing application between terminals, and terminals
CN109067739B (en) Communication data encryption method and device
US8533458B2 (en) Headend system for downloadable conditional access service and method of operating the same
EP2340483A1 (en) Method for provisioning trusted software to an electronic device
US8638932B2 (en) Security method and system and computer-readable medium storing computer program for executing the security method
CN106656923A (en) Device association method, key update method and apparatuses
US9225585B2 (en) Method and system for device management, and server
CN110806883A (en) Method and device for safely upgrading firmware and computer readable medium
US11212116B2 (en) Information processing apparatus, control method for controlling information processing apparatus, and storage medium
KR20120140043A (en) A set-top box and method for diagnostic of the same
CN112053477B (en) Control system, method and device of intelligent door lock and readable storage medium
US8490155B2 (en) Method and apparatus for detecting downloadable conditional access system host with duplicated secure micro
US11962465B2 (en) Control system, electronic device, and control method
CN112565236A (en) Information authentication method, device, computer equipment and storage medium
CN109451497B (en) Wireless network connection method and device, electronic equipment and storage medium
CN101645893A (en) Network trading method, device and system
CN115150162B (en) Root certificate updating method and device
JPWO2005038661A1 (en) Terminal authentication apparatus and method
CN110769065A (en) Remote management method, system, terminal equipment and server
CN113328883B (en) Terminal management method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 1301, No.132, Fengqi Road, phase III, software park, Xiamen City, Fujian Province

Applicant after: Xiamen Entropy Technology Co.,Ltd.

Address before: 361000, Xiamen three software park, Fujian Province, 8 North Street, room 2001

Applicant before: XIAMEN ZKTECO INFORMATION TECHNOLOGY Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190409