Software package conversion method, device, equipment, computer medium and program product

CN122924930APending Publication Date: 2026-10-16SHENZHEN TENCENT COMP SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510439912.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2026-10-16

Smart Images

  • Figure CN122924930A_ABST
    Figure CN122924930A_ABST
Patent Text Reader

Abstract

The application discloses a software package conversion method, device, equipment, computer medium and program product, which can be applied to various scenes such as operating system migration, operating system upgrade, system management and operation and maintenance fields. The method comprises the following steps: obtaining a plurality of to-be-processed software packages under a to-be-migrated operating system; determining a plurality of to-be-migrated software packages corresponding to transaction creation success in the plurality of to-be-processed software packages; and converting the plurality of to-be-migrated software packages into a plurality of target software packages under a target operating system, so as to realize migration from the to-be-migrated operating system to the target operating system, and improve the efficiency of the migrated system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a software package conversion method, apparatus, device, computer medium, and program product. Background Technology

[0002] In the early stages of IT infrastructure development, users have deployed a large number of CentOS (Community Enterprise Operating System) and server operating systems in their IT (Information Technology) systems. However, CentOS is facing the issue of service interruption, posing challenges to the operation of business systems, especially to secure production.

[0003] The essence of operating system migration is to replace the entire software environment of the source operating system, namely the RPM (Red Hat Package Manager) packages, with the RPM packages released by the target operating system. Therefore, the most basic idea is to set up a software repository for the target operating system and then use the yum manager command "yumdistro-sync" to synchronize the entire software environment. This command will search for the corresponding packages in the software repository based on the packages on the current system and synchronize the software to the latest version existing in the software repository.

[0004] Because RPM packages have interdependencies, and the local software environment differs from the software environment in the target software repository, current CentOS migration tools, after setting up the software repository, directly synchronize the entire software environment using the "yumdistro-sync" command. This easily leads to errors caused by various dependencies, preventing the migration from completing successfully. This requires manual intervention for analysis and processing, making the migration process cumbersome and inefficient.

[0005] Application content

[0006] This application provides a software package conversion method, apparatus, device, computer medium, and program product, which can simplify the operating system migration process and improve migration efficiency.

[0007] On the one hand, a software package conversion method is provided, the method comprising:

[0008] Obtain multiple software packages to be processed from the operating system to be migrated;

[0009] Identify the multiple pending software packages whose corresponding transactions were successfully created;

[0010] The multiple software packages to be migrated are converted into multiple target software packages under the target operating system to achieve migration from the operating system to be migrated to the target operating system.

[0011] On the other hand, a software package conversion apparatus is provided, the apparatus comprising:

[0012] The acquisition unit is used to acquire multiple software packages to be processed under the operating system to be migrated.

[0013] The determining unit is used to determine the multiple migration packages whose corresponding transactions have been successfully created among the multiple packages to be processed;

[0014] The conversion unit is used to convert the plurality of software packages to be migrated into a plurality of target software packages under the target operating system, so as to realize the migration from the operating system to be migrated to the target operating system.

[0015] On the other hand, a computer-readable storage medium is provided that stores a computer program adapted for loading by a processor to perform the steps in the method described in any of the above embodiments.

[0016] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing a computer program, the processor executing the steps of the method as described in any of the above embodiments by calling the computer program stored in the memory.

[0017] On the other hand, a computer program product is provided, including computer instructions that, when executed by a processor, implement the steps in the method described in any of the above embodiments.

[0018] This application embodiment obtains multiple software packages to be processed under the operating system to be migrated; determines multiple software packages to be migrated whose corresponding transactions have been successfully created; and converts the multiple software packages to be migrated into multiple target software packages under the target operating system, thereby realizing a software package conversion method for migration from the operating system to be migrated to the target operating system. In the system migration scenario, when synchronizing software packages, the entire software package environment is no longer directly synchronized using commands. Instead, an algorithm is used to calculate a reliable set of software packages that can be synchronized, i.e., multiple software packages to be migrated, and then the system migration is performed. This avoids failures due to dependency issues, provides flexible migration control capabilities, simplifies the migration process, and improves migration efficiency. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1a This is a schematic diagram illustrating the principle of migrating software packages from the operating system to be migrated to the target operating system, as provided in an embodiment of this application.

[0021] Figure 1b This is a schematic diagram of the structure of the software package conversion system provided in the embodiments of this application.

[0022] Figure 2a This is a flowchart illustrating the software package conversion method provided in an embodiment of this application.

[0023] Figure 2b This is a schematic diagram illustrating the process of determining multiple software packages to be migrated, as provided in an embodiment of this application.

[0024] Figure 2c This is a schematic diagram illustrating the classification of multiple software packages to be processed, as provided in an embodiment of this application.

[0025] Figure 2d This is a schematic diagram illustrating the splitting logic of software package groups corresponding to the classification categories provided in this application embodiment.

[0026] Figure 2e and Figure 2f A schematic diagram illustrating the method for determining the difference database provided in an embodiment of this application.

[0027] Figure 2g This is a schematic diagram of the operating system migration process provided in an embodiment of this application.

[0028] Figure 2h This is a schematic diagram of the migration tool provided in an embodiment of this application.

[0029] Figure 3 This is a schematic diagram of the software package conversion device provided in an embodiment of this application.

[0030] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0032] The embodiments of this application can be applied to various scenarios such as operating system migration, operating system upgrade, system management and maintenance.

[0033] This application provides a software package conversion method, apparatus, device, computer medium, and program product. Specifically, the software package conversion method of this application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, smart voice interaction device, smart home appliance, wearable smart device, aircraft, smart vehicle terminal, etc. The terminal can also include a client, which can be a video client, browser client, or instant messaging client, etc. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0034] First, some of the nouns or terms that appear in the description of the embodiments of this application are explained as follows:

[0035] RPM (Red Hat Package Manager) is a common software package format in Linux systems. The basic characteristics of RPM packages include:

[0036] File extension: RPM software packages have the file extension ".rpm", which is their most intuitive identifier.

[0037] Contents: Each RPM package typically contains one or more files and metadata about those files, such as version number, dependency information, and installation location.

[0038] Standardized distribution: RPM provides a standardized way to distribute and install software, making software installation and maintenance simpler and more consistent.

[0039] YUM (Yellowdog Updater, Modified) is a widely used package manager, primarily used for managing RPM packages.

[0040] TOSAM (Transfer Optimization for System Migration and Acceleration) can be viewed as a user interface component of a migration tool. Built on web technologies, it allows users to access and manage migration tasks through a browser. Its purpose is to provide an intuitive and easy-to-use interface, enabling users to easily configure, start, monitor, and terminate migration tasks.

[0041] A transaction is a collection of operations that are logically treated as a single unit. In YUM, transactions typically include operations such as installing, updating, and deleting software packages. Transaction execution follows an "all or nothing" principle: all operations within a transaction either execute successfully or, if an error occurs, are rolled back to their state before execution.

[0042] The TK4 kernel refers to one of the kernel versions, specifically a T-Kernel version that is deeply optimized based on the community's 5.4LTS (Long Term Support) version. T-Kernel versions refer to the different iterations and updates that occurred during the development of the T-Kernel real-time operating system. T-Kernel is an operating system designed specifically for embedded systems and real-time applications, and it is widely praised for its microkernel architecture, real-time performance, security, and scalability.

[0043] CentOS (Community Enterprise Operating System): A free community version based on the RHEL (Red Hat Enterprise Linux) source code.

[0044] The `yum distro-sync` command is an important feature of the YUM package manager, primarily used to synchronize installed packages on the system to the latest available version of their distribution.

[0045] User-mode software refers to software that runs in user mode within an operating system. To better understand this concept, it can be analyzed from the following aspects:

[0046] User mode, also known as user space, is the lower-privilege running state of an application. In user mode, applications can only access their own memory space and limited system resources, and can only execute non-privileged instructions.

[0047] Kernel mode, also known as kernel space or privileged mode, is the state in which the operating system kernel runs. In kernel mode, the operating system has complete control over all critical resources and functions, including system hardware, memory management, and process scheduling. It can execute all instructions, including privileged instructions.

[0048] Oracle Linux: An enterprise-grade distribution compiled from RHEL source code, highly compatible with RHEL, and offering both a free version and commercial support.

[0049] In RPM-based Linux systems, package dependencies refer to the requirement that a package needs the support of other specific packages (or shared libraries, configuration files, etc.) to function properly.

