技术领域technical field
本发明涉及计算机技术,尤指一种软件升级方法及装置。The invention relates to computer technology, in particular to a software upgrading method and device.
背景技术Background technique
软件包括程序和文件,程序指的是一组指示计算机执行动作或做出判断的指令,也就是说该程序为计算机程序,文件包括配置文件和日志文件,例如,grub.cfg、libvirt.conf和anaconda-ks.cfg是配置文件,upgrade.log是日志文件。通过对软件中的程序和文件进行升级可以修复软件中存在的漏洞和增加软件的功能。在相关技术中,通过人工确定软件中的待升级的程序和待升级的文件,并开发出用于升级程序的安装包和用于升级文件的文件,再由人工使用开发出的安装包对软件中的程序进行升级,以及使用开发出的文件对软件中的文件进行升级。可见,软件中的程序和文件的升级都需要人工来完成,这样就导致了软件的升级效率比较低。特别是当软件中的待升级的程序和待升级的文件比较多时,人工对软件升级的效率是非常低的。Software includes programs and files. Programs refer to a set of instructions that instruct the computer to perform actions or make judgments. That is to say, the program is a computer program. Files include configuration files and log files, such as grub.cfg, libvirt.conf and anaconda-ks.cfg is the configuration file, and upgrade.log is the log file. By upgrading the programs and files in the software, the bugs in the software can be repaired and the functions of the software can be increased. In the related technology, by manually determining the program to be upgraded and the file to be upgraded in the software, and developing an installation package for upgrading the program and a file for upgrading the file, the installation package developed by manual use is used to update the software. The program in the software is upgraded, and the files in the software are upgraded by using the developed files. It can be seen that the upgrade of programs and files in the software needs to be completed manually, which leads to relatively low efficiency of software upgrade. Especially when there are many programs and files to be upgraded in the software, the efficiency of manually upgrading the software is very low.
发明内容Contents of the invention
为了解决上述技术问题,本发明提供了一种软件升级方法及装置,能够自动对软件进行升级,提高软件升级的效率。In order to solve the above technical problems, the present invention provides a software upgrading method and device, which can automatically upgrade software and improve the efficiency of software upgrading.
为了达到本发明目的,本发明提供了一种软件升级方法,包括:In order to achieve the purpose of the present invention, the present invention provides a method for upgrading software, comprising:
从预先设置的配置文件中解析出软件的升级方式以及与该升级方式对应的文件名称;Analyze the software upgrade method and the file name corresponding to the upgrade method from the preset configuration file;
根据解析出的升级方式和文件名称对软件进行升级。Upgrade the software according to the analyzed upgrade method and file name.
进一步地,所述根据解析出的升级方式和文件名称对软件进行升级之前,还包括:Further, before upgrading the software according to the parsed upgrade method and file name, it also includes:
从所述配置文件中解析出在对所述软件升级之前执行的动作和在对所述软件升级之后执行的动作。The actions performed before upgrading the software and the actions performed after upgrading the software are analyzed from the configuration file.
进一步地,所述对软件进行升级之前,还包括:Further, before upgrading the software, it also includes:
根据所述文件名称,检查所述软件是否符合预先设置的与所述升级方式对应的升级要求;According to the name of the file, check whether the software meets the preset upgrade requirements corresponding to the upgrade method;
在不符合预先设置的与升级方式对应的升级要求时,输出升级错误的提示信息。When the preset upgrade requirements corresponding to the upgrade mode are not met, an upgrade error prompt message is output.
进一步地,所述升级方式为:更新所述软件中的程序、向所述软件中添加程序、卸载所述软件中的程序、替换所述软件中的文件、向所述软件中添加文件或者删除所述软件中的文件。Further, the upgrade method is: updating programs in the software, adding programs to the software, uninstalling programs in the software, replacing files in the software, adding files to the software, or deleting files in the software.
进一步地,所述根据解析出的升级方式和名称对软件进行升级,包括:Further, said upgrading the software according to the parsed upgrade method and name includes:
若所述升级方式为更新所述软件中的程序、向所述软件中添加程序、替换所述软件中的文件或者向所述软件中添加文件,则从预先设置的升级文件中查找所述解析出的文件名称的文件,按照所述升级方式,使用该查找出的文件对所述软件进行升级;If the upgrade method is to update the program in the software, add a program to the software, replace a file in the software, or add a file to the software, then search for the analysis from the preset upgrade file According to the upgrade method, use the file found to upgrade the software;
若所述升级方式为卸载所述软件中的程序,根据所述解析出的文件名称,卸载所述软件中的使用所述解析出的文件名称的文件升级的程序;If the upgrade method is to uninstall the program in the software, according to the parsed file name, uninstall the file upgrade program in the software using the parsed file name;
若所述升级方式包括删除所述软件的文件,则根据所述解析出的文件名称,删除所述软件中的所述解析出的文件名称的文件。If the upgrade method includes deleting the file of the software, then delete the file with the parsed file name in the software according to the parsed file name.
进一步地,如果所述升级方式为:更新所述软件中的程序、卸载所述软件中的程序、替换所述软件中的文件或者删除所述软件中的文件,所述根据解析出的升级方式和名称对软件进行升级之前,还包括:Further, if the upgrade method is: updating programs in the software, uninstalling programs in the software, replacing files in the software, or deleting files in the software, the upgrade method obtained according to the analysis and name before upgrading the software, also include:
根据所述文件名称,从预先设置的备份文件中查找在对所述软件升级失败时用于将所述软件回滚到升级前的状态的文件。According to the file name, a file used to roll back the software to a pre-upgrade state when the software upgrade fails is searched from preset backup files.
进一步地,如果对所述软件升级成功,还包括:Further, if the software upgrade is successful, it also includes:
若所述升级方式为更新所述软件中的程序或者替换所述软件中的文件,则删除所述备份文件中的用于将所述软件回滚到升级前的状态的文件,将从所述升级文件中查找到的文件添加到所述备份文件中;If the upgrade method is to update the program in the software or replace the file in the software, then delete the file used to roll back the software to the state before the upgrade in the backup file, and the The files found in the upgrade file are added to the backup file;
若所述升级方式为向所述软件中添加程序或者向所述软件中添加文件,则将从所述升级文件中查找到的文件添加到所述备份文件中;If the upgrade method is adding a program to the software or adding a file to the software, adding the file found in the upgrade file to the backup file;
若所述升级方式为卸载所述软件中的程序或者删除所述软件中的文件,则删除所述备份文件中的用于将所述软件回滚到升级前的状态的文件。If the upgrade method is to uninstall the program in the software or delete the file in the software, then delete the file used to roll back the software to the state before the upgrade in the backup file.
本发明提供一种软件升级装置,包括:The present invention provides a software upgrading device, comprising:
解析模块,用于从预先设置的配置文件中解析出软件的升级方式以及与该升级方式对应的文件名称;A parsing module, configured to parse out a software upgrade method and a file name corresponding to the upgrade method from a preset configuration file;
升级模块,用于根据解析出的升级方式和文件名称对软件进行升级。The upgrade module is used to upgrade the software according to the parsed upgrade method and file name.
进一步地,所述解析模块还用于,Further, the parsing module is also used for,
从所述配置文件中解析出在对所述软件升级之前执行的动作和在对所述软件升级之后执行的动作。The actions performed before upgrading the software and the actions performed after upgrading the software are analyzed from the configuration file.
进一步地,还包括:Further, it also includes:
检查模块,用于根据所述文件名称,检查所述软件是否符合预先设置的与所述升级方式对应的升级要求;A check module, configured to check whether the software meets the preset upgrade requirements corresponding to the upgrade method according to the file name;
输出模块,用于在不符合预先设置的与升级方式对应的升级要求时,输出升级错误的提示信息。The output module is configured to output an upgrade error prompt message when the preset upgrade requirement corresponding to the upgrade mode is not met.
进一步地,所述升级方式为:更新所述软件中的程序、向所述软件中添加程序、卸载所述软件中的程序、替换所述软件中的文件、向所述软件中添加文件或者删除所述软件中的文件。Further, the upgrade method is: updating programs in the software, adding programs to the software, uninstalling programs in the software, replacing files in the software, adding files to the software, or deleting files in the software.
进一步地,所述升级模块包括:Further, the upgrade module includes:
第一升级单元,用于若所述升级方式为更新所述软件中的程序、向所述软件中添加程序、替换所述软件中的文件或者向所述软件中添加文件,则从预先设置的升级文件中查找所述解析出的文件名称的文件,按照所述升级方式,使用该查找出的文件对所述软件进行升级;The first upgrade unit is configured to, if the upgrade method is to update a program in the software, add a program to the software, replace a file in the software, or add a file to the software, from the preset Find the file with the parsed file name in the upgrade file, and use the found file to upgrade the software according to the upgrade method;
第二升级单元,用于若所述升级方式为卸载所述软件中的程序,根据所述解析出的文件名称,卸载所述软件中的使用所述解析出的文件名称的文件升级的程序;The second upgrading unit is configured to uninstall the program in the software that uses the parsed file name to upgrade the file in the software according to the parsed file name if the upgrade method is to uninstall the program in the software;
第三升级单元,用于若所述升级方式包括删除所述软件的文件,则根据所述解析出的文件名称,删除所述软件中的所述解析出的文件名称的文件。A third upgrading unit, configured to delete the file with the parsed file name in the software according to the parsed file name if the upgrade method includes deleting the file of the software.
进一步地,如果所述升级方式为:更新所述软件中的程序、卸载所述软件中的程序、替换所述软件中的文件或者删除所述软件中的文件,还包括:Further, if the upgrade method is: updating programs in the software, uninstalling programs in the software, replacing files in the software, or deleting files in the software, it also includes:
查找模块,用于根据所述文件名称,从预先设置的备份文件中查找在对所述软件升级失败时用于将所述软件回滚到升级前的状态的文件。The search module is configured to search the preset backup file for the file used to roll back the software to the pre-upgrade state when the software upgrade fails according to the file name.
进一步地,如果对所述软件升级成功,还包括:Further, if the software upgrade is successful, it also includes:
添加模块,用于若所述升级方式为更新所述软件中的程序、替换所述软件中的文件、向所述软件中添加程序或者向所述软件中添加文件,则将从所述升级文件中查找到的文件添加到所述备份文件中;The adding module is used to update the program in the software, replace the file in the software, add a program to the software, or add a file to the software if the upgrade method is to upgrade the file from the The files found in are added to the backup file;
删除模块,用于若所述升级方式为卸载所述软件中的程序、删除所述软件中的文件、更新所述软件中的程序或者替换所述软件中的文件,则删除所述备份文件中的用于将所述软件回滚到升级前的状态的文件。A deletion module, configured to delete the backup file in the backup file if the upgrade method is to uninstall the program in the software, delete the file in the software, update the program in the software, or replace the file in the software. file to roll back the software to its pre-upgrade state.
本发明至少包括从预先设置的配置文件中解析出软件的升级方式以及与该升级方式对应的文件名称;根据解析出的升级方式和文件名称对软件进行升级。从本发明实施例可见,由于预先在配置文件中设置软件的升级方式和与该升级方式对应的文件名称,通过解析配置文件就可以根据解析出的内容自动对软件升级,避免了人工对软件进行升级,特别是软件中有很多的内容需要升级时,有效地提高了软件升级的效率。The present invention at least includes parsing out a software upgrade mode and a file name corresponding to the upgrade mode from a preset configuration file; and upgrading the software according to the parsed out upgrade mode and file name. As can be seen from the embodiment of the present invention, since the upgrade method of the software and the file name corresponding to the upgrade method are set in the configuration file in advance, the software can be automatically upgraded according to the content analyzed by analyzing the configuration file, avoiding manual software upgrade. Upgrading, especially when there are a lot of content in the software that needs to be upgraded, effectively improves the efficiency of software upgrading.
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
附图说明Description of drawings
附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本发明的技术方案,并不构成对本发明技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solution of the present invention, and constitute a part of the description, and are used together with the embodiments of the application to explain the technical solution of the present invention, and do not constitute a limitation to the technical solution of the present invention.
图1为本发明实施例提供的一种软件升级方法的流程示意图;FIG. 1 is a schematic flowchart of a software upgrading method provided by an embodiment of the present invention;
图2为本发明实施例提供的另一种软件升级方法的流程示意图;FIG. 2 is a schematic flowchart of another software upgrading method provided by an embodiment of the present invention;
图3为本发明实施例提供的一种软件升级装置的结构示意图;FIG. 3 is a schematic structural diagram of a software upgrading device provided by an embodiment of the present invention;
图4为本发明实施例提供的另一种软件升级装置的结构示意图。Fig. 4 is a schematic structural diagram of another software upgrading device provided by an embodiment of the present invention.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。In order to make the purpose, technical solution and advantages of the present invention more clear, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined arbitrarily with each other.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps shown in the flowcharts of the figures may be performed in a computer system, such as a set of computer-executable instructions. Also, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that shown or described herein.
本发明实施例提供一种软件升级方法,如图1所示,该软件升级方法包括:The embodiment of the present invention provides a software upgrade method, as shown in Figure 1, the software upgrade method includes:
步骤101、从预先设置的配置文件中解析出软件的升级方式以及与该升级方式对应的文件名称。Step 101, analyzing the software upgrade method and the file name corresponding to the upgrade method from the preset configuration file.
具体地,预先在配置文件中设置软件的升级方式和该升级方式对应的文件名称,这样对该配置文件解析就可以解析出软件的升级方式和该升级方式对应的文件名称。其中,软件包括:系统软件(例如操作系统软件)和应用软件(例如办公软件、图像处理软件、社交通信软件等)。该软件可以安装在虚拟机上,还可以安装在物理主机上。配置文件可以是可扩展标记语言(eXtensible Markup Language,XML)格式的文件,例如配置文件为upgrade.xml。Specifically, the software upgrade method and the file name corresponding to the upgrade method are set in advance in the configuration file, so that the software upgrade method and the file name corresponding to the upgrade method can be analyzed by analyzing the configuration file. Wherein, software includes: system software (such as operating system software) and application software (such as office software, image processing software, social communication software, etc.). The software can be installed on a virtual machine or on a physical host. The configuration file may be a file in an extensible markup language (eXtensible Markup Language, XML) format, for example, the configuration file is upgrade.xml.
步骤102、根据解析出的升级方式和名称对软件进行升级。Step 102, upgrade the software according to the analyzed upgrade method and name.
步骤101和步骤102的执行主体是主机。The execution subject of step 101 and step 102 is the host.
进一步地,在图1对应实施例的基础上,步骤102之前,还包括:Further, on the basis of the corresponding embodiment in FIG. 1, before step 102, it also includes:
从配置文件中解析出在对软件升级之前执行的动作和在对软件升级之后执行的动作。The actions performed before upgrading the software and the actions performed after upgrading the software are analyzed from the configuration file.
配置文件中进一步包括:用于标识在对软件升级之前执行的动作的字段和用于标识在对软件升级之后执行的动作的字段,换句话说配置文件中进一步包括两种字段,第一种字段用于标识在软件升级之前执行哪些动作,第二种字段用于标识在软件升级之后执行哪些动作。因此在对配置文件解析时,不仅解析出了升级方式以及与升级方式对应的文件名称,还解析出了在对软件升级之前执行的动作和在对软件升级之后执行的动作,从而在对软件升级之前和对软件升级之后自动执行该解析出的动作,避免了在软件升级之前和在软件升级之后人工手动操控来执行该解析出的动作。其中,解析配置文件的实现可以采用相关技术中的方式实现,具体实现并不用于限定本发明的保护范围,这里不再赘述。解析出的在对软件升级之前执行的动作包括:暂停主机的业务,如果软件是安装在虚拟机上的,解析出的在对软件升级之前执行的动作还可以包括:清空虚拟机,解析出的在对软件升级之后执行的动作包括:重启操作系统。The configuration file further includes: a field for identifying actions performed before the software upgrade and a field for identifying actions performed after the software upgrade. In other words, the configuration file further includes two types of fields, the first field It is used to identify which actions are performed before the software upgrade, and the second field is used to identify which actions are performed after the software upgrade. Therefore, when analyzing the configuration file, not only the upgrade method and the file name corresponding to the upgrade method are analyzed, but also the actions performed before the software upgrade and the actions performed after the software upgrade are analyzed, so that when the software is upgraded The parsed action is automatically executed before and after the software upgrade, avoiding manual manipulation to execute the parsed action before and after the software upgrade. Wherein, the implementation of parsing the configuration file can be implemented by means in related technologies, and the specific implementation is not used to limit the scope of protection of the present invention, and will not be repeated here. The analyzed actions performed before upgrading the software include: suspending the business of the host, if the software is installed on a virtual machine, the analyzed actions performed before upgrading the software may also include: clearing the virtual machine, the analyzed Actions performed after upgrading the software include: restarting the operating system.
进一步地,在图1对应实施例的基础上,步骤102之前,还包括:Further, on the basis of the corresponding embodiment in FIG. 1, before step 102, it also includes:
根据解析出的文件名称,检查软件是否符合预先设置的与升级方式对应的升级要求;在不符合预先设置的与升级方式对应的升级要求时,输出升级错误的提示信息。According to the parsed file name, check whether the software meets the preset upgrade requirements corresponding to the upgrade method; if it does not meet the preset upgrade requirements corresponding to the upgrade method, output an upgrade error prompt message.
进一步地,升级方式为:更新软件中的程序、向软件中添加程序、卸载软件中的程序、替换软件中的文件、向所述软件中添加文件或者删除软件中的文件。Further, the upgrade method includes: updating programs in the software, adding programs to the software, uninstalling programs in the software, replacing files in the software, adding files to the software, or deleting files in the software.
一个软件包括程序和文件,程序指的是一组指示计算机执行动作或做出判断的指令,也就是说该程序为计算机程序,文件包括配置文件和日志文件,例如,grub.cfg、libvirt.conf和anaconda-ks.cfg是配置文件,upgrade.log是日志文件。在升级程序时,可以更新软件中的程序、向软件中添加程序、卸载软件中的程序、替换、删除软件中的文件或者向软件中添加文件。A software includes programs and files. A program refers to a set of instructions that instruct the computer to perform actions or make judgments. That is to say, the program is a computer program. Files include configuration files and log files, for example, grub.cfg, libvirt.conf and anaconda-ks.cfg is the configuration file, upgrade.log is the log file. When upgrading programs, you can update programs in the software, add programs to the software, uninstall programs in the software, replace, delete files in the software, or add files to the software.
下面具体说明与升级方式对应的升级要求。若升级方式为替换软件中的文件或者删除软件中的文件,则与该升级方式对应的升级要求为:软件中存在解析出的文件名称的文件;若升级方式为向软件中添加文件,则与该升级方式对应的升级要求为:软件中不存在解析出的文件名称的文件。若升级方式为更新软件中的程序,则与该升级方式对应的升级要求为:软件中存在待更新的程序,和在对程序升级后,升级后的程序的版本高于升级前的程序的版本;若升级方式为卸载软件中的程序,则与该升级方式对应的升级要求为:软件中存在待卸载的程序,若升级方式为向软件中添加程序,则与该升级方式对应的升级要求为:软件中不存在待添加的程序。如果软件不符合升级要求,说明升级错误,则输出升级错误的提示信息,以使技术人员发现错误并更正,从而减少了软件升级出错的概率。The upgrade requirements corresponding to the upgrade methods are described in detail below. If the upgrade method is to replace files in the software or delete files in the software, the upgrade requirements corresponding to the upgrade method are: there is a file with the parsed file name in the software; if the upgrade method is to add files to the software, then the same as The upgrade requirement corresponding to this upgrade method is: the file with the parsed file name does not exist in the software. If the upgrade method is to update the program in the software, the upgrade requirements corresponding to the upgrade method are: there is a program to be updated in the software, and after the program is upgraded, the version of the upgraded program is higher than the version of the program before the upgrade ; If the upgrade method is to uninstall the program in the software, then the upgrade requirement corresponding to the upgrade method is: there is a program to be uninstalled in the software, if the upgrade method is to add a program to the software, then the upgrade requirement corresponding to the upgrade method is : There is no program to be added in the software. If the software does not meet the upgrade requirements, it means an upgrade error, and an upgrade error prompt message is output to enable technicians to find the error and correct it, thereby reducing the probability of software upgrade errors.
进一步地,在图1对应实施例的基础上,步骤102包括:Further, on the basis of the embodiment corresponding to FIG. 1, step 102 includes:
若升级方式为更新软件中的程序、向软件中添加程序、替换软件中的文件或者向软件中添加文件,则从预先设置的升级文件中查找解析出的文件名称的文件,按照升级方式,使用查找出的文件对软件进行升级;若升级方式为卸载软件中的程序,根据解析出的文件名称,卸载软件中的使用该解析出的文件名称的文件升级的程序;若升级方式包括删除软件的安装文件,则根据解析出的文件名称,删除软件中的解析出的文件名称的文件。If the upgrade method is to update programs in the software, add programs to the software, replace files in the software, or add files to the software, search for the file with the parsed file name from the preset upgrade files, and use the Find out the file to upgrade the software; if the upgrade method is to uninstall the program in the software, according to the parsed file name, uninstall the file upgrade program in the software that uses the parsed file name; if the upgrade method includes deleting the software To install the file, delete the file with the parsed file name in the software according to the parsed file name.
具体地,若升级方式为更新软件中的程序,则根据解析出的文件名称,从预先设置的升级文件中查找该解析出的文件名称的文件,使用该查找到的文件对软件中的程序进行更新;若升级方式为向软件中添加程序,则根据解析出的文件名称,从预先设置的升级文件中查找该解析出的文件名称的文件,使用该查找到的文件向软件中添加新的程序,也就是说使用该查找到的文件为软件安装新的程序;若升级方式为卸载软件中的程序,则根据解析出的文件名称,卸载软件中的使用该解析出的文件名称的文件安装的程序。其中,在对软件中的程序进行更新或者向软件中添加程序时,从预先设置的升级文件中查找到的文件可以是由软件包管理器(Red Hat Package Manager,RPM)生成的文件,该生成的文件是RPM格式的文件。若升级方式为替换软件中的文件,则根据解析出的文件名称,从预先设置的升级文件中查找该解析出的文件名称的文件,使用该查找到的文件替换软件中的该解析出的文件名称的文件;若升级方式为向软件中添加文件,则根据解析出的文件名称,从预先设置的升级文件中查找该解析出的文件名称的文件,将该查找到的文件添加到软件中;若升级方式为删除软件中的文件,则根据解析出的文件名称,删除软件中的该解析出的文件名称的文件。Specifically, if the upgrade method is to update the program in the software, then according to the parsed file name, search for the file with the parsed file name from the preset upgrade files, and use the found file to update the program in the software. Update; if the upgrade method is to add a program to the software, then according to the parsed file name, search for the file with the parsed file name from the preset upgrade file, and use the found file to add a new program to the software , that is to say, use the found file to install a new program for the software; if the upgrade method is to uninstall the program in the software, then according to the parsed file name, uninstall the file installed with the parsed file name in the software program. Wherein, when updating a program in the software or adding a program to the software, the file found from the preset upgrade file may be a file generated by a software package manager (Red Hat Package Manager, RPM). The files are in RPM format. If the upgrade method is to replace the file in the software, then according to the parsed file name, search for the file with the parsed file name from the preset upgrade files, and use the found file to replace the parsed file in the software If the upgrade method is to add a file to the software, then according to the parsed file name, search for the file with the parsed file name from the preset upgrade file, and add the found file to the software; If the upgrade method is to delete files in the software, then delete the file in the software with the parsed file name according to the parsed file name.
进一步地,在图1对应实施例的基础上,如果升级方式为:更新软件中的程序、卸载软件中的程序、替换软件中的文件或者删除软件中的文件,步骤102之前,还包括:Further, on the basis of the corresponding embodiment in FIG. 1 , if the upgrading method is: updating the program in the software, uninstalling the program in the software, replacing the file in the software, or deleting the file in the software, before step 102, it also includes:
根据解析出的文件名称,从预先设置的备份文件中查找在所述软件升级失败时用于将软件回滚到升级前的状态的文件。According to the parsed file name, the file used to roll back the software to the state before the upgrade when the software upgrade fails is searched from the preset backup file.
从备份文件中查找用于将软件回滚到升级前的状态的文件,这样当软件升级失败时,可以利用该查找出的文件将软件回滚到升级前的状态,减少在升级失败时给客户带来损失,从而保证了软件的可用性。另外,如果在对软件中的程序进行升级的过程中主机意外宕机或者断电,再次对该程序升级时自动检查该程序的已升级成功的部分,并跳过已升级成功的部分,接着该已升级成功的部分开始升级,这样避免意外情况对升级的影响,减少了技术人员参与软件的升级。Find the file used to roll back the software to the state before the upgrade from the backup file, so that when the software upgrade fails, the file can be used to roll the software back to the state before the upgrade, reducing the cost to the customer when the upgrade fails Bring losses, thereby ensuring the availability of the software. In addition, if the host computer crashes unexpectedly or loses power during the process of upgrading the program in the software, when the program is upgraded again, it will automatically check the part of the program that has been successfully upgraded, and skip the part that has been successfully upgraded, and then the The part that has been upgraded successfully starts to upgrade, so as to avoid the influence of unexpected situations on the upgrade and reduce the participation of technicians in software upgrade.
例如,若升级方式为更新软件中的程序,则根据解析出的文件名称,从预先设置的备份文件中查找待更新的程序的安装包,在备份文件中查找到的该程序的安装包是旧版本的安装包;若对该程序更新失败,使用从备份文件中查找到的安装包对该程序进行回滚。若升级方式为卸载软件中的程序,则根据解析出的文件名称,从预先设置的备份文件中查找待卸载的程序的安装包;若对该程序卸载失败,使用从备份文件中查找到的安装包对该程序进行回滚。For example, if the upgrade method is to update the program in the software, then according to the analyzed file name, search for the installation package of the program to be updated from the preset backup file, and the installation package of the program found in the backup file is the old one. version of the installation package; if the program update fails, use the installation package found from the backup file to roll back the program. If the upgrade method is to uninstall the program in the software, then search for the installation package of the program to be uninstalled from the pre-set backup file according to the parsed file name; if the program fails to be uninstalled, use the installation package found from the backup file The package rolls back the program.
若升级方式为删除软件中的文件,则根据解析出的文件名称,从备份文件中查找该解析出的文件名称的文件,如果未成功删除软件中的文件,则利用从备份文件中查找出的文件将软件回滚到升级前的状态。若升级方式为替换软件中的文件,则根据解析出的文件名称,从升级文件中查找该解析出的文件名称的文件,该文件是最新版本的文件,并从备份文件中查找解析出的文件名称的文件,该文件是旧版本的文件,使用最新版本的文件替换旧版本的文件,若替换失败,使用旧版本的文件对软件进行回滚。If the upgrade method is to delete the file in the software, then according to the parsed file name, find the file with the parsed file name from the backup file, if the file in the software is not successfully deleted, use the file found from the backup file file to roll back the software to its pre-upgrade state. If the upgrade method is to replace the file in the software, then according to the parsed file name, find the file with the parsed file name from the upgrade file, which is the latest version of the file, and find the parsed file from the backup file Name of the file, the file is an old version of the file, use the latest version of the file to replace the old version of the file, if the replacement fails, use the old version of the file to roll back the software.
进一步地,如果对软件升级成功,还包括:Further, if the software upgrade is successful, it also includes:
若升级方式为更新软件中的程序或者替换软件中的文件,则删除备份文件中的用于将软件回滚到升级前的状态的文件,将从升级文件中查找到的文件添加到备份文件中;若升级方式为向软件中添加程序或者向软件中添加文件,则将从升级文件中查找到的文件添加到备份文件中;若升级方式为卸载软件中的程序或者删除软件中的文件,则删除备份文件中的用于将软件回滚到升级前的状态的文件。If the upgrade method is to update the program in the software or replace the files in the software, delete the files in the backup file used to roll back the software to the state before the upgrade, and add the files found in the upgrade file to the backup file ; If the upgrade method is to add programs or files to the software, add the files found in the upgrade file to the backup file; if the upgrade method is to uninstall programs in the software or delete files in the software, then Delete the files in the backup file that are used to roll back the software to its pre-upgrade state.
由于从升级文件中查找到的文件是最新版本的文件,因此将从升级文件中查找到的文件添加到备份文件中,保证了备份文件中的文件是最新版本的文件。而且删除备份文件中的用于将软件回滚到升级前的状态的文件,避免了备份文件中存在过多的冗余数据。Since the files found from the upgrade file are files of the latest version, the files found from the upgrade file are added to the backup file to ensure that the files in the backup file are files of the latest version. Moreover, deleting the file used to roll back the software to the state before the upgrade in the backup file avoids excessive redundant data in the backup file.
下面举一个例子对上述中的配置文件进行说明,在该例子中,软件安装在虚拟机上,用于对软件升级的配置文件的内容如下:The following is an example to illustrate the above configuration file. In this example, the software is installed on a virtual machine, and the content of the configuration file used to upgrade the software is as follows:
其中,<id>Center</id>表示软件的模式为Center。Among them, <id>Center</id> indicates that the mode of the software is Center.
<description>common configuration</description>表示软件的升级内容。<description>common configuration</description> indicates the upgrade content of the software.
<version>CS50EESP1-Center</version>表示软件的版本号。<version>CS50EESP1-Center</version> indicates the version number of the software.
<hotfix>yes</hotfix>中的hotfix表示是否为软件的版本间的升级,yes表示是软件的版本间的升级,软件的版本间的升级指的是修复软件的漏洞,但不改变软件的版本号,就是说软件的版本号不发生变化。The hotfix in <hotfix>yes</hotfix> indicates whether it is an upgrade between software versions, yes means an upgrade between software versions, and the upgrade between software versions refers to repairing software vulnerabilities without changing the software Version number, that is to say, the version number of the software does not change.
<backuppath>/tmp/iso</backuppath>表示软件回滚的路径,也就是说在该路径下存储有软件的备份文件。<backuppath>/tmp/iso</backuppath> indicates the path of software rollback, that is to say, the backup file of the software is stored in this path.
<dependencies><dependencies>
<dependency>CS50EE_Center_SP1.upgrade.zip</dependency><dependency>CS50EE_Center_SP1.upgrade.zip</dependency>
</dependencies></dependencies>
以上三行的内容表示软件所依赖的版本,意思是说软件依赖于版本为CS50EE_Center_SP1.upgrade.zip的安装包来完成安装的。The content of the above three lines indicates the version that the software depends on, which means that the software depends on the installation package whose version is CS50EE_Center_SP1.upgrade.zip to complete the installation.
<requirements>和</requirements>之间的内容包括对软件升级前执行的动作和对软件升级后执行的动作。The content between <requirements> and </requirements> includes the actions performed before the software upgrade and the actions performed after the software upgrade.
<reboot>yes</reboot>中的reboot表示升级后是否重启虚拟机的操作系统,<reboot>yes</reboot>中的yes表示升级后重启虚拟机的操作系统。The reboot in <reboot>yes</reboot> indicates whether to restart the operating system of the virtual machine after the upgrade, and the yes in <reboot>yes</reboot> indicates that the operating system of the virtual machine is restarted after the upgrade.
<maintenance>yes</maintenance>中的maintenance表示升级前是否暂停运行虚拟机的主机的业务,<maintenance>yes</maintenance>中的yes表示升级前暂停该主机的业务。The maintenance in <maintenance>yes</maintenance> indicates whether to suspend the business of the host running the virtual machine before the upgrade, and the yes in <maintenance>yes</maintenance> indicates that the business of the host is suspended before the upgrade.
<cleanvm>yes</cleanvm>中的cleanvm表示升级前是否清空虚拟机,<cleanvm>yes</cleanvm>中的yes表示升级前清空虚拟机。The cleanvm in <cleanvm>yes</cleanvm> indicates whether to clear the virtual machine before upgrading, and the yes in <cleanvm>yes</cleanvm> indicates clearing the virtual machine before upgrading.
在以上的内容中,cs-agent-1.7-39.20161021.x86_64.rpm表示用于更新软件中的程序的RPM包的名称,cs-agent表示待更新的程序的名称。In the above content, cs-agent-1.7-39.20161021.x86_64.rpm represents the name of the RPM package used to update the program in the software, and cs-agent represents the name of the program to be updated.
在以上的内容中,tree-2.5.0-1.x86_64.rpm表示用于向软件中添加程序的RPM包的名称,tree表示待添加的程序的名称。In the above content, tree-2.5.0-1.x86_64.rpm represents the name of the RPM package used to add the program to the software, and tree represents the name of the program to be added.
在以上的内容中,screen-4.0.3-16.el.x86_64.rpm表示待卸载软件中程序的RPM包的名称,换句话说软件中的待卸载的程序是使用该RPM包安装得到的,screen表示待卸载的程序的名称。In the above content, screen-4.0.3-16.el.x86_64.rpm indicates the name of the RPM package of the program in the software to be uninstalled. In other words, the program to be uninstalled in the software is installed using the RPM package. screen indicates the name of the program to be uninstalled.
<file method='add'>/var/log/upgrade.log</file>中的'add'表示向软件中添加文件,upgrade.log表示待添加的文件的名称,/var/log/表示待添加的文件的存储位置,换句话说就是向/file的文件夹中添加文件。'add' in <file method='add'>/var/log/upgrade.log</file> means to add files to the software, upgrade.log means the name of the file to be added, /var/log/ means to The storage location of the added files, in other words, adding files to the /file folder.
<file method='add'>/etc/grub/grub.cfg</file>中的'add'表示向软件中添加文件,grub.cfg表示待添加的文件的名称,/etc/grub/表示待添加的文件的存储位置,换句话说就是向/file的文件夹中添加文件。'add' in <file method='add'>/etc/grub/grub.cfg</file> means to add files to the software, grub.cfg means the name of the file to be added, /etc/grub/ means to The storage location of the added files, in other words, adding files to the /file folder.
<file method='update'>/etc/sasl2/libvirt.conf</file>中的'update'表示更新软件中的文件,libvirt.conf表示待更新的文件的名称,/etc/sasl2/表示待更新的文件的存储位置,换句话说就是更新/file的文件夹中的文件。'update' in <file method='update'>/etc/sasl2/libvirt.conf</file> means to update the file in the software, libvirt.conf means the name of the file to be updated, /etc/sasl2/ means to be Where the updated files are stored, in other words the files in the updated /file folder.
<file method='delete'>/root/anaconda-ks.cfg</file>中的'delete'表示删除软件中的文件,anaconda-ks.cfg表示待删除的文件的名称,/root/表示待删除的文件的存储位置,换句话说就是删除/file的文件夹中的文件。'delete' in <file method='delete'>/root/anaconda-ks.cfg</file> means to delete the file in the software, anaconda-ks.cfg means the name of the file to be deleted, /root/ means to be deleted The storage location of the deleted files, in other words the deleted files in the /file folder.
根据本发明实施例的软件升级方法,从预先设置的配置文件中解析出软件的升级方式以及与该升级方式对应的文件名称;根据解析出的升级方式和文件名称对软件进行升级。从本发明实施例可见,由于预先在配置文件中设置软件的升级方式和与该升级方式对应的文件名称,通过解析配置文件就可以根据解析出的内容自动对软件升级,避免了人工对软件进行升级,特别是软件中有很多的内容需要升级时,有效地提高了软件升级的效率。而且本发明是将升级方式以及与该升级方式对应的文件名称设置到配置文件中即可,不需要人工对软件进行升级操作,降低了软件升级的复杂度,大大简化了软件升级的流程,使用户更容易操作,保证了软件升级的易用性。由于用户很容易操作软件升级,也就是说对用户在专业技术水平上要求不高,从而降低了公司在人力运维方面投入更多的成本。According to the software upgrade method of the embodiment of the present invention, the software upgrade method and the file name corresponding to the upgrade method are analyzed from the preset configuration file; the software is upgraded according to the analyzed upgrade method and file name. As can be seen from the embodiment of the present invention, since the upgrade method of the software and the file name corresponding to the upgrade method are set in the configuration file in advance, the software can be automatically upgraded according to the content analyzed by analyzing the configuration file, avoiding manual software upgrade. Upgrading, especially when there are a lot of content in the software that needs to be upgraded, effectively improves the efficiency of software upgrading. Moreover, the present invention only needs to set the upgrade mode and the file name corresponding to the upgrade mode in the configuration file, and does not need to manually upgrade the software, which reduces the complexity of software upgrade and greatly simplifies the process of software upgrade. It is easier for users to operate, which ensures the ease of software upgrade. Because users can easily operate software upgrades, that is to say, the professional technical level of users is not high, which reduces the company's investment in human operation and maintenance costs.
本发明实施例提供另一种软件升级方法,如图2所示,该软件升级方法包括:The embodiment of the present invention provides another software upgrade method, as shown in Figure 2, the software upgrade method includes:
步骤201、下发对软件升级的任务,下发的任务中包括用于对软件升级的配置文件和升级文件。Step 201 , issue a task for upgrading software, and the issued task includes a configuration file and an upgrade file for upgrading software.
步骤202、验证软件的升级文件是否正确,在验证正确时,执行步骤203,否则,结束本次流程,在结束本次流程时可以输出升级文件出错的提示。具体地,读取升级文件中的文件的名称,根据该文件的名称判断升级文件是否为该软件的升级文件,也就是说判断升级文件和软件是否是对应的。Step 202, verify whether the upgrade file of the software is correct, and if the verification is correct, execute step 203; otherwise, end this process, and output an error prompt for the upgrade file when ending this process. Specifically, read the name of the file in the upgrade file, and judge whether the upgrade file is the upgrade file of the software according to the name of the file, that is to say, judge whether the upgrade file corresponds to the software.
步骤203、解析配置文件,以解析出配置文件中的升级方式和与该升级方式对应的文件名称。解析出的文件名称包括用于升级软件中的程序的RPM包的名称和/或用于升级软件中的文件的名称。Step 203: Parse the configuration file to find out the upgrade method in the configuration file and the file name corresponding to the upgrade method. The parsed file name includes the name of the RPM package used to upgrade the program in the software and/or the name of the file used to upgrade the software.
步骤204、从备份文件中查找用于将软件回滚到升级前的状态的文件。Step 204, searching the backup file for the file used to roll back the software to the state before the upgrade.
步骤205、如果查找到多个用于将软件回滚到升级前的状态的文件,则删除多余的老版本文件。例如,在备份文件中查找到3个版本的RPM包,该3个版本的RPM包都用于升级一个程序,删除版本多余的2个老版本的RPM包,以保留该3个版本的RPM包中的最新版本的RPM包。Step 205, if multiple files for rolling back the software to the pre-upgrade state are found, delete redundant old version files. For example, if you find 3 versions of RPM packages in the backup file, the 3 versions of RPM packages are used to upgrade a program, delete the 2 old versions of RPM packages with redundant versions to keep the 3 versions of RPM packages The latest version of the RPM package in .
步骤206、如果解析出的文件名称中包括RPM包的名称,则从升级文件中查找该名称的RPM包,使用查找的RPM包对软件中的程序进行升级。Step 206, if the parsed file name includes the name of the RPM package, search for the RPM package with the name from the upgrade file, and use the found RPM package to upgrade the programs in the software.
步骤207、软件中的程序是否升级成功,若升级成功则执行步骤208,若升级失败则执行步骤209。Step 207, whether the program in the software is successfully upgraded, if the upgrade is successful, execute step 208, and if the upgrade fails, execute step 209.
步骤208、将从升级文件中查找出的RPM包添加到备份文件中。Step 208, adding the RPM package found from the upgrade file to the backup file.
步骤209、使用老版本的RPM包(即在步骤204中,从备份文件中查找的用于将软件中的程序回滚到升级前的状态的文件)将软件回滚到该升级之前的状态。Step 209, using the old version of the RPM package (that is, in step 204, the file used to roll back the program in the software to the state before the upgrade found from the backup file) to roll back the software to the state before the upgrade.
步骤210、如果解析出的文件的名称中包括用于升级软件中的文件的名称,则从升级文件中查找该名称的文件,使用查找的文件对软件中的文件进行升级。Step 210, if the parsed file name includes the name of the file used to upgrade the software, search for the file with the name from the upgrade file, and use the found file to upgrade the file in the software.
步骤211、软件中的文件是否升级成功,若升级成功则执行步骤212,若升级失败则执行步骤214。Step 211 , whether the file in the software is successfully upgraded, if the upgrade is successful, execute step 212 , if the upgrade fails, execute step 214 .
步骤212、将从升级文件中查找出的RPM包添加到备份文件中,将从升级文件中查找出的用于升级软件中的文件的文件添加到备份文件中。Step 212, add the RPM package found from the upgrade file to the backup file, and add the file used to upgrade the files in the software found from the upgrade file to the backup file.
步骤213、修改软件的版本号。Step 213, modify the version number of the software.
步骤214、使用老版本的文件(即在步骤204中,从备份文件中查找的用于将软件中的文件回滚到升级前的状态的文件)将软件中的文件回滚到该升级之前的状态。Step 214, using the old version of the file (that is, in step 204, the file used to roll back the file in the software to the state before the upgrade from the backup file) is rolled back to the file in the software to the file before the upgrade state.
步骤215、使用老版本的RPM包(即在步骤204中,从备份文件中查找的用于将软件中的程序回滚到升级前的状态的文件)将软件中的程序回滚到该升级之前的状态。Step 215, use the old version of the RPM package (that is, in step 204, the file used to roll back the program in the software to the state before the upgrade from the backup file) that the program in the software is rolled back to before the upgrade status.
本发明实施例提供一种软件升级装置,如图3所示,该软件升级装置3包括:The embodiment of the present invention provides a software upgrade device, as shown in Figure 3, the software upgrade device 3 includes:
解析模块31,用于从预先设置的配置文件中解析出软件的升级方式以及与该升级方式对应的文件名称。The parsing module 31 is configured to parse out a software upgrade method and a file name corresponding to the upgrade method from a preset configuration file.
升级模块32,用于根据解析出的升级方式和文件名称对软件进行升级。The upgrade module 32 is configured to upgrade the software according to the parsed upgrade method and file name.
进一步地,在图3对应实施例的基础上,解析模块31还用于,Further, on the basis of the embodiment corresponding to FIG. 3 , the parsing module 31 is also used to:
从配置文件中解析出在对软件升级之前执行的动作和在对软件升级之后执行的动作。The actions performed before upgrading the software and the actions performed after upgrading the software are analyzed from the configuration file.
进一步地,在图3对应实施例的基础上,本发明提供另一种软件升级装置,如图4所示,该软件升级装置3还包括:Further, on the basis of the embodiment corresponding to FIG. 3 , the present invention provides another software upgrading device. As shown in FIG. 4 , the software upgrading device 3 also includes:
检查模块33,用于根据文件名称,检查软件是否符合预先设置的与升级方式对应的升级要求;Checking module 33 is used to check whether the software meets the preset upgrade requirements corresponding to the upgrade method according to the file name;
输出模块34,用于在不符合预先设置的与升级方式对应的升级要求时,输出升级错误的提示信息。The output module 34 is configured to output an upgrade error prompt message when the preset upgrade requirement corresponding to the upgrade mode is not met.
进一步地,升级方式为:更新软件中的程序、向软件中添加程序、卸载软件中的程序、替换软件中的文件、向软件中添加文件或者删除软件中的文件。Further, the upgrade method includes: updating programs in the software, adding programs to the software, uninstalling programs in the software, replacing files in the software, adding files to the software, or deleting files in the software.
进一步地,如图4所示,升级模块32包括:Further, as shown in Figure 4, the upgrade module 32 includes:
第一升级单元321,用于若升级方式为更新软件中的程序、向软件中添加程序、替换软件中的文件或者向软件中添加文件,则从预先设置的升级文件中查找解析出的文件名称的文件,按照升级方式,使用该查找出的文件对软件进行升级。The first upgrade unit 321 is used to search for the parsed file name from the preset upgrade file if the upgrade method is to update a program in the software, add a program to the software, replace a file in the software or add a file to the software According to the upgrade method, use the found file to upgrade the software.
第二升级单元322,用于若升级方式为卸载软件中的程序,根据解析出的文件名称,卸载软件中的使用解析出的文件名称的文件升级的程序。The second upgrade unit 322 is configured to uninstall the program in the software that uses the file name that is parsed out according to the file name that is parsed out if the upgrade method is to uninstall the program in the software.
第三升级单元323,用于若升级方式包括删除软件的文件,则根据解析出的文件名称,删除软件中的解析出的文件名称的文件。The third upgrading unit 323 is configured to delete the file with the parsed file name in the software according to the parsed file name if the upgrade method includes deleting the file of the software.
进一步地,如果升级方式为:更新软件中的程序、卸载软件中的程序、替换软件中的文件或者删除软件中的文件,如图4所示,软件升级装置3还包括:Further, if the upgrading method is: update the program in the software, uninstall the program in the software, replace the file in the software or delete the file in the software, as shown in Figure 4, the software upgrading device 3 also includes:
查找模块35,用于根据文件名称,从预先设置的备份文件中查找在对软件升级失败时用于将软件回滚到升级前的状态的文件。The search module 35 is configured to search the preset backup file for the file used to roll back the software to the pre-upgrade state when the software upgrade fails according to the file name.
进一步地,如果对软件升级成功,如图4所示,软件升级装置3还包括:Further, if the software upgrade is successful, as shown in Figure 4, the software upgrade device 3 also includes:
添加模块36,用于若升级方式为更新软件中的程序、替换软件中的文件、向软件中添加程序或者向软件中添加文件,则将从升级文件中查找到的文件添加到备份文件中。The adding module 36 is used to add the files found in the upgrade file to the backup file if the upgrade method is to update the program in the software, replace the file in the software, add a program to the software or add a file to the software.
删除模块37,用于若升级方式为卸载软件中的程序、删除软件中的文件、更新软件中的程序或者替换软件中的文件,则删除备份文件中的用于将软件回滚到升级前的状态的文件。Deletion module 37 is used for if upgrade mode is to uninstall the program in the software, delete the file in the software, update the program in the software or replace the file in the software, then delete the file in the backup file that is used to roll the software back to before the upgrade. status file.
在实际应用中,解析模块31、升级模块32、检查模块33、输出模块34、查找模块35、添加模块36和删除模块37均可由软件升级装置3中的CPU、微处理器(Micro ProcessorUnit,MPU)、数字信号处理器(Digital Signal Processor,DSP)或现场可编程门阵列(Field Programmable Gate Array,FPGA)等实现。In practical application, analysis module 31, upgrade module 32, check module 33, output module 34, search module 35, add module 36 and delete module 37 all can be by CPU in the software upgrade device 3, microprocessor (Micro ProcessorUnit, MPU ), digital signal processor (Digital Signal Processor, DSP) or field programmable gate array (Field Programmable Gate Array, FPGA) and other implementations.
根据本发明实施例的软件升级装置,从预先设置的配置文件中解析出软件的升级方式以及与该升级方式对应的文件名称;根据解析出的升级方式和文件名称对软件进行升级。从本发明实施例可见,由于预先在配置文件中设置软件的升级方式和与该升级方式对应的文件名称,通过解析配置文件就可以根据解析出的内容自动对软件升级,避免了人工对软件进行升级,特别是软件中有很多的内容需要升级时,有效地提高了软件升级的效率。According to the software upgrading device of the embodiment of the present invention, the software upgrading method and the file name corresponding to the upgrading method are analyzed from the preset configuration file; the software is upgraded according to the analyzed upgrading method and the file name. As can be seen from the embodiment of the present invention, since the upgrade method of the software and the file name corresponding to the upgrade method are set in the configuration file in advance, the software can be automatically upgraded according to the content analyzed by analyzing the configuration file, avoiding manual software upgrade. Upgrading, especially when there are a lot of content in the software that needs to be upgraded, effectively improves the efficiency of software upgrading.
本发明实施例提供又一种软件升级装置,该软件升级装置包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现的步骤包括:An embodiment of the present invention provides yet another software upgrade device, the software upgrade device includes a memory, a processor, and a computer program stored on the memory and operable on the processor, and the steps implemented when the processor executes the computer program include:
从预先设置的配置文件中解析出软件的升级方式以及与该升级方式对应的文件名称;Analyze the software upgrade method and the file name corresponding to the upgrade method from the preset configuration file;
根据解析出的升级方式和文件名称对软件进行升级。Upgrade the software according to the analyzed upgrade method and file name.
进一步地,上述处理器执行计算机程序时实现的步骤还包括:Further, the steps implemented when the above-mentioned processor executes the computer program also include:
从所述配置文件中解析出在对所述软件升级之前执行的动作和在对所述软件升级之后执行的动作。The actions performed before upgrading the software and the actions performed after upgrading the software are analyzed from the configuration file.
进一步地,上述处理器执行计算机程序时实现的步骤还包括:Further, the steps implemented when the above-mentioned processor executes the computer program also include:
根据所述文件名称,检查所述软件是否符合预先设置的与所述升级方式对应的升级要求;在不符合预先设置的与升级方式对应的升级要求时,输出升级错误的提示信息。According to the name of the file, check whether the software meets the preset upgrade requirements corresponding to the upgrade method; if the preset upgrade requirements corresponding to the upgrade method are not met, output an upgrade error prompt message.
进一步地,所述升级方式为:更新所述软件中的程序、向所述软件中添加程序、卸载所述软件中的程序、替换所述软件中的文件、向所述软件中添加文件或者删除所述软件中的文件。Further, the upgrade method is: updating programs in the software, adding programs to the software, uninstalling programs in the software, replacing files in the software, adding files to the software, or deleting files in the software.
进一步地,上述处理器执行计算机程序时实现的步骤具体包括:Further, the steps implemented when the above-mentioned processor executes the computer program specifically include:
若所述升级方式为更新所述软件中的程序、向所述软件中添加程序、替换所述软件中的文件或者向所述软件中添加文件,则从预先设置的升级文件中查找所述解析出的文件名称的文件,按照所述升级方式,使用该查找出的文件对所述软件进行升级;若所述升级方式为卸载所述软件中的程序,根据所述解析出的文件名称,卸载所述软件中的使用所述解析出的文件名称的文件升级的程序;若所述升级方式包括删除所述软件的文件,则根据所述解析出的文件名称,删除所述软件中的所述解析出的文件名称的文件。If the upgrade method is to update the program in the software, add a program to the software, replace a file in the software, or add a file to the software, then search for the analysis from the preset upgrade file For the file with the name of the file, according to the upgrade method, use the file found to upgrade the software; if the upgrade method is to uninstall the program in the software, according to the file name analyzed, uninstall A file upgrade program in the software using the parsed file name; if the upgrade method includes deleting the file of the software, then delete the file in the software according to the parsed file name A file of parsed filenames.
进一步地,如果所述升级方式为:更新所述软件中的程序、卸载所述软件中的程序、替换所述软件中的文件或者删除所述软件中的文件,上述处理器执行计算机程序时实现的步骤还包括:Further, if the upgrade method is: updating programs in the software, uninstalling programs in the software, replacing files in the software, or deleting files in the software, when the above-mentioned processor executes the computer program, the The steps also include:
根据所述文件名称,从预先设置的备份文件中查找在对所述软件升级失败时用于将所述软件回滚到升级前的状态的文件。According to the file name, a file used to roll back the software to a pre-upgrade state when the software upgrade fails is searched from preset backup files.
进一步地,如果对所述软件升级成功,上述处理器执行计算机程序时实现的步骤还包括:Further, if the upgrade of the software is successful, the steps implemented when the processor executes the computer program further include:
若所述升级方式为更新所述软件中的程序或者替换所述软件中的文件,则删除所述备份文件中的用于将所述软件回滚到升级前的状态的文件,将从所述升级文件中查找到的文件添加到所述备份文件中;若所述升级方式为向所述软件中添加程序或者向所述软件中添加文件,则将从所述升级文件中查找到的文件添加到所述备份文件中;若所述升级方式为卸载所述软件中的程序或者删除所述软件中的文件,则删除所述备份文件中的用于将所述软件回滚到升级前的状态的文件。If the upgrade method is to update the program in the software or replace the file in the software, then delete the file used to roll back the software to the state before the upgrade in the backup file, and the Add the files found in the upgrade file to the backup file; if the upgrade method is to add a program to the software or add a file to the software, then add the files found in the upgrade file to to the backup file; if the upgrade method is to uninstall the program in the software or delete the file in the software, then delete the document.
虽然本发明所揭露的实施方式如上,但所述的内容仅为便于理解本发明而采用的实施方式,并非用以限定本发明。任何本发明所属领域内的技术人员,在不脱离本发明所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明的专利保护范围,仍须以所附的权利要求书所界定的范围为准。Although the embodiments disclosed in the present invention are as above, the described content is only an embodiment adopted for understanding the present invention, and is not intended to limit the present invention. Anyone skilled in the field of the present invention can make any modifications and changes in the form and details of the implementation without departing from the spirit and scope disclosed by the present invention, but the patent protection scope of the present invention must still be The scope defined by the appended claims shall prevail.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710881627.6ACN107391216A (en) | 2017-09-26 | 2017-09-26 | A kind of method for upgrading software and device |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710881627.6ACN107391216A (en) | 2017-09-26 | 2017-09-26 | A kind of method for upgrading software and device |
| Publication Number | Publication Date |
|---|---|
| CN107391216Atrue CN107391216A (en) | 2017-11-24 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710881627.6APendingCN107391216A (en) | 2017-09-26 | 2017-09-26 | A kind of method for upgrading software and device |
| Country | Link |
|---|---|
| CN (1) | CN107391216A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113505777A (en)* | 2021-07-20 | 2021-10-15 | 深圳市拓普泰克技术股份有限公司 | Keyboard layout version detection method, device, equipment and storage medium |
| CN114416132A (en)* | 2021-12-14 | 2022-04-29 | 广州极飞科技股份有限公司 | Equipment upgrading method, device, equipment and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1866252A (en)* | 2006-02-20 | 2006-11-22 | 华为技术有限公司 | Method and system for transformation between different version configuration data |
| CN101158908A (en)* | 2007-10-25 | 2008-04-09 | 中兴通讯股份有限公司 | System and method for realizing automatic equipment software upgrade |
| CN101281469A (en)* | 2008-04-11 | 2008-10-08 | 青岛海信电器股份有限公司 | Embedded type system and start-up load application method |
| CN101739278A (en)* | 2009-12-17 | 2010-06-16 | 中国电力科学研究院 | Enterprise-level application software updating method and system |
| CN102170536A (en)* | 2011-04-15 | 2011-08-31 | 深圳创维数字技术股份有限公司 | Digital television network system, digital television all-in-one machine and upgrading method thereof |
| CN102346673A (en)* | 2010-07-27 | 2012-02-08 | 比亚迪股份有限公司 | Method and device for upgrading mobile phone system |
| CN104156244A (en)* | 2014-08-06 | 2014-11-19 | 北京奇虎科技有限公司 | Method and device for software upgrading |
| CN104615471A (en)* | 2015-03-05 | 2015-05-13 | 浪潮软件集团有限公司 | System upgrading method and device for terminal |
| CN106502685A (en)* | 2016-11-01 | 2017-03-15 | Tcl集团股份有限公司 | A kind of upgrade method of data base and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1866252A (en)* | 2006-02-20 | 2006-11-22 | 华为技术有限公司 | Method and system for transformation between different version configuration data |
| CN101158908A (en)* | 2007-10-25 | 2008-04-09 | 中兴通讯股份有限公司 | System and method for realizing automatic equipment software upgrade |
| CN101281469A (en)* | 2008-04-11 | 2008-10-08 | 青岛海信电器股份有限公司 | Embedded type system and start-up load application method |
| CN101739278A (en)* | 2009-12-17 | 2010-06-16 | 中国电力科学研究院 | Enterprise-level application software updating method and system |
| CN102346673A (en)* | 2010-07-27 | 2012-02-08 | 比亚迪股份有限公司 | Method and device for upgrading mobile phone system |
| CN102170536A (en)* | 2011-04-15 | 2011-08-31 | 深圳创维数字技术股份有限公司 | Digital television network system, digital television all-in-one machine and upgrading method thereof |
| CN104156244A (en)* | 2014-08-06 | 2014-11-19 | 北京奇虎科技有限公司 | Method and device for software upgrading |
| CN104615471A (en)* | 2015-03-05 | 2015-05-13 | 浪潮软件集团有限公司 | System upgrading method and device for terminal |
| CN106502685A (en)* | 2016-11-01 | 2017-03-15 | Tcl集团股份有限公司 | A kind of upgrade method of data base and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113505777A (en)* | 2021-07-20 | 2021-10-15 | 深圳市拓普泰克技术股份有限公司 | Keyboard layout version detection method, device, equipment and storage medium |
| CN114416132A (en)* | 2021-12-14 | 2022-04-29 | 广州极飞科技股份有限公司 | Equipment upgrading method, device, equipment and storage medium |
| CN114416132B (en)* | 2021-12-14 | 2025-07-08 | 广州极飞科技股份有限公司 | Device upgrading method, device and storage medium |
| Publication | Publication Date | Title |
|---|---|---|
| US8140907B2 (en) | Accelerated virtual environments deployment troubleshooting based on two level file system signature | |
| US10114630B2 (en) | Management of software and operating system updates required for the process of creating a virtual machine facsimile of an existing physical or virtual machine | |
| CN110275722B (en) | Method, apparatus, device and storage medium for upgrading application | |
| CN104679527B (en) | Virtual machine image upgraded in offline method | |
| WO2013078951A1 (en) | Method and system for upgrading software | |
| KR20110086732A (en) | Application Recovery Points | |
| US8132047B2 (en) | Restoring application upgrades using an application restore point | |
| CN108021427A (en) | Information system deployment and updating management method based on Docker | |
| CN113805925A (en) | Online upgrade method, device, device and medium for distributed cluster management software | |
| CN114741096A (en) | Upgrade processing method, device and storage medium | |
| WO2022156277A1 (en) | Application program installation method and apparatus, and computing device and readable storage medium | |
| CN115129348A (en) | Resource updating method, device and equipment of application program and readable storage medium | |
| CN117591136A (en) | Storage image generation method, device, computer equipment and storage medium | |
| CN104820610B (en) | The update method and system of virtual machine image in a kind of cloud environment | |
| CN104331311B (en) | A kind of AKU generation method and device | |
| US10394619B2 (en) | Signature-based service manager with dependency checking | |
| CN107391216A (en) | A kind of method for upgrading software and device | |
| US8689048B1 (en) | Non-logging resumable distributed cluster | |
| WO2022120640A1 (en) | Electron-based updating method and system | |
| CN105594184A (en) | Software version upgrade method, apparatus and device | |
| CN106933604A (en) | A kind of method for upgrading system and device | |
| CN106201578A (en) | A Software System Update Framework | |
| CN115291925A (en) | A BMC upgrade method, system, device and storage medium | |
| CN114296770A (en) | Differential upgrade method, apparatus, device and readable storage medium | |
| KR102423056B1 (en) | Method and system for swapping booting disk |
| 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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication | Application publication date:20171124 |