CN113900684A - Terminal equipment upgrading method and device, computer equipment and storage medium - Google Patents

Terminal equipment upgrading method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113900684A
CN113900684A CN202111107134.XA CN202111107134A CN113900684A CN 113900684 A CN113900684 A CN 113900684A CN 202111107134 A CN202111107134 A CN 202111107134A CN 113900684 A CN113900684 A CN 113900684A
Authority
CN
China
Prior art keywords
upgrading
information
upgrade
data packet
token
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
CN202111107134.XA
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.)
Shenzhen Neoway Technology Co Ltd
Original Assignee
Shenzhen Neoway 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 Shenzhen Neoway Technology Co Ltd filed Critical Shenzhen Neoway Technology Co Ltd
Priority to CN202111107134.XA priority Critical patent/CN113900684A/en
Publication of CN113900684A publication Critical patent/CN113900684A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/101Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM] by binding digital rights to specific entities
    • G06F21/1014Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM] by binding digital rights to specific entities to tokens
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/107License processing; Key processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to a terminal device upgrading method and device, computer equipment and a storage medium. The method comprises the following steps: sending an access request instruction to an upgrade server, and receiving an authentication reply result fed back by the upgrade server based on the access request instruction; analyzing the authentication reply result to obtain identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information; based on the access result information obtained by analysis, when the request access is confirmed to be successful, generating a first token based on the verification information; acquiring equipment information, transmitting a first token and the equipment information to an upgrade server, inquiring an upgrade data packet based on the equipment information by the upgrade server according to the first token when the terminal equipment is determined to have the download right, and feeding back the download information of the upgrade data packet to the terminal equipment when the inquiry is successful; and receiving the download information of the upgrade data packet fed back by the upgrade server, and upgrading the equipment according to the download information of the upgrade data packet.

Description