[0050] An operating system's software source, also known as a software repository, is a location in a computer system used to store and distribute software packages. It is a core component of a package management system, allowing users to download, install, update, and uninstall software packages from designated servers.

[0051] In the early stages of IT infrastructure development, users have deployed a large number of CentOS and server operating systems in their IT systems. However, CentOS is facing the issue of service interruption, posing challenges to the operation of business systems, especially to secure production.

[0052] The essence of operating system migration is to replace the entire software environment of the source operating system, i.e., RPM packages, with the RPM packages released by the target operating system. Therefore, the most basic idea is to set up a software repository for the target operating system and then use the yum manager command "yum distro-sync" to synchronize the entire software environment. This command will search for the corresponding packages in the software repository based on the packages on the current system and synchronize the software to the latest version existing in the software repository.

[0053] Because RPM packages have interdependencies, and the local software environment differs from the software environment in the target software repository, current CentOS migration tools, after setting up the software repository, directly synchronize the entire software environment using the "yumdistro-sync" command. This easily leads to errors caused by various dependencies, preventing the migration from completing successfully. This requires manual intervention for analysis and processing, making the migration process cumbersome and inefficient.

[0054] Specifically, the schematic diagram for migrating software packages from the operating system to be migrated to the target operating system can be found in [reference needed]. Figure 1a As shown, in the target operating system, the software packages corresponding to the software packages in the operating system to be migrated can be stored in the software repository of the target operating system. The migration process can be carried out by a migration tool, and system files can also be backed up during the migration process.

[0055] In addition, in some cases, it is actually quite difficult to achieve certain customized requirements, such as retaining some business-related software, during the migration process using existing technical solutions.

[0056] The inventors discovered through research that the main problems with CentOS migration are as follows: the migration process fails due to dependency issues; after migration, compatibility issues prevent normal operation; and the unreliability of migration leads to excessive manual intervention, resulting in high migration costs and significant impact on business.

[0057] This application no longer directly uses commands to synchronize the entire package environment when synchronizing packages. Instead, it calculates a reliable set of packages that can be synchronized using an algorithm, and then uses the "yum distro-sync" command to synchronize this reliable set of packages, avoiding failures due to dependency issues. This set of packages can be calculated before the actual synchronization command is executed, allowing for prediction of the software results after migration. It provides flexible migration control capabilities, and when customization is needed, only the various conditions in this algorithm need to be handled to achieve the goal.

[0058] In this application, the migration tool is provided in the form of an RPM package. Personnel only need to install the migration tool on the machine to be migrated and then execute the migration command to achieve a fully automatic migration of the operating system from CentOS to the target operating system.

[0059] Please refer to Figure 1b , Figure 1b This is a schematic diagram of the software package conversion system provided in an embodiment of this application. The software package conversion system includes an electronic device and a software repository; the electronic device and the software repository are connected via a network, such as a wired or wireless network.

[0060] The electronic device is a terminal or a server, and the terminal can be used to display a graphical user interface. Specifically, the terminal is used to interact with the user through the graphical user interface, such as downloading and installing a corresponding client and running it, calling and running a corresponding app, or displaying a corresponding graphical user interface when logging into a website.

[0061] Optionally, in this embodiment of the application, when performing software package conversion, the electronic device is specifically used for:

[0062] Obtain multiple software packages to be processed from the operating system to be migrated;

[0063] Identify the multiple pending software packages whose corresponding transactions were successfully created;

[0064] The multiple software packages to be migrated are converted into multiple target software packages under the target operating system to achieve migration from the operating system to be migrated to the target operating system.

[0065] Among them, multiple target software packages under the target operating system are stored in the software repository.

[0066] It should be noted that the order of description of the following embodiments is not intended to limit the priority of the embodiments.

[0067] Various embodiments of this application provide a software package conversion method, which can be executed by the aforementioned electronic device, such as a terminal or server, or by both a terminal and a server; the embodiments of this application are described using the server as an example.

[0068] Figure 2a This is a flowchart illustrating the software package conversion method provided in this application embodiment. The method includes the following steps S201-S203:

[0069] S201. Obtain multiple software packages to be processed under the operating system to be migrated;

[0070] In this application, the operating system to be migrated is the old system to be updated to the new system. The term "migration" in this application is essentially a replacement, and the aforementioned new system is the target operating system.

[0071] Optionally, the operating system to be migrated is CentOS.

[0072] Optionally, the multiple software packages to be processed under the operating system to be migrated are the software packages under the operating system to be migrated that are initially determined to be replaced with new software packages under the target operating system.

[0073] S202. Identify the multiple migration packages whose corresponding transactions have been successfully created among the multiple packages to be processed;

[0074] Optionally, if the transaction corresponding to the package to be processed can be created successfully, it means that the package to be processed can be successfully converted into the target package under the target operating system. If the dependency is not satisfied, an error will be reported and the creation of the transaction will fail.

[0075] A transaction, corresponding to a software package to be processed, refers to a set of operations that are treated as an indivisible unit for installing, updating, or deleting the package. All operations within a transaction either succeed entirely or are rolled back entirely if an error is encountered, in order to maintain the consistency of the system state.

[0076] In some optional embodiments of this application, the determination of multiple migration packages whose transactions have been successfully created in the aforementioned S202 includes the following steps S2021-S2026:

[0077] S2021. Obtain the first software package to be processed from the plurality of software packages to be processed;

[0078] Wherein, obtaining the first processing package from the plurality of processing packages can refer to obtaining a first processing package that has not been obtained before from the plurality of processing packages, that is, the first processing package obtained from the plurality of processing packages is different each time.

[0079] S2022, Take the first pending software package and the pending software packages that have been acquired from the plurality of pending software packages as the transaction software packages to be created;

[0080] For example, when the previously acquired pending package is A and the first pending package is B, the pending transaction packages to be created are A and B.

[0081] S2023. Obtain the first transaction creation status corresponding to the transaction software package to be created, wherein the first transaction creation status includes whether the creation was successful or failed.

[0082] S2024. If the first transaction creation status is creation failure, then delete the first pending software package; if the first transaction creation status is creation success, then add the first pending software package to the set of packages to be migrated.

[0083] The set of packages to be migrated is used to store the packages whose transactions have been successfully created among the multiple packages to be processed.

[0084] S2025. Determine the remaining unprocessed software packages among the plurality of unprocessed software packages;

[0085] Among them, the remaining pending packages refer to the pending packages that have not yet been acquired.

[0086] S2026. Based on the remaining pending software packages and the set of pending migration packages, determine the multiple pending software packages whose transactions have been successfully created.

[0087] Furthermore, the process for determining the aforementioned multiple software packages to be migrated can also be found in [reference needed]. Figure 2b As shown.

[0088] In some optional embodiments of this application, in the aforementioned S2026, determining the multiple migration packages whose transactions have been successfully created among the multiple processing packages based on the remaining unprocessed packages and the set of migration packages includes the following steps S261-S262:

[0089] S261. Obtain a second unprocessed software package from the remaining unprocessed software packages, and use the second unprocessed software package as a new first unprocessed software package;

[0090] S262, Return to the step of treating the first pending software package and the pending software packages that have been acquired among the plurality of pending software packages as pending transaction software packages to be created, until all pending software packages among the plurality of pending software packages have been traversed, and then treat the software packages included in the pending migration package set as the plurality of pending migration software packages whose corresponding transactions have been successfully created among the plurality of pending software packages.

[0091] Optionally, the aforementioned first package to be processed can also be a set of packages. Starting from a base list of packages, the process of creating yum transactions and handling dependencies is executed step by step: yum distro-sync --assumeno{packages}.

[0092] After the current set is successfully processed, it is added to the next set to continue execution. If it fails, the package that cannot be added is found and excluded, and finally the largest set of packages that can be successfully processed is obtained.

[0093] Specifically, a package A can be obtained from multiple packages to be processed. Then, execute `yum distro-sync --assumeno{A}` to determine whether a transaction can be created normally. If the dependencies are not met, an error will be reported and no transaction will be generated. If it can be done normally, package A will be stored in the set of packages to be migrated.

[0094] Continue to obtain package B. Based on the previous set, execute yum distro-sync --assumeno{A,B}. If a transaction can be created, keep it in the synchronization set. If it cannot be created, abandon synchronization B. The synchronization set will still contain {A}.

