[go: up one dir, main page]

CN117608653A - Operating system migration method and computing device - Google Patents

Operating system migration method and computing device Download PDF

Info

Publication number
CN117608653A
CN117608653A CN202311348302.3A CN202311348302A CN117608653A CN 117608653 A CN117608653 A CN 117608653A CN 202311348302 A CN202311348302 A CN 202311348302A CN 117608653 A CN117608653 A CN 117608653A
Authority
CN
China
Prior art keywords
operating system
package
software package
target
dependency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311348302.3A
Other languages
Chinese (zh)
Other versions
CN117608653B (en
Inventor
谢李浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion Digital Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202311348302.3A priority Critical patent/CN117608653B/en
Publication of CN117608653A publication Critical patent/CN117608653A/en
Application granted granted Critical
Publication of CN117608653B publication Critical patent/CN117608653B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides an operating system migration method and computing equipment, relates to the technical field of servers, and can avoid the compatibility problem of software packages so that an operating system can normally complete migration. The method comprises the following steps: determining a target software package in a first operating system; the target software package is a software package which is not updated and is incompatible in the process of migrating the first operating system to the second operating system; deleting the related information of the target software package from the target database; the target database is used for recording the related information of each software package in the first operating system before and after the migration of the first operating system; migrating the first operating system to a second operating system based on the target database; installing a compatible dependency package on a second operating system; the compatible dependency package is used to support the target software package running on the second operating system. The embodiment of the application can be used in the operation and maintenance process of the computing equipment.

Description

一种操作系统迁移方法及计算设备Operating system migration method and computing device

技术领域Technical field

本申请实施例涉及服务器技术领域,尤其涉及一种操作系统迁移方法及计算设备。Embodiments of the present application relate to the field of server technology, and in particular, to an operating system migration method and a computing device.

背景技术Background technique

随着操作系统的更新迭代,原有操作系统可能存在漏洞或者安全问题,对于企业来说,需要进行操作系统的迁移,以保证操作系统上业务应用的安全性与运行稳定性。As the operating system is updated and iterated, the original operating system may have loopholes or security issues. For enterprises, operating system migration is required to ensure the security and operational stability of business applications on the operating system.

在操作系统迁移的场景中,用户常常期望保持现有业务的稳定,即期望部分业务的软件包不随着操作系统迁移而进行升级。但是保留的软件包在新的操作系统上可能存在兼容问题,导致操作系统的迁移不能正常完成。In the scenario of operating system migration, users often expect to maintain the stability of existing services, that is, they expect that the software packages of some services will not be upgraded along with the operating system migration. However, the retained software packages may have compatibility issues on the new operating system, causing the operating system migration to not be completed normally.

发明内容Contents of the invention

本申请实施例提供一种操作系统迁移方法及计算设备,可以避免软件包的兼容问题,使得操作系统能够正常完成迁移。Embodiments of the present application provide an operating system migration method and a computing device, which can avoid software package compatibility issues and enable the operating system to complete migration normally.

第一方面,本申请实施例提供一种操作系统迁移方法,该方法包括:确定第一操作系统中的目标软件包;其中,目标软件包为第一操作系统在迁移至第二操作系统的过程中不升级且不兼容的软件包;从目标数据库中删除目标软件包的相关信息;目标数据库用于记录第一操作系统中的各软件包在第一操作系统迁移前后的相关信息;基于目标数据库,将第一操作系统迁移至第二操作系统;在第二操作系统上安装兼容依赖包;兼容依赖包用于支持目标软件包兼容运行于第二操作系统。In a first aspect, embodiments of the present application provide an operating system migration method. The method includes: determining a target software package in a first operating system; wherein the target software package is a process of migrating the first operating system to a second operating system. software packages that are not upgraded and are incompatible; delete the relevant information of the target software package from the target database; the target database is used to record the relevant information of each software package in the first operating system before and after the migration of the first operating system; based on the target database , migrate the first operating system to the second operating system; install the compatible dependency package on the second operating system; the compatible dependency package is used to support the target software package to be compatible with the second operating system.

本申请实施例提供一种操作系统迁移方法,该方法在操作系统迁移之前,从目标数据库中删除目标软件包的相关信息。由于操作系统的迁移是基于目标数据库中软件包的记录情况进行的。因此,操作系统会认为没有安装目标软件包,在迁移过程中对该目标软件包不作处理,这样操作系统在迁移过程中就不会因为目标软件包的兼容问题报错,使得操作系统可以正常完成迁移。最后,在迁移后的操作系统上安装兼容依赖包,保证目标软件包可以在新的操作系统上正常运行。Embodiments of the present application provide an operating system migration method, which deletes relevant information of the target software package from the target database before the operating system is migrated. Because the migration of the operating system is based on the records of the software packages in the target database. Therefore, the operating system will think that the target software package is not installed and will not process the target software package during the migration process. In this way, the operating system will not report errors due to compatibility issues with the target software package during the migration process, allowing the operating system to complete the migration normally. . Finally, install compatible dependency packages on the migrated operating system to ensure that the target software package can run normally on the new operating system.

一种可能的实现方式中,确定第一操作系统中的目标软件包,包括:获取待保留软件包;确定待保留软件包的依赖包;依赖包为支持待保留软件包在第一操作系统上运行的软件包;确定依赖包在第二操作系统上是否存在版本冲突;版本冲突用于指示第二操作系统中存在依赖包的不同版本;在存在版本冲突的情况下,确定待保留软件包为目标软件包。可以理解的是,针对用户需要保留的软件包,仅删选出存在兼容问题的待保留软件包进行后续处理,可以有效提高操作系统的迁移效率。In a possible implementation, determining the target software package in the first operating system includes: obtaining the software package to be retained; determining the dependent packages of the software package to be retained; and the dependent package to support the software package to be retained on the first operating system. Run the software package; determine whether the dependent package has a version conflict on the second operating system; the version conflict is used to indicate that there are different versions of the dependent package in the second operating system; in the case of a version conflict, determine whether the software package to be retained is Target package. It is understandable that for the software packages that users need to retain, only the software packages that have compatibility issues to be retained are deleted for subsequent processing, which can effectively improve the efficiency of operating system migration.

另一种可能的实现方式中,在第二操作系统上安装兼容依赖包之前,方法还包括:根据目标软件包的标识,从兼容依赖包集合中获取与目标软件包对应的兼容依赖包;兼容依赖包集合包括支持不升级软件包在第二操作系统上运行的软件包。可以理解的是,从事先配置的兼容依赖包集合中直接查询获取兼容依赖包并安装,可以极大提高迁移效率。In another possible implementation, before installing the compatible dependency package on the second operating system, the method further includes: obtaining the compatible dependency package corresponding to the target software package from the compatible dependency package collection according to the identification of the target software package; The dependency package collection includes software packages that support running on a second operating system without upgrading the software package. It is understandable that directly querying and installing compatible dependency packages from the pre-configured collection of compatible dependency packages can greatly improve migration efficiency.

又一种可能的实现方式中,在第二操作系统上安装兼容依赖包之前,方法还包括:根据目标软件包的标识,从兼容依赖包集合中获取与目标软件包对应的兼容依赖包;兼容依赖包集合包括支持不升级软件包在第二操作系统上运行的软件包。可以理解的是,对依赖包的包名进行更改,可以直接得到对应的兼容依赖包,对任何类型的软件包都适用,可以有效提高操作系统迁移方法的泛用性。In another possible implementation, before installing the compatible dependency package on the second operating system, the method further includes: obtaining the compatible dependency package corresponding to the target software package from the compatible dependency package collection according to the identification of the target software package; The dependency package collection includes software packages that support running on a second operating system without upgrading the software package. It is understandable that by changing the package name of a dependent package, you can directly obtain the corresponding compatible dependent package, which is applicable to any type of software package and can effectively improve the versatility of the operating system migration method.

又一种可能的实现方式中,在从目标数据库中删除目标软件包的相关信息之前,方法还包括:从目标数据库中获取目标软件包的相关信息;将目标软件包的相关信息备份至存储空间。可以理解的是,对相关信息进行备份,避免数据丢失,方便后续的数据恢复过程。In another possible implementation, before deleting the relevant information of the target software package from the target database, the method also includes: obtaining the relevant information of the target software package from the target database; and backing up the relevant information of the target software package to the storage space. . It is understandable that relevant information should be backed up to avoid data loss and facilitate the subsequent data recovery process.

又一种可能的实现方式中,在将所第一操作系统迁移至第二操作系统之后,方法还包括:从存储空间获取目标软件包的相关信息;将目标软件包的相关信息更新至目标数据库。可以理解的是,数据恢复后,目标数据库中重新记录有目标软件包的相关信息,使得用户后续在使用新的操作系统的过程中,可以方便地维护目标软件包。In another possible implementation, after migrating the first operating system to the second operating system, the method further includes: obtaining relevant information of the target software package from the storage space; and updating the relevant information of the target software package to the target database. . It is understandable that after the data is restored, the relevant information of the target software package is re-recorded in the target database, so that the user can easily maintain the target software package when using the new operating system.

又一种可能的实现方式中,方法还包括:将目标软件包与兼容依赖包的依赖关系,更新至目标数据库中目标软件包的相关信息中。In another possible implementation manner, the method further includes: updating the dependency relationship between the target software package and the compatible dependency package to the relevant information of the target software package in the target database.

又一种可能的实现方式中,目标数据库为Rpm数据库。In another possible implementation, the target database is the Rpm database.

又一种可能的实现方式中,方法还包括:在将第一操作系统迁移至所述第二操作系统过程中,对第一操作系统中的预定目录进行备份。In yet another possible implementation, the method further includes: during the process of migrating the first operating system to the second operating system, backing up a predetermined directory in the first operating system.

第二方面,本申请实施例提供一种操作系统迁移装置,该装置包括:确定模块、删除模块、迁移模块以及安装模块。确定模块用于,确定第一操作系统中的目标软件包;其中,目标软件包为第一操作系统在迁移至第二操作系统的过程中不升级且不兼容的软件包;删除模块用于,从目标数据库中删除目标软件包的相关信息;目标数据库用于记录第一操作系统中的各软件包在第一操作系统迁移前后的相关信息;迁移模块用于,基于目标数据库,将第一操作系统迁移至第二操作系统;安装模块用于,在第二操作系统上安装兼容依赖包;兼容依赖包用于支持目标软件包兼容运行于第二操作系统。In a second aspect, embodiments of the present application provide an operating system migration device, which includes: a determination module, a deletion module, a migration module, and an installation module. The determination module is used to determine the target software package in the first operating system; wherein the target software package is a software package that will not be upgraded and is incompatible with the first operating system during the migration to the second operating system; the deletion module is used to, Delete the relevant information of the target software package from the target database; the target database is used to record the relevant information of each software package in the first operating system before and after the migration of the first operating system; the migration module is used to, based on the target database, transfer the first operation The system is migrated to the second operating system; the installation module is used to install the compatible dependency package on the second operating system; the compatible dependency package is used to support the target software package to be compatible with the second operating system.

一种可能的实现方式中,确定模块具体用于,获取待保留软件包;确定待保留软件包的依赖包;依赖包为支持待保留软件包在第一操作系统上运行的软件包;确定依赖包在第二操作系统上是否存在版本冲突;版本冲突用于指示第二操作系统中存在依赖包的不同版本;在存在版本冲突的情况下,确定待保留软件包为目标软件包。In a possible implementation, the determination module is specifically used to obtain the software package to be retained; determine the dependent packages of the software package to be retained; the dependent packages are software packages that support the software package to be retained running on the first operating system; determine the dependencies Whether there is a version conflict of the package on the second operating system; the version conflict is used to indicate that there are different versions of the dependent package in the second operating system; if there is a version conflict, the software package to be retained is determined to be the target software package.

另一种可能的实现方式中,上述装置还包括:获取模块。获取模块用于,根据目标软件包的标识,从兼容依赖包集合中获取与目标软件包对应的兼容依赖包;兼容依赖包集合包括支持不升级软件包在第二操作系统上运行的软件包。In another possible implementation, the above device further includes: an acquisition module. The acquisition module is used to obtain the compatible dependency package corresponding to the target software package from the compatible dependency package set according to the identification of the target software package; the compatible dependency package set includes software packages that support running on the second operating system without upgrading the software package.

又一种可能的实现方式中,上述装置还包括:更改模块。获取模块还用于,获取支持目标软件包在第一操作系统上运行的依赖包;更改模块用于,将依赖包的包名进行更改,得到兼容依赖包。In another possible implementation manner, the above device further includes: a change module. The acquisition module is also used to obtain the dependency package that supports the target software package to run on the first operating system; the change module is used to change the package name of the dependency package to obtain a compatible dependency package.

又一种可能的实现方式中,上述装置还包括:备份模块。获取模块还用于,从目标数据库中获取目标软件包的相关信息;备份模块用于,将目标软件包的相关信息备份至存储空间。In another possible implementation manner, the above device further includes: a backup module. The acquisition module is also used to obtain the relevant information of the target software package from the target database; the backup module is used to back up the relevant information of the target software package to the storage space.

又一种可能的实现方式中,上述装置还包括:更新模块。获取模块还用于,从存储空间获取目标软件包的相关信息;更新模块用于,将目标软件包的相关信息更新至目标数据库。In another possible implementation manner, the above device further includes: an update module. The acquisition module is also used to obtain the relevant information of the target software package from the storage space; the update module is used to update the relevant information of the target software package to the target database.

又一种可能的实现方式中,更新模块还用于,将目标软件包与兼容依赖包的依赖关系,更新至目标数据库中目标软件包的相关信息中。In another possible implementation manner, the update module is also used to update the dependency relationship between the target software package and the compatible dependency package to the relevant information of the target software package in the target database.

又一种可能的实现方式中,目标数据库为Rpm数据库。In another possible implementation, the target database is the Rpm database.

又一种可能的实现方式中,备份模块还用于,在将第一操作系统迁移至第二操作系统过程中,对第一操作系统中的预定目录进行备份。In another possible implementation, the backup module is also used to back up a predetermined directory in the first operating system during the process of migrating the first operating system to the second operating system.

第三方面,本申请实施例提供一种计算设备,该计算设备包括处理器和存储器;处理器与存储器耦合;存储器用于存储计算机指令,计算机指令由处理器加载并执行以使计算设备实现上述第一方面的方法。In a third aspect, embodiments of the present application provide a computing device, which includes a processor and a memory; the processor is coupled to the memory; the memory is used to store computer instructions, and the computer instructions are loaded and executed by the processor to enable the computing device to implement the above The first approach.

第四方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质包括:计算机软件指令;当计算机软件指令在计算设备中运行时,使得计算设备实现上述第一方面的方法。In a fourth aspect, embodiments of the present application provide a computer-readable storage medium. The computer-readable storage medium includes: computer software instructions; when the computer software instructions are run in a computing device, the computing device implements the method of the first aspect. .

第五方面,本申请实施例提供一种计算机程序产品,当该计算机程序产品在计算设备上运行时,使得计算设备执行上述第一方面描述的相关方法的步骤,以实现上述第一方面的方法。In a fifth aspect, embodiments of the present application provide a computer program product. When the computer program product is run on a computing device, it causes the computing device to execute the steps of the related method described in the first aspect to implement the method in the first aspect. .

上述第二方面至第五方面的有益效果可以参考第一方面的对应描述,不再赘述。For the beneficial effects of the above second to fifth aspects, reference can be made to the corresponding descriptions of the first aspect and will not be described again.

附图说明Description of drawings

图1为本申请实施例提供的一种计算设备的组成示意图;Figure 1 is a schematic diagram of the composition of a computing device provided by an embodiment of the present application;

图2为本申请实施例提供的一种操作系统迁移过程中涉及的软件模块之间的交互示意图;Figure 2 is a schematic diagram of the interaction between software modules involved in an operating system migration process provided by an embodiment of the present application;

图3为本申请实施例提供的一种操作系统迁移方法的流程示意图;Figure 3 is a schematic flow chart of an operating system migration method provided by an embodiment of the present application;

图4为本申请实施例提供的另一种操作系统迁移方法的流程示意图;Figure 4 is a schematic flow chart of another operating system migration method provided by an embodiment of the present application;

图5为本申请实施例提供的另一种操作系统迁移方法的流程示意图;Figure 5 is a schematic flow chart of another operating system migration method provided by an embodiment of the present application;

图6为本申请实施例提供的另一种操作系统迁移方法的流程示意图;Figure 6 is a schematic flow chart of another operating system migration method provided by an embodiment of the present application;

图7为本申请实施例提供的一种操作系统迁移流程示意图;Figure 7 is a schematic diagram of an operating system migration process provided by an embodiment of the present application;

图8为本申请实施例提供的一种操作系统迁移装置的组成示意图;Figure 8 is a schematic diagram of the composition of an operating system migration device provided by an embodiment of the present application;

图9为本申请实施例提供的另一种计算设备的组成示意图。FIG. 9 is a schematic diagram of the composition of another computing device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.

需要说明的是,本申请实施例中,“示例性地”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性地”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性地”或者“例如”等词旨在以具体方式呈现相关概念。It should be noted that in the embodiments of this application, words such as "exemplarily" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "such as" in the embodiments of the present application is not to be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.

为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分,本领域技术人员可以理解“第一”、“第二”等字样并不是在对数量和执行次序进行限定。In order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as “first” and “second” are used to distinguish the same or similar items with basically the same functions and effects. Skilled persons can understand that words such as "first" and "second" do not limit the quantity and execution order.

下面对本申请实施例涉及到的技术术语进行解释说明。The technical terms involved in the embodiments of this application are explained below.

1、Rpm,红帽包管理器,英文全称为redhat package manager,是一种用来管理Linux各项套件的包管理器(软件程序),遵循GNU通用公共许可证(GNU general publiclicense,GPL)规则且功能强大方便。基于Rpm的套件管理方式,可以让Linux易于安装与升级,进而提升了Linux的适用度。1. Rpm, Red Hat package manager, the full English name is redhat package manager, is a package manager (software program) used to manage various Linux packages, following the rules of the GNU general public license (GPL) And it is powerful and convenient. The RPM-based package management method can make Linux easy to install and upgrade, thereby improving the applicability of Linux.

2、CentOS,社区企业操作系统,英文全称为community enterprise operatingsystem,是开源社区免费提供的服务器操作系统,为Linux发行版之一。2. CentOS, community enterprise operating system, the full English name is community enterprise operating system, is a server operating system provided for free by the open source community and is one of the Linux distributions.

3、依赖包,在操作系统中,依赖包指的是一个业务应用/程序运行所需的软件包/程序包。当一个业务应用依赖于其他程序或库文件的功能时,这些被依赖的程序或库文件就被称为依赖包。这些依赖包通常是一些动态库或静态库,可以为程序提供所需的函数、数据结构或算法等资源。例如,如果一个程序需要使用某个软件包中提供的函数来进行特定操作,那么这个软件包就是该程序的依赖包。3. Dependency package. In the operating system, dependency package refers to the software package/program package required to run a business application/program. When a business application depends on the functions of other programs or library files, these dependent programs or library files are called dependent packages. These dependency packages are usually some dynamic libraries or static libraries that can provide the required functions, data structures, algorithms and other resources for the program. For example, if a program needs to use functions provided in a certain software package to perform specific operations, then this software package is a dependency package of the program.

4、Dracut,一个可引导的随机存取存储器(random access memory,RAM)磁盘映像工具,它用于生成initramfs(初始RAM文件系统)。Initramfs是操作系统启动前加载到内存中的一个临时文件系统,作用是引导操作系统的正常启动。在Linux引导过程中,initramfs是一个临时的根文件系统,包含了在操作系统启动过程中需要的必要驱动程序和文件系统工具。这些必要驱动程序和文件系统工具可以帮助操作系统启动过程中识别和加载所需的设备驱动程序,并且可以让操作系统在启动后顺利进入到正常的运行模式。另外,Dracut还可以根据用户的需求,定制initramfs,从而满足用户特定的需求。例如,用户可以添加特定的驱动程序,以便在引导过程中使用。4. Dracut, a bootable random access memory (RAM) disk imaging tool, which is used to generate initramfs (initial RAM file system). Initramfs is a temporary file system loaded into the memory before the operating system starts. Its function is to guide the normal startup of the operating system. During the Linux boot process, initramfs is a temporary root file system that contains the necessary drivers and file system tools needed during the operating system startup process. These necessary drivers and file system tools can help the operating system identify and load the required device drivers during startup, and allow the operating system to smoothly enter normal operating mode after startup. In addition, Dracut can also customize the initramfs according to the user's needs to meet the user's specific needs. For example, users can add specific drivers to use during the boot process.

随着开源社区宣布停止对CentOS的服务,对于企业来说,CentOS停服将导致系统产品不演进、安全漏洞不解决等问题,给部署在现网服务器上的业务应用带来严重的安全隐患,进而给用户带来严重系统安全问题和业务连续性风险问题,甚至造成重大经济损失。因此,针对企业来说,需要进行操作系统的迁移到其他版本,保证业务应用的安全性与运行稳定性。As the open source community announced the cessation of services for CentOS, for enterprises, the suspension of CentOS will lead to problems such as system products not evolving and security vulnerabilities not being resolved, which will bring serious security risks to business applications deployed on live network servers. This in turn brings serious system security problems and business continuity risks to users, and even causes major economic losses. Therefore, for enterprises, it is necessary to migrate the operating system to other versions to ensure the security and operational stability of business applications.

操作系统的迁移不是简单的对操作系统的重新安装,而是需要针对操作系统及其上搭载的应用软件或业务系统进行替代、适配或升级,在实际工程实践中存在许多问题需要考虑,例如兼容性分析,复杂业务场景下业务完整性以及迁移效率等。其中,操作系统的迁移可以理解为将一种类型的操作系统更新为另一种类型的操作系统(如将CentOS等国外操作系统更新为国产操作系统如fusionOS),也可以理解为将操作系统由较低版本升级至较高版本。The migration of the operating system is not a simple reinstallation of the operating system, but requires the replacement, adaptation or upgrade of the operating system and the application software or business systems it carries. In actual engineering practice, there are many issues that need to be considered, such as Compatibility analysis, business integrity and migration efficiency in complex business scenarios, etc. Among them, operating system migration can be understood as updating one type of operating system to another type of operating system (such as updating foreign operating systems such as CentOS to domestic operating systems such as fusionOS), or it can also be understood as updating the operating system from Upgrade lower version to higher version.

对于业务应用来说,新版本的业务应用,会由于上线时间较短,存在测试不够全面的情况,反而不如旧版本的业务应用稳定。因此,在操作系统迁移过程中,往往伴随着对操作系统中安装的各类业务应用的升级。因此,为了保证现有业务应用的稳定性,用户常常会期望保留部分业务应用对应的软件包不进行升级。但是在这种情况下,操作系统迁移过程中容易存在迁移失败的问题。For business applications, the new version of the business application will not be as stable as the old version of the business application due to the short online time and insufficient comprehensive testing. Therefore, the operating system migration process is often accompanied by the upgrade of various business applications installed in the operating system. Therefore, in order to ensure the stability of existing business applications, users often expect to retain the software packages corresponding to some business applications without upgrading them. However, in this case, migration failure is likely to occur during the operating system migration process.

导致操作系统迁移失败的原因如下:操作系统的迁移过程中,若需要保留某个软件包(如称为目标软件包)不进行升级,则需要同时保留该目标软件包对应的依赖包不进行升级,该依赖包在新的操作系统中,可能存在版本冲突问题导致操作系统的迁移失败。例如,用户想要保留软件包nginx-1.18不进行升级,nginx-1.18的运行依赖于openssl-libs-1.0.2。但是新的操作系统中大部分软件依赖于openssl-libs-1.1.1,因此操作系统迁移的过程中自动安装版本为1.1.1的openssl-libs。但是同一个操作系统中不能同时存在同一软件包的不同版本,因此openssl-libs-1.0.2与openssl-libs-1.1.1冲突不可共存,导致操作系统迁移失败。The reasons for the failure of operating system migration are as follows: During the migration process of the operating system, if a certain software package (such as a target software package) needs to be retained without upgrading, the dependent packages corresponding to the target software package need to be retained without upgrading. , this dependency package may have version conflicts in the new operating system, causing the migration of the operating system to fail. For example, the user wants to keep the software package nginx-1.18 without upgrading. The operation of nginx-1.18 depends on openssl-libs-1.0.2. However, most software in the new operating system depends on openssl-libs-1.1.1, so the openssl-libs version 1.1.1 is automatically installed during the operating system migration process. However, different versions of the same software package cannot exist in the same operating system at the same time. Therefore, openssl-libs-1.0.2 and openssl-libs-1.1.1 conflict and cannot coexist, causing the operating system migration to fail.

另外,产生版本冲突的依赖包通常属于较为底层的软件包,如openssl-libs-1.1.1,新的操作系统上大部分软件都依赖于其才能正常运行。因此,在产生版本冲突问题时,无法通过常规的忽略手段或者对卸载该依赖包的手段以解决问题,因此会导致操作系统的迁移失败。In addition, dependency packages that cause version conflicts usually belong to relatively low-level software packages, such as openssl-libs-1.1.1, which most software on new operating systems depends on to run normally. Therefore, when a version conflict occurs, the problem cannot be solved by conventional means of ignoring or uninstalling the dependency package, which will cause the migration of the operating system to fail.

为解决版本冲突问题导致的操作系统迁移失败,用户只能采用重新部署业务应用的方式,这样无法保证业务数据的完整性,业务数据的恢复上可能存在问题。而且,业务应用的重新部署,花费时间也较长。In order to solve the operating system migration failure caused by version conflicts, users can only redeploy business applications. This cannot guarantee the integrity of business data and may cause problems in the recovery of business data. Moreover, the redeployment of business applications also takes a long time.

综上所述,目前亟需一种可以解决操作系统迁移后版本冲突问题,保证操作系统正常完成迁移的方案。To sum up, there is an urgent need for a solution that can solve the problem of version conflicts after operating system migration and ensure that the operating system completes the migration normally.

基于此,本申请实施例提供一种操作系统迁移方法,该方法在操作系统迁移之前,从目标数据库中删除目标软件包的相关信息。由于操作系统的迁移是基于目标数据库中软件包的记录情况进行的。因此,操作系统会认为没有安装目标软件包,在迁移过程中对该目标软件包不作处理,这样操作系统在迁移过程中就不会因为兼容问题报错,使得操作系统可以正常完成迁移。最后,在迁移后的操作系统上安装兼容依赖包,保证目标软件包可以在新的操作系统上正常运行。下面结合说明书附图,对本申请提供的实施例进行具体介绍。Based on this, embodiments of the present application provide an operating system migration method, which deletes relevant information of the target software package from the target database before the operating system is migrated. Because the migration of the operating system is based on the records of the software packages in the target database. Therefore, the operating system will think that the target software package is not installed and will not process the target software package during the migration process. In this way, the operating system will not report an error due to compatibility issues during the migration process, so that the operating system can complete the migration normally. Finally, install compatible dependency packages on the migrated operating system to ensure that the target software package can run normally on the new operating system. The embodiments provided in this application will be specifically introduced below in conjunction with the accompanying drawings of the description.

本申请实施例提供的技术方案可以应用于计算设备,该计算设备具体可以是刀片服务器、高密服务器、机架服务器或高性能服务器等。图1为计算设备的系统架构示意图,如图1所示,该计算设备的硬件包括处理器、带外控制器、存储器以及内存。软件包括带外管理模块以及操作系统(operating system,OS)。The technical solutions provided by the embodiments of this application can be applied to computing devices, which specifically can be blade servers, high-density servers, rack servers, or high-performance servers. Figure 1 is a schematic diagram of the system architecture of a computing device. As shown in Figure 1, the hardware of the computing device includes a processor, an out-of-band controller, a memory, and a memory. The software includes an out-of-band management module and an operating system (OS).

其中,带外管理模块运行于带外控制器内,OS运行于处理器(如图1所示)。Among them, the out-of-band management module runs in the out-of-band controller, and the OS runs on the processor (as shown in Figure 1).

其中,带外管理模块可以为非业务模块的管理单元。例如,带外管理模块可以通过专用的数据通道对计算设备进行远程维护和管理,该带外管理模块是完全独立于计算设备的操作系统之外,可以通过计算设备的带外管理接口与基本输入输出系统(basic inputoutput system,BIOS)和OS进行通信。Among them, the out-of-band management module may be a management unit of a non-service module. For example, the out-of-band management module can remotely maintain and manage the computing device through a dedicated data channel. The out-of-band management module is completely independent of the operating system of the computing device and can communicate with basic input through the out-of-band management interface of the computing device. The output system (basic input output system, BIOS) communicates with the OS.

示例性的,带外管理模块可以包括计算设备运行状态的管理单元、处理器外的管理芯片中的管理系统、计算设备基板管理控制器(baseboard management controller,BMC)、系统管理模块(system management mode,SMM)等。需要说明的,本申请实施例对带外管理模块的具体形式并不限定,以上仅为示例性说明。Exemplarily, the out-of-band management module may include a management unit for the operating status of the computing device, a management system in a management chip outside the processor, a computing device baseboard management controller (BMC), a system management mode ,SMM) etc. It should be noted that the embodiment of the present application does not limit the specific form of the out-of-band management module, and the above is only an exemplary description.

