A method, system, storage medium and device for data migration
By moving data in units of the total capacity of the data page, the difficulty of scenario classification and implementation is simplified, the problem of insufficient complexity and reliability of data transfer algorithms in the prior art is solved, and efficient data transmission is achieved.
Patent Information
- Application Number
- CN202210181670.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-26
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-02-26
AI Technical Summary
In the prior art, data transfer algorithms are complex in classification of different scenarios, difficult to implement, and insufficient reliability. Especially when there is in-page offset between host memory and local memory, data transmission is prone to overflow beyond the available capacity of the data page.
Data transfer is carried out in units of total data page capacity PAGE_SIZE. By comparing the effective capacity of the first data page of the host memory and local memory, the difference value split_size is calculated, and data transmission is completed in batches or at one time, simplifying scenario classification and improving system reliability.
The scenario classification of the data transfer process is simplified, the implementation difficulty is reduced, and the system is improved. It can effectively handle the combination of multiple data distributions and in-page offsets.
Smart Images

Figure CN114780015B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, in particular to the field of data migration technology, and specifically to data migration between a host data page linked list and a local data page linked list. Background Art
[0002] When data is moved between the host data page list and the local data page list through the DMA (Direct Memory Access) controller, due to the possible intra-page offset of the data page, the available capacity of the data page may be less than the total capacity of the data page. Therefore, the DMA controller needs to reasonably calculate the amount of data to be moved each time to ensure that the available capacity of the data page is fully utilized while preventing the amount of moved data from exceeding the available capacity of the data page and causing overflow.
[0003] Currently, most algorithms process data in units of pages. When such algorithms are applied to actual scenarios, problems may easily arise during operation due to the large number of classifications.
[0004] The following uses three typical scenarios where data is moved from the host memory (host) to the local memory (local) with page offsets on both ends as examples to illustrate the implementation process of the existing algorithm.
[0005] The three scenarios have the following in common:
[0006] (1) The data movement direction is from host to local;
[0007] (2) The amount of data moved is the total capacity of N data pages (Page), that is, N*PAGE_SIZE;
[0008] (3) Since the host side has the host memory data page's page offset (host_offset) and the local side has the local memory data page's page offset (local_offset), the effective capacity available for the first data page is less than the total capacity of the data page. Therefore, N+1 data pages are actually required to store N*PAGE_SIZE data.
[0009] Scenario 1: Processing steps when host_offset is less than local_offset, such as Figure 1 As shown, including:
[0010] (1) Calculate the actual number of data pages required based on the amount of data to be moved and the page offset information;
[0011] (2) Calculate the effective capacity host_size of the first data page on the host side;
[0012] (3) Calculate the effective capacity of the first data page on the local side, local_size;
[0013] (4) Calculate the difference split_size from host_size minus local_size;
[0014] (5) Calculate the difference between PAGE_SIZE and split_size to obtain the initial data transmission volume trans_size of the subsequent complete data page;
[0015] (6) Calculate the size of host_offset of the last page transferred data;
[0016] (7) According to Figure 1 The transfer process shown completes the data transfer of each data page on the host side in sequence.
[0017] Scenario 2: Processing steps when host_offset is greater than local_offset, such as Figure 2 As shown, including:
[0018] (1) Calculate the actual number of data pages required based on the amount of data to be moved and the page offset information;
[0019] (2) Calculate the effective capacity host_size of the first data page on the host side;
[0020] (3) Calculate the effective capacity of the first data page on the local side, local_size;
[0021] (4) Calculate the difference between local_size and host_size to obtain the first transfer size of the subsequent complete data page, split_size, and the second transfer size, trans_size;
[0022] (5) Calculate the size of host_offset for the last page of data to be transferred, and transfer this data twice: first transfer the split_size, and then transfer the remaining data size, remaining_size;
[0023] (6) According to Figure 2 The transfer process shown completes the data transfer of each data page on the host side in sequence.
[0024] Scenario 3: Processing steps for host_offset equal to local_offset, such as Figure 3 As shown, including:
[0025] (1) Calculate the actual number of data pages required based on the amount of data to be moved and the page offset information;
[0026] (2) Calculate the effective capacity of the first data page on the host side and the local side, host_size and local_size, which are equal;
[0027] (3) Calculate the data transfer volume trans_size of the subsequent complete data page, which is the same as PAGE_SIZE;
[0028] (4) Calculate the size of host_offset of the last page of data transferred;
[0029] (5) According to Figure 3 The transfer process shown completes the data transfer of each data page on the host side in sequence.
[0030] As can be seen above, the existing method handles data transmission for each scenario separately, resulting in a large number of code implementation steps. Furthermore, in practice, there are situations where the page offset may be zero, so the above method may need to handle more than six scenarios, further increasing the implementation difficulty.
[0031] Therefore, in view of the above shortcomings and problems in the existing technology, it is necessary to propose an improved method to optimize data migration, thereby simplifying scene classification and reducing implementation difficulty. Summary of the Invention
[0032] In view of this, the purpose of the present invention is to propose an improved data migration method, system, storage medium and device, so as to solve the problems of complex scene classification, excessive implementation difficulty and insufficient reliability in the prior art.
[0033] Based on the above objectives, in one aspect, the present invention provides a method for data migration, wherein the method comprises the following steps:
[0034] Compare the effective capacity host_size of the first data page of the host memory with the effective capacity local_size of the first data page of the local memory, use the smaller value as the data amount to be transferred for the first data page to complete the data transfer, and calculate the difference split_size based on host_size and local_size;
[0035] Get the amount of remaining data and compare it with the total capacity of a single data page, PAGE_SIZE;
[0036] In response to the amount of remaining data being greater than or equal to PAGE_SIZE, completing data transmission of the amount of data PAGE_SIZE in batches according to the state of the difference split_size, and comparing the updated amount of remaining data with PAGE_SIZE;
[0037] In response to the amount of the remaining data being less than PAGE_SIZE, the data transmission of the remaining data is completed in batches according to the state of the difference split_size and the amount of the remaining data.
[0038] In some embodiments of the data migration method according to the present invention, in response to the amount of remaining data being greater than or equal to PAGE_SIZE, completing data transmission of an amount of data equal to PAGE_SIZE in batches according to the status of the difference split_size, and comparing the updated amount of remaining data with PAGE_SIZE further includes:
[0039] In response to the difference split_size being zero, data transmission of a data amount of PAGE_SIZE is completed at one time.
[0040] In some embodiments of the data migration method according to the present invention, in response to the amount of remaining data being greater than or equal to PAGE_SIZE, completing data transmission of an amount of data equal to PAGE_SIZE in batches according to the status of the difference split_size, and comparing the updated amount of remaining data with PAGE_SIZE further includes:
[0041] In response to the difference split_size being non-zero, the transmission data amount trans_size is calculated based on PAGE_SIZE and the difference split_size, and data transmission of the data amount PAGE_SIZE is completed in two times, wherein the data transmission of the data amount split_size is completed in the first time, and the data transmission of the data amount trans_size is completed in the second time.
[0042] In some embodiments of the method for data migration according to the present invention, in response to the amount of the remaining data being less than PAGE_SIZE, completing the data transmission of the remaining data in batches according to the state of the difference split_size and the amount of the remaining data further includes:
[0043] In response to the difference split_size being zero, the data transmission of the remaining data is completed at one time.
[0044] In some embodiments of the method for data migration according to the present invention, in response to the amount of the remaining data being less than PAGE_SIZE, completing the data transmission of the remaining data in batches according to the state of the difference split_size and the amount of the remaining data further includes:
[0045] In response to the difference split_size being non-zero, the data transmission of the remaining data is completed in batches according to a comparison between the difference split_size and the amount of the remaining data.
[0046] In some embodiments of the method for data migration according to the present invention, in response to the amount of the remaining data being less than PAGE_SIZE, completing the data transmission of the remaining data in batches according to the size of the difference split_size and the amount of the remaining data further includes:
[0047] In response to the amount of the remaining data being greater than the difference split_size, the data transmission of the remaining data is completed twice, wherein the first transmission completes the data transmission of the amount of split_size, and the second transmission completes the final data transmission of the remaining data.
[0048] In some embodiments of the method for data migration according to the present invention, in response to the amount of the remaining data being less than PAGE_SIZE, completing the data transmission of the remaining data in batches according to the size of the difference split_size and the amount of the remaining data further includes:
[0049] In response to the amount of the remaining data being less than or equal to the difference split_size, the data transmission of the remaining data is completed at one time.
[0050] Another aspect of the present invention further provides a data migration system, comprising:
[0051] a home page data transmission module configured to compare the effective capacity host_size of the first data page of the host memory with the effective capacity local_size of the first data page of the local memory, use the smaller value as the data amount transmitted for the first data page to complete the data transmission, and calculate the difference split_size based on host_size and local_size;
[0052] A remaining data comparison module is configured to obtain the amount of remaining data and compare it with the total capacity PAGE_SIZE of a single data page;
[0053] a cyclic transmission processing module, the cyclic transmission processing module being configured to, in response to the amount of the remaining data being greater than or equal to PAGE_SIZE, complete data transmission of an amount of data of PAGE_SIZE in batches according to a state of the difference split_size, and compare the updated amount of the remaining data with PAGE_SIZE;
[0054] The last page data transmission module is configured to complete the data transmission of the remaining data in batches according to the state of the difference split_size and the amount of the remaining data in response to the amount of the remaining data being less than PAGE_SIZE.
[0055] In another aspect of the present invention, a computer-readable storage medium is provided, which stores computer program instructions, and when the computer program instructions are executed, the above-mentioned data migration method is implemented.
[0056] In another aspect of the present invention, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, any one of the above-mentioned methods for data migration according to the present invention is executed.
[0057] The present invention has at least the following beneficial technical effects: in response to the shortcomings of the data migration algorithm involved in the prior art, an improved method is proposed according to the present invention, in which the main migration process no longer performs data migration operations in units of data pages, but performs data migration in units of the total capacity PAGE_SIZE of the data page, which simplifies the scene classification and the implementation process under different data distribution scenarios, while reducing the implementation difficulty and improving the system reliability; in addition, the application of the present invention is not limited to the three conventional scenarios mentioned above, and it still has high adaptability to various combinations such as changes in data migration direction and intra-page offsets. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying any creative work.
[0059] In the figure:
[0060] Figure 1 A schematic diagram showing a flow chart of scenario 1 of a data migration method in the prior art is shown;
[0061] Figure 2 A schematic diagram showing a flow chart of scenario 2 of a data migration method in the prior art is shown;
[0062] Figure 3 A schematic diagram showing a flow chart of scenario three of a method for data migration in the prior art is shown;
[0063] Figure 4 A schematic block diagram showing an embodiment of a method for data migration according to the present invention is shown;
[0064] Figure 5 A schematic flow chart of scenario 1 of the method for data migration according to the present invention is shown;
[0065] Figure 6 A schematic diagram showing a flow chart of scenario 2 of the method for data migration according to the present invention is shown;
[0066] Figure 7 A flow chart showing scenario 3 of the data migration method according to the present invention is shown.
[0067] Figure 8 A schematic block diagram showing an embodiment of a system for data migration according to the present invention is shown;
[0068] Figure 9 A schematic diagram showing an embodiment of a computer-readable storage medium for implementing a method for data migration according to the present invention;
[0069] Figure 10 A schematic diagram of the hardware structure of an embodiment of a computer device for implementing a method for data migration according to the present invention is shown. DETAILED DESCRIPTION
[0070] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.
[0071] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are intended to distinguish two non-identical entities or non-identical parameters with the same name. Therefore, "first" and "second" are used for convenience of expression only and should not be understood as limitations on the embodiments of the present invention. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, other steps or units inherent to a process, method, system, product, or device that includes a series of steps or units.
[0072] First, the relevant terms involved in the present invention are introduced.
[0073]
[0074] In response to the shortcomings of the data migration algorithms involved in the existing technology, according to the present invention, the main migration process no longer performs data migration operations in units of data pages, but instead performs data migration in units of the total capacity of the data page PAGE_SIZE, thereby simplifying the scene classification and the implementation process in different data distribution scenarios, while reducing the implementation difficulty, thereby improving system reliability.
[0075] To this end, a first aspect of the present invention provides a data migration method 100. Figure 4 FIG. 1 is a schematic block diagram showing an embodiment of a method for data migration according to the present invention. Figure 4 In the illustrated embodiment, the method includes:
[0076] Step S110: comparing the effective capacity host_size of the first data page of the host memory and the effective capacity local_size of the first data page of the local memory, taking the smaller value as the data size of the first data page to complete the data transmission, and calculating the difference split_size based on host_size and local_size;
[0077] Step S120: Obtain the amount of remaining data and compare it with the total capacity of a single data page PAGE_SIZE
[0078] Make comparisons;
[0079] Step S130: In response to the amount of remaining data being greater than or equal to PAGE_SIZE, completing data transmission of the amount of data PAGE_SIZE in batches according to the state of the difference split_size, and comparing the updated amount of remaining data with PAGE_SIZE;
[0080] Step S140: In response to the amount of the remaining data being less than PAGE_SIZE, the data transmission of the remaining data is completed in batches according to the state of the difference split_size and the amount of the remaining data.
[0081] In summary, to address the aforementioned issues in the prior art, the present invention no longer first calculates the actual number of data pages required based on the amount of data to be transferred and the page offset information. Instead, it first compares the effective capacities. Therefore, in step S110, the effective capacity of the first data page in the host memory, host_size, is compared with the effective capacity of the first data page in the local memory, local_size. The smaller value is used as the data size for the first data page to complete the data transfer. The difference, split_size, is then calculated based on host_size and local_size.
[0082] Then in step S120, the amount of remaining data is obtained, and the subsequent processing process is divided into two categories based on the comparison between the amount of remaining data and the total capacity PAGE_SIZE of the single data page, instead of dividing the migration process into multiple complex scenarios as in the prior art, such as the aforementioned three scenarios, or even six scenarios or more.
[0083] Based on this, in step S130, if the amount of remaining data is greater than or equal to PAGE_SIZE based on the comparison result of step S120, data of an amount of PAGE_SIZE is transmitted in batches according to the status of the difference split_size calculated in step S110, and the updated amount of remaining data is compared with PAGE_SIZE. This step is repeated until the updated amount of remaining data is less than PAGE_SIZE.
[0084] Once the comparison result shows that the amount of remaining data is less than PAGE_SIZE, in step S140 , the data transmission of the remaining data is completed in batches according to the state of the difference split_size calculated in step S110 and the amount of the remaining data.
[0085] At this point, the simplified scenario of data movement between the host data page linked list and the local data page linked list through the DMA (Direct Memory Access) controller is completed.
[0086] Furthermore, in some embodiments of the method 100 for data migration according to the present invention, the method can also be implemented according to the following aspects.
[0087] (1) Compare the sizes of host_size and local_size, take the smaller value as the data size for the first transmission of page 1, and complete the first data transmission of page 1;
[0088] (2) Determine the amount of remaining data. If it is not less than PAGE_SIZE, complete the transmission of data of PAGE_SIZE. Depending on whether split_size is zero, decide whether to perform the transmission in one or two steps.
[0089] (2.1) If split_size is greater than 0, the transmission is performed in two times, the first time is to transmit split_size, and the second time is to transmit trans_size;
[0090] (2.2) If split_size is equal to 0, the transmission is performed in one batch, and the amount of data transmitted is trans_size;
[0091] (3) Repeat (2) until the remaining data is less than PAGE_SIZE. Then, depending on whether split_size is zero, perform the following operations:
[0092] (3.1) If split_size is greater than 0, determine whether the remaining data is greater than split_size. If so, perform two transfers: the first transfer is split_size, and the second transfer is the remaining data. If not, complete the remaining data transfer in one go.
[0093] (3.2) If split_size is equal to 0, the remaining data transmission is completed in one go.
[0094] Therefore, in some embodiments of the data migration method 100 according to the present invention, step S130, in response to the amount of remaining data being greater than or equal to PAGE_SIZE, completing the data transmission of the amount of data PAGE_SIZE in batches according to the status of the difference split_size, and comparing the updated amount of remaining data with PAGE_SIZE, further includes: step S131: in response to the difference split_size being zero, completing the data transmission of the amount of data PAGE_SIZE in one go. That is, when the difference split_size is zero, completing the data transmission of the amount of data PAGE_SIZE in one go.
[0095] Furthermore, according to the data migration method 100 of the present invention, step S130 further includes: step S132: in response to the difference split_size being non-zero, calculating the transmission data amount trans_size based on PAGE_SIZE and the difference split_size, and completing the data transmission of the data amount PAGE_SIZE in two steps, wherein the data transmission of the data amount split_size is completed in the first step, and the data transmission of the data amount trans_size is completed in the second step. In other words, when the difference split_size is not equal to zero, preferably greater than zero, the transmission data amount trans_size is first calculated based on PAGE_SIZE and the difference split_size. The data transmission of the data amount PAGE_SIZE is completed in two steps, wherein the data transmission of the data amount split_size is completed in the first step, and the data transmission of the data amount trans_size is completed in the second step.
[0096] In some embodiments of the data migration method 100 according to the present invention, step S140, in response to the amount of the remaining data being less than PAGE_SIZE, completing the data transmission of the remaining data in batches according to the state of the difference split_size and the amount of the remaining data, further includes: step S141: in response to the difference split_size being zero, completing the data transmission of the remaining data all at once. That is, when the difference split_size is zero, completing the data transmission of the remaining data all at once.
[0097] Furthermore, according to the data migration method 100 of the present invention, step S140 further includes: step S142: in response to the difference split_size being non-zero, completing the data transmission of the remaining data in batches based on the comparison between the difference split_size and the amount of remaining data. In other words, when the difference split_size is not equal to zero, preferably greater than zero, the difference split_size and the amount of remaining data are first compared. Then, the data transmission of the remaining data is completed in batches based on the comparison result.
[0098] In some embodiments of the method 100 for data migration according to the present invention, step S140, or more precisely, step S142, of completing the data transmission of the remaining data in batches based on the comparison of the difference split_size and the amount of the remaining data further includes: step S1421: in response to the amount of the remaining data being greater than the difference split_size, completing the data transmission of the remaining data in two batches, wherein the first batch completes the data transmission of the amount of split_size, and the second batch completes the data transmission of the remaining data. That is, if the amount of the remaining data is greater than the difference split_size, completing the data transmission of the remaining data in two batches, wherein the first batch completes the data transmission of the amount of split_size, and the second batch completes the data transmission of the remaining data.
[0099] Furthermore, step S140, or more precisely, step S142, of completing the data transmission of the remaining data in batches based on the comparison of the difference split_size and the amount of remaining data further includes: step S1422: in response to the amount of remaining data being less than or equal to the difference split_size, completing the data transmission of the remaining data all at once. In other words, if the amount of remaining data is less than or equal to the difference split_size, the data transmission of the remaining data is completed all at once.
[0100] Next, the implementation process of the present invention is further explained by taking three typical scenarios of data being moved from a host memory (host) to a local memory (local) with intra-page offsets on both ends as examples.
[0101] For scenario 1, the process of handling host_offset less than local_offset is as follows: Figure 5 As shown, including:
[0102] (1) Compare the sizes of host_size and local_size, and take the smaller value as the data size for the first transmission of page 1. In this scenario, this value is local_size, and the first data transmission of page 1 is completed.
[0103] (2) Determine the amount of remaining data. If it is not less than PAGE_SIZE, complete a round of data transmission with a data amount of PAGE_SIZE. The transmission is carried out in two times. The first time is to transmit split_size, and the second time is to transmit trans_size. The combination is as follows: Figure 5 As shown in the dotted ellipse 1, the total amount of data transferred twice is PAGE_SIZE, but the data transferred twice are distributed on two different data pages.
[0104] (3) Repeat step (2) until the remaining data is less than PAGE_SIZE. Then determine whether the remaining data is greater than split_size. If so, perform two transmissions, the first transmission is split_size, and the second transmission is the remaining data. The combination is as follows: Figure 5 As shown by the dotted oval 2, the two transmitted data are distributed on two different data pages.
[0105] For scenario 2, the process of handling host_offset greater than local_offset is as follows: Figure 6 As shown, the same steps as in scenario 1 are still used, except that when the data size is PAGE_SIZE in scenario 2, the two data segments split_size and trans_size are located on the same data page, as shown in Figure 6 The remaining data that is less than PAGE_SIZE is also located on the same data page, as shown in the dotted oval 1 in FIG. Figure 6 As shown in the dotted ellipse 2 in FIG.
[0106] For scenario three, the process of host_offset being equal to local_offset is as follows: Figure 7 As shown, the same steps as in Scenario 1 are still used, except that because host_offset and local_offset are equal, split_size is 0. Compared with Scenario 1, the original two intermediate data transfers of PAGE_SIZE are reduced to one, and the final data transfer of less than PAGE_SIZE is also reduced from two to one.
[0107] The second aspect of the present invention further provides a data migration system 200. Figure 8 FIG. 2 shows a schematic block diagram of an embodiment of a data migration system 200 according to the present invention. Figure 8 As shown, the system includes:
[0108] The home page data transmission module 210 is configured to compare the effective capacity host_size of the first data page of the host memory and the effective capacity local_size of the first data page of the local memory, use the smaller value as the data size of the first data page to complete the data transmission, and calculate the difference split_size based on host_size and local_size;
[0109] The remaining data comparison module 220 is configured to obtain the amount of remaining data and compare it with the total capacity PAGE_SIZE of a single data page;
[0110] a cyclic transmission processing module 230 configured to complete data transmission of an amount of data of PAGE_SIZE in batches according to the state of the difference split_size in response to the amount of remaining data being greater than or equal to PAGE_SIZE, and compare the updated amount of remaining data with PAGE_SIZE;
[0111] The last page data transmission module 240 is configured to complete the data transmission of the remaining data in batches according to the state of the difference split_size and the amount of the remaining data in response to the amount of the remaining data being less than PAGE_SIZE.
[0112] A third aspect of the embodiments of the present invention further provides a computer-readable storage medium. Figure 9 Schematic diagram of a computer-readable storage medium according to a method for data migration provided by an embodiment of the present invention. Figure 9 As shown, the computer-readable storage medium 300 stores computer program instructions 310, which can be executed by a processor. When the computer program instructions 310 are executed, the method of any one of the above embodiments is implemented.
[0113] It should be understood that, unless they conflict with each other, all the embodiments, features and advantages described above for the method for data migration according to the present invention are also applicable to the system and storage medium for data migration according to the present invention.
[0114] According to a fourth aspect of the embodiments of the present invention, a computer device 400 is provided, including a memory 420 and a processor 410. The memory stores a computer program, and when the computer program is executed by the processor, the method of any one of the above embodiments is implemented.
[0115] like Figure 10 FIG. 1 is a schematic diagram of the hardware structure of a computer device for executing the data migration method provided by the present invention. Figure 10 Taking the computer device 400 shown as an example, the computer device includes a processor 410 and a memory 420, and may also include: an input device 430 and an output device 440. The processor 410, the memory 420, the input device 430 and the output device 440 can be connected via a bus or other means. Figure 10 The input device 430 can receive input digital or character information and generate signal input related to data transfer. The output device 440 can include a display device such as a display screen.
[0116] The memory 420, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the resource monitoring method in the embodiment of the present application. The memory 420 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; and the data storage area may store data created by the use of the resource monitoring method, etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 420 may optionally include a memory remotely located relative to the processor 410, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0117] The processor 410 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 420, that is, implements the resource monitoring method of the above method embodiment.
[0118] Finally, it should be noted that the computer-readable storage medium (e.g., memory) herein may be a volatile memory or a non-volatile memory, or may include both a volatile memory and a non-volatile memory. By way of example and not limitation, the non-volatile memory may include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which may act as an external cache memory. By way of example and not limitation, RAM may be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
[0119] It will also be appreciated by those skilled in the art that the various exemplary logic blocks, modules, circuits and algorithmic steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given of the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0120] The various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure herein may be implemented or executed using 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 device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general-purpose processor may be a microprocessor, but alternatively, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and / or any other such configuration.
[0121] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope of the embodiments disclosed in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless expressly limited to the singular.
[0122] It should be understood that, as used herein, the singular form "a" or "an" is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations of one or more of the items listed in association. The serial numbers of the embodiments disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0123] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples. Within the spirit of the embodiments of the present invention, the technical features of the above embodiments or different embodiments may be combined, and there are many other variations of different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the scope of protection of the embodiments of the present invention.
Claims
1. A method for data migration, characterized in that: The following steps are involved: Compare the effective capacity host_size of the first data page of the host memory with the effective capacity local_size of the first data page of the local memory, use the smaller value as the data amount to be transferred for the first data page to complete the data transfer, and calculate the difference split_size based on host_size and local_size; Get the amount of remaining data and compare it with the total capacity of a single data page, PAGE_SIZE; In response to the amount of remaining data being greater than or equal to PAGE_SIZE, completing data transmission of a data amount of PAGE_SIZE in batches according to the status of the difference split_size, and comparing the updated amount of remaining data with PAGE_SIZE; in response to the difference split_size being zero, completing data transmission of a data amount of PAGE_SIZE at one time; in response to the difference split_size being non-zero, calculating a transmission data amount trans_size based on PAGE_SIZE and the difference split_size, and completing data transmission of a data amount of PAGE_SIZE in two batches, wherein the data transmission of a data amount of split_size is completed in the first batch, and the data transmission of a data amount of trans_size is completed in the second batch; In response to the amount of the remaining data being less than PAGE_SIZE, the data transmission of the remaining data is completed in batches according to the status of the difference split_size and the amount of the remaining data; in response to the difference split_size being zero, the data transmission of the remaining data is completed at one time; in response to the difference split_size being non-zero, the data transmission of the remaining data is completed in batches according to the comparison between the difference split_size and the amount of the remaining data.
2. The method according to claim 1, characterized in that In response to the amount of the remaining data being less than PAGE_SIZE, completing the data transmission of the remaining data in batches according to the size of the difference split_size and the amount of the remaining data further includes: In response to the amount of the remaining data being greater than the difference split_size, data transmission of the remaining data is completed twice, wherein the first transmission completes data transmission of the amount of split_size, and the second transmission completes the final data transmission of the remaining data.
3. The method according to claim 1, characterized in that In response to the amount of the remaining data being less than PAGE_SIZE, completing the data transmission of the remaining data in batches according to the size of the difference split_size and the amount of the remaining data further includes: In response to the amount of the remaining data being less than or equal to the difference split_size, the data transmission of the remaining data is completed at one time.
4. A data migration system, characterized in that: include: a home page data transmission module configured to compare the effective capacity host_size of the first data page of the host memory with the effective capacity local_size of the first data page of the local memory, use the smaller value as the data amount transmitted for the first data page to complete the data transmission, and calculate the difference split_size based on host_size and local_size; a remaining data comparison module, configured to obtain the amount of remaining data and compare it with the total capacity PAGE_SIZE of a single data page; a cyclic transmission processing module, the cyclic transmission processing module being configured to, in response to the amount of the remaining data being greater than or equal to PAGE_SIZE, complete data transmission of an amount of data of PAGE_SIZE in batches according to a state of the difference split_size, and compare the updated amount of the remaining data with PAGE_SIZE; a last page data transmission module, the last page data transmission module being configured to complete the data transmission of the remaining data in batches according to the state of the difference split_size and the amount of the remaining data in response to the amount of the remaining data being less than PAGE_SIZE; The cyclic transmission processing module is further configured to complete the data transmission of a data volume of PAGE_SIZE in one go in response to the difference split_size being zero, and to calculate the transmission data volume trans_size based on PAGE_SIZE and the difference split_size in response to the difference split_size being non-zero, and to complete the data transmission of a data volume of PAGE_SIZE in two times, wherein the data transmission of the data volume of split_size is completed in the first time, and the data transmission of the data volume of trans_size is completed in the second time; The last page data transmission module is further configured to complete the data transmission of the remaining data at one time in response to the difference split_size being zero, and to complete the data transmission of the remaining data in batches according to a comparison between the difference split_size and the amount of the remaining data in response to the difference split_size being non-zero.
5. A computer-readable storage medium, characterized in that Computer program instructions are stored, and when the computer program instructions are executed, the method for data migration according to any one of claims 1 to 3 is implemented.
6. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the processor executes the computer program, the method for moving data according to any one of claims 1 to 3 is executed.
Citation Information
Patent Citations
Data storage method and apparatus
CN106598504A
A page alignment method for data storage device and a look up table production method thereof
CN107403637A