Software process live migration method and system

By preconfiguring migration configuration information in the executable file of the software, the CRIU tool can directly obtain and use this information for hot migration of software processes, solving the configuration delay problem caused by communication between migration implementers and software developers, and improving the hot migration efficiency.

CN119806635AActive Publication Date: 2025-04-11WUHAN COMPUTING ECOLOGY TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411867344.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11
Estimated Expiration
2044-12-17

AI Technical Summary

Technical Problem

During the hot migration of software processes, the migration implementer does not understand the specific business scenarios of the software process and needs to communicate with the software developers to configure the command line options of the CRIU tool, resulting in configuration delays and reducing the efficiency of hot migration.

Method used

The CRIU tool can obtain these configuration information directly from the executable file to perform hot migration of software processes.

Benefits of technology

There is no need to communicate with the configuration command line between the migration implementer and the software developer, and directly obtain the migration configuration information from the executable file, which improves the efficiency of the migration configuration information and thus improves the hot migration efficiency of the software process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806635A_ABST
    Figure CN119806635A_ABST
Patent Text Reader

Abstract

The invention provides a software process live migration method and system. The method comprises the steps that a CRIU tool controls an Agent program to send an executable file in source hardware equipment to target hardware equipment; the CRIU tool obtains migration configuration information from the executable file; the CRIU tool controls the Agent program to freeze a process in the source hardware equipment according to the migration configuration information, and controls the Agent program to transmit state data of the process during freezing to target hardware equipment; and the CRIU tool controls a new process in the target hardware equipment to start running from a freezing point of the source hardware equipment based on the state data and the migration configuration information, so that the process of the to-be-migrated software is thermally migrated to the target hardware equipment from the source hardware equipment. In an executable file of software, a software developer configures migration configuration information in advance. According to the method, the CRIU tool obtains the migration configuration information in the executable file, a migration implementer does not need to communicate with a software developer, the obtaining efficiency of the migration configuration information is improved, and then the efficiency of software process live migration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer software technology, and in particular to a software process hot migration method, a software process hot migration system, a computer-readable storage medium, and a computer program product. Background Art

[0002] When a hardware device needs maintenance, the software in the hardware device needs to be upgraded, or network load balancing is required between multiple hardware devices, hot migration can be used to allow the software process in the current hardware device to run in another hardware device, thereby allowing hardware device maintenance, software upgrades, and network load balancing to be performed without the software user being aware of it.

[0003] At present, the hot migration of software processes is mainly achieved by using the Checkpoint and Restore In Userspace (CRIU) tool. Specifically, when a software process in a source hardware device needs to be hot migrated to a target hardware device, the CRIU tool needs to be installed on the target hardware device first. In order to ensure the effective implementation of hot migration, the CRIU tool introduces command line options. In the command line options, in addition to conventional general options, options related to the specific business scenarios of the migrated software process are also included. After the CRIU tool is installed in the target hardware device, the migration implementer needs to configure the command line related to the business scenario of the software process to be migrated in the command line options of the CRIU tool. At the same time, the agent program of the CRIU tool also needs to be installed in the source hardware device. Next, the CRIU tool controls the Agent to freeze the software process to be migrated in the source hardware device according to the command line configured in the command line options, and saves all states of the software process to be migrated as an image file, and then sends the image file to the target hardware device. The CRIU tool of the target hardware device uses a new process to start running from the frozen point in the source hardware device based on the command line and the image file, thereby realizing hot migration of the corresponding software process.

[0004] However, when the migration implementer is not the developer of the migrated software, since the migration implementer does not understand the specific business scenario of the software process, the migration implementer needs to communicate with the developer of the migrated software before configuring the command line options of the CRIU tool to obtain the specific business scenario of the migrated software process, and then edit the corresponding command line based on the specific business scenario, and configure the command line in the command line options of the CRIU tool. Since the communication between the migration implementer and the developer of the migrated software takes time, the configuration of the command line options in the CRIU tool is delayed, which reduces the efficiency of hot migration of the software process. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a software process hot migration method, a software process hot migration system, a computer-readable storage medium, and a computer program product to improve the hot migration efficiency of the software process.

[0006] In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:

[0007] The first aspect of the present application provides a method for hot migration of software processes, which is applied to a software process hot migration system. The system includes a source hardware device, a target hardware device, a CRIU tool and an agent program. The CRIU tool is installed on the target hardware device, and the Agent program is installed on the source hardware device. The source hardware device includes a process and an executable file of the software to be migrated. The executable file includes migration configuration information related to the business scenario of the process in the command line options of the CRIU tool, and the migration configuration information is provided by the developer of the software to be migrated. The method includes: the CRIU tool controls the Agent program to send the executable file in the source hardware device to the target hardware device; the CRIU tool obtains the migration configuration information from the executable file; the CRIU tool controls the Agent program to freeze the process in the source hardware device according to the migration configuration information, and controls the Agent program to transmit the state data of the process when frozen to the target hardware device; based on the state data and the migration configuration information, the CRIU tool controls the new process in the target hardware device to start running from the freezing point of the source hardware device, so as to realize hot migration of the process of the software to be migrated from the source hardware device to the target hardware device.