Terminal equipment upgrading method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for upgrading a terminal device, a computer device, and a storage medium.
Background
At present, with the development of the technology of the internet of things, more and more terminals of the internet of things are online and network-connected. However, after the application site is installed and accessed to the network, related maintenance personnel also need to perform maintenance and upgrade on the internet of things terminal according to the change of the customer demand or the market, and since the number of the general internet of things terminals is large and the installation places are different, most manufacturers upgrade the equipment based on the wireless upgrade technology when performing maintenance and upgrade on the internet of things terminals.
The existing wireless upgrading technology mainly downloads a program updating package through a wireless network, and flash burning upgrading is carried out through the downloaded program updating package. Although the existing wireless upgrade technology can effectively realize equipment upgrade, when downloading a program update package, the program update package may be maliciously intercepted, or dropped, so that the program update package with an unknown source may be upgraded, the upgrade security of the equipment cannot be guaranteed, and certain potential safety hazards exist.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a terminal device upgrading method, apparatus, computer device and storage medium capable of ensuring device upgrading security.
A terminal equipment upgrading method is applied to terminal equipment and comprises the following steps:
sending an access request instruction to an upgrade server, and receiving an authentication reply result correspondingly fed back by the upgrade server based on the access request instruction;
analyzing the authentication reply result to obtain corresponding identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information;
based on the access result information obtained by analysis, when the access of the request is confirmed to be successful, a first token is generated based on the verification information;
acquiring equipment information, transmitting the first token and the equipment information to the upgrading server, and inquiring an upgrading data packet based on the equipment information by the upgrading server according to the received first token when the terminal equipment is determined to have downloading right, and feeding back corresponding upgrading data packet downloading information to the terminal equipment when the terminal equipment is successfully inquired;
and receiving the download information of the upgrade data packet fed back by the upgrade server, and upgrading the equipment according to the download information of the upgrade data packet.
An apparatus for upgrading a terminal device, the apparatus comprising:
the request initiating module is used for sending an access request instruction to the upgrading server and receiving an authentication reply result correspondingly fed back by the upgrading server based on the access request instruction;
the analysis module is used for analyzing the authentication reply result to obtain corresponding identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information;
the verification processing module is used for generating a first token based on the verification information when the access request is confirmed to be successfully accessed based on the access result information obtained by analysis;
the information transmission module is used for acquiring equipment information, transmitting the first token and the equipment information to the upgrading server, inquiring an upgrading data packet based on the equipment information when the upgrading server determines that the terminal equipment has the downloading right according to the received first token, and feeding back corresponding upgrading data packet downloading information to the terminal equipment when the terminal equipment is successfully inquired;
and the equipment upgrading module is used for receiving the upgrading data package downloading information fed back by the upgrading server and upgrading the equipment according to the upgrading data package downloading information.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
sending an access request instruction to an upgrade server, and receiving an authentication reply result correspondingly fed back by the upgrade server based on the access request instruction;
analyzing the authentication reply result to obtain corresponding identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information;
based on the access result information obtained by analysis, when the access of the request is confirmed to be successful, a first token is generated based on the verification information;
acquiring equipment information, transmitting the first token and the equipment information to the upgrading server, and inquiring an upgrading data packet based on the equipment information by the upgrading server according to the received first token when the terminal equipment is determined to have downloading right, and feeding back corresponding upgrading data packet downloading information to the terminal equipment when the terminal equipment is successfully inquired;
and receiving the download information of the upgrade data packet fed back by the upgrade server, and upgrading the equipment according to the download information of the upgrade data packet.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
sending an access request instruction to an upgrade server, and receiving an authentication reply result correspondingly fed back by the upgrade server based on the access request instruction;
analyzing the authentication reply result to obtain corresponding identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information;
based on the access result information obtained by analysis, when the access of the request is confirmed to be successful, a first token is generated based on the verification information;
acquiring equipment information, transmitting the first token and the equipment information to the upgrading server, and inquiring an upgrading data packet based on the equipment information by the upgrading server according to the received first token when the terminal equipment is determined to have downloading right, and feeding back corresponding upgrading data packet downloading information to the terminal equipment when the terminal equipment is successfully inquired;
and receiving the download information of the upgrade data packet fed back by the upgrade server, and upgrading the equipment according to the download information of the upgrade data packet.
According to the terminal equipment upgrading method and device, the computer equipment and the storage medium, the terminal equipment sends the access request instruction to the upgrading server and receives the authentication reply result correspondingly fed back by the upgrading server based on the access request instruction. The authentication reply result comprises access result information and verification information. And then, the terminal equipment determines that the access request is successfully accessed based on the access result information, and generates a corresponding first token based on the verification information obtained by analysis so as to obtain a corresponding upgrading data packet through the first token. The terminal equipment can perform subsequent data interaction with the upgrading server after being successfully accessed into the upgrading server, so that the security of the interactive identity between the upgrading server and the terminal equipment can be guaranteed, the access of illegal visitors is avoided, and the security of the upgrading process can be guaranteed. Moreover, since the verification information is randomly generated, the operation can indirectly ensure the variability of the token, so that even if an illegal visitor can steal the token at a certain upgrading stage, the illegal visitor cannot forge a terminal device based on the token, and further request an upgrading data packet from an upgrading server. In addition, before feeding back the download information of the upgrade data packet to the terminal device, the upgrade server also determines the download authority of the terminal device based on the received token, so as to avoid resource loss caused by feeding back the download information of the upgrade data packet to the device without authority, and further guarantee the upgrade safety of the device.
Drawings
FIG. 1 is a diagram of an application environment of a method for upgrading a terminal device in an embodiment;
FIG. 2 is a partial flowchart of a method for upgrading a terminal device according to an embodiment;
fig. 3 is a schematic overall flow chart of an upgrading method of a terminal device in one embodiment;
FIG. 4 is a flowchart illustrating the upgrade steps of an old program in one embodiment;
FIG. 5 is a block diagram showing the configuration of an upgrading apparatus for a terminal device according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The terminal device upgrading method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal device 102 communicates with the upgrade server 104 via a network. The terminal device 102 sends an access request instruction to the upgrade server 104, and receives an authentication reply result correspondingly fed back by the upgrade server 104 based on the access request instruction; the terminal device 102 analyzes the authentication reply result to obtain corresponding identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information; the terminal device 102 generates a first token based on the verification information when confirming that the request access is successful based on the access result information obtained by the analysis; the terminal equipment 102 acquires equipment information, transmits a first token and the equipment information to the upgrade server 104, and the upgrade server 104 inquires an upgrade data packet based on the equipment information when determining that the terminal equipment 102 has the download right according to the received first token, and feeds back corresponding download information of the upgrade data packet to the terminal equipment 102 when the inquiry is successful; the terminal device 102 receives the upgrade data package download information fed back by the upgrade server 104, and performs device upgrade according to the upgrade data package download information.
The terminal device 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, portable wearable devices, and internet of things terminals, and the upgrade server 106 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In an embodiment, as shown in fig. 2, a method for upgrading a terminal device is provided, which is described by taking the method as an example for being applied to the terminal device in fig. 1, and includes the following steps:
step S202, sending an access request instruction to the upgrade server, and receiving an authentication reply result correspondingly fed back by the upgrade server based on the access request instruction.
Specifically, first, the terminal device receives an upgrade instruction sent by the application server, where the upgrade instruction carries an access address of the upgrade server. Secondly, the terminal equipment analyzes the received upgrading instruction, and directionally sends an access request instruction to the upgrading server based on a preset communication port and an access address of the upgrading server obtained through analysis, wherein the access request instruction carries an identification number of the terminal equipment. And then, after receiving the access request instruction, the upgrade server analyzes the access request instruction to determine the identification number of the terminal equipment, judges whether the terminal equipment has the access authority or not according to the identification number of the terminal equipment obtained by analysis, and feeds back a corresponding authentication reply result to the terminal equipment.
In one embodiment, the identification number of the terminal device may be an IMEI (International Mobile Equipment Identity) number. The IMEI number is a so-called mobile phone serial number, mobile phone "serial number" or the like, and is used for identifying communication equipment such as each independent mobile phone in a network, and corresponds to an identity card of a terminal device.
Based on the above embodiment, the terminal device will send the access request instruction to the upgrade server through the following communication interfaces:
“https://ip:port/fota/api/authentid={IMEI_NUM}&version={VERSION_NUM},method=GET”;
wherein { IMEI _ NUM } is an IMEI number of the terminal equipment; { VERSION _ NUM } is the protocol VERSION employed. It should be noted that the protocol version mentioned above refers to a protocol used by the upgrade server for upgrading, and the specific format of the protocol version may be "alpha + numeric", for example: v1.1, etc.
In one embodiment, after receiving the access request instruction, the upgrade server replies the following content (i.e. authentication reply result) to the terminal device:
“{"state":"{RESULT}","action":"authent","message":"{MESSAGE_INFO}","id":"{IMEI_NUM}","ticket":"{TICKET_NUM}"}”;
wherein, the (1) { RESULT } field is the access RESULT (i.e. the access RESULT information of the terminal device) fed back. In one embodiment, the { RESULT } field may be defined as "ok" or "error", where "ok" characterizes terminal device access success and "error" characterizes terminal device access failure. The detailed information of the access result is described in the { MESSAGE _ INFO } field, and the { MESSAGE _ INFO } field is specific contents of the access result, and for example, the { MESSAGE _ INFO } field may be described with "IMEI length error" information indicating an IMEI number length error. (2) { TICKET _ NUM } is a randomly generated TICKET number (randomly generated authentication information). In one embodiment, ticket may be a number of 0 to 9 bits in length.
Step S204, analyzing the authentication reply result to obtain corresponding identity authentication information; the identity authentication information includes access result information of the terminal device and randomly generated verification information.
Specifically, the terminal device analyzes the received authentication reply result, and obtains corresponding access result information and randomly generated verification information. Since the data structure of the authentication reply result, the meaning of the access result information representation, and the meaning of the randomly generated verification information representation, and the definable form have been described in detail in the above embodiments, the embodiments of the present application are not described herein in more detail.
And step S206, based on the analyzed access result information, when the request access is confirmed to be successful, generating a first token based on the verification information.
Specifically, the terminal device generates the first token through an information digest algorithm under the condition that the identification number, the preset specific character string and the verification information of the terminal device are known when the terminal device determines that the upgrade server is successfully accessed according to the access result information fed back by the upgrade server. It should be noted that the specific character string is determined in advance by the manufacturers of the terminal device and the upgrade server, and the character string does not pass through the network, so that an illegal visitor cannot acquire the character string by means of network monitoring and the like. The randomly generated verification information also ensures that tokens correspondingly generated are different every time of upgrading even the same equipment. In addition, the use of the message digest algorithm can also ensure that the token cannot be reversely restored. Therefore, the condition that an illegal visitor cannot masquerade as the terminal equipment is ensured, the upgrading server is requested to acquire the upgrading data packet, and the equipment upgrading safety is further improved.
In one embodiment, the Message Digest Algorithm may be an MD5(Message-Digest Algorithm, a widely used cryptographic hash function) Algorithm, and in one embodiment, the terminal device calculates an identification number of the terminal device, a preset specific character string, and authentication information through the MD5 Algorithm to obtain a corresponding token field. The token field is a string of character strings generated by the terminal device, and is used as a token requested by the client. the token field usage can also relieve the stress of the device, reduce frequent database queries, and make the device more robust.
And S208, acquiring the equipment information, transmitting the first token and the equipment information to the upgrading server, inquiring an upgrading data packet based on the equipment information when the upgrading server determines that the terminal equipment has the downloading right according to the received first token, and feeding back corresponding upgrading data packet downloading information to the terminal equipment when the terminal equipment is successfully inquired.
Specifically, after acquiring the device information, the terminal device transmits the first token and the device information to the upgrade server through a specified transmission interface.
In one embodiment, the transmission interface is defined in the form of:
“https://ip:port/fota/api/checkid={IMEI_NUM}&version={VERS0ION_NUM}&company={COMPANY}&token={MD5_TOKEN}&product_name={PRODUCT_NAME}&product_version={PRODUCT_VERSION},method=GET”;
wherein, { COMPANY } is a manufacturer of the equipment; { PRODUCT _ NAME } is the equipment item NAME to which the terminal equipment belongs; { PRODUCT _ VERSION } is the VERSION number of the old program in the terminal equipment in the running state before equipment upgrading is included in the equipment information; { MD5_ TOKEN } is a check value obtained by checking the ticket field based on the MD5 algorithm.
Specifically, the upgrade server generates a second token based on the same manner (for example, based on an information digest algorithm) when the identification number of the terminal device is known and a specific character string agreed with the terminal device in advance, and compares the received first token with the second token to determine whether the terminal device has the download authority. And the upgrading server inquires an upgrading data packet based on the received equipment information under the condition that the terminal equipment is determined to have the access authority, and transmits relevant downloading information (such as a downloading address and a version number) of the upgrading data packet to the terminal equipment when the inquiry is successful.
And step S210, receiving the upgrade data package download information fed back by the upgrade server, and upgrading the equipment according to the upgrade data package download information.
Specifically, the terminal device accesses the download address after determining the download address corresponding to the upgrade data package according to the received download information of the upgrade data package, and downloads the upgrade data package from the accessed resource. Subsequently, when the terminal equipment determines that the upgrading data package is downloaded successfully, the equipment upgrading is carried out on the upgrading data package obtained based on downloading.
In one embodiment, the terminal device may access a download address of the upgrade packet using an HTTPS (Hyper Text Transfer Protocol over secure session Layer) Protocol, and determine to download the upgrade packet if the access is successful. Of course, in the present embodiment, the terminal device may also use another communication Protocol to access the download address of the upgrade data package, for example, an FTP (File Transfer Protocol) Protocol, and the embodiment of the present application does not limit what communication Protocol is used by the terminal device to access the download address of the upgrade data package.
In the terminal equipment upgrading method, the terminal equipment sends an access request instruction to the upgrading server and receives an authentication reply result correspondingly fed back by the upgrading server based on the access request instruction. The authentication reply result comprises access result information and verification information. And then, the terminal equipment determines that the access request is successfully accessed based on the access result information, and generates a corresponding first token based on the verification information obtained by analysis so as to obtain a corresponding upgrading data packet through the first token. The terminal equipment can perform subsequent data interaction with the upgrading server after being successfully accessed into the upgrading server, so that the security of the interactive identity between the upgrading server and the terminal equipment can be guaranteed, the access of illegal visitors is avoided, and the security of the upgrading process can be guaranteed. Moreover, since the verification information is randomly generated, the operation can indirectly ensure the variability of the token, so that even if an illegal visitor can steal the token at a certain upgrading stage, the illegal visitor cannot forge a terminal device based on the token, and further request an upgrading data packet from an upgrading server. In addition, before feeding back the download information of the upgrade data packet to the terminal device, the upgrade server also determines the download authority of the terminal device based on the received token, so as to avoid resource loss caused by feeding back the download information of the upgrade data packet to the device without authority, and further guarantee the upgrade safety of the device.
In one embodiment, generating the first token based on the verification information comprises: acquiring an identification number of the terminal equipment and a preset specific character string; the specific character string is determined through pre-negotiation between the terminal equipment and the upgrading server; and calculating the identification number, the specific character string and the verification information of the terminal equipment through an information abstract algorithm to generate a first token.
Specifically, first, the terminal device obtains its own identification number and determines a preset specific character string. The preset specific character string is determined by negotiation between the terminal device and the upgrade server in advance, and the specific character string does not pass through the network, so that an illegal visitor (e.g., a hacker) cannot monitor the specific character string by illegal means such as network monitoring. Then, the terminal device checks the acquired identification number, specific character string, and ticket field of the terminal device by using an information digest algorithm (e.g., MD5 algorithm), so as to obtain a corresponding token field (i.e., generate the first token).
In the above embodiment, the token field is determined by the identification number of the terminal device, the specific character string, and the token randomly generated by the server. The specific character string is determined by negotiation between the terminal equipment and the upgrading server in advance, and does not pass through a network, so that an illegal visitor cannot acquire the specific character string by means of network monitoring and the like; the randomly generated ticket ensures that the token fields of each upgrade are different even if the same equipment is used, and the use of the information abstract algorithm further ensures that the token fields cannot be reversely restored, so that an illegal visitor cannot pretend to be a terminal device to request the upgrade server to acquire the upgrade data packet, and the safety of the upgrade process is ensured.
In one embodiment, the querying, by the upgrade server, the upgrade data packet based on the device information when it is determined that the terminal device has the download right according to the received first token includes: the upgrade server compares the received first token with a second token determined based on an authentication reply result fed back to the terminal equipment in advance to obtain a corresponding comparison result; when the terminal equipment is determined to have the downloading right based on the comparison result, the upgrading server inquires an upgrading data packet in a background inquiry mode based on the received equipment information; the device information includes at least one of a version number of an old program in a running state in the terminal device before upgrading the device, a device project name to which the terminal device belongs, and a manufacturer of the terminal device.
Specifically, the upgrade server, knowing the identification number of the terminal device, the preset specific character string and the token field (i.e. the verification information) randomly generated by itself, calculates the above information based on the same verification manner, i.e. based on the information digest algorithm, to generate the corresponding second token. And then, after receiving the first token, comparing the first token with the generated second token, and inquiring the upgrade data packet based on the received equipment information when the first token is determined to be matched with the second token based on the obtained comparison result. In an embodiment, the upgrade server may query the upgrade data package in a background query manner, and certainly, other query manners may also be used, for example, a database query manner, which is not limited in this embodiment of the present application.
In one embodiment, the version number of the old program is the version of the device that was running before the upgrade, such as "N311-001". The names of the device items to which the terminal device belongs include, but are not limited to, the NWY _ N311 item, and the like, which is not limited in this embodiment. The upgrade server may store the upgrade data package in the database in advance in an upgrade data form of { upgrade data package, device information }, and query the upgrade data package from each item of upgrade data stored in the database in advance with the device information as a query condition when it is determined that the terminal device has the download right.
In the embodiment, the upgrade server determines whether the terminal device has the access right based on a token comparison mode, so that the terminal device is prevented from being disguised by an illegal visitor, the upgrade server requests to acquire the upgrade data packet, and the upgrade safety of the device is ensured.
In one embodiment, when the query is successful, the feeding back the corresponding upgrade data package download information to the terminal device by the upgrade server includes: when the upgrading server inquires the corresponding upgrading data packet in a background inquiry mode, determining a download address of the upgrading data packet, a version number of the upgrading data packet and a token of the upgrading data packet; and the upgrading server takes the download address of the upgrading data packet, the version number of the upgrading data packet and the token of the upgrading data packet as the download information of the upgrading data packet and feeds the download information of the upgrading data packet back to the terminal equipment.
Specifically, the upgrade server, based on the received first token, performs query of the upgrade data package in a background query manner with device information as a search condition when it is determined that the terminal device has access permission, performs information integration on the download address of the determined upgrade data package, the version number of the upgrade data package, and the token of the upgrade data package when it is determined that the query is successful, and feeds back the download information of the upgrade data package obtained by integration to the terminal device through a corresponding transmission interface. And when the query fails, feeding back information of failure of the upgrade request to the terminal equipment by the upgrade server.
In one embodiment, when the upgrade server determines that the upgrade data packet search is successful, the information fed back by the upgrade server is as follows:
“{"state":"ok","action":"check","message":"{MESSAGE_INFO}","update":true,"product_version":"{PRODUCT_VERSION}","company":"{COMPANY}","file_md5":"{FILE_MD5}","content":"{CONTENT}","current_version":"{PRODUCT_VERSION}","date":"{DATA_TIME}","url":"{FILE_URL}","id":"{IMEI_NUM}"}”;
wherein:
(1) the "state" defines the access result of the terminal device, for example, when the content defined by the "state" is "ok", the terminal device is considered to be successfully accessed; when the content defined by the method is 'error', the terminal equipment is considered to have failed access.
(2) The "action" defines the action type currently executed by the upgrade service, for example, when the defined content is "check", it is considered that the action type executed by the upgrade server is the query type; when the content defined by the upgrade server is "authent", the action type executed by the upgrade server is considered as the identity authentication type.
(3) Defined in "message" is detailed information of the returned result, which may be, for example, "post param error": indicating an error in the transmitted request parameters, etc.
(4) Defined in "update" is the query result of the upgrade package, for example, when the defined content is "true", it may be considered that the upgrade package has been successfully queried currently, and when the defined content is "false", it may be considered that the upgrade package has not been queried currently.
(5) Defined in "company" is the manufacturer of the terminal device.
(6) Defined in "file _ md 5" is a token to upgrade the package.
(7) Defined in "content" is the descriptive content of the upgrade package, which may be, for example, a related description about the upgrade package, belonging to an optional part, wherein the defined content may also be empty.
(8) Defined in "current _ version" is the version number of the upgrade packet, for example, the version number of the upgrade packet is defined as "N311-002".
(9) Defined in "date" is a point in time at which the upgrade server stores the corresponding upgrade data package.
(10) Defined in "url" is the download address of the upgrade package, such as: "https:// 115.29.212.25:80/upload/1515750186756ROM 1". Defined in "id" is XXX.
In one embodiment, receiving upgrade data package download information fed back by an upgrade server, and performing device upgrade according to the upgrade data package download information includes: receiving the download information of the upgrade data package, and analyzing the download information of the upgrade data package to determine a download address of the upgrade data package; accessing a download address of the upgrade data packet based on a preset secure communication protocol, and downloading the upgrade data packet in real time from the currently accessed address when the address access is determined to be successful; and upgrading the old program based on the downloaded real-time upgrading data packet, and starting the new program obtained by corresponding upgrading when the old equipment is determined to be upgraded.
Specifically, after receiving the download information of the upgrade data package, the terminal device analyzes the download information to obtain a download address of the upgrade data package. And then, accessing the download address of the upgrading data packet through a preset safe communication protocol, and downloading the upgrading data packet from the accessed address to obtain a corresponding real-time upgrading data packet. And then, the terminal equipment upgrades the equipment based on the downloaded real-time upgrade data packet, starts a new program through a preset boot loader under the condition of determining that the equipment is upgraded successfully, and judges whether the equipment is upgraded successfully or not through the starting state of the new program.
In one embodiment, the boot loader may be a bootloader. It should be noted that, in the embedded operating system, the null is run before the kernel of the operating system is run. The method can initialize hardware equipment and establish a memory space mapping chart, thereby bringing the software and hardware environment of the system to a proper state so as to prepare a correct environment for finally calling an operating system kernel. The preset secure communication protocol may be an HTTPS protocol, an FTPS protocol, and the like, which is not limited in this embodiment of the present application.
In the above embodiment, when the upgrade data packet is issued, since the secure communication protocol is adopted, even if a hacker acquires the download address of the upgrade data packet midway in the transmission process of the download information of the upgrade data packet, the download address cannot be analyzed, so that the security of the download process of the upgrade data packet is optimized, and the security of the whole communication process is ensured.
In one embodiment, before performing the upgrading step of the old program based on the real-time upgrade data package obtained by downloading, the method comprises: analyzing the download information of the upgrade data package to determine the version number of the upgrade data package and a token of the upgrade data package; backup storage is carried out on the version number of the upgrade data packet, the token of the upgrade data packet and the old program which is operated in the terminal equipment, which are obtained by analysis, through a preset storage partition; and determining a token of the real-time upgrading data packet, and comparing the token of the real-time upgrading data packet with the first same type data correspondingly stored in the storage partition to obtain a corresponding first comparison result.
Specifically, referring to fig. 3, before upgrading the device, the terminal device may also immediately store the version number of the upgrade data packet, the token of the upgrade data packet, and the old program that has been run in the terminal device, which are obtained through parsing, through a preset storage partition. Therefore, when data (such as the version number of an upgrade data packet) comparison is needed and an old program is recovered, corresponding data can be directly called from the storage partition, and the problem that equipment cannot work normally under the condition that a new program fails to start due to the fact that the old program is not backed up is solved. And subsequently, the real-time upgrading data package can be verified based on the version number and the token of the pre-stored upgrading data package, so that the upgrading data package in the downloading process can be prevented from being replaced, and the situation that equipment cannot work normally due to the fact that a wrong upgrading data package is upgraded due to misoperation of personnel can be prevented.
In an embodiment, referring to fig. 4, performing an upgrade on an old program based on a real-time upgrade data package obtained by downloading, and starting a new program obtained by corresponding upgrade when it is determined that the upgrade of the old device is completed, includes:
and S402, based on the obtained first comparison result, when the token of the real-time upgrading data packet is determined to be matched with the first same type data, based on the downloaded real-time upgrading data packet, upgrading the old program.
Specifically, when the token of the real-time upgrade data packet is determined to be matched with the corresponding first same type data stored in the storage partition in advance, the terminal device performs program upgrade on the upgrade data packet obtained based on downloading, and subsequently judges whether the device is upgraded successfully by combining with the starting state of a new program obtained by corresponding upgrade.
Step S404, when the old equipment is determined to be upgraded, a new program obtained by corresponding upgrading is started through a preset boot loader, and when the new program is determined to be failed to be started, the corresponding backed-up old program is called from the storage partition, and the old program is recovered.
Specifically, the terminal device starts a new program through a preset boot loader, which may be a bootloader, for example, and calls a corresponding old program from the storage partition and restores the old program when it is determined that the new program fails to start through the start state of the new program. In an embodiment, when the terminal device determines that the new program fails, and determines that the upgrade server and the application server can be successfully accessed (it should be noted that the upgrade server and the application server may be two independent servers, or may be two services of one server), the instantly generated information of the upgrade failure is fed back to the application server and the upgrade server, so that the two servers instantly take corresponding measures for the current state of the device upgrade failure.
Step S406, when the new program is successfully started, determining the version number of the new program obtained by corresponding upgrading, comparing the version number of the new program with second data of the same type correspondingly stored in the storage partition, and determining that the terminal equipment is successfully upgraded when the version number of the new program is matched with the second data of the same type based on the obtained second comparison result.
Specifically, the terminal device verifies the validity of the version number of the new program under the condition that the start of the new program is determined to be successful, so that the situation that the upgrading data packet in the downloading process is illegally replaced and is unknown and the device cannot work normally due to the fact that the wrong upgrading data packet is upgraded due to misoperation of personnel is avoided.
In the above embodiment, when the device is upgraded, the old program is backed up, the token of the upgrade data packet obtained by downloading is verified, and after the upgrade is completed, the version number of the new program is also verified, so that the upgrade data packet in the downloading process is prevented from being illegally replaced without self-awareness, and the upgrade safety of the device is guaranteed.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 5, there is provided a terminal device upgrade apparatus 500, including: a request initiating module 501, a parsing module 502, a verification processing module 503, an information transmission module 504 and an equipment upgrading module 505, wherein:
the request initiating module 501 is configured to send an access request instruction to the upgrade server, and receive an authentication reply result correspondingly fed back by the upgrade server based on the access request instruction.
The analysis module 502 is configured to analyze the authentication reply result to obtain corresponding identity authentication information; the identity authentication information includes access result information of the terminal device and randomly generated verification information.
And the verification processing module 503 is configured to generate a first token based on the verification information when it is determined that the request access is successful based on the access result information obtained through the analysis.
The information transmission module 504 is configured to obtain the device information, transmit the first token and the device information to the upgrade server, and enable the upgrade server to query the upgrade data package based on the device information when it is determined that the terminal device has the download right according to the received first token, and feed back corresponding download information of the upgrade data package to the terminal device when the query is successful.
And the device upgrading module 505 is configured to receive the upgrade data packet download information fed back by the upgrade server, and upgrade the device according to the upgrade data packet download information.
In one embodiment, the verification processing module 503 is further configured to obtain an identification number of the terminal device and a preset specific character string; the specific character string is determined through pre-negotiation between the terminal equipment and the upgrading server; and calculating the identification number, the specific character string and the verification information of the terminal equipment through an information abstract algorithm to generate a first token.
In one embodiment, the information transmission module 504 is further configured to compare, by the upgrade server, the received first token with a second token determined based on an authentication reply result fed back to the terminal device in advance, so as to obtain a corresponding comparison result; when the terminal equipment is determined to have the downloading right based on the comparison result, the upgrading server inquires an upgrading data packet in a background inquiry mode based on the received equipment information; the device information includes at least one of a version number of an old program in a running state in the terminal device before upgrading the device, a device project name to which the terminal device belongs, and a manufacturer of the terminal device.
In one embodiment, the information transmission module 504 is further configured to determine, when the upgrade server queries a corresponding upgrade data package through a background query manner, a download address of the upgrade data package, a version number of the upgrade data package, and a token of the upgrade data package; and the upgrading server takes the download address of the upgrading data packet, the version number of the upgrading data packet and the token of the upgrading data packet as the download information of the upgrading data packet and feeds the download information of the upgrading data packet back to the terminal equipment.
In one embodiment, the device upgrade module 505 is further configured to receive upgrade data package download information, and parse the upgrade data package download information to determine a download address of the upgrade data package; accessing a download address of the upgrade data packet based on a preset secure communication protocol, and downloading the upgrade data packet in real time from the currently accessed address when the address access is determined to be successful; and upgrading the old program based on the downloaded real-time upgrading data packet, and starting the new program obtained by corresponding upgrading when the old equipment is determined to be upgraded.
In one embodiment, the device upgrade module 505 is further configured to parse the upgrade data package download information to determine a version number of the upgrade data package and a token of the upgrade data package; backup storage is carried out on the version number of the upgrade data packet, the token of the upgrade data packet and the old program which is operated in the terminal equipment, which are obtained by analysis, through a preset storage partition; and determining a token of the real-time upgrading data packet, and comparing the token of the real-time upgrading data packet with the first same type data correspondingly stored in the storage partition to obtain a corresponding first comparison result.
In one embodiment, the device upgrading module 505 is further configured to, based on the obtained first comparison result, upgrade the old program based on the downloaded real-time upgrade data package when it is determined that the token of the real-time upgrade data package matches the first homogeneous data; when the old equipment is determined to be upgraded, starting a new program obtained by corresponding upgrading through a preset boot loader, and when the new program is determined to be failed to start, calling the corresponding backed-up old program from the storage partition and recovering the old program; and when the new program is determined to be successfully started, determining the version number of the new program obtained by corresponding upgrading, comparing the version number of the new program with second data of the same type correspondingly stored in the storage partition, and determining that the terminal equipment is successfully upgraded when the version number of the new program is matched with the second data of the same type based on the obtained second comparison result.
According to the terminal equipment upgrading device, the terminal equipment sends the access request instruction to the upgrading server and receives the authentication reply result correspondingly fed back by the upgrading server based on the access request instruction. The authentication reply result comprises access result information and verification information. And then, the terminal equipment determines that the access request is successfully accessed based on the access result information, and generates a corresponding first token based on the verification information obtained by analysis so as to obtain a corresponding upgrading data packet through the first token. The terminal equipment can perform subsequent data interaction with the upgrading server after being successfully accessed into the upgrading server, so that the security of the interactive identity between the upgrading server and the terminal equipment can be guaranteed, the access of illegal visitors is avoided, and the security of the upgrading process can be guaranteed. Moreover, since the verification information is randomly generated, the operation can indirectly ensure the variability of the token, so that even if an illegal visitor can steal the token at a certain upgrading stage, the illegal visitor cannot forge a terminal device based on the token, and further request an upgrading data packet from an upgrading server. In addition, before feeding back the download information of the upgrade data packet to the terminal device, the upgrade server also determines the download authority of the terminal device based on the received token, so as to avoid resource loss caused by feeding back the download information of the upgrade data packet to the device without authority, and further guarantee the upgrade safety of the device.
For the specific definition of the terminal device upgrading apparatus, reference may be made to the above definition of the terminal device upgrading method, which is not described herein again. All or part of each module in the terminal equipment upgrading device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a terminal device upgrade method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program: sending an access request instruction to the upgrade server, and receiving an authentication reply result correspondingly fed back by the upgrade server based on the access request instruction; analyzing the authentication reply result to obtain corresponding identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information; based on the access result information obtained by analysis, when the request access is confirmed to be successful, generating a first token based on the verification information; acquiring equipment information, transmitting a first token and the equipment information to an upgrade server, and inquiring an upgrade data packet based on the equipment information by the upgrade server according to the received first token when the terminal equipment is determined to have the download right, and feeding back corresponding download information of the upgrade data packet to the terminal equipment when the inquiry is successful; and receiving the download information of the upgrade data packet fed back by the upgrade server, and upgrading the equipment according to the download information of the upgrade data packet.
In one embodiment, the processor, when executing the computer program, further performs the steps of: acquiring an identification number of the terminal equipment and a preset specific character string; the specific character string is determined through pre-negotiation between the terminal equipment and the upgrading server; and calculating the identification number, the specific character string and the verification information of the terminal equipment through an information abstract algorithm to generate a first token.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the upgrade server compares the received first token with a second token determined based on an authentication reply result fed back to the terminal equipment in advance to obtain a corresponding comparison result; when the terminal equipment is determined to have the downloading right based on the comparison result, the upgrading server inquires an upgrading data packet in a background inquiry mode based on the received equipment information; the device information includes at least one of a version number of an old program in a running state in the terminal device before upgrading the device, a device project name to which the terminal device belongs, and a manufacturer of the terminal device.
In one embodiment, the processor, when executing the computer program, further performs the steps of: when the upgrading server inquires the corresponding upgrading data packet in a background inquiry mode, determining a download address of the upgrading data packet, a version number of the upgrading data packet and a token of the upgrading data packet; and the upgrading server takes the download address of the upgrading data packet, the version number of the upgrading data packet and the token of the upgrading data packet as the download information of the upgrading data packet and feeds the download information of the upgrading data packet back to the terminal equipment.
In one embodiment, the processor, when executing the computer program, further performs the steps of: receiving the download information of the upgrade data package, and analyzing the download information of the upgrade data package to determine a download address of the upgrade data package; accessing a download address of the upgrade data packet based on a preset secure communication protocol, and downloading the upgrade data packet in real time from the currently accessed address when the address access is determined to be successful; and upgrading the old program based on the downloaded real-time upgrading data packet, and starting the new program obtained by corresponding upgrading when the old equipment is determined to be upgraded.
In one embodiment, the processor, when executing the computer program, further performs the steps of: analyzing the download information of the upgrade data package to determine the version number of the upgrade data package and a token of the upgrade data package; backup storage is carried out on the version number of the upgrade data packet, the token of the upgrade data packet and the old program which is operated in the terminal equipment, which are obtained by analysis, through a preset storage partition; and determining a token of the real-time upgrading data packet, and comparing the token of the real-time upgrading data packet with the first same type data correspondingly stored in the storage partition to obtain a corresponding first comparison result.
In one embodiment, the processor, when executing the computer program, further performs the steps of: based on the obtained first comparison result, when the token of the real-time upgrading data package is determined to be matched with the first same type data, upgrading the old program based on the downloaded real-time upgrading data package; when the old equipment is determined to be upgraded, starting a new program obtained by corresponding upgrading through a preset boot loader, and when the new program is determined to be failed to start, calling the corresponding backed-up old program from the storage partition and recovering the old program; and when the new program is determined to be successfully started, determining the version number of the new program obtained by corresponding upgrading, comparing the version number of the new program with second data of the same type correspondingly stored in the storage partition, and determining that the terminal equipment is successfully upgraded when the version number of the new program is matched with the second data of the same type based on the obtained second comparison result.
In the computer device, the terminal device sends the access request instruction to the upgrade server and receives the authentication reply result correspondingly fed back by the upgrade server based on the access request instruction. The authentication reply result comprises access result information and verification information. And then, the terminal equipment determines that the access request is successfully accessed based on the access result information, and generates a corresponding first token based on the verification information obtained by analysis so as to obtain a corresponding upgrading data packet through the first token. The terminal equipment can perform subsequent data interaction with the upgrading server after being successfully accessed into the upgrading server, so that the security of the interactive identity between the upgrading server and the terminal equipment can be guaranteed, the access of illegal visitors is avoided, and the security of the upgrading process can be guaranteed. Moreover, since the verification information is randomly generated, the operation can indirectly ensure the variability of the token, so that even if an illegal visitor can steal the token at a certain upgrading stage, the illegal visitor cannot forge a terminal device based on the token, and further request an upgrading data packet from an upgrading server. In addition, before feeding back the download information of the upgrade data packet to the terminal device, the upgrade server also determines the download authority of the terminal device based on the received token, so as to avoid resource loss caused by feeding back the download information of the upgrade data packet to the device without authority, and further guarantee the upgrade safety of the device.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: sending an access request instruction to the upgrade server, and receiving an authentication reply result correspondingly fed back by the upgrade server based on the access request instruction; analyzing the authentication reply result to obtain corresponding identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information; based on the access result information obtained by analysis, when the request access is confirmed to be successful, generating a first token based on the verification information; acquiring equipment information, transmitting a first token and the equipment information to an upgrade server, and inquiring an upgrade data packet based on the equipment information by the upgrade server according to the received first token when the terminal equipment is determined to have the download right, and feeding back corresponding download information of the upgrade data packet to the terminal equipment when the inquiry is successful; and receiving the download information of the upgrade data packet fed back by the upgrade server, and upgrading the equipment according to the download information of the upgrade data packet.
In one embodiment, the computer program when executed by the processor further performs the steps of: acquiring an identification number of the terminal equipment and a preset specific character string; the specific character string is determined through pre-negotiation between the terminal equipment and the upgrading server; and calculating the identification number, the specific character string and the verification information of the terminal equipment through an information abstract algorithm to generate a first token.
In one embodiment, the computer program when executed by the processor further performs the steps of: the upgrade server compares the received first token with a second token determined based on an authentication reply result fed back to the terminal equipment in advance to obtain a corresponding comparison result; when the terminal equipment is determined to have the downloading right based on the comparison result, the upgrading server inquires an upgrading data packet in a background inquiry mode based on the received equipment information; the device information includes at least one of a version number of an old program in a running state in the terminal device before upgrading the device, a device project name to which the terminal device belongs, and a manufacturer of the terminal device.
In one embodiment, the computer program when executed by the processor further performs the steps of: when the upgrading server inquires the corresponding upgrading data packet in a background inquiry mode, determining a download address of the upgrading data packet, a version number of the upgrading data packet and a token of the upgrading data packet; and the upgrading server takes the download address of the upgrading data packet, the version number of the upgrading data packet and the token of the upgrading data packet as the download information of the upgrading data packet and feeds the download information of the upgrading data packet back to the terminal equipment.
In one embodiment, the computer program when executed by the processor further performs the steps of: receiving the download information of the upgrade data package, and analyzing the download information of the upgrade data package to determine a download address of the upgrade data package; accessing a download address of the upgrade data packet based on a preset secure communication protocol, and downloading the upgrade data packet in real time from the currently accessed address when the address access is determined to be successful; and upgrading the old program based on the downloaded real-time upgrading data packet, and starting the new program obtained by corresponding upgrading when the old equipment is determined to be upgraded.
In one embodiment, the computer program when executed by the processor further performs the steps of: analyzing the download information of the upgrade data package to determine the version number of the upgrade data package and a token of the upgrade data package; backup storage is carried out on the version number of the upgrade data packet, the token of the upgrade data packet and the old program which is operated in the terminal equipment, which are obtained by analysis, through a preset storage partition; and determining a token of the real-time upgrading data packet, and comparing the token of the real-time upgrading data packet with the first same type data correspondingly stored in the storage partition to obtain a corresponding first comparison result.
In one embodiment, the computer program when executed by the processor further performs the steps of: based on the obtained first comparison result, when the token of the real-time upgrading data package is determined to be matched with the first same type data, upgrading the old program based on the downloaded real-time upgrading data package; when the old equipment is determined to be upgraded, starting a new program obtained by corresponding upgrading through a preset boot loader, and when the new program is determined to be failed to start, calling the corresponding backed-up old program from the storage partition and recovering the old program; and when the new program is determined to be successfully started, determining the version number of the new program obtained by corresponding upgrading, comparing the version number of the new program with second data of the same type correspondingly stored in the storage partition, and determining that the terminal equipment is successfully upgraded when the version number of the new program is matched with the second data of the same type based on the obtained second comparison result.
In the storage medium, the terminal device sends an access request instruction to the upgrade server and receives an authentication reply result correspondingly fed back by the upgrade server based on the access request instruction. The authentication reply result comprises access result information and verification information. And then, the terminal equipment determines that the access request is successfully accessed based on the access result information, and generates a corresponding first token based on the verification information obtained by analysis so as to obtain a corresponding upgrading data packet through the first token. The terminal equipment can perform subsequent data interaction with the upgrading server after being successfully accessed into the upgrading server, so that the security of the interactive identity between the upgrading server and the terminal equipment can be guaranteed, the access of illegal visitors is avoided, and the security of the upgrading process can be guaranteed. Moreover, since the verification information is randomly generated, the operation can indirectly ensure the variability of the token, so that even if an illegal visitor can steal the token at a certain upgrading stage, the illegal visitor cannot forge a terminal device based on the token, and further request an upgrading data packet from an upgrading server. In addition, before feeding back the download information of the upgrade data packet to the terminal device, the upgrade server also determines the download authority of the terminal device based on the received token, so as to avoid resource loss caused by feeding back the download information of the upgrade data packet to the device without authority, and further guarantee the upgrade safety of the device.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A terminal equipment upgrading method is characterized in that the method is applied to terminal equipment and comprises the following steps:
sending an access request instruction to an upgrade server, and receiving an authentication reply result correspondingly fed back by the upgrade server based on the access request instruction;
analyzing the authentication reply result to obtain corresponding identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information;
based on the access result information obtained by analysis, when the access of the request is confirmed to be successful, a first token is generated based on the verification information;
acquiring equipment information, transmitting the first token and the equipment information to the upgrading server, and inquiring an upgrading data packet based on the equipment information by the upgrading server according to the received first token when the terminal equipment is determined to have downloading right, and feeding back corresponding upgrading data packet downloading information to the terminal equipment when the terminal equipment is successfully inquired;
and receiving the download information of the upgrade data packet fed back by the upgrade server, and upgrading the equipment according to the download information of the upgrade data packet.
2. The method of claim 1, wherein generating the first token based on the authentication information comprises:
acquiring an identification number of the terminal equipment and a preset specific character string; the specific character string is determined through pre-negotiation between the terminal equipment and an upgrading server;
and calculating the identification number of the terminal equipment, the specific character string and the verification information through an information abstract algorithm to generate a first token.
3. The method of claim 1, wherein the querying, by the upgrade server, the upgrade data package based on the device information when determining that the terminal device has the download right according to the received first token comprises:
the upgrade server compares the received first token with a second token determined based on an authentication reply result fed back to the terminal equipment in advance to obtain a corresponding comparison result;
when the terminal equipment is determined to have the downloading right based on the comparison result, the upgrading server inquires an upgrading data packet in a background inquiry mode based on the received equipment information; the device information includes at least one of a version number of an old program in a running state in the terminal device before upgrading the device, a device project name to which the terminal device belongs, and a manufacturer of the terminal device.
4. The method of claim 3, wherein the feeding back, by the upgrade server, the corresponding upgrade data package download information to the terminal device when the query is successful comprises:
when the upgrading server inquires the corresponding upgrading data packet in a background inquiry mode, determining a download address of the upgrading data packet, a version number of the upgrading data packet and a token of the upgrading data packet;
and the upgrading server takes the download address of the upgrading data packet, the version number of the upgrading data packet and the token of the upgrading data packet as upgrading data packet download information and feeds the upgrading data packet download information back to the terminal equipment.
5. The method according to claim 4, wherein the receiving upgrade data package download information fed back by the upgrade server and performing device upgrade according to the upgrade data package download information comprises:
receiving the download information of the upgrade data package, and analyzing the download information of the upgrade data package to determine a download address of the upgrade data package;
accessing the download address of the upgrade data packet based on a preset secure communication protocol, and downloading the upgrade data packet in real time from the currently accessed address when the address access is determined to be successful;
and upgrading the old program based on the downloaded real-time upgrading data packet, and starting the new program obtained by corresponding upgrading when the old equipment is determined to be upgraded.
6. The method of claim 5, wherein prior to said step of upgrading the old program based on the downloaded real-time upgrade data package, the method comprises:
analyzing the download information of the upgrading data packet to determine the version number of the upgrading data packet and a token of the upgrading data packet;
backup storage is carried out on the version number of the upgrade data packet, the token of the upgrade data packet and the old program which is operated in the terminal equipment, which are obtained by analysis, through a preset storage partition;
and determining a token of the real-time upgrading data packet, and comparing the token of the real-time upgrading data packet with first same type data correspondingly stored in the storage partition to obtain a corresponding first comparison result.
7. The method according to claim 6, wherein the upgrading of the old program is performed based on the downloaded real-time upgrade data package, and when it is determined that the upgrading of the old device is completed, starting a new program corresponding to the upgrading is performed, including:
based on the obtained first comparison result, when the token of the real-time upgrading data packet is determined to be matched with the first same-type data, upgrading the old program based on the downloaded real-time upgrading data packet;
when the old equipment is determined to be upgraded, starting a new program obtained by corresponding upgrading through a preset boot loader, and when the new program is determined to be failed to start, calling the corresponding backed-up old program from the storage partition and recovering the old program;
and when the new program is determined to be successfully started, determining the version number of the new program obtained by corresponding upgrading, comparing the version number of the new program with second data of the same type correspondingly stored in the storage partition, and determining that the terminal equipment is successfully upgraded when the version number of the new program is matched with the second data of the same type based on the obtained second comparison result.
8. An upgrading apparatus for a terminal device, the apparatus comprising:
the request initiating module is used for sending an access request instruction to the upgrading server and receiving an authentication reply result correspondingly fed back by the upgrading server based on the access request instruction;
the analysis module is used for analyzing the authentication reply result to obtain corresponding identity authentication information; the identity authentication information comprises access result information of the terminal equipment and randomly generated verification information;
the verification processing module is used for generating a first token based on the verification information when the access request is confirmed to be successfully accessed based on the access result information obtained by analysis;
the information transmission module is used for acquiring equipment information, transmitting the first token and the equipment information to the upgrading server, inquiring an upgrading data packet based on the equipment information when the upgrading server determines that the terminal equipment has the downloading right according to the received first token, and feeding back corresponding upgrading data packet downloading information to the terminal equipment when the terminal equipment is successfully inquired;
and the equipment upgrading module is used for receiving the upgrading data package downloading information fed back by the upgrading server and upgrading the equipment according to the upgrading data package downloading information.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202111107134.XA 2021-09-22 2021-09-22 Terminal equipment upgrading method and device, computer equipment and storage medium Pending CN113900684A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111107134.XA CN113900684A (en) 2021-09-22 2021-09-22 Terminal equipment upgrading method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111107134.XA CN113900684A (en) 2021-09-22 2021-09-22 Terminal equipment upgrading method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113900684A true CN113900684A (en) 2022-01-07