[0095] By doing this, we eventually obtain the largest set of replaceable packages: yum distro-sync --assumeno{A, B, C, D, ...}; this largest set of replaceable packages is the aforementioned set of packages to be migrated.

[0096] In some optional embodiments of this application, the determination of multiple migration packages whose corresponding transactions have been successfully created in the aforementioned S202 includes the following steps S021-S023:

[0097] S021. Obtain the software repository address corresponding to the target operating system;

[0098] The software repository address corresponding to the target operating system is the address of the repository containing software packages for the target operating system. Here, "repository" can refer to a database, serving as the data source for the target operating system.

[0099] S022. From the software repository address, determine the multiple software packages to be determined under the target operating system that correspond to the multiple software packages to be processed;

[0100] Optionally, in S022, determining the plurality of packages to be determined corresponding to the plurality of packages to be processed under the target operating system from the software repository address may include:

[0101] For each of the multiple pending software packages, a software package with the same package name as the pending software package under the target operating system is determined from the software repository address. This software package is then used as the pending software package corresponding to the pending software package, thereby obtaining multiple pending software packages under the target operating system that correspond to the multiple pending software packages.

[0102] Optionally, in S022, determining the plurality of packages to be determined corresponding to the plurality of packages to be processed under the target operating system from the software repository address may include:

[0103] Obtain preset correspondence information, which includes the package name of the package to be determined corresponding to each package to be processed; determine multiple packages to be determined under the target operating system that correspond to the multiple packages to be processed based on the correspondence information.

[0104] S023. Based on the version relationship between the multiple undetermined software packages and the multiple unprocessed software packages, determine the multiple unmigrated software packages whose corresponding transactions have been successfully created.

[0105] Since the yum process must be sequential, calculating the dependencies of packages one by one is extremely time-consuming, and the calculation result depends on the previous result. This technical solution adopts the following methods to optimize performance: batch adding and calculating packages, and distinguishing the granularity of packages with different versions.

[0106] The version relationship between the plurality of packages to be determined and the plurality of packages to be processed includes: the version relationship between each package to be determined and its corresponding package to be processed.

[0107] The version relationship between the software package to be determined and its corresponding software package to be processed includes any of the following: upgrade, downgrade, or same level.

[0108] The version relationship of the package to be determined relative to its corresponding package to be processed is an upgrade, meaning that the version of the package to be determined is newer than the version of the package to be processed.

[0109] The version relationship between the package to be determined and its corresponding package to be processed is downgraded, meaning that the version of the package to be determined is older than the version of the package to be processed.

[0110] The version relationship between the package to be determined and its corresponding package to be processed is at the same level, meaning that the version of the package to be determined is the same as the version of the package to be processed.

[0111] In some optional embodiments of this application, in the aforementioned S023, determining the multiple migration packages whose transactions have been successfully created among the multiple packages to be processed, according to the version relationship between the multiple packages to be determined and the multiple packages to be processed, includes the following steps S231-S234:

[0112] S231. Determine multiple classification categories according to the version relationship between the multiple packages to be determined and the multiple packages to be processed;

[0113] Optionally, the version relationship between the package to be determined and its corresponding package to be processed can include three types: upgrade, downgrade, and same level.

[0114] Each category corresponds to a version relationship.

[0115] Optionally, the aforementioned categories include: upgrade packages, downgrade packages, and peer packages. Further details can be found in [link to relevant documentation]. Figure 2c As shown, Figure 2cThis is a schematic diagram illustrating the classification of multiple software packages to be processed according to an embodiment of this application. Among the multiple software packages to be processed, when the version relationship is upgrade, the software package to be processed is classified as upgrade software package; when the version relationship is downgrade, the software package to be processed is classified as downgrade software package; and when the version relationship is at the same level, the software package to be processed is classified as at the same level software package.

[0116] There is a version relationship between each package to be determined and its corresponding package to be processed.

[0117] S232. Group the multiple software packages to be processed based on the multiple classification categories to obtain software package groups belonging to each classification category among the multiple software packages to be processed, with each classification category corresponding to one software package group;

[0118] S233. For each of the multiple classification categories, determine the pending software package group composed of software packages whose transactions have been successfully created in the software package group corresponding to the classification category, and obtain the pending software package group corresponding to the classification category.

[0119] In some optional embodiments of this application, the determination of the pending software package group, which consists of software packages whose transactions have been successfully created, in the software package group corresponding to the classification category, in step S233 above includes the following steps S31-S34:

[0120] S31. Obtain the creation status of the second transaction corresponding to the software package group corresponding to the classification category;

[0121] The creation status of the second transaction corresponding to the software package group of the category includes whether the transaction creation of the software package group corresponding to the category was successful or failed.

[0122] Optionally, when all transactions corresponding to packages in the package group corresponding to a category are successfully created, the creation status of the second transaction corresponding to the package group corresponding to the category is considered successful. When there are packages in the package group corresponding to a category whose corresponding transactions failed to be created, the creation status of the second transaction corresponding to the package group corresponding to the category is considered failed.

[0123] In some optional embodiments of this application, the granularity of splitting software package groups is related to the category. When the category is at the same level, the granularity of splitting the software package group corresponding to that category is greater than the granularity of splitting the software package group corresponding to that category when the category is an upgrade. When the category is an upgrade, the granularity of splitting the software package group corresponding to that category is greater than...

[0124] When the category is downgraded, the granularity of the splitting of the software package group corresponding to the category is specified.

[0125] S32. If the second transaction creation status is successful, then add the software package in the software package group corresponding to the category to the initial software package set;

[0126] S33. If the second transaction creation fails, the software package group is split to obtain multiple first sub-software package groups;

[0127] Optionally, when splitting the software package group to obtain multiple first sub-software package groups, the software package group can be divided into N equal parts, where N is a positive integer greater than 1. Preferably, N = 2.

[0128] S34. Determine the pending package group based on the multiple first sub-package groups, which consists of packages whose transactions were successfully created in the package group corresponding to the classification category.

[0129] In some optional embodiments of this application, in the aforementioned S34, determining the pending package group, which consists of packages whose transactions were successfully created within the package group corresponding to the classification category, based on the plurality of first sub-package groups, includes:

[0130] For each of the plurality of first sub-package groups, obtain the third transaction creation status corresponding to the first sub-package group; if the third transaction creation status is successful, add the first sub-package group to the initial package set; if the third transaction creation status is unsuccessful, split the first sub-package group again to obtain a plurality of second sub-package groups; use the plurality of second sub-packages as new first sub-package groups; return to execute the process of obtaining the third transaction creation status corresponding to each of the plurality of first sub-package groups for each first sub-package group, until the current first sub-package group whose corresponding transaction has failed to be created cannot be split, and then use the packages in the initial package set as a pending package group composed of packages whose corresponding transactions have been successfully created in the package group corresponding to the category.

[0131] Furthermore, the logic for splitting the software package groups corresponding to the aforementioned classification categories can be found in [reference needed]. Figure 2d As shown.

[0132] In some optional embodiments of this application, optionally, in the aforementioned S233, determining the pending package group consisting of packages whose transactions have been successfully created in the package group corresponding to the classification category includes the following steps S301-S304:

[0133] S301. Obtain the quantity within the split package corresponding to the classification category;

[0134] Optionally, the `yum distro-sync` command will perform three actions depending on the package version number: lateral replacement, upgrade, or downgrade. Of these three, lateral replacement has the lowest probability of encountering dependency issues, followed by upgrade, while downgrade has the highest probability. Therefore, different numbers of packages are split for each of these three scenarios:

[0135] In some optional embodiments of this application, the number of items within a split package corresponding to a category is related to the category. When the category is at the same level, the number of items within a split package corresponding to that category is greater than the number of items within a split package corresponding to that category when the category is upgraded. When the category is upgraded, the number of items within a split package corresponding to that category is greater than the number of items within a split package corresponding to that category when the category is downgraded.

[0136] Optionally, when the category is at the same level, the number of items in the corresponding split package is 256; when the category is upgraded, the number of items in the corresponding split package is 64; when the category is downgraded, the number of items in the corresponding split package is 1.

[0137] S302. Split the software package group corresponding to the classification category according to the quantity in the split package to obtain multiple third sub-software package groups;

[0138] Specifically, the software package group corresponding to the category is split according to the number of packages in the split package to obtain multiple third sub-package groups. The number of packages in each third sub-package group is the number of packages in the split package.

[0139] S303. For each third sub-package group, obtain the creation status of the fourth transaction corresponding to the third sub-package group; if the creation status of the fourth transaction is successful, add the package in the third sub-package group to the initial package set; if the creation status of the fourth transaction is unsuccessful, split the third sub-package group to obtain multiple fourth sub-package groups; use the multiple fourth sub-package groups as new multiple third sub-package groups, and return to execute the step of obtaining the creation status of the fourth transaction corresponding to each third sub-package group until the current third sub-package group whose corresponding transaction has failed to be created cannot be split, and use the packages in the initial package set as a pending package group composed of packages whose corresponding transactions have been successfully created in the package group corresponding to the category.

[0140] When splitting the third sub-package group to obtain multiple fourth sub-package groups, a binary search method can be used to split the third sub-package group to obtain multiple fourth sub-package groups.

[0141] For peer-to-peer replacement, commands to create transactions are executed in sets of 256 packages. If a transaction cannot be created, a binary search recursively continues the calculation until a package that cannot be replaced is found. Similarly, for upgrades and downgrades, due to the higher probability of dependency issues, the granularity is set to 64 and 1 respectively. The granularity is determined by the number of packages within the split package.

[0142] The aforementioned scheme in this application no longer adds packages one by one, but adds them in batches. When a dependency error occurs, the current set of smaller packages to be added is split in half, and the addition judgment continues recursively. Finally, only packages that cannot be added are excluded, and the remaining packages are added normally. However, whether the number of packages added in batches is too large or too small may cause this optimization effect to not reach the expected level. Therefore, the calculation granularity is divided according to the version.

[0143] S234. The packages in the set of pending package groups corresponding to each category are regarded as multiple pending packages whose transactions have been successfully created in the multiple pending packages.

[0144] S203. Convert the plurality of software packages to be migrated into a plurality of target software packages under the target operating system, so as to realize the migration from the operating system to be migrated to the target operating system.

[0145] In some optional embodiments of this application, in S203, the step of converting the plurality of software packages to be migrated into a plurality of target software packages under the target operating system includes the following steps S2031-S2033:

[0146] S2031. Obtain the software repository address corresponding to the target operating system;

[0147] The software repository address corresponding to the target operating system is the address of the repository containing software packages for the target operating system. Here, "repository" can refer to a database, serving as the data source for the target operating system.

[0148] S2032. From the software repository address, determine the multiple target software packages corresponding to the multiple software packages to be migrated;

[0149] Optionally, in S2032, determining the multiple target software packages corresponding to the multiple software packages to be migrated from the software repository address may include:

[0150] For each of the multiple software packages to be migrated, the software package with the same package name as the software package to be migrated under the target operating system is determined from the software repository address. This software package is then used as the target software package corresponding to the software package to be migrated, thereby obtaining multiple target software packages under the target operating system that correspond to the multiple software packages to be migrated.

[0151] Optionally, in S2032, determining the multiple target software packages corresponding to the multiple software packages to be migrated under the target operating system from the software repository address may include: obtaining preset correspondence information, the correspondence information including the package name of the target software package corresponding to each software package to be migrated; and determining the multiple target software packages corresponding to the multiple software packages to be migrated under the target operating system based on the correspondence information.

[0152] S2033, Control the multiple target software packages to replace the multiple software packages to be migrated.

[0153] In some optional embodiments of this application, before obtaining multiple software packages to be processed under the operating system to be migrated, the method further includes the following steps S01-S03:

[0154] S01. Obtain multiple first software packages under the operating system to be migrated, and determine multiple second software packages corresponding to the multiple first software packages from the software repository address;

[0155] Optionally, multiple first packages can be all packages under the operating system to be migrated.

[0156] Optionally, the corresponding second software package can be determined based on the package name of each first software package, and the first software package and the second software package can correspond one-to-one.

[0157] S02. Determine the first difference information between the plurality of first software packages and the plurality of second software packages;

[0158] In some optional embodiments of this application, the aforementioned S02 can be implemented by a compatibility assessment tool. A compatibility assessment tool is a tool used before operating system migration to determine whether the software of the two operating systems before and after the migration is compatible, in order to ensure the reliability of the software environment after migration and replacement.

[0159] In some optional embodiments of this application, in step S02, determining the first difference information between the plurality of first software packages and the plurality of second software packages includes:

[0160] Retrieve multiple preset file categories;

[0161] For each of the plurality of file categories, a third software package belonging to the file category is determined from the first software package; and a fourth software package belonging to the file category is determined from the second software package; the difference information between the third software package and the fourth software package is determined to obtain the second difference information corresponding to the file category, and then the first difference information between the plurality of first software packages and the plurality of second software packages is obtained.

[0162] Alternatively, see Figure 2e As shown, the first difference information can be stored in the difference database. Figure 2e and Figure 2f This diagram illustrates a method for determining a difference database as provided in an embodiment of this application. The aforementioned file categories include: python, java, c, and exec. Corresponding second difference information can be retrieved based on each file category.

[0163] When the file category is "python", the second difference information corresponding to the file category is the "python difference data".

[0164] Alternatively, you can refer to the open-source component pkgdiff to compare Python files. For the collected .py files with the same name, you can perform operations similar to the diff command to generate patches as Python difference data.

[0165] When the file category is java, the second difference information corresponding to the file category is java difference data.

[0166] The open-source component pkgdiff is a difference comparison tool designed specifically for Linux software packages. It helps users quickly identify changes between two packages, including the addition, deletion, and modification of files.

[0167] Alternatively, you can refer to the open-source component pkgdiff and use the javap command provided by the OpenJDK open-source component. Compare Java files, collect .class / jar files with the same name, first unzip the jar package to obtain some class files, use the javap command to convert the class files into source code, and use an operation similar to the diff command to generate a patch as Java difference data. The open-source component OpenJDK (Open Java Development Kit) is feature-rich; it is a free and open-source implementation of the Java platform standard edition (Java SE), providing Java developers with a powerful and flexible toolset.

[0168] When the file category is 'c', the second difference information corresponding to the file category is 'so' difference data.

[0169] Optionally, the open-source component abidiff can be used to compare .so files, compare them with collected .so files of the same name, generate a difference report, and format it as the .so difference data. The open-source component abidiff is a tool specifically designed for comparing the application binary interfaces of two shared libraries.

[0170] Optionally, when the file category is exec, the second difference information corresponding to the file category is exec difference data.

[0171] Optionally, for the collected exec (executable files), since there are many uses for executable files and no unified way to compare them, if the file package under the target system includes the exec file package, it is considered that there is no difference.

[0172] Optionally, for files that exist in the operating system to be transferred but not in the target operating system, a difference is considered to exist and is identified by a difference status indicator.

[0173] Furthermore, see further. Figure 2f As shown, the aforementioned multiple first software packages and multiple second software packages are software packages obtained by decompressing RPM software packages.

[0174] S03. Based on the first difference information, determine the plurality of software packages to be processed from the plurality of first software packages, wherein the plurality of software packages to be processed are included in the plurality of first software packages.

[0175] Optionally, determining the plurality of packages to be processed from the plurality of first packages based on the first difference information includes: adding packages whose package names are included in the plurality of package names of the plurality of first packages but not in the plurality of package names of the plurality of second packages to the package set to be processed; adding packages whose package names are included in the plurality of package names of the plurality of first packages and in the plurality of package names of the plurality of second packages to the package set to be processed; and using the packages in the package set to be processed as the plurality of packages to be processed.

[0176] In some optional embodiments of this application, the method further includes the following steps S001-S002:

[0177] S001. Display preset alternative configuration information;

[0178] This application provides preset alternative configuration information, which is used by relevant personnel to set migration commands during system migration. This alternative configuration information includes various configuration options, such as: -v, -g, --inpkgs, --outpkgs, -d, -k, --check, --level, --checkcontinue; where:

[0179] -v selects the target for migration. 2.4 indicates migration to version 2.4 of the target operating system, which is applicable to CentOS 7; 3.1 indicates migration to version 3.1 of the target operating system, which is applicable to CentOS 8.

[0180] -g selects the set of packages to migrate. minimal means to migrate the core packages in the system user space, server means to migrate the packages in the group server, and the default is to migrate all packages.

[0181] --inpkgs is usually used in conjunction with -g to indicate that in addition to migrating the specified group, the specified package will also be migrated.

[0182] `--outpkgs package_name a` indicates which packages should not be migrated. During the migration process, migration often fails due to dependency or compatibility issues preventing the migration of certain packages. This parameter can be used to exclude these packages. The parameter can be a direct package name, such as `--outpkgs gnome-shell`, or a category of packages matched using wildcards, such as `--outpkgs.i386*.i686`, which excludes all 32-bit packages.

[0183] -d selects the software source of the target operating system server to be used in the migration. The default is local, which uses the local yum source configured on the local ISO disc. It can be set to remote to use the image corresponding to the target operating system, or you can directly give a custom yum source URL address to use a custom yum source.

[0184] During the migration process, the -k option will install the TK4 kernel of the target operating system. Without using the -k option, the system will still use the existing CentOS kernel after migration. With the -k option, the system will use the TencentOSTK4 kernel after reboot.

[0185] --check does not perform any migration actions; it only performs a migration feasibility check.

[0186] --level command line, choice:[1,2,3].

[0187] --level 1: Only replace packages with the same version;

[0188] --level 2: Replace the same version of the packages that will be upgraded;

[0189] --level 3 (default): Synchronize all.

[0190] The `--checkcontinue` parameter is used for migration operations. It directly uses the results of the previous pre-migration check for migration. When using `checkcontinue`, `--level 1` or `--level 2` cannot be used.

[0191] Optionally, the aforementioned preset alternative configuration information can be provided by the migration tool. In addition, the migration tool has built-in backup and restore scripts:

[0192] Operating system backup command: #EasyBackup(-d{dir})

[0193] The default backup directory is / mnt / backup, but you can also specify a directory for backup using the -d option. The backup space requirements are related to the operating system's deployment mode and the size of the user-space software, so you need to ensure that there is enough space.

[0194] The backup process will analyze the operating system software package and then compress and back up all the relevant system files. The backup process will not involve user data. The backup process will automatically calculate the number of CPU cores in the system and divide all backup tasks according to the number of CPU cores for multi-threaded backup.

[0195] Operating system recovery command: #EasyRestore -d {dir}.

[0196] The recovery process requires specifying a directory to read the previous backup content, then decompressing and restoring it. The recovery process only involves the operating system's system files and has no impact on user data.

[0197] This solution eliminates the need for third-party backup and recovery tools. The backup and recovery process does not involve user data. If problems are encountered after the migration is completed, the new data generated during the migration rollback will not be affected.

[0198] S002. In response to the configuration information setting instruction for the alternative configuration information, determine the target configuration information;

[0199] Optionally, the migration tool may provide a visual user interface, through which relevant personnel can trigger configuration information setting instructions for the alternative configuration information.

[0200] Optionally, in the aforementioned S03, determining the plurality of software packages to be processed from the plurality of first software packages based on the first difference information includes: determining the plurality of software packages to be processed from the plurality of first software packages based on the first difference information and the target configuration information.

[0201] Optionally, the plurality of packages to be processed are determined from the plurality of first packages based on the first difference information and the target configuration information, including:

[0202] Based on the target configuration information, multiple candidate software packages to be converted are determined from multiple first software packages; based on the first difference information, the multiple software packages to be processed are determined from the multiple candidate software packages.

[0203] Optionally, determining the multiple software packages to be processed from multiple candidate software packages based on the first difference information includes: adding software packages whose package names are included in multiple package names of multiple candidate software packages but not in multiple package names of multiple second software packages to the set of software packages to be processed; adding software packages whose package names are included in multiple package names of multiple candidate software packages and also in multiple package names of multiple second software packages to the set of software packages to be processed; and using the software packages in the set of software packages to be processed as multiple software packages to be processed.

[0204] Optionally, Figure 2g This application provides a schematic diagram of an operating system migration process. After the system migration starts, five stages of tasks need to be executed, including:

[0205] Phase 1: The pre-migration check phase mainly involves performing read-only operations to ensure the system meets the requirements for running the migration tool. If the requirements are not met, an exception will be thrown. This phase does not involve any intrusive behavior on the system.

[0206] Phase 2: This step involves modifying the system content and making some preliminary preparations for the migration, such as configuring the yum repository and uninstalling and installing necessary software packages in advance.

[0207] Phase 3: The core algorithm of the migration tool calculates a maximum set (multiple packages to be migrated) based on the current command-line configuration. Packages in this set can be synchronously replaced with packages from the target operating system distribution, such as:

[0208] glibc-2.17-326.el7.x86_64——>glibc-2.17-326.tl2.x86_64

[0209] The example above replaces the package with the CentOS7 release version el7 via the yum repository with the package with the target operating system release version tl2. The basic functionality of the replaced package remains unchanged, and it will have better compatibility with the migrated operating system. Users can receive maintenance for the package, such as security patches, bug fixes, and performance improvements, by updating the package.

[0210] The prediction process does not actually modify the current system's software package environment. When using the --check command line, the program will end after the prediction and output the prediction information. Users can then proceed with the next step based on the prediction results.

[0211] Since the prediction process can only predict feasibility at the yum transaction level, if some packages cannot be replaced due to network fluctuations, file permissions, or other issues during the actual migration, the actual migration result may deviate from the prediction result.

[0212] Phase 4: Add the obtained package set (i.e., the aforementioned multiple packages to be migrated) to the command for synchronization, i.e., migration execution;

[0213] Phase 5: Post-migration system processing, such as GRUB processing, yum cache processing, and outputting migration information.

[0214] Optionally, the aforementioned stage 1 includes executing the following functions: yum_util_check(), user_check(), and space_check(); wherein:

[0215] 1. yum_util_check()

[0216] Purpose: Used to check the availability and configuration of yum (or a similar package manager). Ensuring the package manager is functioning correctly is crucial during migration, as it's used to install, update, or remove packages to adapt to the new system's requirements.

[0217] Specific tasks: yum_util_check() verifies whether yum is installed, whether the configuration file is correct, and whether the repository is reachable. If any problems are found, it will prompt the user to fix these problems or take other appropriate measures.

[0218] 2. user_check()

[0219] Purpose: To check the current user's permissions and identity to ensure that the migration process is performed by a user with sufficient privileges. Ensuring operational security is crucial in sensitive tasks such as operating system migration.

[0220] Specific task: user_check() checks if the current user is the root user or a user with sudo privileges. If not, it prompts the user to rerun the migration script or tool with appropriate privileges.

[0221] 3. space_check()

[0222] Purpose: To check the available disk space on the system to ensure there is enough space to complete the migration process. Operating system migration may require downloading numerous software packages, updating system files, etc., all of which consume disk space.

[0223] Specific task: space_check() calculates the estimated space required for the migration and compares it with the currently available disk space. If insufficient space is found, it prompts the user to clean up the disk or add additional storage space.

[0224] During the operating system migration process, the functions `yum_util_check()`, `user_check()`, and `space_check()` are responsible for checking the availability of the package manager, user permissions and identities, and available disk space on the system, respectively. These checks are crucial steps in ensuring a smooth migration process and helping to avoid potential problems and errors.

[0225] Optionally, stage 2 includes a task execution stage for the system to be migrated and a task execution stage for the target operating system. The task execution stage for the system to be migrated may include the execution of the following functions: `s_os.backup.repo()`, `s_os.change_yum_conf()`, and `s_os.remove_release()`. The task execution stage for the target operating system includes the execution of the following functions: `os.add.repo()` and `s_os.download_release()`.

[0226] 1.s_os.backup.repo()

[0227] Purpose: This function is used to back up the yum repository configuration files for the current operating system (source operating system, abbreviated as s_os). Maintaining backups of these configuration files during the migration process is crucial so that they can be restored or referenced if needed after the migration.

[0228] Specific task: It copies all repository configuration files under the / etc / yum.repos.d / directory to a safe location, such as the / backup / directory.

[0229] 2.s_os.change_yum_conf()

[0230] Purpose: This function modifies the current operating system's yum configuration file to suit the needs of the migration process. For example, it can disable repositories that are no longer needed or add temporary repositories to obtain the packages required for the migration.

[0231] Specific task: It edits the / etc / yum.conf file or the repository configuration file in the / etc / yum.repos.d / directory to change the repository's enabled status, priority, or other related settings.

[0232] 3.s_os.remove_release()

[0233] Purpose: This function removes the distribution identification files from the current operating system. These files may cause the package manager to attempt to install packages incompatible with the current system during the migration process.

[0234] Specific task: It deletes files such as / etc / os-release, / etc / redhat-release, or similar files that contain information about the current operating system version and distribution.

[0235] 4.t_os.add.repo()

[0236] Purpose: This function adds new yum repositories to the target operating system (t_os). After migration, these repositories will be used to install the packages required by the target operating system.

[0237] Specific tasks: It creates new repository configuration files in the / etc / yum.repos.d / directory, or edits existing configuration files to add new repository sources.

[0238] 5.s_os.download_release()

[0239] Purpose: This function downloads distribution identification files from the target operating system's repository. These files are crucial for the target operating system's package manager because they provide information about the operating system version and distribution.

[0240] Specific tasks: It uses wget, curl, or other download tools to download files such as / etc / os-release and / etc / redhat-release from the target operating system's repository and places them in an appropriate location (which can be the migrated system directory).

[0241] During the operating system migration process, these five functions each play a crucial role, from backing up repository configurations, modifying yum configurations, and removing distribution identifiers, to adding new repositories and downloading the target operating system's distribution identifier file. These steps collectively ensure a smooth migration process and help users successfully install and run the required software packages on the new system.

[0242] Phase 3 may include the execution of the following functions: check_distro_sync() and switch_os();

[0243] 1. check_distro_sync()

[0244] Purpose: This function can be used to check the package synchronization status between the source and target operating systems. Understanding the package differences between the two systems is crucial before migration, as it helps determine which packages need to be migrated and how dependencies should be handled.

[0245] Specific tasks: check_distro_sync() can compare the package lists of two systems, identifying which packages need to be updated, which need to be retained, and which need to be removed. Furthermore, it can check package dependencies to ensure the stability of the system after migration.

[0246] 2. switch_os()

[0247] Purpose: This function can be used to perform the actual operation of switching operating systems. During the migration process, this typically involves steps such as installing the target operating system, configuring the system environment, and migrating user data and applications.

[0248] Specific tasks: switch_os() can perform a series of complex operations, such as installing a new kernel, updating the bootloader (e.g., GRUB), configuring network settings, mounting file systems, and copying user data and applications. These operations are designed to switch the system from the source operating system to the target operating system while minimizing data loss and service interruption.

[0249] Phase 4 may include the execution of the following function: execute_distro_sync();

[0250] excute_distro_sync()

[0251] Purpose: This function can be used to perform package synchronization after migration, ensuring that the packages on the target operating system are consistent with the latest versions in the repository. This is an important step in the migration process because it helps resolve any potential dependency issues and ensures system security and stability.

[0252] Specific task: `execute_distro_sync()` can use `yum distro-sync` or similar commands to synchronize packages on the system. This process may update old packages, install new packages, and remove packages that are no longer needed. Furthermore, it can handle any dependency conflicts to ensure all packages function correctly.

[0253] During the operating system migration process, the functions `check_distro_sync()`, `switch_os()`, and `execute_distro_sync()` each play a distinct role. `check_distro_sync()` checks the software package synchronization status, `switch_os()` performs the actual operating system switch, and `execute_distro_sync()` synchronizes the software packages after the migration. These functions work together to ensure a smooth migration process and help users successfully run the required applications and services on the new system.

[0254] Phase 5 may include the execution of the following functions: set_grub_default(), efi_boot_handle(), show_log(), and yum_cache(). Among them:

[0255] 1. set_grub_default()

[0256] Purpose: This function can be used to set the default boot option for GRUB (GRand Unified Bootloader). After migrating the operating system, the new operating system may need to be set as the default boot option so that it can be automatically loaded upon system reboot.

[0257] Specific task: `set_grub_default()` can edit the GRUB configuration file (usually ` / boot / grub2 / grub.cfg` or ` / etc / default / grub`) to set a new operating system entry as the default boot option. This typically involves modifying settings related to `GRUB_DEFAULT`.

[0258] 2. efi_boot_handle()

[0259] Purpose: This function handles matters related to EFI (Extensible Firmware Interface) booting. When migrating an operating system on a UEFI system, it may be necessary to update the EFI boot entry or bootloader to ensure that the new operating system can be correctly recognized and booted.

[0260] Specific tasks: efi_boot_handle() can use the efibootmgr tool or other similar tools to add, remove, or modify EFI boot entries. It can also be used to update bootloaders (such as GRUB EFI versions) or fix boot order issues.

[0261] 3. show_log()

[0262] Purpose: This function can be used to display log information during the migration process. Log information is crucial for understanding the migration progress, identifying potential problems, and troubleshooting.

[0263] Specific tasks: show_log() can read information from log files (such as / var / log / migration.log) and display it in the terminal or a log viewer. It also provides log search, filtering, and sorting functions to help users quickly locate key information.

[0264] 4. yum_cache()

[0265] Purpose: This function can be used to manage the yum cache. During operating system migration, the yum cache may contain package information that is incompatible with the new system, so it needs to be cleaned up or updated.

[0266] Specific tasks: `yum_cache()` can execute the command `yum clean all` to delete all files in the yum cache, or execute the command `yum makecache` to rebuild the cache. This helps ensure that yum can accurately retrieve and install packages after a migration.

[0267] During the operating system migration process, the four functions set_grub_default(), efi_boot_handle(), show_log(), and yum_cache() are each responsible for handling tasks such as boot settings, EFI boot entry management, log display, and yum cache management. They work together to ensure a smooth migration process and system stability.

[0268] The key technical features of this application are: a secure and flexible migration algorithm and a flexible migration control framework. This application provides users with a secure and convenient way to smoothly migrate and replace the existing operating system of a server, effectively solving the service outage problem encountered in the existing environment. The solution design focuses on the reliable operation of business, ensuring the normal operation of online business during migration and replacement.

[0269] Furthermore, see further. Figure 2hAs shown, the migration tool in this application can be MigrationCLI, which typically refers to a command-line interface tool for database or application migration. Such tools are designed to help developers or system administrators automate the migration process, thereby simplifying version control, deployment, and upgrades.

[0270] The migration tool in this application has three core classes: the operating system class (OSS), the package management class, and the migration class.

[0271] The operating system-level OSS primarily defines the operations performed on each operating system during migration. This includes functions for each operating system to handle its own packages and functions for backing up its own content. This ensures the tool's embeddability and provides a framework guarantee for adding migration capabilities to other operating systems or migrating to more target operating system server versions. It supports multiple versions of the operating systems to be migrated and multiple versions of the target operating systems. The versions of the operating systems to be migrated include CentOS 7, CentOS 7, and Rhel 7. Rhel 7 is an enterprise-grade Linux distribution. Linux is a free and open-source Unix-like operating system that inherits Unix's network-centric design philosophy and features multi-user, multi-tasking, multi-threading, and multi-CPU capabilities. The database management system version of the operating system to be migrated can be Oracle 7. The target operating system can also have multiple versions, such as version 2.4 or 3.1.

[0272] The package management class mainly defines the behaviors related to the yum package manager, as well as the processing capabilities for RPM packages, such as configuring yum repositories on the system.

[0273] The migration class is the core of the tool, mainly including the implementation capabilities of each part of the migration, including the algorithms for core computational dependencies, ensuring that the automated migration process can proceed smoothly. The migration class can provide preset alternative configuration information for the migration.

[0274] Furthermore, before migrating the operating system to be migrated, it is crucial to back it up. Backups protect important data from accidental loss or system failures, ensuring a rapid system recovery to a stable state should problems arise during or after the migration. After migrating the operating system to the target operating system, the target operating system can also be restored.

[0275] This technical solution can automatically avoid and handle dependency issues that arise during operating system migration, significantly reducing the analysis and investment required by migration personnel to address software dependencies. Furthermore, the tool can flexibly control the scale of operating system migration for various real-world engineering scenarios, thereby ensuring a smooth operating system migration for customers with minimal disruption to their business operations.

[0276] This application embodiment obtains multiple software packages to be processed under the operating system to be migrated; determines multiple software packages to be migrated whose corresponding transactions have been successfully created; and converts the multiple software packages to be migrated into multiple target software packages under the target operating system, thereby realizing a software package conversion method for migration from the operating system to be migrated to the target operating system. In the system migration scenario, when synchronizing software packages, the entire software package environment is no longer directly synchronized using commands. Instead, an algorithm is used to calculate a reliable set of software packages that can be synchronized, i.e., multiple software packages to be migrated, and then the system migration is performed. This avoids failures due to dependency issues, provides flexible migration control capabilities, simplifies the migration process, and improves migration efficiency.

[0277] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.

[0278] To facilitate better implementation of the software package conversion method of this application embodiment, this application embodiment also provides a software package conversion apparatus. Please refer to [link to relevant documentation]. Figure 3 , Figure 3 A schematic diagram of the software package conversion apparatus provided in this application embodiment. The apparatus may include:

[0279] Acquisition unit 31 is used to acquire multiple software packages to be processed under the operating system to be migrated;

[0280] Determining unit 32 is used to determine multiple migration packages whose corresponding transactions have been successfully created among the multiple packages to be processed;

[0281] The conversion unit 33 is used to convert the plurality of software packages to be migrated into a plurality of target software packages under the target operating system, so as to realize the migration from the operating system to be migrated to the target operating system.

[0282] In some optional embodiments of this application, when the aforementioned apparatus is used to determine multiple migration packages whose corresponding transactions have been successfully created among the multiple processing packages, it is specifically used for:

[0283] Obtain the first software package to be processed from the plurality of software packages to be processed;

[0284] The first software package to be processed and the software packages that have been acquired among the plurality of software packages to be processed are used as transaction software packages to be created;

[0285] Obtain the creation status of the first transaction corresponding to the transaction software package to be created, where the creation status includes whether the creation was successful or failed.

[0286] If the first transaction creation status is creation failure, then the first pending software package is deleted; if the first transaction creation status is creation success, then the first pending software package is added to the set of packages to be migrated.

[0287] Identify the remaining unprocessed software packages among the plurality of unprocessed software packages;

[0288] Based on the remaining pending software packages and the set of pending migration packages, multiple pending migration packages whose transactions were successfully created are identified from among the multiple pending software packages.

[0289] In some optional embodiments of this application, when the aforementioned apparatus is used to determine, based on the remaining pending software packages and the set of pending migration packages, multiple pending migration packages whose corresponding transactions have been successfully created, are specifically used for:

[0290] Obtain a second unprocessed package from the remaining unprocessed packages, and use the second unprocessed package as a new first unprocessed package;

[0291] The process involves taking the first pending software package and the previously acquired pending software packages from the plurality of pending software packages as pending transaction software packages, and continuing this process until all pending software packages in the plurality of pending software packages have been traversed. Then, the software packages included in the set of pending migration packages are taken as the plurality of first pending migration software packages whose corresponding transactions have been successfully created.

[0292] In some optional embodiments of this application, when the aforementioned apparatus is used to determine multiple migration packages whose corresponding transactions have been successfully created among the multiple processing packages, it is specifically used for:

[0293] Obtain the software repository address corresponding to the target operating system;

[0294] From the software repository address, identify multiple software packages to be determined under the target operating system that correspond to the multiple software packages to be processed;

[0295] Based on the version relationship between the multiple undetermined software packages and the multiple unprocessed software packages, the multiple unmigrated software packages whose corresponding transactions were successfully created are identified.

[0296] In some optional embodiments of this application, when the aforementioned apparatus is used to determine, according to the version relationship between the plurality of software packages to be determined and the plurality of software packages to be processed, the plurality of software packages to be migrated whose corresponding transactions have been successfully created, is specifically used for:

[0297] Multiple classification categories are determined based on the version relationship between the multiple packages to be determined and the multiple packages to be processed;

[0298] The multiple software packages to be processed are grouped based on the multiple classification categories to obtain software package groups belonging to each classification category, with each classification category corresponding to one software package group;

[0299] For each of the multiple classification categories, determine the pending software package group consisting of software packages whose transactions were successfully created in the software package group corresponding to the classification category, and obtain the pending software package group corresponding to the classification category;

[0300] The packages in the set of pending package groups corresponding to each category are considered as multiple pending packages whose transactions have been successfully created and are to be migrated.

[0301] In some optional embodiments of this application, the aforementioned apparatus, when determining the pending package group consisting of packages whose transactions have been successfully created within the package group corresponding to the classification category, is specifically used for:

[0302] Obtain the creation status of the second transaction corresponding to the software package group of the classification category;

[0303] If the second transaction creation status is successful, then the software package in the software package group corresponding to the category is added to the initial software package set;

[0304] If the second transaction creation fails, the package group is split into multiple first sub-package groups;

[0305] Based on the multiple first sub-package groups, a pending package group is determined, which consists of packages whose transactions were successfully created within the package group corresponding to the classification category.

[0306] In some optional embodiments of this application, when the aforementioned apparatus is used to determine the pending package group consisting of packages whose transactions were successfully created in the package group corresponding to the classification category, based on the plurality of first sub-package groups, it is specifically used for:

[0307] For each of the plurality of first sub-package groups, obtain the creation status of the third transaction corresponding to the first sub-package group; if the creation status of the third transaction is successful, add the first sub-package group to the initial package set; if the creation status of the third transaction is unsuccessful, split the first sub-package group again to obtain a plurality of second sub-package groups; use the plurality of second sub-packages as new first sub-package groups; return to execute for each of the plurality of first sub-package groups, obtain the creation status of the third transaction corresponding to the first sub-package group, until the current first sub-package group whose corresponding transaction has failed to be created cannot be split, and use the packages in the initial package set as a pending package group composed of packages whose corresponding transactions have been successfully created in the package group corresponding to the category.

[0308] In some optional embodiments of this application, the aforementioned apparatus, when determining the pending package group consisting of packages whose transactions have been successfully created within the package group corresponding to the classification category, is specifically used for:

[0309] Obtain the quantity within the split package corresponding to the category;

[0310] The software packages corresponding to the classification categories are split according to the number of packages in the split package to obtain multiple third sub-software packages;

[0311] For each third sub-package group, obtain the creation status of the fourth transaction corresponding to the third sub-package group; if the fourth transaction creation status is successful, add the package in the third sub-package group to the initial package set; if the fourth transaction creation status is unsuccessful, split the third sub-package group to obtain multiple fourth sub-package groups; use the multiple fourth sub-package groups as new multiple third sub-package groups, and return to execute the process of obtaining the creation status of the fourth transaction corresponding to each third sub-package group until the current third sub-package group whose corresponding transaction has failed to be created cannot be split, then use the packages in the initial package set as a pending package group composed of packages whose corresponding transactions have been successfully created in the package group corresponding to the category.

[0312] In some optional embodiments of this application, the aforementioned apparatus, when used to convert the plurality of software packages to be migrated into a plurality of target software packages under the target operating system, so as to realize the migration from the operating system to be migrated to the target operating system, is specifically used for:

[0313] Obtain the software repository address corresponding to the target operating system;

[0314] From the software repository address, determine the multiple target software packages corresponding to the multiple software packages to be migrated;

[0315] Control the multiple target software packages to replace the multiple software packages to be migrated.

[0316] In some optional embodiments of this application, the aforementioned apparatus is further configured to: Before acquiring multiple software packages to be processed under the operating system to be migrated, the aforementioned apparatus is further configured to:

[0317] Obtain multiple first software packages under the operating system to be migrated, and determine multiple second software packages corresponding to the multiple first software packages from the software repository address;

[0318] Determine the first difference information between the plurality of first software packages and the plurality of second software packages;

[0319] Based on the first difference information, the plurality of packages to be processed are determined from the plurality of first packages, wherein the plurality of packages to be processed are included in the plurality of first packages.

[0320] In some optional embodiments of this application, the aforementioned apparatus is further used for:

[0321] Displays preset alternative configuration information;

[0322] In response to the configuration information setting instruction for the alternative configuration information, the target configuration information is determined;

[0323] Determining the plurality of packages to be processed from the plurality of first packages based on the first difference information includes: determining the plurality of packages to be processed from the plurality of first packages based on the first difference information and the target configuration information.

[0324] Each unit of the aforementioned software package conversion device can be implemented entirely or partially through software, hardware, or a combination thereof. These units can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can invoke and execute the operations corresponding to each unit.

[0325] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0326] The software package conversion device can be integrated into a terminal or server that has storage and a processor and thus computing power, or the software package conversion device can be the terminal or server itself.

[0327] Optionally, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0328] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device may be... Figure 1b The electronic device shown. For example... Figure 4 As shown, the computer device 400 may include: a communication interface 401, a memory 402, a processor 403, and a communication bus 404. The communication interface 401, memory 402, and processor 403 communicate with each other via the communication bus 404. The communication interface 401 is used for data communication between the computer device 400 and external devices. The memory 402 can be used to store software programs and modules, and the processor 403 runs the software programs and modules stored in the memory 402, such as the software programs for the corresponding operations in the foregoing method embodiments.

[0329] Optionally, the processor 403 can invoke software programs and modules stored in the memory 402 to perform the following operations:

[0330] Obtain multiple software packages to be processed from the operating system to be migrated;

[0331] Identify the multiple pending software packages whose corresponding transactions were successfully created;

[0332] The multiple software packages to be migrated are converted into multiple target software packages under the target operating system to achieve migration from the operating system to be migrated to the target operating system.

[0333] This application also provides a computer-readable storage medium for storing a computer program. This computer-readable storage medium can be applied to a computer device, and the computer program causes the computer device to execute the corresponding processes in the methods described in the embodiments of this application; for brevity, these will not be elaborated further here.

[0334] This application also provides a computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding processes in the methods described in the embodiments of this application. For brevity, these details will not be elaborated further here.

[0335] This application also provides a computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the corresponding processes in the methods described in the embodiments of this application. For the sake of brevity, these details will not be elaborated further here.

[0336] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0337] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0338] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0339] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0340] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0341] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0342] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0343] In addition, the functional units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0344] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer or a server) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0345] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A software package conversion method, characterized in that, The method includes: Obtain multiple software packages to be processed from the operating system to be migrated; Identify the multiple pending software packages whose corresponding transactions were successfully created; The multiple software packages to be migrated are converted into multiple target software packages under the target operating system to achieve migration from the operating system to be migrated to the target operating system.

2. The method according to claim 1, characterized in that, The determination of the multiple migration packages whose corresponding transactions were successfully created among the multiple pending processing packages includes: Obtain the first software package to be processed from the plurality of software packages to be processed; The first software package to be processed and the software packages that have been acquired among the plurality of software packages to be processed are used as transaction software packages to be created; Obtain the creation status of the first transaction corresponding to the transaction software package to be created, where the creation status includes whether the creation was successful or failed. If the first transaction creation status is creation failure, then the first pending software package is deleted; if the first transaction creation status is creation success, then the first pending software package is added to the set of packages to be migrated. Identify the remaining unprocessed software packages among the plurality of unprocessed software packages; Based on the remaining pending software packages and the set of pending migration packages, multiple pending migration packages whose transactions were successfully created are identified from among the multiple pending software packages.

3. The method according to claim 2, characterized in that, The step of determining, based on the remaining pending software packages and the set of pending migration packages, multiple pending migration packages whose corresponding transactions were successfully created, include: Obtain a second unprocessed package from the remaining unprocessed packages, and use the second unprocessed package as a new first unprocessed package; The process returns to the previous step, whereby the first pending package and the previously acquired pending packages among the plurality of pending packages are treated as pending transaction packages to be created. This continues until all pending packages among the plurality of pending packages have been traversed. Finally, the packages included in the set of pending migration packages are treated as the plurality of pending migration packages whose corresponding transactions have been successfully created.

4. The method according to claim 1, characterized in that, The determination of the multiple migration packages whose corresponding transactions were successfully created among the multiple pending processing packages includes: Obtain the software repository address corresponding to the target operating system; From the software repository address, identify multiple software packages to be determined under the target operating system that correspond to the multiple software packages to be processed; Based on the version relationship between the multiple undetermined software packages and the multiple unprocessed software packages, the multiple unmigrated software packages whose corresponding transactions were successfully created are identified.

5. The method according to claim 4, characterized in that, The step of determining, based on the version relationship between the plurality of undetermined software packages and the plurality of unprocessed software packages, multiple migration software packages whose corresponding transactions have been successfully created, includes: Multiple classification categories are determined based on the version relationship between the multiple packages to be determined and the multiple packages to be processed; The multiple software packages to be processed are grouped based on the multiple classification categories to obtain software package groups belonging to each classification category, with each classification category corresponding to one software package group; For each of the multiple classification categories, determine the pending software package group consisting of software packages whose transactions were successfully created in the software package group corresponding to the classification category, and obtain the pending software package group corresponding to the classification category; The packages in the set of pending package groups corresponding to each category are considered as multiple pending packages whose transactions have been successfully created and are to be migrated.

6. The method according to claim 5, characterized in that, The process of determining the pending package group, which consists of packages whose transactions were successfully created within the package group corresponding to the classification category, includes: Obtain the creation status of the second transaction corresponding to the software package group of the classification category; If the second transaction creation status is successful, then the software package in the software package group corresponding to the category is added to the initial software package set; If the second transaction creation fails, the package group is split into multiple first sub-package groups; Based on the multiple first sub-package groups, a pending package group is determined, which consists of packages whose transactions were successfully created within the package group corresponding to the classification category.

7. The method according to claim 6, characterized in that, The step of determining the pending package group, which consists of packages whose transactions were successfully created within the package group corresponding to the classification category, based on the plurality of first sub-package groups, includes: For each of the plurality of first sub-package groups, obtain the third transaction creation status corresponding to the first sub-package group; if the third transaction creation status is successful, add the first sub-package group to the initial package set; if the third transaction creation status is unsuccessful, split the first sub-package group again to obtain a plurality of second sub-package groups; use the plurality of second sub-packages as new first sub-package groups; return to execute the process of obtaining the third transaction creation status corresponding to each of the plurality of first sub-package groups until the current first sub-package group whose corresponding transaction has failed to be created cannot be split, and then use the packages in the initial package set as a pending package group composed of packages whose corresponding transactions have been successfully created in the package group corresponding to the category.

8. The method according to claim 5, characterized in that, The process of determining the pending package group, which consists of packages whose transactions were successfully created within the package group corresponding to the classification category, includes: Obtain the quantity within the split package corresponding to the category; The software packages corresponding to the classification categories are split according to the number of packages in the split package to obtain multiple third sub-software packages; For each third sub-package group, obtain the creation status of the fourth transaction corresponding to the third sub-package group; if the fourth transaction creation status is successful, add the package in the third sub-package group to the initial package set; if the fourth transaction creation status is unsuccessful, split the third sub-package group to obtain multiple fourth sub-package groups; use the multiple fourth sub-package groups as new multiple third sub-package groups, and return to execute the process of obtaining the creation status of the fourth transaction corresponding to each third sub-package group until the current third sub-package group whose corresponding transaction has failed to be created cannot be split, then use the packages in the initial package set as a pending package group composed of packages whose corresponding transactions have been successfully created in the package group corresponding to the category.

9. The method according to claim 1, characterized in that, The step of converting the plurality of software packages to be migrated into a plurality of target software packages under the target operating system includes: Obtain the software repository address corresponding to the target operating system; From the software repository address, determine the multiple target software packages corresponding to the multiple software packages to be migrated; Control the multiple target software packages to replace the multiple software packages to be migrated.

10. The method according to claim 1, characterized in that, Before obtaining multiple software packages to be processed under the operating system to be migrated, the method further includes: Obtain multiple first software packages under the operating system to be migrated, and determine multiple second software packages corresponding to the multiple first software packages from the software repository address; The first difference information between the plurality of first software packages and the plurality of second software packages is determined; Based on the first difference information, the plurality of packages to be processed are determined from the plurality of first packages, wherein the plurality of packages to be processed are included in the plurality of first packages.

11. The method according to claim 10, characterized in that, The method further includes: Displays preset alternative configuration information; In response to the configuration information setting instruction for the alternative configuration information, the target configuration information is determined; Determining the plurality of packages to be processed from the plurality of first packages based on the first difference information includes: determining the plurality of packages to be processed from the plurality of first packages based on the first difference information and the target configuration information.

12. A software package conversion device, characterized in that, The device includes: The acquisition unit is used to acquire multiple software packages to be processed under the operating system to be migrated. The determining unit is used to determine the multiple migration packages whose corresponding transactions have been successfully created among the multiple packages to be processed; The conversion unit is used to convert the plurality of software packages to be migrated into a plurality of target software packages under the target operating system, so as to realize the migration from the operating system to be migrated to the target operating system.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the steps of the software package conversion method as described in any one of claims 1-11.

14. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the steps of the software package conversion method according to any one of claims 1-11 by calling the computer program stored in the memory.

15. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the software package conversion method according to any one of claims 1-11.