[0008] Compared with the prior art, the software process hot migration method provided in the first aspect of the present application, in the executable file of the software, the software developer pre-configures the migration configuration information related to the business scenario of the software process for the CRIU tool. In this way, when the software process in the source hardware device needs to be hot migrated to the target hardware device, the CRIU tool in the target hardware device can control the Agent program in the source hardware device to obtain the executable file of the software to be migrated from the source hardware device, thereby obtaining the migration configuration information in the executable file. Then the target hardware device performs normal hot migration on the corresponding software process in the source hardware device based on the obtained migration configuration information. The hot migration process does not require the migration implementer to configure the command line for the business scenario related to the process in the CRIU tool, and then there is no need for the migration implementer to communicate with the software developer. The CRIU tool can directly obtain the migration configuration information from the executable file of the software, which improves the efficiency of obtaining the migration configuration information, and then improves the efficiency of hot migration of the software process.

[0009] In some changed implementation modes of the first aspect of the present application, the migration configuration information is stored in a custom section in an executable file, a header of the custom section is set with a custom name, and the CRIU tool stores the custom name; the CRIU tool obtains the migration configuration information from the executable file, including: the CRIU tool matches the stored custom name with the name of each section header in the executable file; the CRIU tool determines the section corresponding to the successfully matched name as a custom section, obtains all data from the custom section, and determines all data as the migration configuration information.

[0010] By storing the migration configuration information in a custom section in the executable file, the name of the custom section is only held by the CRIU tool, which makes it more difficult for a third party to obtain the migration configuration information through the executable file, thereby improving the security of the migration configuration information storage and ensuring the correct implementation of software hot migration.

[0011] In some changed implementation modes of the first aspect of the present application, the custom section is the first section among multiple sections of the executable file; the CRIU tool matches the stored custom name with the name of each section header in the executable file, including: the CRIU tool matches the stored custom name with the name of the first section header in the executable file; the CRIU tool determines whether the matching result indicates a successful match; if so, the CRIU tool determines that the match is successful and ends the match.

[0012] The migration configuration information is stored in the first section of the executable file. When the sections in the executable file are matched in order, the section where the migration configuration information is located can be matched more quickly, and the migration configuration information can be obtained more quickly, thereby improving the hot migration efficiency of the software process.

[0013] In some modified implementations of the first aspect of the present application, the migration configuration information is stored in a session definition segment in the executable file, and the session definition segment is configured in the compiler so that the contents therein are not executed and loaded by the source hardware device, and the compiler is used to implement the execution and loading of the executable file in the source hardware device.

[0014] The migration configuration information is stored in the session definition segment in the executable file. The compiler does not execute the feature in the session definition segment, so that when the executable file is loaded in the source hardware device, the migration configuration information will not be loaded, ensuring the normal operation of the software process in the source hardware device and the target hardware device.

[0015] In some modified implementations of the first aspect of the present application, the attribute of the migration configuration information in the session definition segment is read-only.

[0016] Configuring the attribute of the migration configuration information as read-only can further ensure that the migration configuration information will not be loaded during the loading process of the executable file, and further ensure the normal operation of the software process in the source hardware device and the target hardware device.

[0017] In some change implementation modes of the first aspect of the present application, the migration configuration information is one of a plurality of preset command formats, and the CRIU tool stores an identifier corresponding to the command format of the migration configuration information; the CRIU tool controls the Agent program to freeze the process in the source hardware device according to the migration configuration information, including: the CRIU tool determines the command format of the migration configuration information based on the currently stored identifier, and parses the migration configuration information based on the determined command format, and controls the Agent program to freeze the process in the source hardware device based on the parsed migration configuration information.

[0018] Migration configuration information can be represented in any command format, and the CRIU tool stores the identifier corresponding to the command format of the migration configuration information. In this way, it can improve the difficulty of parsing the migration configuration information by other tools and improve the security of the migration configuration information. In addition, it can also realize personalized configuration of the migration configuration information, so that the software developer can choose the command format he is good at to edit the migration configuration information, which improves the accuracy of editing the migration configuration information in the executable file, thereby ensuring the normal hot migration of the software process.

[0019] In some changed implementation modes of the first aspect of the present application, the command format of the migration configuration information is a string command, or the migration configuration information is data in multiple bits, and the CRIU tool stores string commands corresponding to multiple business scenarios, and different meanings of the data in the multiple bits correspond to different string command combinations; parsing the migration configuration information based on a determined command format includes: obtaining the data in the multiple bits based on the determined command format; searching for a target string command corresponding to the meaning indicated by the data in the multiple bits from the multiple string commands stored in the CRIU tool, and parsing the string command.

[0020] Using string commands to edit migration configuration information can improve the readability of CRIU tools for migration configuration information and ensure the correct implementation of hot migration. Using meaningful bits to edit migration configuration information has a smaller amount of data than using command lines, which can reduce the space occupied by executable files, thereby reducing the storage space occupied by executable files in hardware devices.