Family

ID=79029091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111107134.XA Pending CN113900684A (en) 2021-09-22 2021-09-22 Terminal equipment upgrading method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113900684A (en)

Similar Documents

Publication Publication Date Title
CN110365670B (en) Blacklist sharing method and device, computer equipment and storage medium
CN109639661B (en) Server certificate updating method, device, equipment and computer readable storage medium
US10073916B2 (en) Method and system for facilitating terminal identifiers
CN112019493B (en) Identity authentication method, identity authentication device, computer equipment and medium
EP2550595B1 (en) System and method for remote maintenance of multiple clients in an electronic network using virtualization and attestation.
CN111666564B (en) Application program safe starting method and device, computer equipment and storage medium
CN111107073A (en) Application automatic login method and device, computer equipment and storage medium
CN112559993A (en) Identity authentication method, device and system and electronic equipment
JP2011215753A (en) Authentication system and authentication method
CN109286933B (en) Authentication method, device, system, computer equipment and storage medium
CN109257426B (en) Service line resource loading method and device, computer equipment and storage medium
CN111460410A (en) Server login method, device and system and computer readable storage medium
CN111291345A (en) Voiceprint data processing method and device, computer equipment and storage medium
CN112468540A (en) Data distribution method, device and medium based on cloud platform
CN113626840A (en) Interface authentication method and device, computer equipment and storage medium
CN112416391A (en) System upgrading method and device, computer equipment and storage medium
CN112800393A (en) Authorization authentication method, software development kit generation method, device and electronic equipment
CN111966422A (en) Localized plug-in service method and device, electronic equipment and storage medium
CN109948330B (en) Method, device, equipment and storage medium for implementing application management service
CN112637307B (en) File updating method, system, computer equipment and storage medium
WO2021169469A1 (en) Voiceprint data processing method and apparatus, computer device, and storage medium
CN113055182A (en) Authentication method and system, terminal, server, computer system, and medium
CN114143197B (en) OTA (over the air) upgrading method, device and equipment for Internet of things equipment and readable storage medium
CN113900684A (en) Terminal equipment upgrading method and device, computer equipment and storage medium
CN113114623B (en) Data connection method, device, terminal equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination