Disclosure of Invention
The invention aims to solve the technical problem of a convenient software upgrading method, and provides a software upgrading method, a system and a computer aiming at the defects in the prior art.
In a first aspect, an embodiment of the present invention provides a software upgrading method, which is applied to a computer, where the computer performs software upgrading through a usb disk; at least two version numbers of target software and an upgrade package corresponding to each version number are stored in the USB flash disk; the sequence of the version numbers exists between the at least two version numbers, wherein the sequence of the newer version numbers is more advanced, and the upgrade packages corresponding to the newer version numbers are newer;
when the USB flash disk is inserted into the USB interface, judging whether a user of the USB flash disk has the authority of using the USB flash disk;
when determining that a user of the USB flash disk has the authority to use the USB flash disk, mounting the USB flash disk;
judging whether the sequence of the at least two version numbers can be decrypted according to the identity of the USB flash disk;
when the sequence of the at least two version numbers is determined to be capable of being decrypted, executing:
step S1: acquiring the current version number of the target software currently loaded by the computer from the basic information of the target software currently loaded by the computer;
step S2: determining the sequence position of the current version number in the at least two version numbers according to the sequence of the at least two version numbers;
step S3: if the ordinal position is not the top ordinal position, executing S4, and if the ordinal position is the top ordinal position, ending the current flow;
step S4: determining a target version number of a sequential position immediately preceding the sequential position;
step S5: and upgrading the target software currently loaded in the computer by using the target upgrading packet corresponding to the target version number stored in the U disk, and returning to the step S1.
Preferably, the first and second electrodes are formed of a metal,
the judging whether the user of the USB flash disk has the authority to use the USB flash disk comprises the following steps:
shooting an iris image of a user of the USB flash disk, acquiring at least one target iris image which is stored in the USB flash disk and represents at least one authorized user with the USB flash disk use authority, comparing the iris image with the at least one target iris image one by one, judging whether the target iris image which is the same as the iris image exists, if so, determining that the user has the authority to use the USB flash disk, and if not, mounting the USB flash disk.
Preferably, the first and second electrodes are formed of a metal,
the judging whether the sequence of the at least two version numbers can be decrypted according to the identity of the USB flash disk comprises the following steps:
acquiring the sequence of the at least two version numbers stored in the USB flash disk, wherein the sequence of the at least two version numbers is encrypted through a default public key;
and acquiring the serial number of the U disk, judging whether the serial number can be used as a private key to decrypt the sequence of the at least two encrypted version numbers, if so, executing S1, and if not, unloading the U disk.
Preferably, the first and second electrodes are formed of a metal,
in S5, the upgrading the target software currently loaded in the computer by using the target upgrade package corresponding to the target version number stored in the usb disk includes:
and acquiring a target upgrade package corresponding to the target version number stored in the USB flash disk, verifying the target upgrade package, upgrading the target software currently loaded in the computer by using the target upgrade package when the verification is passed, and ending the current process when the verification is not passed.
Preferably, the first and second electrodes are formed of a metal,
the verifying the target upgrade package comprises: and converting the target upgrading packet into corresponding information codes according to an information abstract algorithm MD5, acquiring the correct target information codes which are stored in the target upgrading packet and represent the target upgrading packet, comparing the information codes with the target information codes, if the information codes are the same as the target information codes, determining that the verification is passed, and if the information codes are different from the target information codes, ending the current flow.
In a second aspect, an embodiment of the present invention provides a computer based on the software upgrading method provided in any one of the first aspects, including:
the device comprises a first judgment module, a mounting module, a second judgment module and a processing module;
the first judging module is used for judging whether a user of the USB flash disk has the authority to use the USB flash disk or not when the USB flash disk is inserted into the USB interface;
the mounting module is used for mounting the USB flash disk when the first judging module determines that a user of the USB flash disk has the authority of using the USB flash disk;
the second judging module is used for judging whether the sequence of the at least two version numbers can be decrypted according to the identity of the USB flash disk;
the processing module is configured to execute, when the second determining module determines that the sequence of the at least two version numbers can be decrypted:
step S1: acquiring the current version number of the target software currently loaded by the computer from the basic information of the target software currently loaded by the computer;
step S2: determining the sequence position of the current version number in the at least two version numbers according to the sequence of the at least two version numbers;
step S3: if the ordinal position is not the top ordinal position, executing S4, and if the ordinal position is the top ordinal position, ending the current flow;
step S4: determining a target version number of a sequential position immediately preceding the sequential position;
step S5: and upgrading the target software currently loaded in the computer by using the target upgrading packet corresponding to the target version number stored in the U disk, and returning to the step S1.
Preferably, the first and second electrodes are formed of a metal,
the first judging module, when executing the judgment that whether the user of the usb disk has the right to use the usb disk, specifically executes:
shooting an iris image of a user of the USB flash disk, acquiring at least one target iris image which is stored in the USB flash disk and represents at least one authorized user with the USB flash disk use authority, comparing the iris image with the at least one target iris image one by one, judging whether the target iris image which is the same as the iris image exists, if so, determining that the user has the authority to use the USB flash disk, and if not, mounting the USB flash disk.
Preferably, the first and second electrodes are formed of a metal,
the second judging module is configured to obtain a sequence of the at least two version numbers stored in the usb disk, where the sequence of the at least two version numbers is encrypted by a default public key;
acquiring a serial number of the U disk, judging whether the serial number can be used as a private key to decrypt the sequence of the at least two encrypted version numbers, if so, triggering the processing unit to execute S1, and if not, unloading the U disk;
preferably, the first and second electrodes are formed of a metal,
the processing module, when executing the upgrading of the target software currently loaded in the computer by using the target upgrade package corresponding to the target version number stored in the usb disk in S5, specifically executes:
and acquiring a target upgrade package corresponding to the target version number stored in the USB flash disk, verifying the target upgrade package, upgrading the target software currently loaded in the computer by using the target upgrade package when the verification is passed, and ending the current process when the verification is not passed.
Preferably, the first and second electrodes are formed of a metal,
the processing module, when executing the verification of the target upgrade package, specifically executes: and converting the target upgrading packet into corresponding information codes according to an information abstract algorithm MD5, acquiring the correct target information codes which are stored in the target upgrading packet and represent the target upgrading packet, comparing the information codes with the target information codes, if the information codes are the same as the target information codes, determining that the verification is passed, and if the information codes are different from the target information codes, ending the current flow.
In a third aspect, an embodiment of the present invention provides a software upgrading system, including: the computer and the USB flash disk provided by any one of the second aspects;
the USB flash disk is used for storing at least two version numbers of target software and an upgrade package corresponding to each version number; the sequence of the version numbers exists between the at least two version numbers, wherein the sequence of the newer version numbers is more advanced, and the upgrade package corresponding to the newer version numbers is newer.
According to the technical scheme, the computer performs software upgrading through the USB flash disk, at least two version numbers of target software on the computer and the upgrading package corresponding to each version number are stored in the USB flash disk in advance, the version numbers are in sequence, and the upgrading package corresponding to the newer version number is correspondingly updated when the sequence of the newer version number is earlier. When detecting that the USB flash disk is inserted into the USB interface of the computer, firstly, determining whether the current user of the USB flash disk has the authority to use the USB flash disk. And when the user side is determined to have the right to use the USB flash disk, mounting the USB flash disk. Then, whether the sequence of the at least two version numbers stored in the USB flash disk can be decrypted according to the identity of the USB flash disk is judged, and if the sequence of the at least two version numbers can be decrypted, the following steps are executed: firstly, acquiring the version number of the current target software from basic information of the currently loaded target software of a computer, determining the sequence of the version number of the current target software in at least two version numbers according to the sequence of at least two version numbers decrypted before, and if the current version number is at the forefront position, indicating that the version of the current target software is the newest and does not need to be updated. If the current version number is not at the top sequential position, the current version number is not up to date and needs to be updated. And determining a target version number of a previous sequence position of the current version number in the sequence of at least two version numbers, upgrading the target software from a target upgrading packet corresponding to the target version number stored in the USB flash disk, judging whether the updated version number is the latest or not after upgrading is finished, and if not, continuously acquiring the version number of the previous sequence and updating until the sequence position of the version number in the sequence of at least two version numbers is the foremost, namely, upgrading to the latest version. Therefore, the sequence of at least two version numbers in the USB flash disk is decrypted, whether the version number of the current target software is at the forefront sequence position in the sequence is judged, if not, the target version number of the previous sequence position is determined, the target software is upgraded according to the upgrade package corresponding to the target version number stored in the USB flash disk, and whether the target software is the latest is judged again. The user only needs to insert the USB flash disk into the computer and conduct identity verification, the target software can be automatically upgraded according to the interaction, operation of professional technicians is not needed, time is saved, and therefore software upgrading can be conducted conveniently.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
As mentioned above, software in a power plant project is usually deployed in a local area network and cannot be upgraded online, so that software upgrade requires a professional technician to go to the field. Since power plant projects are distributed all over the country, technicians need time to respond, so that the latest functions of software cannot be used in time and new-version function repairs cannot be obtained in time, and the operation is very inconvenient.
The following describes an intelligent device control panel and an intelligent device control system according to embodiments of the present invention in detail with reference to the accompanying drawings.
As shown in fig. 1, an embodiment of the present invention provides a software upgrading method, which is applied to a computer, where the computer performs software upgrading through a usb disk; at least two version numbers of target software and an upgrade package corresponding to each version number are stored in the USB flash disk; the sequence of the version numbers exists between the at least two version numbers, wherein the sequence of the newer version numbers is more advanced, and the upgrade package corresponding to the newer version numbers is newer. The method comprises the following steps:
step 101: when it is detected that the USB interface is inserted into the USB disk, it is determined whether a user of the USB disk has a right to use the USB disk, and if yes, step 102 is executed.
Step 102: and mounting the USB flash disk, judging whether the sequence of the at least two version numbers can be decrypted according to the identity of the USB flash disk, and if so, executing step 103.
Step 103: and acquiring the current version number of the target software currently loaded by the computer from the basic information of the target software currently loaded by the computer.
Step 104: and determining whether the sequence position of the current version number in the at least two version numbers is the foremost according to the sequence of the at least two version numbers, if not, executing 105, and if so, executing 106.
Step 105: and determining a target version number of the previous sequence position of the sequence positions, upgrading the target software currently loaded in the computer by using a target upgrading packet corresponding to the target version number stored in the U disk, and returning to the step 103.
Step 106: the current flow is ended.
In an embodiment of the present invention, the computer performs software upgrade through a usb disk, where at least two version numbers of target software on the computer and an upgrade package corresponding to each version number are stored in the usb disk in advance, and the version numbers are in sequence, and the sequence of newer version numbers is earlier, the upgrade package corresponding to the newer version numbers is correspondingly updated. When detecting that the USB flash disk is inserted into the USB interface of the computer, firstly, determining whether the current user of the USB flash disk has the authority to use the USB flash disk. And when the user side is determined to have the right to use the USB flash disk, mounting the USB flash disk. Then, whether the sequence of the at least two version numbers stored in the USB flash disk can be decrypted according to the identity of the USB flash disk is judged, and if the sequence of the at least two version numbers can be decrypted, the following steps are executed: firstly, acquiring the version number of the current target software from basic information of the currently loaded target software of a computer, determining the sequence of the version number of the current target software in at least two version numbers according to the sequence of at least two version numbers decrypted before, and if the current version number is at the forefront position, indicating that the version of the current target software is the newest and does not need to be updated. If the current version number is not at the top sequential position, the current version number is not up to date and needs to be updated. And determining a target version number of a previous sequence position of the current version number in the sequence of at least two version numbers, upgrading the target software from a target upgrading packet corresponding to the target version number stored in the USB flash disk, judging whether the updated version number is the latest or not after upgrading is finished, and if not, continuously acquiring the version number of the previous sequence and updating until the sequence position of the version number in the sequence of at least two version numbers is the foremost, namely, upgrading to the latest version. Therefore, the sequence of at least two version numbers in the USB flash disk is decrypted, whether the version number of the current target software is at the forefront sequence position in the sequence is judged, if not, the target version number of the previous sequence position is determined, the target software is upgraded according to the upgrade package corresponding to the target version number stored in the USB flash disk, and whether the target software is the latest is judged again. The user only needs to insert the USB flash disk into the computer and conduct identity verification, the target software can be automatically upgraded according to the interaction, operation of professional technicians is not needed, time is saved, and therefore software upgrading can be conducted conveniently.
In an embodiment of the present invention, the determining whether the user of the usb disk has the right to use the usb disk includes:
shooting an iris image of a user of the USB flash disk, acquiring at least one target iris image which is stored in the USB flash disk and represents at least one authorized user with the USB flash disk use authority, comparing the iris image with the at least one target iris image one by one, judging whether the target iris image which is the same as the iris image exists, if so, determining that the user has the authority to use the USB flash disk, and if not, mounting the USB flash disk.
Specifically, in order to ensure the security of data in the usb disk, only a user with the usb disk usage right can use the usb disk to update software. A plurality of iris images with USB flash disk use authority are stored in the USB flash disk in advance, the iris images are stored in the USB flash disk in a single partition mode and only used for authentication of the authority, the iris images cannot be seen in a file system when the USB flash disk is mounted on a computer, and safety of the iris images is guaranteed. When a user of the USB flash disk inserts the USB flash disk into the USB port, the computer shoots an iris image of the user, the shot iris image is compared with an iris image stored in the USB flash disk in advance, whether the iris image is consistent or not is judged according to detail characteristics such as spots, filaments, crowns, stripes, recesses and the like which are staggered in the iris image, if the shot iris image is consistent with any one of the iris images stored in advance, the user of the current USB flash disk is determined to have the use authority of the USB flash disk, and the USB flash disk is mounted.
In an embodiment of the present invention, the determining whether the sequence of the at least two version numbers can be decrypted according to the id of the usb disk in step 102 includes:
acquiring the sequence of the at least two version numbers stored in the USB flash disk, wherein the sequence of the at least two version numbers is encrypted through a default public key;
and acquiring the serial number of the USB flash disk, judging whether the serial number can be used as a private key to decrypt the sequence of the at least two encrypted version numbers, if so, executing 103, and if not, unloading the USB flash disk.
Specifically, at least two version numbers stored in the usb disk are sequentially encrypted by a default public key through an asymmetric encryption algorithm, which requires two keys: a public key and a private key. The public key and the private key are a pair, and if data is encrypted by the public key, the data can be decrypted only by the corresponding private key. This algorithm is called asymmetric encryption algorithm because two different keys are used for encryption and decryption. The basic process of realizing confidential information exchange by the asymmetric encryption algorithm is as follows: the first party generates a pair of secret keys and discloses the public keys, and other roles (the second party) needing to send information to the first party encrypt the confidential information by using the secret keys (the public keys of the first party) and then send the encrypted confidential information to the first party; the first party decrypts the encrypted information by using the private key of the first party. The method is characterized in that when the party A wants to reply to the party B, the opposite is true, the public key of the party B is used for encrypting data, and similarly, the party B uses the private key of the party B for decrypting. As can be seen from the above, data transmission is performed between the usb disk and the computer, the usb disk is encrypted by the default public key and can only be decrypted by the private key of the computer, i.e., the serial number of the usb disk. If the decryption cannot be carried out, the serial number of the U disk is wrong, and the software cannot be updated.
In an embodiment of the present invention, the upgrading, in step 105, the target software currently loaded in the computer by using the target upgrade package corresponding to the target version number stored in the usb disk includes:
and acquiring a target upgrade package corresponding to the target version number stored in the USB flash disk, verifying the target upgrade package, upgrading the target software currently loaded in the computer by using the target upgrade package when the verification is passed, and ending the current process when the verification is not passed.
In an embodiment of the present invention, the verifying the target upgrade package includes: and converting the target upgrading packet into corresponding information codes according to an information abstract algorithm MD5, acquiring the correct target information codes which are stored in the target upgrading packet and represent the target upgrading packet, comparing the information codes with the target information codes, if the information codes are the same as the target information codes, determining that the verification is passed, and if the information codes are different from the target information codes, ending the current flow.
Specifically, in order to ensure the success of software upgrade, after the target upgrade package corresponding to the target version number is determined, the integrity of the target upgrade package needs to be verified. The currently stored target upgrade package is converted into the corresponding information code through the information abstract algorithm MD5, and meanwhile, the target upgrade package stores the target information code corresponding to the complete target upgrade package, because if the upgrade package has data loss, the information code calculated through the MD5 is determined to be changed, only when the information code is the same as the correct target information code, the target upgrade package can be determined to be complete, and the software can be updated through the target upgrade package.
As shown in fig. 2, an embodiment of the present invention provides a computer based on the software upgrading method provided in any one of the above embodiments, including:
the system comprises a first judgment module 201, a mounting module 202, a second judgment module 203 and a processing module 204;
the first judging module 201 is configured to, when it is detected that the USB interface is inserted into the USB disk, judge whether a user of the USB disk has an authority to use the USB disk;
the mounting module 202 is configured to mount the usb disk when the first determining module 201 determines that a user of the usb disk has an authority to use the usb disk;
the second determining module 203 is configured to determine whether the sequence of the at least two version numbers can be decrypted according to the identity of the usb disk;
the processing module 204 is configured to, when the second determining module 203 determines that the sequence of the at least two version numbers can be decrypted, execute:
step S1: acquiring the current version number of the target software currently loaded by the computer from the basic information of the target software currently loaded by the computer;
step S2: determining the sequence position of the current version number in the at least two version numbers according to the sequence of the at least two version numbers;
step S3: if the ordinal position is not the top ordinal position, executing S4, and if the ordinal position is the top ordinal position, ending the current flow;
step S4: determining a target version number of a sequential position immediately preceding the sequential position;
step S5: and upgrading the target software currently loaded in the computer by using the target upgrading packet corresponding to the target version number stored in the U disk, and returning to the step S1.
In an embodiment of the present invention, when the first determining module 201 performs the determining whether the user of the usb disk has the right to use the usb disk, the first determining module specifically performs:
shooting an iris image of a user of the USB flash disk, acquiring at least one target iris image which is stored in the USB flash disk and represents at least one authorized user with the USB flash disk use authority, comparing the iris image with the at least one target iris image one by one, judging whether the target iris image which is the same as the iris image exists, if so, determining that the user has the authority to use the USB flash disk, and if not, mounting the USB flash disk.
In an embodiment of the present invention, the second determining module 203 is configured to obtain a sequence of the at least two version numbers stored in the usb disk, where the sequence of the at least two version numbers is encrypted by a default public key;
acquiring a serial number of the U disk, judging whether the serial number can be used as a private key to decrypt the sequence of the at least two encrypted version numbers, if so, triggering the processing unit to execute S1, and if not, unloading the U disk;
in an embodiment of the present invention, when the target upgrade package corresponding to the target version number stored in the usb disk is used to upgrade the target software currently loaded in the computer in S5, the processing module 204 specifically executes:
and acquiring a target upgrade package corresponding to the target version number stored in the USB flash disk, verifying the target upgrade package, upgrading the target software currently loaded in the computer by using the target upgrade package when the verification is passed, and ending the current process when the verification is not passed.
In an embodiment of the present invention, when the processing module 204 performs the verification on the target upgrade package, specifically perform: and converting the target upgrading packet into corresponding information codes according to an information abstract algorithm MD5, acquiring the correct target information codes which are stored in the target upgrading packet and represent the target upgrading packet, comparing the information codes with the target information codes, if the information codes are the same as the target information codes, determining that the verification is passed, and if the information codes are different from the target information codes, ending the current flow.
It should be understood that the illustrated structure of the embodiment of the present invention is not intended to limit the computer. In other embodiments of the invention, a computer may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
As shown in fig. 3, an embodiment of the present invention provides a software upgrading system, including: the computer 301 and the usb disk 302 provided in any of the above embodiments;
the USB flash disk 302 is used for storing at least two version numbers of target software and an upgrade package corresponding to each version number; the sequence of the version numbers exists between the at least two version numbers, wherein the sequence of the newer version numbers is more advanced, and the upgrade package corresponding to the newer version numbers is newer.
The information interaction, execution process and other contents between the units in the system are based on the same concept as the embodiment of the apparatus of the present invention, and specific contents can be referred to the description in the embodiment of the apparatus of the present invention, and are not described herein again.
In summary, the embodiments of the present invention have at least the following advantages:
1. in the embodiment of the invention, the sequence of at least two version numbers in the USB flash disk is decrypted, whether the version number of the current target software is at the top sequence position in the sequence is judged, if not, the target version number of the top sequence position is determined, the target software is upgraded according to the upgrade package corresponding to the target version number stored in the USB flash disk, and whether the target software is the latest is judged again. The user only needs to insert the USB flash disk into the computer and conduct identity verification, the target software can be automatically upgraded according to the interaction, operation of professional technicians is not needed, time is saved, and therefore software upgrading can be conducted conveniently.
2. In the embodiment of the invention, before the USB flash disk is mounted, iris recognition is carried out on the user of the USB flash disk, and the USB flash disk can be mounted for software updating after the iris recognition is passed, so that the safety of the scheme provided by the invention is improved.
3. In the embodiment of the invention, the information code corresponding to the target update package is calculated through the MD5 algorithm, and is compared with the correct target information code to judge whether the target update package is complete, and the update is carried out only under the condition that the target update package is complete, so that the success of software upgrade is ensured.
It should be noted that not all steps and modules in the above flows and system structure diagrams are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities, or some components in a plurality of independent devices may be implemented together.
In the above embodiments, the hardware unit may be implemented mechanically or electrically. For example, a hardware element may comprise permanently dedicated circuitry or logic (such as a dedicated processor, FPGA or ASIC) to perform the corresponding operations. The hardware elements may also comprise programmable logic or circuitry, such as a general purpose processor or other programmable processor, that may be temporarily configured by software to perform the corresponding operations. The specific implementation (mechanical, or dedicated permanent, or temporarily set) may be determined based on cost and time considerations.
While the invention has been shown and described in detail in the drawings and in the preferred embodiments, it is not intended to limit the invention to the embodiments disclosed, and it will be apparent to those skilled in the art that various combinations of the code auditing means in the various embodiments described above may be used to obtain further embodiments of the invention, which are also within the scope of the invention.