[0021] The second aspect of the present application provides a software process hot migration system, the system includes a source hardware device, a target hardware device, a CRIU tool and an agent program, the CRIU tool is installed on the target hardware device, the Agent program is installed on the source hardware device, the source hardware device includes the process and executable file of the software to be migrated, the executable file includes migration configuration information related to the business scenario of the process in the command line options of the CRIU tool, and the migration configuration information is provided by the developer of the software to be migrated. In the system, the CRIU tool is used to control the Agent program to send the executable file in the source hardware device to the target hardware device; the CRIU tool is also used to obtain the migration configuration information from the executable file; the CRIU tool is also used to control the Agent program to freeze the process in the source hardware device according to the migration configuration information, and control the Agent program to transmit the state data of the process when frozen to the target hardware device; the CRIU tool is also used to control the new process in the target hardware device to start running from the freezing point of the source hardware device based on the state data and the migration configuration information, so as to realize the hot migration of the process of the software to be migrated from the source hardware device to the target hardware device.

[0022] A third aspect of the present application provides a computer-readable storage medium, the storage medium including a stored program, which controls a source hardware device and a target hardware device to execute the method in the first aspect when the program is executed.

[0023] A fourth aspect of the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a source hardware device and a target hardware device, the method in the first aspect is implemented.

[0024] The software process hot migration system provided in the second aspect of the present application, the computer readable storage medium provided in the third aspect, and the computer program product provided in the fourth aspect have the same or similar beneficial effects as the software process hot migration method provided in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easy to understand. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0026] Figure 1 This is a schematic diagram of the structure of the software process hot migration system in the embodiment of the present application;

[0027] Figure 2 The process diagram of the software process hot migration method in the embodiment of the present application is as follows Figure 1 ;

[0028] Figure 3 The process diagram of the software process hot migration method in the embodiment of the present application is as follows Figure 2 ;

[0029] Figure 4 A schematic diagram of each section in an executable file in an embodiment of the present application;

[0030] Figure 5 It is a structural diagram of the software process hot migration system in the embodiment of the present application. DETAILED DESCRIPTION

[0031] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0032] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by technicians in the field to which this application belongs.

[0033] Currently, hot migration of software processes requires migration implementers to configure corresponding command lines based on the business scenarios of the software processes in the command line options of the CRIU tool. However, migration implementers do not understand the specific business scenarios of the software processes, so they need to communicate with the software developers. Time-consuming communication will reduce the efficiency of hot migration of software processes.

[0034] In view of this, the embodiments of the present application provide a method for hot migration of a software process, a system for hot migration of a software process, a computer-readable storage medium, and a computer program product, by enabling the software developer to pre-configure migration configuration information related to the specific business scenario of the software process in the executable file of the software, so that the CRIU tool can directly obtain the migration configuration information from the executable file of the software, thereby performing hot migration of the software process. In this way, there is no need for the migration implementer to communicate with the software developer again, because the software developer is most familiar with the specific business scenario of the software process, so the migration configuration information edited by the software developer is more accurate, thereby achieving accurate and efficient hot migration of the software process.

[0035] First, the application scenario of the software process hot migration method provided in the embodiment of the present application is described.

[0036] Figure 1 This is a schematic diagram of the structure of the software process hot migration system in the embodiment of the present application, see Figure 1As shown, the system may include: a source hardware device 11, a target hardware device 12, a CRIU tool 13 and an agent program 14.

[0037] In practical applications, the source hardware device 11 and the target hardware device 12 can be any hardware device capable of running software, such as a terminal device, a server, etc. The specific types of the source hardware device 11 and the target hardware device 12 can be the same or different, which is not limited here.

[0038] The source hardware device 11 is installed with software, that is, the executable file of the software is stored. The executable file stores the migration configuration information related to the business scenario of the software process in the command line options of the CRIU tool pre-configured by the software developer, so that the subsequent hot migration of the software process can be carried out accurately and quickly.

[0039] When the software corresponding to the executable file runs in the source hardware device 11, the source hardware device 11 will have a process of the software. When the source hardware device 11 needs to hot migrate the software process therein for some reason, the software corresponding to the executable file is the software to be migrated, and the process of the software is the software process to be migrated.

[0040] The object to be migrated of the software process to be migrated is the target hardware device 12. In the target hardware device 12, a CRIU tool 13 is installed. The CRIU tool 13 is a conventional software process hot migration tool. The specific type of the CRIU tool 13 is not limited here. The CRIU tool 13 is installed in the target hardware device 12. In order to hot migrate the software process in the source hardware device 11 to the target hardware device 12, it is necessary to obtain some information from the source hardware device 11, and the information can be obtained through the Agent program 14 installed in the source hardware device 11.

[0041] Next, the software process hot migration method provided in the embodiment of the present application is described in detail.

[0042] Figure 2 The process diagram of the software process hot migration method in the embodiment of the present application is as follows Figure 1 , see Figure 1 As shown, the method may include:

[0043] S21: The CRIU tool controls the Agent program to send the executable file in the source hardware device to the target hardware device.

[0044] When a software process in the source hardware device needs to be hot migrated to the target hardware device, the CRIU tool in the target hardware device is started by the migration implementer. The CRIU tool controls the Agent program so that the Agent program obtains the executable file of the software corresponding to the software process to be migrated from the source hardware device and sends the executable file to the CRIU tool.

[0045] Since the CRIU tool and the Agent program are located in different hardware devices, when the CRIU tool controls the Agent program, the CRIU tool can send a preset instruction to the Agent program to instruct the Agent program to search for executable files in the hardware device where it is located and send the found executable files to the CRIU tool.

[0046] The preset instruction may include the software name and the address of the hardware device where the CRIU tool is located. After the Agent program finds the corresponding executable file in the source hardware device based on the software name, it can send the executable file to the target hardware device where the CRIU tool is located according to the address.

[0047] Generally speaking, the executable files of the software are stored in the disk of the hardware device. Therefore, the Agent program can search for the executable file corresponding to the software to be migrated in the disk of the source hardware device based on the software name, and then send the executable file to the target hardware device after finding the executable file.

[0048] S22: The CRIU tool obtains migration configuration information from the executable file.

[0049] After the target hardware device receives the executable file, since the executable file of the software is pre-configured with the command line for the CRIU tool to perform process hot migration corresponding to the specific business scenario of the software process, that is, the migration configuration information, the CRIU tool needs to obtain the migration configuration information from the executable file in order to automatically implement the process hot migration later.

[0050] The migration implementer and the software developer may agree in advance on where to configure the migration configuration information in the executable file. The software developer writes the migration configuration information in the predetermined location of the executable file, and the migration implementer controls the CRIU tool to obtain the migration configuration information from the predetermined location of the executable file.

[0051] Currently, the migration implementer and the software developer do not need to make a prior agreement. The software developer can write the migration configuration information at any location in the executable file according to the actual situation. The migration implementer controls the CRIU tool to search for information with the migration configuration information identifier from the executable file, and then uses the found information as the migration configuration information.

[0052] S23: The CRIU tool controls the Agent program to freeze the process in the source hardware device according to the migration configuration information, and controls the Agent program to transmit the state data of the process when frozen to the target hardware device.

[0053] After the CRIU tool obtains the migration configuration information, it can officially start the hot migration of the process. On the one hand, the software corresponding to the software process to be migrated is installed on the target hardware device using the executable file. On the other hand, according to the specific process identifier indicated in the migration configuration information, the control Agent program freezes the corresponding process in the source hardware device and sends the state data of the process when the process is frozen to the target hardware device.

[0054] Since the relevant data of the process will be stored in the memory of the device when the process is running, the Agent program can send all the data in the memory of the source hardware device to the target hardware device. In order to improve the data transmission efficiency, the Agent program can also delete the data in the memory that is not related to the current process migration, and then send the deleted data to the target hardware device. In this way, the amount of data transmitted to the target hardware device can be reduced. The smaller the amount of data transmitted, the faster the data transmission, thereby improving the efficiency of hot migration of the software process.

[0055] S24: Based on the state data and the migration configuration information, the CRIU tool controls the new process in the target hardware device to start running from the freezing point of the source hardware device, so as to achieve hot migration of the process of the software to be migrated from the source hardware device to the target hardware device.

[0056] Migration configuration information includes command lines corresponding to specific business scenarios of the software process to be migrated. Status data includes the current specific status of the software process to be migrated. Based on the status data and migration configuration information, the CRIU tool can start the continued operation of the software process in the target hardware device, and start the operation from the freezing point of the software process in the source hardware device, thereby realizing hot migration of the software process.

[0057] It can be seen from the above content that in the method for hot migration of software processes provided by the embodiment of the present application, in the executable file of the software, the software developer pre-configures the migration configuration information related to the business scenario of the software process for the CRIU tool. In this way, when the software process in the source hardware device needs to be hot migrated to the target hardware device, the CRIU tool in the target hardware device can control the Agent program in the source hardware device to obtain the executable file of the software to be migrated from the source hardware device, thereby obtaining the migration configuration information in the executable file. Then the target hardware device performs normal hot migration on the corresponding software process in the source hardware device based on the obtained migration configuration information. The hot migration process does not require the migration implementer to configure the command line of the business scenario related to the process in the CRIU tool, and then there is no need for the migration implementer to communicate with the software developer. The CRIU tool can directly obtain the migration configuration information from the executable file of the software, which improves the efficiency of obtaining the migration configuration information, and then improves the efficiency of hot migration of the software process.

[0058] Furthermore, as a Figure 2 As a refinement and extension of the method shown, an embodiment of the present application also provides a method for hot migration of software processes.

[0059] Figure 3 The process diagram of the software process hot migration method in the embodiment of the present application is as follows Figure 2 , see Figure 3 As shown, the method may include:

[0060] S31: The software developer configures the migration configuration information in the executable file of the software.

[0061] In order to avoid the migration implementer from performing command line configuration in the CRIU tool based on the specific business scenarios of the software process to be migrated and the time-consuming communication with the software developer, the software developer can write the migration configuration information in the executable file of the software in advance.

[0062] When the software developer writes the migration configuration information, he or she may write the migration configuration information in any format at any location in the executable file according to the actual situation.

[0063] The migration configuration information here may refer to the information related to the specific business scenario of the software process in the command line options that can be applied to the CRIU tool, such as process number, process status, etc. The migration configuration information can be directly written into the executable file of the software when the software development is completed, or the software developer can write the adjusted migration configuration information into the executable file of the software based on the actual operation of the software after the software is installed on the hardware device and runs for a period of time.

[0064] The executable file is stored in the disk of the hardware device. The hardware device runs the executable file in the disk to make the corresponding software run in the hardware device. However, the migration configuration information in the executable file is not a necessary condition for the software to run in the hardware device. In order to prevent the migration configuration information from affecting the normal function of the software during the operation of the executable file, the migration configuration information can be stored in the session definition segment of the executable file.

[0065] In the executable file, a session definition segment is configured, and the migration configuration information is stored in the session definition segment. Then, the name of the session definition segment is informed to the compiler, and the information under the name is configured in the compiler to be non-executable. That is, the session definition segment is configured in the compiler so that the content therein cannot be executed and loaded by the source hardware device. The compiler here is used to implement the execution of the executable file in the source hardware device and the loading compiler. In this way, all information in the executable file except the migration configuration information can be loaded by the compiler, ensuring that the corresponding software runs in the hardware device.

[0066] In some cases, the compiler may fail to work properly, or the session definition segment stored in the compiler may be modified, causing the compiler to load and execute all the information in the executable file. To avoid this, ensure that the migration configuration information in the executable file is not loaded, and ensure that the software runs normally in the source hardware device, the attribute of the migration configuration information in the session definition segment can be further set to read-only.

[0067] In this way, the migration configuration information saved in the session definition segment in the executable file will no longer be loaded and executed by the compiler, thus ensuring the normal operation of the software.

[0068] At this time, the executable file is located in the source hardware device. The executable file is executed, and the corresponding software runs in the source hardware device, that is, the software process runs.

[0069] When hot migration of a software process in a source hardware device to a target hardware device is required, the CRIU tool needs to be installed in the target hardware device in advance, and the Agent program of the CRIU tool needs to be installed in the source hardware device.

[0070] When the CRIU tool in the target hardware device is started by the migration implementer, the CRIU tool will send a migration instruction to the Agent program in the source hardware device after it is started or under the instruction of the migration implementer.

[0071] S32: The CRIU tool sends a migration instruction to the Agent program.

[0072] The migration instruction may include the name of the software to be migrated or other indication information that enables the Agent program to obtain the executable file of the software corresponding to the software process to be migrated from the source hardware device.

[0073] S33: The Agent program obtains the executable file from the source hardware device according to the migration instruction, and sends the executable file to the target hardware device.

[0074] The Agent program searches for files with the same name in the disk of the source hardware device according to the software name in the migration instruction, and obtains the executable file from the found file. The obtained executable file is the executable file required by the CRIU tool, that is, the executable file of the software corresponding to the software process to be migrated.

[0075] After the target hardware device obtains the executable file, the CRIU tool can extract the migration configuration information corresponding to the corresponding software process from the executable file.

[0076] Software developers generally customize sections in executable files, store migration configuration information in the customized sections, and set customized names in the headers of the customized sections, and then inform the CRIU tool of the customized names so that the CRIU tool can accurately obtain the migration configuration information from the executable file.

[0077] S34: The CRIU tool matches the stored custom name with the name of each section header in the executable file.

[0078] There are multiple sections in the executable file. If you search for the content of the migration configuration information in each section, the search speed is slow, which affects the migration speed of the software process. At this time, you can match the custom name set by the software developer with the name of each section in the executable file. The section corresponding to the successfully matched name is the custom name configured for the custom section by the software developer when storing the migration configuration information.

[0079] S35: The CRIU tool determines the section corresponding to the successfully matched name as a custom section, obtains all data from the custom section, and determines all data as migration configuration information.

[0080] Generally speaking, when writing information unrelated to software operation in an executable file, a section of corresponding size is created and a custom name is given to the section. Therefore, the data in the custom section found according to the custom name stored in the CRIU tool is all migration configuration information.

[0081] In order to match a custom section in an executable file based on a custom name as quickly as possible, the first section among multiple sections of the executable file can be set as a custom section.

[0082] Figure 4 This is a schematic diagram of each section in the executable file in the embodiment of the present application, see Figure 4 As shown, in the executable file, first, there is the header of the executable file, that is, the ELF header. Then, there is the program header table. Then, there are the sections. Among them, section 1 can be a custom section for storing migration configuration information, that is, .criu.config. Then there is section n, and so on. Finally, there is the section header table.

[0083] In this way, when the CRIU tool matches the name of the first section according to the custom name, the match is successful. The match is successful once, which reduces the number of matches before obtaining the migration configuration information, thereby improving the migration efficiency.

[0084] Specifically, the above step S35 may include:

[0085] Step A1: The CRIU tool matches the stored custom name with the name of the first section header in the executable file.

[0086] Before the sections in the executable file appear, there will be some preset information, such as: ELF header, program header table, etc. The CRIU tool skips these preset information and starts matching the section name.

[0087] Step A2: The CRIU tool determines whether the matching result indicates a successful match. If yes, step A3 is executed; if no, step A4 is executed.

[0088] If the custom name stored in the CRIU tool is consistent with the name of the first section, it is determined that the match is successful.

[0089] If the custom name stored in the CRIU tool is inconsistent with the name of the first section, or there are some differences in format, it is determined that the match is unsuccessful, that is, the match fails.

[0090] Step A3: The CRIU tool determines that the match is successful and ends the match.

[0091] If the custom name stored in the CRIU tool is consistent with the name of the first section, it means that the information stored in the first section is the migration configuration information previously written by the software developer. At this point, the matching can be ended, and the information in the section can be used as the migration configuration information.

[0092] Step A4: The CRIU tool determines that the match fails and outputs a confirmation prompt message for the custom name.

[0093] If the custom name stored in the CRIU tool is consistent with the name of the first section, it means that the custom name stored in the CRIU tool may be stored incorrectly or modified. At this time, a confirmation prompt message can be output to prompt the migration implementer to confirm whether the custom name currently stored in the CRIU tool is correct, and after the custom name is modified correctly, perform matching again and subsequent migration steps to ensure that the migration of the software process is always carried out normally.

[0094] After obtaining the migration configuration information from the custom section of the executable file, since the specific expression of the migration configuration information when it is written into the executable file is a command format selected by the developer from a plurality of preset command formats according to the actual situation, after the developer writes the migration configuration information into the executable file, it is also necessary to inform the migration implementer of the command format used by the migration configuration information so that the migration implementer can store the identifier corresponding to the command format used by the migration configuration information in the CRIU tool, thereby facilitating the CRIU tool to correctly parse the migration configuration information, thereby ensuring the correct progress of the migration.

[0095] S36: The CRIU tool determines the command format of the migration configuration information based on the currently stored identifier, and parses the migration configuration information based on the determined command format.

[0096] The CRIU tool stores an identifier corresponding to the command format used by the migration configuration information. The CRIU tool can obtain the command format used by the migration configuration information through the identifier.

[0097] The CRIU tool can directly determine the command format used by the migration configuration information through the data features of the identifier. For example: if the identifier is "string command", it can be determined that the command format used by the migration configuration information is a string command. The CRIU tool can also search in the correspondence between the identifier and the command format to obtain the command format used by the migration configuration information. For example: the correspondence includes: 1-string command. The identifier stored in the CRIU tool is 1, so through this correspondence, it can be determined that the command format used by the migration configuration information is a string command.

[0098] In actual applications, the command format for migrating configuration information can be a string command. For example:

[0099] Hex dump of section'.criu.config':

[0100] 0x0002190 2d2d7469 6d656f75 74203630 002d2d67–timeout 60.—g

[0101] 0x000021a0 686f7374 2d666965 6d617000host-fiemap.

[0102] Alternatively, the migration configuration information may be data in multiple bits. The CRIU tool stores string commands corresponding to multiple business scenarios. Different meanings of the data in multiple bits correspond to different string command combinations. For example:

[0103] The migration configuration information is 0001 and 0010. In the CRIU tool, string command 1, string command 2 and string command 3 are stored. 0001-string command 1, 0010-string command 2, 0011-string command 3. It can be seen that the CRIU tool can determine that the commands used for subsequent migration are string command 1 and string command 2 through the migration configuration information 0001.

[0104] Specifically, the above step S36 may include:

[0105] Step B1: Acquire data in a plurality of bits based on a determined command format.

[0106] The CRIU tool stores an identifier of the command format used by the migration configuration information, and through the identifier, the command format used by the migration configuration information can be determined. For example, the CRIU tool stores an identifier a, and the identifier a corresponds to a command corresponding to a bit with a special meaning, thereby determining that the migration configuration information is represented by a bit with a special meaning, and then obtaining the data in the corresponding bit.

[0107] Step B2: searching for a target string command corresponding to the meaning indicated by the data in the multiple bits from the multiple string commands stored in the CRIU tool, and parsing the string command.

[0108] In the CRIU tool, the string commands and their corresponding bit data configured by the software developer based on various specific business scenarios of the software process are pre-stored. Based on the identifier of the command format stored in it, the CRIU tool determines that the migration configuration information uses a bit representation with a special meaning, and then the bit representation of the migration configuration information can be matched with the bit representation corresponding to each string command stored therein, and the string command corresponding to the successfully matched bit representation is determined as the string command to be used for this migration.

[0109] After the migration configuration information is parsed, the process migration can be officially started, that is, the software process in the source hardware device is frozen and the software process is restored from the freezing point in the target hardware device.

[0110] S37: The CRIU tool sends a freeze instruction to the Agent program based on the parsed migration configuration information.

[0111] The freeze instruction may only include relevant information indicating process freezing. If the source hardware device currently runs multiple software or multiple processes of a certain software, the freeze instruction may also include the software name or process identifier so that the Agent program freezes the corresponding software or process.

[0112] S38: The Agent program freezes the process in the source hardware device according to the freezing instruction, and controls the Agent program to transmit the state data of the process when freezing to the target hardware device.

[0113] After receiving the freeze instruction, the Agent program freezes the relevant process indicated by the freeze instruction. The freezing method adopted is the conventional process freezing method, which will not be described here. On the other hand, the Agent program sends the status data corresponding to the frozen process to the target hardware device.

[0114] When the Agent program sends the status data corresponding to the frozen process to the target hardware device, the memory data in the source hardware device can be directly sent to the target hardware device, so that the CRIU tool in the target hardware device can select the status parameters of the corresponding software process from the memory data and perform process recovery. If all currently running processes in the source hardware device are hot migrated, the CRIU tool will recover all previously running processes in the source hardware device in the target hardware device based on the process status parameters in the entire memory data.

[0115] The state data is used to characterize the state of the software process previously running in the source hardware device. The migration configuration information is used to indicate the specific migration configuration of the software process. After the CRIU tool obtains the state data and migration configuration information, it can restore the software process in the target hardware device according to the configuration.

[0116] S39: Based on the status data and migration configuration information, the CRIU tool controls the new process in the target hardware device to start running from the freezing point of the source hardware device, so as to achieve hot migration of the process of the software to be migrated from the source hardware device to the target hardware device.

[0117] The specific implementation method of step S39 here is the same as that of step S24 in the aforementioned embodiment. Please refer to the relevant description in the aforementioned embodiment and will not be repeated here.

[0118] At this point, the software process hot migration method provided in the embodiment of the present application has been fully described.

[0119] Based on the same inventive concept, as an implementation of the above method, an embodiment of the present application also provides a software process hot migration system.

[0120] Figure 5 This is a schematic diagram of the structure of the software process hot migration system in the embodiment of the present application, see Figure 5 As shown, the system may include: a source hardware device 11, a target hardware device 12, a CRIU tool 13 and an agent program 14.

[0121] The CRIU tool 13 is installed on the target hardware device 12 .

[0122] The Agent program 14 is installed on the source hardware device 11 .

[0123] The source hardware device 11 includes the process and executable file of the software to be migrated. The executable file includes the migration configuration information related to the business scenario of the process in the command line options of the CRIU tool 13. The migration configuration information is provided by the developer of the software to be migrated.

[0124] In this system:

[0125] The CRIU tool 13 is used to control the Agent program 14 to send the executable file in the source hardware device 11 to the target hardware device 12 .

[0126] The CRIU tool 13 is also used to obtain migration configuration information from the executable file.

[0127] The CRIU tool 13 is further used to control the Agent program 14 to freeze the process in the source hardware device 11 according to the migration configuration information, and control the Agent program 14 to transmit the state data of the process when frozen to the target hardware device 12 .

[0128] The CRIU tool 13 is also used to control the new process in the target hardware device 12 to start running from the freezing point of the source hardware device 11 based on the state data and migration configuration information, so as to realize the hot migration of the process of the software to be migrated from the source hardware device 11 to the target hardware device 12.

[0129] Furthermore, as a Figure 5 As a refinement and expansion of the system shown, an embodiment of the present application also provides a software process hot migration system.

[0130] Still see Figure 5 As shown, the migration configuration information is stored in the session definition segment in the executable file. The session definition segment is configured in the compiler so that the content thereof is not executed and loaded by the source hardware device 11 . The compiler is used to implement the execution and loading of the executable file in the source hardware device 11 .

[0131] The attributes of the migration configuration information in the session definition section are read-only.

[0132] When the migration configuration information is stored in a custom section in an executable file, a custom name is set in the header of the custom section, and the CRIU tool 13 stores the custom name, the CRIU tool 13 is specifically used to match the stored custom name with the name of each section header in the executable file; determine the section corresponding to the successfully matched name as the custom section, obtain all data from the custom section, and determine all data as the migration configuration information.

[0133] In the case where the custom section is the first section among multiple sections of an executable file, the CRIU tool 13 is specifically used to match the stored custom name with the name of the first section header in the executable file; determine whether the matching result indicates a successful match; if so, determine that the match is successful and end the matching.

[0134] When the migration configuration information is one of the preset multiple command formats and the CRIU tool 13 stores an identifier corresponding to the command format of the migration configuration information, the CRIU tool 13 is specifically used to determine the command format of the migration configuration information based on the currently stored identifier, and parse the migration configuration information based on the determined command format, and control the Agent program 14 to freeze the process in the source hardware device 11 based on the parsed migration configuration information.

[0135] When the command format of the migration configuration information is a string command, or the migration configuration information is data in multiple bits, the CRIU tool 13 stores string commands corresponding to multiple business scenarios, and different meanings of the data in the multiple bits correspond to different string command combinations, the CRIU tool 13 is specifically used to obtain the data in the multiple bits based on a determined command format; search for a target string command corresponding to the meaning indicated by the data in the multiple bits from the multiple string commands stored in the CRIU tool 13, and parse the string command.

[0136] It should be noted here that the description of the above system embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the system embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0137] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium, which includes a stored program that controls the source hardware device and the target hardware device to execute the method in one or more of the above embodiments when the program is running.

[0138] It should be noted here that the description of the above computer-readable storage medium embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the computer-readable storage medium embodiment of this application, please refer to the description of the method embodiment of this application for understanding.

[0139] Based on the same inventive concept, an embodiment of the present application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a source hardware device and a target hardware device, the method in one or more of the above embodiments is implemented.

[0140] It should be noted here that the description of the above computer program product embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the computer program product embodiment of this application, please refer to the description of the method embodiment of this application for understanding.

[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for hot migration of software processes, characterized in that: The method is applied to a software process hot migration system, the system comprising a source hardware device, a target hardware device, a user space checkpoint and recovery CRIU tool and an agent program, the CRIU tool is installed on the target hardware device, the Agent program is installed on the source hardware device, the source hardware device comprises a process and an executable file of the software to be migrated, the executable file comprises migration configuration information related to the business scenario of the process in the command line options of the CRIU tool, the migration configuration information is provided by the developer of the software to be migrated, the method comprises: The CRIU tool controls the Agent program to send the executable file in the source hardware device to the target hardware device; The CRIU tool obtains the migration configuration information from the executable file; The CRIU tool controls the Agent program to freeze the process in the source hardware device according to the migration configuration information, and controls the Agent program to transmit the state data of the process when frozen to the target hardware device; Based on the status data and the migration configuration information, the CRIU tool controls the new process in the target hardware device to start running from the freezing point of the source hardware device, so as to achieve hot migration of the process of the software to be migrated from the source hardware device to the target hardware device.

2. The method according to claim 1, characterized in that The migration configuration information is stored in a custom section in the executable file, a header of the custom section is provided with a custom name, and the CRIU tool stores the custom name; The CRIU tool obtains the migration configuration information from the executable file, including: The CRIU tool matches the stored custom name with the name of each section header in the executable file; The CRIU tool determines the section corresponding to the successfully matched name as the custom section, obtains all data from the custom section, and determines all data as the migration configuration information.

3. The method according to claim 2, characterized in that The custom section is the first section of the multiple sections of the executable file; the CRIU tool matches the stored custom name with the name of each section header in the executable file, including: The CRIU tool matches the stored custom name with the name of the first section header in the executable file; The CRIU tool determines whether the matching result indicates a successful match; If so, the CRIU tool determines that the match is successful and ends the match.

4. The method according to claim 1, characterized in that: The migration configuration information is stored in a session definition segment in the executable file. The session definition segment is configured in a compiler so that the content thereof is not executed or loaded by the source hardware device. The compiler is used to implement execution and loading of the executable file in the source hardware device.

5. The method according to claim 4, characterized in that The attribute of the migration configuration information in the session definition section is read-only.

6. The method according to any one of claims 1 to 5, characterized in that The migration configuration information is a command format among a plurality of preset command formats, and the CRIU tool stores an identifier corresponding to the command format of the migration configuration information; The CRIU tool controls the Agent program to freeze the process in the source hardware device according to the migration configuration information, including: The CRIU tool determines the command format of the migration configuration information based on the currently stored identifier, parses the migration configuration information based on the determined command format, and controls the Agent program to freeze the process in the source hardware device based on the parsed migration configuration information.

7. The method according to claim 6, characterized in that The command format of the migration configuration information is a string command, or the migration configuration information is data in multiple bits, the CRIU tool stores string commands corresponding to multiple business scenarios, and different meanings of the data in the multiple bits correspond to different string command combinations; The parsing of the migration configuration information based on the determined command format includes: Acquire the data in the plurality of bits based on a determined command format; A target string command corresponding to the meaning indicated by the data in the multiple bits is searched from the multiple string commands stored in the CRIU tool, and the string command is parsed.

8. A software process hot migration system, characterized in that: The system includes a source hardware device, a target hardware device, a user space checkpoint and recovery CRIU tool and an agent program. The CRIU tool is installed on the target hardware device, and the Agent program is installed on the source hardware device. The source hardware device includes a process and an executable file of the software to be migrated. The executable file includes migration configuration information related to the business scenario of the process in the command line options of the CRIU tool. The migration configuration information is provided by the developer of the software to be migrated. In the system, The CRIU tool is used to control the Agent program to send the executable file in the source hardware device to the target hardware device; The CRIU tool is further used to obtain the migration configuration information from the executable file; The CRIU tool is further used to control the Agent program to freeze the process in the source hardware device according to the migration configuration information, and control the Agent program to transmit the state data of the process when frozen to the target hardware device; The CRIU tool is also used to control the new process in the target hardware device to start running from the freezing point of the source hardware device based on the status data and the migration configuration information, so as to realize the hot migration of the process of the software to be migrated from the source hardware device to the target hardware device.

9. A computer-readable storage medium, characterized in that: The storage medium includes a stored program, and when the program is executed, the source hardware device and the target hardware device are controlled to execute the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The computer program product comprises a computer program or instructions, and when the computer program or instructions are executed by a source hardware device and a target hardware device, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • CRIU-based Docker container heat migration method and system

    CN107526626A

  • Thermal migration method, computer readable storage medium and electronic equipment

    CN118733224A

  • System for automated process substitution with connection-preserving capabilities

    US20240406173A1