内存,也称为内存储器或主存储器,安装在计算设备的主板上的内存插槽中,内存与内存控制器之间通过内存通道(channel)进行通信。内存具有至少一个内存列(rank),每个内存列分别位于内存的一个面上,每个内存列包括至少一个子内存列(subrank),内存列或子内存列包括多个内存芯片(device),每个内存芯片被划分为多个存储阵列组(bankgroup),每个存储阵列组包括多个存储阵列(bank),每个存储阵列划分为多个存储单元(cell),每个存储单元具有一个行(row)地址和一个列(column)地址,每个存储单元包括一个或多个比特位。在一种划分方式中,内存从上级至下级可以依次划分为内存芯片、存储阵列组、存储阵列,存储行/存储列、存储单元、比特位,其中,内存颗粒、存储阵列组、存储阵列、存储行、存储了列、存储单元、比特位在内存上的地址为真实的物理地址。在另一种划分方式中,CPU基于分页机制将内存芯片划分为多个内存页(page),其中,内存页的地址为虚拟地址,虚拟地址需要转换后才会变为真实的物理地址。Memory, also known as internal memory or main memory, is installed in a memory slot on the motherboard of a computing device, and communicates with the memory controller through a memory channel. The memory has at least one memory rank (rank). Each memory rank is located on one side of the memory. Each memory rank includes at least one sub-memory rank (subrank). The memory rank or sub-memory rank includes multiple memory chips (device). , each memory chip is divided into multiple storage array groups (bankgroup), each storage array group includes multiple storage arrays (banks), each storage array is divided into multiple storage units (cells), each storage unit has A row address and a column address, each storage unit includes one or more bits. In one division method, memory can be divided into memory chips, storage array groups, storage arrays, storage rows/storage columns, storage units, and bits from upper level to lower level. Among them, memory particles, storage array groups, storage arrays, The addresses of storage rows, columns, storage units, and bits in the memory are real physical addresses. In another way of dividing, the CPU divides the memory chip into multiple memory pages (pages) based on the paging mechanism. The address of the memory page is a virtual address, and the virtual address needs to be converted before it becomes a real physical address.

存储器,可以是计算设备上配备的插接式硬盘,智能存储卡(smart media card,SMC),安全数字(secure digital,SD)卡,闪存卡(flash card)等,也可以是外部存储设备,例如U盘等。The memory can be a plug-in hard drive, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computing device, or it can be an external storage device. For example, U disk, etc.

在本申请实施例中,用户可以在存储器中预装操作系统迁移软件,用于进入预装环境,使得用户对计算设备上原有的操作系统进行迁移。In this embodiment of the present application, the user can pre-install operating system migration software in the memory to enter the pre-installation environment, allowing the user to migrate the original operating system on the computing device.

需要说明的,本申请实施例描述的系统架构以及应用场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。It should be noted that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those of ordinary skill in the art will know that , with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

图2为本申请实施例提供的一种操作系统迁移过程中涉及的软件模块之间的交互示意图。如图2所示,包括两大部分,一为待迁移的操作系统(即进行迁移前的操作系统),二为迁移平台,即执行本申请实施例提供的操作系统迁移方法的软件模块。Figure 2 is a schematic diagram of the interaction between software modules involved in an operating system migration process provided by an embodiment of the present application. As shown in Figure 2, it includes two parts, one is the operating system to be migrated (that is, the operating system before migration), and the other is the migration platform, that is, the software module that executes the operating system migration method provided by the embodiment of the present application.

其中,待迁移操作系统中包括最底层的操作系统内核,操作系统文件系统,以及安装在操作系统中的各类软件包(软件包1-n)。其中,操作系统文件系统中还安装有Rpm数据库(Rpmdb),该Rpm数据库用于记录操作系统中各软件的相关信息。相关信息包括软件包的名称、版本(version)、依赖信息(requires)、配置文件以及该软件包的修改历史记录等。Among them, the operating system to be migrated includes the lowest-level operating system kernel, operating system file system, and various software packages (software packages 1-n) installed in the operating system. Among them, the Rpm database (Rpmdb) is also installed in the operating system file system, and the Rpm database is used to record relevant information of each software in the operating system. Relevant information includes the name, version, dependency information (requires), configuration file, and modification history of the software package.

其中,迁移平台包括用户界面管理模块,核心功能模块以及公共模块。用户界面管理模块用于提供操作系统迁移相关操作的操作界面,方便用户进行交互。核心功能模块用于实现操作系统迁移时的相关功能。公共模块用于负责一些常规功能。Among them, the migration platform includes user interface management module, core function module and public module. The user interface management module is used to provide an operation interface for operations related to operating system migration to facilitate user interaction. The core function module is used to implement related functions during operating system migration. Public modules are responsible for some general functions.

核心功能模块具体包括:兼容性分析模块、备份模块、迁移模块以及回退模块。兼容性分析模块用于通过分析应用二进制接口(application binary interface,ABI)变化,软件包版本变化、软件包依赖变化、硬件兼容性等信息,来分析操作系统整体差异以及软件包是否存在冲突问题。备份模块用于使用本地或远端备份等方法,对关键数据进行备份。迁移模块用于通过yum(yellow dog updater)管理工具或者dnf(dandified yum)管理工具,结合兼容性分析结果,制定对应策略,对软件包进行卸载保留升级转换等操作,完成操作系统的整体迁移。回退模块用于通过dracut构建回退专用的initramfs和vmlinux并依赖备份文件进行关键目录回退,来实现操作系统的回退。The core functional modules specifically include: compatibility analysis module, backup module, migration module and rollback module. The compatibility analysis module is used to analyze the overall differences in operating systems and whether there are conflicts in software packages by analyzing changes in application binary interface (ABI), software package version changes, software package dependency changes, hardware compatibility and other information. The backup module is used to back up critical data using local or remote backup methods. The migration module is used to use the yum (yellow dog updater) management tool or the dnf (dandified yum) management tool, combined with the compatibility analysis results, to formulate corresponding strategies, uninstall, retain, upgrade, and convert software packages to complete the overall migration of the operating system. The rollback module is used to build rollback-specific initramfs and vmlinux through dracut and rely on backup files for key directory rollback to implement operating system rollback.

另外,核心功能模块还包括:保留包迁移分析模块。该模块用于执行从Rpm数据库中将目标软件包的所有信息删除,并告知迁移模块执行迁移任务。In addition, the core functional modules also include: retained package migration analysis module. This module is used to delete all information of the target software package from the Rpm database and inform the migration module to perform migration tasks.

公共模块具体包括:日志模块、用户管理模块以及部署模块。日志模块用于负责迁移平台运行过程中日志的生成与集中管理。用户管理模块用于管理用户的注册、登录等相关功能。部署模块用于负责各种软件包的安装与卸载等。The public modules specifically include: log module, user management module and deployment module. The log module is responsible for the generation and centralized management of logs during the operation of the migration platform. The user management module is used to manage user registration, login and other related functions. The deployment module is responsible for the installation and uninstallation of various software packages.

在本申请实施例中,在操作系统迁移的场景中,用户可以选择待迁移操作系统中需要保留的软件包(即不升级的软件包)。(1)、迁移平台中兼容性分析模块针对需要保留的软件包进行兼容性分析,分析出所有不兼容包,即目标软件包。保留包迁移分析模块根据兼容性分析模块确定出的目标软件包,(2)、从Rpm数据库删除与目标软件包相关的所有信息(删除前进行数据备份)。然后,(3)、保留包迁移分析模块通知迁移模块对待升级操作系统进行整体迁移。In the embodiment of this application, in the scenario of operating system migration, the user can select the software packages that need to be retained in the operating system to be migrated (that is, the software packages that are not upgraded). (1) The compatibility analysis module in the migration platform performs compatibility analysis on the software packages that need to be retained, and analyzes all incompatible packages, that is, the target software packages. Keep the target software package determined by the package migration analysis module based on the compatibility analysis module. (2) Delete all information related to the target software package from the Rpm database (make a data backup before deletion). Then, (3), the retention package migration analysis module notifies the migration module to perform overall migration of the operating system to be upgraded.

可选的,在迁移过程中,备份模块可以对待迁移操作系统中的操作系统关键目录进行备份,保存在备份目录中。在有需要的时候,回退模块可以基于备份目录中的备份进行操作系统的回退(如图2中虚线部分所示)。Optionally, during the migration process, the backup module can back up the key operating system directories in the operating system to be migrated and save them in the backup directory. When necessary, the rollback module can roll back the operating system based on the backup in the backup directory (as shown in the dotted line in Figure 2).

图3为本申请实施例提供的一种操作系统迁移方法的流程示意图。示例性的,本申请实施例提供的操作系统迁移方法,可以应用于图1的计算设备,或者图2所示的迁移平台中,下面以计算设备为执行主体为例进行说明。Figure 3 is a schematic flowchart of an operating system migration method provided by an embodiment of the present application. Illustratively, the operating system migration method provided by the embodiment of the present application can be applied to the computing device in Figure 1 or the migration platform shown in Figure 2. The following description takes the computing device as the execution subject as an example.

如图3所示,本申请实施例提供的操作系统迁移方法具体可以包括以下步骤:As shown in Figure 3, the operating system migration method provided by the embodiment of the present application may specifically include the following steps:

S301、确定第一操作系统中的目标软件包。S301. Determine the target software package in the first operating system.

其中,第一操作系统为待迁移操作系统。Among them, the first operating system is the operating system to be migrated.

其中,目标软件包为第一操作系统在迁移至第二操作系统的过程中不升级的软件包;且目标软件在所述第一操作系统运行所依赖的软件包在第二操作系统中不兼容。Among them, the target software package is a software package that will not be upgraded during the migration of the first operating system to the second operating system; and the software package that the target software relies on to run in the first operating system is incompatible in the second operating system. .

应理解,如背景技术的描述,操作系统在迁移过程中,若用户需要保留某个软件包,则需要保留该软件包的依赖包。但是这些依赖包在新的操作系统(第二操作系统)上会与其他的软件包冲突,这就说明在迁移过程中目标软件包存在兼容问题。It should be understood that, as described in the background art, during the migration process of the operating system, if the user needs to retain a certain software package, the dependent packages of the software package need to be retained. However, these dependent packages will conflict with other software packages on the new operating system (second operating system), which means that there are compatibility issues with the target software packages during the migration process.

可选的,上述S301可以实现为如下步骤a-步骤d:步骤a、获取待保留软件包。步骤b、确定待保留软件包的依赖包;依赖包为支持待保留软件包在第一操作系统上运行的软件包。步骤c、确定依赖包在第二操作系统上是否存在版本冲突,版本冲突用于指示第二操作系统中存在依赖包的不同版本。步骤d、在存在版本冲突的情况下,确定待保留软件包为目标软件包。可以理解的是,针对用户需要保留的软件包,仅删选出存在兼容问题的待保留软件包进行后续处理,可以有效提高操作系统的迁移效率。Optionally, the above S301 can be implemented as the following steps a-step d: Step a. Obtain the software package to be retained. Step b: Determine the dependent packages of the software package to be retained; the dependent packages are software packages that support the software package to be retained running on the first operating system. Step c: Determine whether there is a version conflict of the dependent package on the second operating system. The version conflict is used to indicate that different versions of the dependent package exist in the second operating system. Step d. If there is a version conflict, determine the software package to be retained as the target software package. It is understandable that for the software packages that users need to retain, only the software packages that have compatibility issues to be retained are deleted for subsequent processing, which can effectively improve the efficiency of operating system migration.

示例性的,计算设备可以获取用户输入的需要保留的软件包的标识,针对每个待保留软件包,计算设备可以确定第一操作系统中,支持待保留软件包运行的依赖包。进一步的,计算设备确定第二操作系统中,是否已经存在与该依赖包类型相同(包名一致)但是版本不同的软件包。若存在,则确定该依赖包在第二操作系统上存在版本冲突,则该依赖包对应的待保留软件包是与第二操作系统不兼容的,会导致后续操作系统迁移失败的目标软件包。For example, the computing device can obtain the identifier of the software package that needs to be retained input by the user, and for each software package to be retained, the computing device can determine the dependent package in the first operating system that supports the running of the software package to be retained. Further, the computing device determines whether a software package of the same type (same package name) but different version as the dependent package already exists in the second operating system. If it exists, it is determined that the dependent package has a version conflict on the second operating system, and the software package to be retained corresponding to the dependent package is a target software package that is incompatible with the second operating system and will cause subsequent operating system migration to fail.

应理解,若待保留软件包中不存在兼容问题,则不会存在导致操作系统迁移失败的问题,It should be understood that if there are no compatibility issues in the software packages to be retained, there will be no problems that will cause the operating system migration to fail.

S302、从目标数据库中删除目标软件包的相关信息。S302. Delete the relevant information of the target software package from the target database.

其中,目标数据库用于记录第一操作系统中各软件包在第一操作系统迁移前后的相关信息。例如,如图7中在迁移前,目标数据库记录第一操作系统中软件包的相关信息,以及迁移后,目标数据库记录第二操作系统中软件包的相关信息。The target database is used to record relevant information of each software package in the first operating system before and after migration of the first operating system. For example, as shown in Figure 7, before migration, the target database records relevant information of software packages in the first operating system, and after migration, the target database records relevant information of software packages in the second operating system.

应理解,目标数据库记录有当前操作系统中各软件包的相关信息。操作系统在迁移过程中,是基于目标数据库所记录的软件包名单,进行迁移的。因此,在本申请实施例中,计算设备可以根据目标软件包的标识,从目标数据库中查询确定目标软件包的相关信息,并将这些相关信息从目标数据库中删除,这样可以保证后续操作系统迁移过程中忽略目标软件包进行迁移。It should be understood that the target database records relevant information of each software package in the current operating system. During the migration process, the operating system is migrated based on the list of software packages recorded in the target database. Therefore, in this embodiment of the present application, the computing device can query and determine the relevant information of the target software package from the target database according to the identification of the target software package, and delete the relevant information from the target database, thus ensuring subsequent operating system migration. The target software package is ignored during migration.

示例性的,目标数据库中记录的目标软件包的相关信息,可以包括version(版本)、requires(依赖)、provides(提供)、files(文件)、conflicts(冲突)、obsoletes(过时)、spec等信息。其中,version指代软件包的版本号。它通常是一个字符串,例如“1.0.0”,表示这是软件包的1.0.0版本。requires列出了该软件包运行所依赖的其他软件包或系统组件,即一个软件包可能需要特定版本的另一个软件包才能运行。provides指明该软件包提供了哪些其他软件包所需要的功能,这使得其他软件可以通过查询这个软件包来找到他们需要的依赖项。也就是说,provides可以指出该软件包可以作为其他哪些软件包的依赖包使用。files列出了该软件包安装的文件列表,这可能包括二进制文件、配置文件、文档等等。conflicts列出了与该软件包不兼容的其他软件包。通常情况下,如果同时也安装了这些冲突的软件包,可能会导致问题或者冲突。obsoletes表示如果这个软件包被安装,那么操作系统中的其他某个软件包就会被标记为过时或者不再需要。spec通常是指一个特定的规范或者标准文件,用于描述如何构建和打包软件程序。在大多Linux发行版中,spec文件用于描述如何构建Rpm包。这个文件包含了各种元数据以及构建所需的指令和脚本。For example, the relevant information of the target software package recorded in the target database may include version, requires, provides, files, conflicts, obsoletes, spec, etc. information. Among them, version refers to the version number of the software package. It is usually a string such as "1.0.0", indicating that this is the 1.0.0 version of the package. requires lists other software packages or system components that the software package depends on to run, that is, a software package may require a specific version of another software package to run. provides specifies which functions the package provides that are required by other packages, allowing other software to query this package to find the dependencies they need. In other words, provides can indicate which other software packages the package can use as a dependency package. files lists the files installed by the package, which may include binaries, configuration files, documentation, etc. conflicts lists other packages that are incompatible with this package. Often, if these conflicting packages are also installed, it can cause problems or conflicts. obsoletes means that if this package is installed, then some other package in the operating system will be marked as obsolete or no longer needed. A spec usually refers to a specific specification or standards document that describes how to build and package software programs. In most Linux distributions, spec files are used to describe how to build RPM packages. This file contains various metadata as well as instructions and scripts required for the build.

可选的,目标数据库为Rpm数据库。Rpm数据库中能够记录关于软件包及其文件的各种信息,Rpm包管理器对软件包的管理是基于Rpm数据库进行的。Optional, the target database is the Rpm database. The Rpm database can record various information about software packages and their files. The Rpm package manager manages software packages based on the Rpm database.

S303、基于目标数据库,将第一操作系统迁移至第二操作系统。S303. Migrate the first operating system to the second operating system based on the target database.

在本申请实施例中,在从目标数据库中删除目标软件包的相关信息后,可以基于删除后的目标数据库,进行操作系统的迁移,将当前的第一操作系统迁移至第二操作系统。In this embodiment of the present application, after the relevant information of the target software package is deleted from the target database, the operating system can be migrated based on the deleted target database, and the current first operating system can be migrated to the second operating system.

可选的,可以通过yum工具或者dnf工具,实现操作系统的迁移过程。Optionally, you can use the yum tool or the dnf tool to implement the operating system migration process.

可以理解的是,上述S302中将目标数据库中目标软件包的相关信息删除(目标软件包的实际运行文件仍然存留在计算设备中),由于操作系统的迁移是基于目标数据库中所记录的软件包名单进行的,这样在操作系统迁移过程中,计算设备不会对目标软件包进行处理。也就是说,在操作系统迁移过程中,计算设备会认为目标软件包没有安装,相当于绕过该目标软件包进行迁移,这样就不会因为目标软件包所存在的兼容问题导致迁移失败而产生报错或告警,即实现操作系统可以正常完成迁移。It can be understood that in the above S302, the relevant information of the target software package in the target database is deleted (the actual running file of the target software package still exists in the computing device), because the migration of the operating system is based on the software package recorded in the target database. Listing is performed so that the target package is not processed by the computing device during the operating system migration process. That is to say, during the operating system migration process, the computing device will think that the target software package is not installed, which is equivalent to bypassing the target software package for migration. In this way, migration failure will not occur due to compatibility issues in the target software package. If an error or alarm is reported, the operating system can complete the migration normally.

S304、在第二操作系统上安装兼容依赖包。S304. Install compatible dependency packages on the second operating system.

其中,兼容依赖包用于支持目标软件包兼容运行于第二操作系统。Among them, the compatibility dependency package is used to support the target software package to be compatible with the second operating system.

应理解,通过删除目标数据库中目标软件包的相关信息,可以实现绕过目标软件包,保证操作系统正常迁移完成。但是,对于目标软件包来说,是无法在迁移后的操作系统(第二操作系统)上正常运行的,因为缺少必要的依赖包支持其运行。因为目标软件包的依赖包可能随着操作系统的迁移也进行了升级(如目标软件包nginx-1.18依赖于openssl-libs-1.0.2,但是操作系统迁移后openssl-libs-1.0.2也会随之升级到openssl-libs-1.1.1)。因此,为了保证目标软件包的正常运行,可以在第二操作系统上安装支持目标软件包运行的兼容依赖包,解决目标软件包的运行问题。It should be understood that by deleting the relevant information of the target software package in the target database, the target software package can be bypassed and the normal migration of the operating system can be completed. However, the target software package cannot run normally on the migrated operating system (second operating system) because it lacks the necessary dependency packages to support its operation. Because the dependent packages of the target software package may have been upgraded with the migration of the operating system (for example, the target software package nginx-1.18 depends on openssl-libs-1.0.2, but after the operating system is migrated, openssl-libs-1.0.2 will also Subsequently upgraded to openssl-libs-1.1.1). Therefore, in order to ensure the normal operation of the target software package, a compatible dependency package that supports the operation of the target software package can be installed on the second operating system to solve the operation problem of the target software package.

一种实现方式中,在S304之前,计算设备可以通过如下方式获取兼容依赖包:根据目标软件包的标识,从兼容依赖包集合中查询与目标软件包对应的兼容依赖包。该兼容依赖包集合包括支持不升级软件包在第二操作系统上运行的软件包。In one implementation, before S304, the computing device can obtain the compatible dependency package in the following manner: according to the identifier of the target software package, query the compatible dependency package corresponding to the target software package from the compatible dependency package collection. The set of compatible dependency packages includes software packages that support running on a second operating system without upgrading the software package.

可以理解的是,计算设备可以预先配置各类软件包在第二操作系统上运行所使用的兼容依赖包集合。该兼容依赖包集合可以存储在本地(如计算设备上),也可以存储在网络侧。当操作系统迁移完成后,计算设备可以从兼容依赖包集合中查询目标软件包对应的兼容依赖包,并在第二操作系统上安装该兼容依赖包,实现支持目标软件包在第二操作系统上的正常运行。从事先配置的兼容依赖包集合中直接查询获取兼容依赖包并安装的方式,可以极大提高迁移效率。It can be understood that the computing device can be pre-configured with a set of compatible dependency packages used by various software packages to run on the second operating system. The set of compatible dependency packages can be stored locally (such as on a computing device) or on the network side. After the operating system migration is completed, the computing device can query the compatible dependency package corresponding to the target software package from the compatible dependency package collection, and install the compatible dependency package on the second operating system to support the target software package on the second operating system. of normal operation. Directly query and install compatible dependency packages from the pre-configured collection of compatible dependency packages, which can greatly improve migration efficiency.

另一种实现方式中,在S304之前,计算设备还可以通过如下方式获取兼容依赖包:步骤a、获取支持目标软件包在第一操作系统上运行的依赖包;步骤b、将依赖包的包名进行更改,得到兼容依赖包。In another implementation, before S304, the computing device can also obtain the compatible dependency package in the following manner: step a, obtain the dependency package that supports the target software package to run on the first operating system; step b, transfer the dependency package of the dependency package to Change the name to get compatible dependency packages.

可以理解的是,如前所述,依赖包存在版本冲突问题,是因为同一个操作系统上同时存在同类软件包的不同版本。也就是说,目标软件包(例如nginx-1.18)在第二操作系统上运行,需要旧版本的依赖包(例如openssl-libs-1.0.2)支持,但是第二操作系统会默认安装新版本的依赖包(openssl-libs-1.1.1),在这种情况下,是无法在第二操作系统上重新安装旧版本的依赖包的。因此,计算设备可以将旧版本的依赖包的包名进行更改(例如将openssl-libs-1.0.2更改为compat-openssl-libs-1.0.2)得到兼容依赖包后安装,这样,对于计算设备或者操作系统来说,会认为包名修改后的依赖包是现有操作系统中没有的,新类型的软件包,因此在安装过程中就不会报版本冲突的问题。容易理解的是,该兼容依赖包的本质与旧版本的依赖包是一致的(功能一致),仅仅是包名存在不同。这种对依赖包的包名进行更改的方式,可以直接得到对应的兼容依赖包,对任何类型的软件包都适用,可以有效提高操作系统迁移方法的泛用性。It is understandable that, as mentioned before, dependent packages have version conflicts because different versions of similar software packages exist on the same operating system. In other words, the target software package (such as nginx-1.18) needs to be supported by the old version of the dependent package (such as openssl-libs-1.0.2) when running on the second operating system, but the second operating system will install the new version by default. Dependent package (openssl-libs-1.1.1), in this case, the old version of the dependent package cannot be reinstalled on the second operating system. Therefore, the computing device can change the package name of the old version of the dependent package (for example, change openssl-libs-1.0.2 to compat-openssl-libs-1.0.2) and install it after obtaining the compatible dependent package. In this way, for the computing device Or the operating system will think that the dependent package after the package name is modified is a new type of software package that is not found in the existing operating system, so no version conflicts will be reported during the installation process. It is easy to understand that the essence of this compatible dependency package is consistent with the old version of the dependency package (the functions are the same), only the package name is different. This method of changing the package name of a dependent package can directly obtain the corresponding compatible dependent package, which is applicable to any type of software package and can effectively improve the versatility of the operating system migration method.

其中,计算设备获取目标软件包在第一操作系统上运行的依赖包,可以是在操作系统迁移前事先获取并保存起来的方式。也可以是在操作系统迁移后,计算设备从网络上临时下载对应的依赖包,进一步修改包名得到兼容依赖包。本申请实施例对此不作具体限制。Wherein, the computing device obtains the dependency package of the target software package running on the first operating system, which may be obtained and saved in advance before the operating system is migrated. It may also be that after the operating system is migrated, the computing device temporarily downloads the corresponding dependency package from the network, and further modifies the package name to obtain a compatible dependency package. The embodiments of the present application do not specifically limit this.

如前所述,目标数据库用于记录第一操作系统中的各软件包在第一操作系统迁移前后的相关信息,后续对于迁移后的操作系统中各软件包的管理(例如升级、变更、卸载等操作)也是依赖于目标数据库进行的。但是,由于目标数据库中已经没有目标软件包的相关信息,这样不方便后续对目标软件包的管理与后续维护。As mentioned above, the target database is used to record the relevant information of each software package in the first operating system before and after the migration of the first operating system, and to subsequently manage each software package in the migrated operating system (such as upgrade, change, uninstallation). etc.) are also performed depending on the target database. However, since there is no relevant information about the target software package in the target database, it is inconvenient for subsequent management and maintenance of the target software package.

因此,结合图3,如图4所示,本申请实施例提供的操作系统迁移方法,还包括如下:Therefore, in conjunction with Figure 3, as shown in Figure 4, the operating system migration method provided by the embodiment of the present application also includes the following:

S401、从目标数据库中获取目标软件包的相关信息。S401. Obtain relevant information of the target software package from the target database.

S402、将目标软件包的相关信息备份至存储空间。S402. Back up the relevant information of the target software package to the storage space.

上述S401和S402,可以在上述S302之前执行。即在将目标软件包的相关信息从目标数据库中删除之前,计算设备可以从目标数据库中查询获取目标软件包的相关信息,并做备份后保存起来,便于后续做数据恢复。其中,备份保存的存储空间可以是计算设备本地的存储空间,也可以是网络侧的存储空间,本申请实施例对此不作具体限定。The above S401 and S402 can be executed before the above S302. That is, before deleting the relevant information of the target software package from the target database, the computing device can query and obtain the relevant information of the target software package from the target database, make a backup and save it to facilitate subsequent data recovery. The storage space for backup saving may be a local storage space of the computing device or a storage space on the network side, which is not specifically limited in the embodiment of the present application.

结合图3,如图5所示,在S303中操作系统迁移完成后,本申请实施例提供的操作系统迁移方法,还包括如下:Combined with Figure 3, as shown in Figure 5, after the operating system migration is completed in S303, the operating system migration method provided by the embodiment of the present application also includes the following:

S403、从存储空间获取目标软件包的相关信息。S403. Obtain relevant information of the target software package from the storage space.

S404、将目标软件包的相关信息更新至目标数据库。S404. Update relevant information of the target software package to the target database.

对于上述S403和S404,在操作系统迁移完成后,计算设备可以从存储空间中获取目标软件包的相关信息,并将该相关信息更新恢复至目标数据库。这样,目标数据库中重新记录有目标软件包的相关信息,使得用户后续在使用新的操作系统的过程中,可以方便地维护目标软件包。For the above S403 and S404, after the operating system migration is completed, the computing device can obtain the relevant information of the target software package from the storage space, and update and restore the relevant information to the target database. In this way, the relevant information of the target software package is re-recorded in the target database, so that the user can easily maintain the target software package when using the new operating system.

另外,目标数据库中还记录有每个软件包的依赖关系(requires),即一个软件包的运行需要哪些依赖包的支持。因此,结合图3,如图6所示,本申请实施例提供的操作系统迁移方法,还包括如下:In addition, the target database also records the dependencies (requires) of each software package, that is, which dependent packages are required to run a software package. Therefore, in conjunction with Figure 3, as shown in Figure 6, the operating system migration method provided by the embodiment of the present application also includes the following:

S305、将目标软件包与兼容依赖包的依赖关系,更新至目标数据库中目标软件包的相关信息中。S305. Update the dependency relationship between the target software package and the compatible dependent package to the relevant information of the target software package in the target database.

其中,依赖关系用于反映支持目标软件包运行的软件包,与目标软件包的关联关系。Among them, the dependency relationship is used to reflect the relationship between the software package that supports the operation of the target software package and the target software package.

上述S305可以在上述S304之后执行。应理解,在本申请实施例中,计算设备备份的是目标软件包运行在第一操作系统时的相关信息。在操作系统迁移完成后,目标软件包的依赖关系已经发生了变化,因此通过备份恢复后的相关信息中,软件包的依赖关系并不是最新的。因此,在第二操作系统上安装兼容依赖包后,计算设备可以将目标软件包与兼容依赖包的依赖关系,更新至目标数据库,便于用户在后续使用操作系统的过程中,对目标软件包的依赖关系进行维护。The above S305 may be executed after the above S304. It should be understood that in this embodiment of the present application, the computing device backs up relevant information when the target software package runs on the first operating system. After the operating system migration is completed, the dependencies of the target software package have changed, so the dependencies of the software package are not the latest in the relevant information after backup and restoration. Therefore, after installing the compatible dependency package on the second operating system, the computing device can update the dependency relationship between the target software package and the compatible dependency package to the target database, so that the user can update the target software package during subsequent use of the operating system. Dependencies are maintained.

可选的,本申请实施例提供的操作系统迁移方法还包括如下S306。Optionally, the operating system migration method provided by the embodiment of this application also includes the following S306.

S306、在将第一操作系统迁移至所述第二操作系统过程中,对第一操作系统中的预定目录进行备份。S306. During the process of migrating the first operating system to the second operating system, back up the predetermined directory in the first operating system.

应理解,预定目录用于保存第一操作系统的核心文件。对预定目录进行备份,可以方便后续在迁移后的第二操作系统出现问题无法运行时,进行操作系统的回退,保证迁移方案的容错性。It should be understood that the predetermined directory is used to save core files of the first operating system. Backing up the predetermined directory can facilitate subsequent operating system rollback when the second operating system after migration encounters problems and cannot run, ensuring the fault tolerance of the migration plan.

下面结合具体的示例,对本申请实施例提供的操作系统迁移方法进行完整的说明。图7为本申请实施例提供的一种操作系统迁移流程示意图,如图7所示。首先,确定nginx1.0为需要保留的目标软件包,1、获取其在Rpm数据库中对应的相关信息进行备份后,2、从Rpm数据库中删除这些相关信息。进一步的,3、基于删除后的Rpm数据库进行操作系统迁移,其中,操作系统中大部分软件包也随之升级至新的版本。如aaa.1.0升级到aaa.3.0,httpd.1.0升级到httpd.2.0,openssl-libs-1.0.2升级到openssl-libs-1.1.1等等。但是,目标软件包还是nginx1.0,版本没有随之更新。然后,4、将备份的信息恢复至Rpm数据库。进一步的,在迁移后的操作系统上,5、安装兼容依赖包compat-openssl-libs-1.0.2,支持nginx1.0的正常运行。至此,操作系统迁移完成。The following is a complete description of the operating system migration method provided by the embodiments of the present application with reference to specific examples. Figure 7 is a schematic diagram of an operating system migration process provided by an embodiment of the present application, as shown in Figure 7 . First, determine nginx1.0 as the target software package that needs to be retained. 1. Obtain its corresponding relevant information in the Rpm database and back it up. 2. Delete the relevant information from the Rpm database. Further, 3. Migrate the operating system based on the deleted Rpm database, in which most software packages in the operating system are also upgraded to new versions. For example, aaa.1.0 is upgraded to aaa.3.0, httpd.1.0 is upgraded to httpd.2.0, openssl-libs-1.0.2 is upgraded to openssl-libs-1.1.1, etc. However, the target software package is still nginx1.0, and the version has not been updated accordingly. Then, 4. Restore the backed up information to the Rpm database. Further, on the migrated operating system, 5. Install the compatible dependency package compat-openssl-libs-1.0.2 to support the normal operation of nginx1.0. At this point, the operating system migration is completed.

本申请实施例提供一种操作系统迁移方法,该方法在操作系统迁移之前,从目标数据库中删除目标软件包的相关信息。由于操作系统的迁移是基于目标数据库中软件包的记录情况进行的。因此,操作系统会认为没有安装目标软件包,在迁移过程中对该目标软件包不作处理,这样操作系统在迁移过程中就不会因为兼容问题报错,使得操作系统可以正常完成迁移。最后,在迁移后的操作系统上安装兼容依赖包,保证目标软件包可以在新的操作系统上正常运行。Embodiments of the present application provide an operating system migration method, which deletes relevant information of the target software package from the target database before the operating system is migrated. Because the migration of the operating system is based on the records of the software packages in the target database. Therefore, the operating system will think that the target software package is not installed and will not process the target software package during the migration process. In this way, the operating system will not report an error due to compatibility issues during the migration process, so that the operating system can complete the migration normally. Finally, install compatible dependency packages on the migrated operating system to ensure that the target software package can run normally on the new operating system.

进一步的,在删除相关信息之前,还对相关信息进行备份,便于操作系统迁移完成后恢复至目标数据库,方便后续对软件包的管理与维护。另外,将兼容依赖包与目标软件包的依赖关系更新至目标数据库,可以进一步方便软件包的运维管理,提高用户的使用体验。该方法与重新部署的方案相比,效率更高,节省更多的升级时间。另外,可以节省重新部署所需要的备份存储空间,节省计算设备的存储资源。Furthermore, before deleting the relevant information, the relevant information is also backed up to facilitate recovery to the target database after the operating system migration is completed, and to facilitate subsequent management and maintenance of the software package. In addition, updating the dependency relationship between the compatible dependency package and the target software package to the target database can further facilitate the operation and maintenance management of the software package and improve the user experience. Compared with the redeployment solution, this method is more efficient and saves more upgrade time. In addition, the backup storage space required for redeployment can be saved, and the storage resources of the computing device can be saved.

可以看出,上述主要从方法的角度对本申请实施例提供的方案进行了介绍。为了实现上述功能,本申请实施例提供了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的模块及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be seen that the solutions provided by the embodiments of the present application are mainly introduced from the perspective of methods. In order to realize the above functions, embodiments of the present application provide corresponding hardware structures and/or software modules to perform each function. Those skilled in the art should easily realize that, in conjunction with the modules and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed by hardware or by computer software driving the hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.

在示例性的实施例中,本申请还提供一种操作系统迁移装置。该迁移装置可以是前述计算设备,也可以是计算设备中的处理器。该迁移装置可以包括一个或多个功能模块,用于实现以上方法实施例的操作系统迁移方法。In an exemplary embodiment, the present application also provides an operating system migration device. The migration device may be the aforementioned computing device, or may be a processor in the computing device. The migration device may include one or more functional modules for implementing the operating system migration method of the above method embodiment.

例如,图8为本申请实施例提供的一种操作系统迁移装置的组成示意图。如图8所示,该操作系统迁移装置包括:确定模块801、删除模块802、迁移模块803以及安装模块804。确定模块801、删除模块802、迁移模块803以及安装模块804之间互相连接。For example, FIG. 8 is a schematic diagram of the composition of an operating system migration device provided by an embodiment of the present application. As shown in FIG. 8 , the operating system migration device includes: a determination module 801 , a deletion module 802 , a migration module 803 and an installation module 804 . The determination module 801, the deletion module 802, the migration module 803 and the installation module 804 are connected to each other.

确定模块801用于,确定第一操作系统中的目标软件包;其中,所述目标软件包为第一操作系统在迁移至第二操作系统的过程中不升级且不兼容的软件包;删除模块802用于,从目标数据库中删除目标软件包的相关信息;目标数据库用于记录第一操作系统中的各软件包在第一操作系统迁移前后的相关信息;迁移模块803用于,基于目标数据库,将第一操作系统迁移至第二操作系统;安装模块804用于,在第二操作系统上安装兼容依赖包;兼容依赖包用于支持目标软件包兼容运行于第二操作系统。The determination module 801 is used to determine the target software package in the first operating system; wherein the target software package is a software package that will not be upgraded and is incompatible with the first operating system during the migration to the second operating system; the deletion module 802 is used to delete the relevant information of the target software package from the target database; the target database is used to record the relevant information of each software package in the first operating system before and after the migration of the first operating system; the migration module 803 is used to, based on the target database , migrate the first operating system to the second operating system; the installation module 804 is used to install the compatible dependency package on the second operating system; the compatible dependency package is used to support the target software package to be compatible with the second operating system.

一种可能的实现方式中,确定模块801具体用于,获取待保留软件包;确定待保留软件包的依赖包;依赖包为支持待保留软件包在第一操作系统上运行的软件包;确定依赖包在第二操作系统上是否存在版本冲突;版本冲突用于指示第二操作系统中存在依赖包的不同版本;在存在版本冲突的情况下,确定待保留软件包为目标软件包。In one possible implementation, the determination module 801 is specifically configured to obtain the software package to be retained; determine the dependent packages of the software package to be retained; the dependent packages are software packages that support the software package to be retained running on the first operating system; determine Whether there is a version conflict of the dependent package on the second operating system; the version conflict is used to indicate that different versions of the dependent package exist in the second operating system; if there is a version conflict, the software package to be retained is determined to be the target software package.

另一种可能的实现方式中,上述装置还包括:获取模块805。获取模块805用于,根据目标软件包的标识,从兼容依赖包集合中获取与目标软件包对应的兼容依赖包;兼容依赖包集合包括支持不升级软件包在第二操作系统上运行的软件包。In another possible implementation, the above device further includes: an acquisition module 805. The acquisition module 805 is used to obtain the compatible dependency package corresponding to the target software package from the compatible dependency package set according to the identification of the target software package; the compatible dependency package set includes software packages that support non-upgraded software packages running on the second operating system. .

又一种可能的实现方式中,上述装置还包括:更改模块806。获取模块805还用于,获取支持目标软件包在第一操作系统上运行的依赖包;更改模块806用于,将依赖包的包名进行更改,得到兼容依赖包。In another possible implementation, the above device further includes: a modification module 806. The obtaining module 805 is also used to obtain the dependency package that supports the target software package to run on the first operating system; the changing module 806 is used to change the package name of the dependency package to obtain a compatible dependency package.

又一种可能的实现方式中,上述装置还包括:备份模块807。获取模块805还用于,从目标数据库中获取目标软件包的相关信息;备份模块807用于,将目标软件包的相关信息备份至存储空间。In another possible implementation, the above device further includes: a backup module 807. The acquisition module 805 is also used to obtain the relevant information of the target software package from the target database; the backup module 807 is used to back up the relevant information of the target software package to the storage space.

又一种可能的实现方式中,上述装置还包括:更新模块808。获取模块805还用于,从存储空间获取相关信息;更新模块808用于,将相关信息更新至目标数据库。In another possible implementation, the above device further includes: an update module 808. The acquisition module 805 is also used to obtain relevant information from the storage space; the update module 808 is used to update the relevant information to the target database.

又一种可能的实现方式中,更新模块808还用于,将目标软件包与兼容依赖包的依赖关系,更新至目标数据库中目标软件包的相关信息中。In another possible implementation, the update module 808 is also used to update the dependency relationship between the target software package and the compatible dependency package to the relevant information of the target software package in the target database.

又一种可能的实现方式中,目标数据库为Rpm数据库。In another possible implementation, the target database is the Rpm database.

又一种可能的实现方式中,备份模块807还用于,在将第一操作系统迁移至第二操作系统过程中,对第一操作系统中的预定目录进行备份。In another possible implementation, the backup module 807 is also used to back up a predetermined directory in the first operating system during the process of migrating the first operating system to the second operating system.

在示例性的实施例中,本申请实施例还提供了一种计算设备。图9为本申请实施例提供的计算设备的组成示意图。如图9所示,该计算设备可以包括:处理器901和存储器902;存储器902存储有处理器901可执行的指令;处理器901被配置为执行指令时,使得计算设备实现如前述方法实施例中描述的方法。In an exemplary embodiment, the embodiment of the present application also provides a computing device. Figure 9 is a schematic diagram of the composition of a computing device provided by an embodiment of the present application. As shown in Figure 9, the computing device may include: a processor 901 and a memory 902; the memory 902 stores instructions executable by the processor 901; when the processor 901 is configured to execute the instructions, the computing device implements the foregoing method embodiments. method described in .

本申请实施例还提供了一种计算机可读存储介质。上述方法实施例中的全部或者部分流程可以由计算机指令来指示相关的硬件完成,该程序可存储于上述计算机可读存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。计算机可读存储介质可以是前述任一实施例的或内存。上述计算机可读存储介质也可以是上述恢复装置的外部存储设备,例如上述恢复装置上配备的插接式硬盘,智能存储卡(smart media card,SMC),安全数字(secure digital,SD)卡,闪存卡(flash card)等。进一步地,上述计算机可读存储介质还可以既包括上述恢复装置的内部存储单元也包括外部存储设备。上述计算机可读存储介质用于存储上述计算机程序以及上述恢复装置所需的其他程序和数据。上述计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。An embodiment of the present application also provides a computer-readable storage medium. All or part of the processes in the above method embodiments can be completed by computer instructions to instruct relevant hardware. The program can be stored in the above computer-readable storage medium. When executed, the program can include the processes of the above method embodiments. . The computer-readable storage medium may be the memory of any of the aforementioned embodiments. The computer-readable storage medium may also be an external storage device of the recovery device, such as a plug-in hard drive, a smart media card (SMC), or a secure digital (SD) card equipped on the recovery device. Flash card, etc. Furthermore, the computer-readable storage medium may also include both the internal storage unit of the recovery device and an external storage device. The above-mentioned computer-readable storage medium is used to store the above-mentioned computer program and other programs and data required by the above-mentioned recovery device. The above-mentioned computer-readable storage media can also be used to temporarily store data that has been output or is to be output.

本申请实施例还提供一种计算机程序产品,该计算机产品包含计算机程序,当该计算机程序产品在计算机上运行时,使得该计算机执行上述实施例中所提供的任一项操作系统迁移方法。An embodiment of the present application also provides a computer program product. The computer product includes a computer program. When the computer program product is run on a computer, it causes the computer to perform any of the operating system migration methods provided in the above embodiments.

尽管在此结合各实施例对本申请进行了描述,然而,在实施所要求保护的本申请过程中,本领域技术人员通过查看附图、公开内容、以及所附权利要求书,可理解并实现公开实施例的其他变化。在权利要求中,“包括”(Comprising)一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。Although the present application has been described herein in connection with various embodiments, in practicing the claimed application, those skilled in the art can understand and implement the disclosure by reviewing the drawings, the disclosure, and the appended claims. Other variations of the embodiment. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may perform several of the functions recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not mean that a combination of these measures cannot be combined to advantageous effects.

尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Although the present application has been described in conjunction with specific features and embodiments thereof, it will be apparent that various modifications and combinations may be made without departing from the spirit and scope of the application. Accordingly, the specification and drawings are intended to be merely illustrative of the application as defined by the appended claims and are to be construed to cover any and all modifications, variations, combinations or equivalents within the scope of the application. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. In this way, if these modifications and variations of the present application fall within the scope of the claims of the present application and equivalent technologies, the present application is also intended to include these modifications and variations.

以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应该以权利要求的保护范围为准。The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be covered by the protection scope of the present application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (10)

1. A method of operating system migration, the method comprising:
determining a target software package in a first operating system; the target software package is a software package which is not updated and is incompatible in the process of migrating the first operating system to the second operating system;
deleting the related information of the target software package from a target database; the target database is used for recording the related information of each software package in the first operating system before and after the migration of the first operating system;
migrating the first operating system to the second operating system based on the target database;
installing a compatibility dependent package on the second operating system; the compatibility dependency package is used for supporting the target software package to be compatible and run on the second operating system.
2. The method of claim 1, wherein the determining the target software package in the first operating system comprises:
Acquiring a software package to be reserved;
determining a dependent package of the software package to be reserved; the dependency package is a software package supporting the software package to be reserved to run on the first operating system;
determining whether a version conflict exists on the second operating system for the dependency package; the version conflict is used for indicating that different versions of the dependent package exist in the second operating system;
and determining the software package to be reserved as the target software package under the condition that version conflict exists.
3. The method of claim 1 or 2, wherein prior to installing a compatible dependency package on the second operating system, the method further comprises:
acquiring a compatible dependency package corresponding to the target software package from a compatible dependency package set according to the identification of the target software package; the set of compatible dependency packages includes software packages that support non-upgraded software packages running on the second operating system.
4. The method of claim 1 or 2, wherein prior to installing a compatible dependency package on the second operating system, the method further comprises:
acquiring a dependency package supporting the target software package to run on the first operating system;
And changing the packet name of the dependent packet to obtain the compatible dependent packet.
5. The method of any of claims 1-4, wherein prior to deleting the relevant information of the target software package from the target database, the method further comprises:
acquiring related information of the target software package from the target database;
and backing up the related information of the target software package to a storage space.
6. The method of claim 5, wherein after migrating the first operating system to the second operating system, the method further comprises:
acquiring related information of the target software package from the storage space;
and updating the related information of the target software package to the target database.
7. The method of claim 6, wherein the method further comprises:
and updating the dependency relationship between the target software package and the compatible dependency package into the related information of the target software package in the target database.
8. The method according to any one of claims 1-7, wherein the target database is a red cap package manager Rpm database.
9. The method according to any one of claims 1-8, further comprising: and in the process of migrating the first operating system to the second operating system, backing up a preset catalogue in the first operating system.
10. A computing device, the computing device comprising a processor and a memory; the processor is coupled with the memory; the memory is configured to store computer instructions that are loaded and executed by the processor to cause a computing device to implement the operating system migration method of any one of claims 1-9.
CN202311348302.3A 2023-10-17 2023-10-17 Operating system migration method and computing device Active CN117608653B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311348302.3A CN117608653B (en) 2023-10-17 2023-10-17 Operating system migration method and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311348302.3A CN117608653B (en) 2023-10-17 2023-10-17 Operating system migration method and computing device

Publications (2)

Publication Number Publication Date
CN117608653A true CN117608653A (en) 2024-02-27
CN117608653B CN117608653B (en) 2025-04-08

Family

ID=89943159

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311348302.3A Active CN117608653B (en) 2023-10-17 2023-10-17 Operating system migration method and computing device

Country Status (1)

Country Link
CN (1) CN117608653B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118170431A (en) * 2024-05-13 2024-06-11 中移(苏州)软件技术有限公司 Cross-operating system service migration method, device and electronic device
CN118210781A (en) * 2024-03-27 2024-06-18 超聚变数字技术有限公司 Compatible database generation method and computing device
CN118363658A (en) * 2024-05-13 2024-07-19 北京长擎软件有限公司 System migration compatibility evaluation method and device based on migration strategy
CN118409785A (en) * 2024-04-28 2024-07-30 超聚变数字技术有限公司 Application compatibility evaluation method and computing device
CN118519674A (en) * 2024-05-13 2024-08-20 北京长擎软件有限公司 System difference data acquisition method and device
CN119537133A (en) * 2024-10-25 2025-02-28 北京比格大数据有限公司 Method, device, equipment and storage medium for monitoring desktop application migration process
CN120255954A (en) * 2025-06-05 2025-07-04 麒麟软件有限公司 An adaptive iterative software package replacement method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010029605A1 (en) * 1998-06-19 2001-10-11 Jonathan A. Forbes Software package management
US20110214021A1 (en) * 2010-02-26 2011-09-01 Seth Kelby Vidal Systems and methods for initiating software repairs in conjunction with software package updates
US20130152072A1 (en) * 2011-12-07 2013-06-13 Yahoo! Inc. Development of Platform Independent Applications
CN111198694A (en) * 2018-11-20 2020-05-26 北京国双科技有限公司 Software installation method and device
CN113867744A (en) * 2021-09-29 2021-12-31 深圳壹账通智能科技有限公司 Method, apparatus, computer equipment and storage medium for automatic installation of software package
CN115617488A (en) * 2022-11-07 2023-01-17 统信软件技术有限公司 Operating system migration method and device, computing equipment and storage medium
CN115668133A (en) * 2020-05-19 2023-01-31 西门子股份公司 Industrial application package management
CN115794220A (en) * 2022-09-28 2023-03-14 统信软件技术有限公司 Software source migration method, device and system, computing device and readable storage medium
CN115827604A (en) * 2022-12-30 2023-03-21 天翼云科技有限公司 Credit adaptation cloud method, system, storage medium and electronic device

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010029605A1 (en) * 1998-06-19 2001-10-11 Jonathan A. Forbes Software package management
US20110214021A1 (en) * 2010-02-26 2011-09-01 Seth Kelby Vidal Systems and methods for initiating software repairs in conjunction with software package updates
US20130152072A1 (en) * 2011-12-07 2013-06-13 Yahoo! Inc. Development of Platform Independent Applications
CN111198694A (en) * 2018-11-20 2020-05-26 北京国双科技有限公司 Software installation method and device
CN115668133A (en) * 2020-05-19 2023-01-31 西门子股份公司 Industrial application package management
CN113867744A (en) * 2021-09-29 2021-12-31 深圳壹账通智能科技有限公司 Method, apparatus, computer equipment and storage medium for automatic installation of software package
CN115794220A (en) * 2022-09-28 2023-03-14 统信软件技术有限公司 Software source migration method, device and system, computing device and readable storage medium
CN115617488A (en) * 2022-11-07 2023-01-17 统信软件技术有限公司 Operating system migration method and device, computing equipment and storage medium
CN115827604A (en) * 2022-12-30 2023-03-21 天翼云科技有限公司 Credit adaptation cloud method, system, storage medium and electronic device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
博主:SSSUPERMARIO: "依赖冲突解决方案-改包名", pages 1, Retrieved from the Internet <URL:https://blog.csdn.net/qq_41958123/article/details/122432819> *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118210781A (en) * 2024-03-27 2024-06-18 超聚变数字技术有限公司 Compatible database generation method and computing device
CN118409785A (en) * 2024-04-28 2024-07-30 超聚变数字技术有限公司 Application compatibility evaluation method and computing device
CN118170431A (en) * 2024-05-13 2024-06-11 中移(苏州)软件技术有限公司 Cross-operating system service migration method, device and electronic device
CN118363658A (en) * 2024-05-13 2024-07-19 北京长擎软件有限公司 System migration compatibility evaluation method and device based on migration strategy
CN118519674A (en) * 2024-05-13 2024-08-20 北京长擎软件有限公司 System difference data acquisition method and device
CN118170431B (en) * 2024-05-13 2024-09-13 中移(苏州)软件技术有限公司 Cross-operating system service migration method and device and electronic equipment
CN118363658B (en) * 2024-05-13 2024-10-01 北京长擎软件有限公司 System migration compatibility evaluation method and device based on migration strategy
CN119537133A (en) * 2024-10-25 2025-02-28 北京比格大数据有限公司 Method, device, equipment and storage medium for monitoring desktop application migration process
CN119537133B (en) * 2024-10-25 2025-06-24 北京比格大数据有限公司 Method, device, equipment and storage medium for monitoring desktop application migration process
CN120255954A (en) * 2025-06-05 2025-07-04 麒麟软件有限公司 An adaptive iterative software package replacement method
CN120255954B (en) * 2025-06-05 2025-08-15 麒麟软件有限公司 An adaptive iterative software package replacement method

Also Published As

Publication number Publication date
CN117608653B (en) 2025-04-08

Similar Documents

Publication Publication Date Title
CN117608653A (en) Operating system migration method and computing device
US9940330B2 (en) System and method for converting a physical disk to a virtual disk
US7107330B1 (en) Data processing system and method for distributing a device driver to a plurality of client computer systems each executing different operating systems
US6851073B1 (en) Extensible system recovery architecture
CN100440147C (en) Method and system for automatically configuring a data processing system
US9852198B1 (en) Method and system for fast generation of file system snapshot bitmap in virtual environment
US9547485B2 (en) System and method for deploying a virtual machine
US8621452B2 (en) Device driver rollback
US8924358B1 (en) Change tracking of individual virtual disk files
US9128742B1 (en) Systems and methods for enhancing virtual machine backup image data
US7669021B2 (en) File system based offline disk management
US8918783B2 (en) Managing virtual computers simultaneously with static and dynamic dependencies
US20090313447A1 (en) Remote, Granular Restore from Full Virtual Machine Backup
US9804855B1 (en) Modification of temporary file system for booting on target hardware
US8176482B1 (en) Methods and systems for inserting software applications into images
CN112068852B (en) Method, system, equipment and medium for installing open-source software based on domestic server
CN114756290B (en) Operating system installation method, device and readable storage medium
CN113760306A (en) Method, device, electronic device and storage medium for installing software
US7480793B1 (en) Dynamically configuring the environment of a recovery OS from an installed OS
CN118484187A (en) Automatic component configuration method and system for Flutter modules
JP2007133544A (en) Failure information analysis method and apparatus for implementing the same
CN109634690A (en) Data clearing method, device, terminal and storage medium based on WinPE system
CN118535103B (en) Storage array deployment method, device, storage system, electronic and computer equipment
US9021220B2 (en) Orphan storage release
KR100947136B1 (en) Incremental provisioning of software

Legal Events

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