Distribution method, device and equipment of land surface calculation task, medium and product

By determining the number of sub-grids of the grid based on the surface coverage type and allocating land surface calculation tasks based on the total number of sub-grids, the problem of load imbalance between CPU cores is solved, and computing efficiency and memory usage balance is improved.

CN120179384AActive Publication Date: 2025-06-20ZHONGKE TIANJI METEOROLOGICAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510223769.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-06-20
Estimated Expiration
2045-02-27

AI Technical Summary

Technical Problem

In the land surface mode, the method of directly allocating the land surface calculation tasks to the CPU cores based on the number of grids, resulting in unbalanced load between multiple CPU cores.

Method used

By obtaining the corresponding surface coverage type of the grid, determine the number of sub-grids of the grid, and assign the land surface calculation task to multiple CPU cores based on the total number of sub-grids.

Benefits of technology

It improves load balancing and memory usage balancing among multiple CPU cores, thereby improving overall computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179384A_ABST
    Figure CN120179384A_ABST
Patent Text Reader

Abstract

The invention provides a land surface calculation task allocation method and device, equipment, a medium and a product. The method comprises the following steps: in response to a distribution request, dividing an earth land surface to obtain a plurality of grids; obtaining at least one land cover type corresponding to the grid; determining the number of secondary grids corresponding to the grids according to the at least one land cover type; according to the number of the secondary grids corresponding to each grid, calculating the total number of the secondary grids; acquiring a land surface calculation task corresponding to each grid; and according to the total number of the secondary grids, distributing the land surface calculation tasks corresponding to the plurality of grids to a plurality of central processing unit (CPU) cores, so that the plurality of CPU cores perform calculation processing on the land surface calculation tasks corresponding to the plurality of grids. Through the method, the load balance among the plurality of CPU cores is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of earth sciences, and particularly to a method, apparatus, device, medium, and product for allocating land surface calculation tasks. Background Art

[0002] In the field of earth sciences, land surface models are used to simulate physical processes related to vegetation cover, including hydrological cycle variables such as surface runoff, base flow, vegetation canopy evaporation, and soil evaporation. They can also be applied to the study of land surface processes such as permafrost, forest fires, and urban canopies.

[0003] In related technologies, in a land surface model, it is necessary to divide the earth's land surface into multiple grids based on longitude and latitude, and evenly distribute the land surface calculation tasks corresponding to the multiple grids to multiple central processing unit (CPU) cores for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0004] However, in related technologies, the method of directly evenly distributing the land surface calculation tasks corresponding to the multiple grids to multiple CPU cores has the problem of uneven load among the multiple CPU cores. Summary of the Invention

[0005] This application provides a method, apparatus, device, medium, and product for allocating land surface calculation tasks, which improves the load balance among multiple CPU cores.

[0006] In a first aspect, this application provides a method for allocating land surface calculation tasks, including:

[0007] Performing a division process on the earth's land surface in response to an allocation request to obtain multiple grids;

[0008] Obtaining at least one surface cover type corresponding to the grid;

[0009] Determining the number of sub-grids corresponding to the grid according to at least one surface cover type;

[0010] Calculating the total number of sub-grids according to the number of sub-grids corresponding to each grid;

[0011] Obtaining the land surface calculation tasks corresponding to each grid;

[0012] Allocating the land surface calculation tasks corresponding to the multiple grids to multiple central processing unit CPU cores according to the total number of sub-grids for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0013] In this solution, the electronic device can, in response to an allocation request, divide the Earth's land surface to obtain multiple grids. For each grid, the electronic device can obtain at least one land cover type corresponding to the grid and determine the number of sub-grids corresponding to the grid based on the at least one land cover type. The electronic device can calculate the total number of sub-grids based on the number of sub-grids corresponding to each grid and allocate the land surface calculation tasks corresponding to the multiple grids to multiple CPU cores according to the total number of sub-grids, so that the multiple CPU cores can perform calculation processing on the land surface calculation tasks corresponding to the multiple grids. Through the above land surface calculation task allocation method, on the one hand, the load balance among multiple CPU cores can be improved, thereby improving the overall calculation efficiency of all land surface calculation tasks; on the other hand, the usage balance among the memories corresponding to multiple CPU cores is improved.

[0014] In one implementation, determining the number of sub-grids corresponding to a grid based on at least one land cover type includes:

[0015] Obtain the area corresponding to each land cover type;

[0016] Determine the number of sub-grids corresponding to each land cover type based on the area corresponding to each land cover type;

[0017] Calculate the number of sub-grids corresponding to the grid based on the number of sub-grids corresponding to each land cover type.

[0018] In this solution, through the above method of determining the number of sub-grids corresponding to a grid by using the area corresponding to each land cover type, the accuracy of determining the number of sub-grids corresponding to the grid is improved, so that the allocation method of allocating the land surface calculation tasks corresponding to multiple grids based on the total number of sub-grids (the sum of the number of sub-grids corresponding to multiple grids) can improve the load balance among multiple CPU cores and the usage balance among the memories corresponding to multiple CPU cores.

[0019] In one implementation, determining the number of sub-grids corresponding to each land cover type based on the area ratio of each land cover type includes:

[0020] Obtain the load factor corresponding to each land cover type;

[0021] Determine the number of sub-grids corresponding to each land cover type based on the load factor corresponding to each land type and the area corresponding to each land cover type.

[0022] In this solution, by using the above method of determining the number of sub-grids corresponding to a grid based on the area and load factor corresponding to each surface coverage type, the accuracy of determining the number of sub-grids corresponding to a grid is further improved. As a result, the method of allocating land surface calculation tasks corresponding to multiple grids based on the total number of sub-grids can improve the load balance among multiple CPU cores and the usage balance among the memories corresponding to multiple CPU cores.

[0023] In one implementation, according to the total number of sub-grids, allocating the land surface calculation tasks corresponding to multiple grids to multiple central processing unit (CPU) cores includes:

[0024] For the nth CPU core, determining whether the serial number value of the nth CPU core is greater than the target serial number value; where n is a positive integer from 1 to N; and N is the total number of CPU cores;

[0025] If so, allocating the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the number of grids corresponding to each CPU core;

[0026] If not, calculating the number of CPU cores to be allocated according to the serial number value of the nth CPU core and N;

[0027] Calculating the average number of sub-grids per nth according to the number of sub-grids to be allocated and the number of CPU cores to be allocated;

[0028] Determining the number of grids corresponding to the nth CPU core according to the starting position serial number of the grids to be allocated and the average number of sub-grids per nth;

[0029] Performing an update process on the number of sub-grids to be allocated and the starting position serial number of the grids to be allocated.

[0030] In this solution, during the process of allocating the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the total number of sub-grids: for the nth CPU core, the electronic device can determine whether the sequence number value of the nth CPU core is greater than the target sequence number value. If so, the electronic device can allocate the land surface calculation tasks corresponding to the multiple grids to the multiple CPU cores according to the number of grids corresponding to each CPU core. If not, the electronic device can calculate the number of CPU cores to be allocated according to the sequence number value of the nth CPU core and N; calculate the average number of sub-grids per nth CPU core according to the number of sub-grids to be allocated and the number of CPU cores to be allocated; determine the number of grids corresponding to the nth CPU core according to the starting position sequence number of the grids to be allocated and the average number of sub-grids per nth CPU core; and perform update processing on the number of sub-grids to be allocated and the starting position sequence number of the grids to be allocated. Through the above allocation method, on the one hand, multiple sub-grids can be evenly allocated to multiple CPU cores, improving the load balance among multiple CPU cores and the usage balance among the memories corresponding to multiple CPU cores; on the other hand, the method of determining the target grid from the grids to be allocated based on the continuously adjusted average number of sub-grids can improve the allocation average.

[0031] In one implementation, determining the number of grids corresponding to the nth CPU core according to the starting position sequence number of the grids to be allocated and the average number of sub-grids per nth CPU core includes:

[0032] For the jth grid to be allocated, increase the number of sub-grids corresponding to the nth CPU core according to the number of sub-grids included in the jth grid to be allocated, and obtain the increased number of sub-grids for the jth time;

[0033] In the case where it is determined that the increased number of sub-grids for the jth time is less than or equal to the average number of sub-grids, increment the number of grids corresponding to the nth CPU core by 1; where j takes 1, 2,..., until the increased number of sub-grids for the jth time is greater than the average number of sub-grids; the position sequence number of the first grid to be allocated is the starting position sequence number of the grids to be allocated.

[0034] In this solution, the electronic device can increment the number of grids corresponding to the nth CPU core by 1 in the case where it is determined that the increased number of sub-grids for the jth time is less than or equal to the average number of sub-grids. Through the above method, it is possible to prevent the number of sub-grids included in the grids allocated to a CPU core from exceeding the average number of sub-grids. That is to say, through the above method, the average allocation of sub-grids is achieved, improving the load balance among multiple CPU cores and the usage balance among the memories corresponding to multiple CPU cores.

[0035] In one implementation, allocating the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the number of grids corresponding to each CPU core includes:

[0036] For any CPU core, determine a first starting position serial number and a first ending position serial number according to the number of grids corresponding to the CPU core;

[0037] Determine the target grid corresponding to the CPU core according to the first starting position serial number and the first ending position serial number;

[0038] Allocate the land surface calculation task corresponding to the target grid to the CPU core.

[0039] In this solution, for any CPU core, the electronic device can determine a first starting position serial number (the starting position serial number of the target grid corresponding to the CPU core) and a first ending position serial number (the ending position serial number of the target grid corresponding to the CPU core) according to the number of grids corresponding to the CPU core, and determine the target grid corresponding to the CPU core according to the first starting position serial number and the first ending position serial number. The electronic device can allocate the land surface calculation task corresponding to the target grid to the CPU core. Through the above method, the target grid corresponding to each CPU core can be accurately determined, and then the land surface calculation task corresponding to the target grid can be accurately allocated to the CPU core.

[0040] In a second aspect, an embodiment of the present application provides an allocation device for land surface calculation tasks, including:

[0041] A processing module, configured to perform division processing on the earth's land surface in response to an allocation request to obtain a plurality of grids;

[0042] The processing module is further configured to obtain at least one land cover type corresponding to the grid;

[0043] The processing module is further configured to determine the number of sub-grids corresponding to the grid according to at least one land cover type;

[0044] The processing module is further configured to calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid;

[0045] The processing module is further configured to obtain the land surface calculation tasks corresponding to each grid;

[0046] An allocation module, configured to allocate the land surface calculation tasks corresponding to the plurality of grids to a plurality of central processing unit (CPU) cores according to the total number of sub-grids, so that the plurality of CPU cores perform calculation processing on the land surface calculation tasks corresponding to the plurality of grids.

[0047] The allocation device for land surface calculation tasks provided by the embodiment of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, which will not be elaborated here.

[0048] In one implementation, the processing module is specifically configured to:

[0049] Obtain the area corresponding to each land surface cover type;

[0050] Determine the number of sub - grids corresponding to each land surface cover type according to the area corresponding to each land surface cover type;

[0051] Calculate the number of sub - grids corresponding to the grid according to the number of sub - grids corresponding to each land surface cover type.

[0052] The land surface calculation task allocation device provided by the embodiments of the present application can execute the technical solutions shown in the above - mentioned method embodiments. The implementation principles and beneficial effects are similar, and will not be elaborated here.

[0053] In one implementation, the processing module is specifically used for:

[0054] Obtain the load factor corresponding to each land surface cover type;

[0055] Determine the number of sub - grids corresponding to each land surface cover type according to the load factor corresponding to each land surface type and the area corresponding to each land surface cover type.

[0056] The land surface calculation task allocation device provided by the embodiments of the present application can execute the technical solutions shown in the above - mentioned method embodiments. The implementation principles and beneficial effects are similar, and will not be elaborated here.

[0057] In one implementation, the allocation module is specifically used for:

[0058] For the nth CPU core, determine whether the serial number value of the nth CPU core is greater than the target serial number value; where n is a positive integer from 1 to N; N is the total number of CPU cores;

[0059] If so, allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the number of grids corresponding to each CPU core;

[0060] If not, calculate the number of CPU cores to be allocated according to the serial number value of the nth CPU core and N;

[0061] Calculate the average number of sub - grids per n according to the number of sub - grids to be allocated and the number of CPU cores to be allocated;

[0062] Determine the number of grids corresponding to the nth CPU core according to the starting position serial number of the grid to be allocated and the average number of sub - grids per n;

[0063] Perform update processing on the number of sub - grids to be allocated and the starting position serial number of the grid to be allocated.

[0064] The allocation device for land surface calculation tasks provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments. The implementation principles and beneficial effects are similar and will not be elaborated here.

[0065] In one implementation, the allocation module is specifically configured to:

[0066] For the j-th grid to be allocated, according to the number of sub-grids included in the j-th grid to be allocated, increase the number of sub-grids corresponding to the n-th CPU core to obtain the increased number of sub-grids for the j-th time;

[0067] In the case where it is determined that the increased number of sub-grids for the j-th time is less than or equal to the average number of sub-grids, increment the number of grids corresponding to the n-th CPU core by 1; where j takes values of 1, 2,..., until the increased number of sub-grids for the j-th time is greater than the average number of sub-grids; the position serial number of the first grid to be allocated is the starting position serial number of the grids to be allocated.

[0068] The allocation device for land surface calculation tasks provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments. The implementation principles and beneficial effects are similar and will not be elaborated here.

[0069] In one implementation, the allocation module is specifically configured to:

[0070] For any CPU core, determine the first starting position serial number and the first ending position serial number according to the number of grids corresponding to the CPU core;

[0071] Determine the target grid corresponding to the CPU core according to the first starting position serial number and the first ending position serial number;

[0072] Allocate the land surface calculation task corresponding to the target grid to the CPU core.

[0073] The allocation device for land surface calculation tasks provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments. The implementation principles and beneficial effects are similar and will not be elaborated here.

[0074] In a third aspect, the present application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0075] The memory stores computer-executable instructions;

[0076] The processor executes the computer-executable instructions stored in the memory to implement the method as in the first aspect.

[0077] The electronic device provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments. The implementation principles and beneficial effects are similar and will not be elaborated here.

[0078] Fourthly, an embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method in the first aspect when executed by a processor.

[0079] When the computer-executable instructions in the computer-readable storage medium provided by the embodiment of the present application are executed by a processor, the technical solutions shown in the above method embodiments can be implemented, and the implementation principles and beneficial effects are similar, which will not be elaborated here.

[0080] Fifthly, the present application provides a computer program product including a computer program, which implements the method in the first aspect when executed by a processor.

[0081] When the computer program in the computer program product provided by the embodiment of the present application is executed by a processor, the technical solutions shown in the above method embodiments can be implemented, and the implementation principles and beneficial effects are similar, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] The drawings here are incorporated into the description and form a part of this description, showing embodiments consistent with the present application, and are used together with the description to explain the principles of the present application.

[0083] Figure 1 It is a schematic diagram of a scenario for a method of allocating land surface calculation tasks provided by an embodiment of the present application;

[0084] Figure 2 It is a schematic flowchart of the first embodiment of a method of allocating land surface calculation tasks provided by an embodiment of the present application;

[0085] Figure 3a It is a schematic flowchart of the second embodiment of a method of allocating land surface calculation tasks provided by an embodiment of the present application;

[0086] Figure 3b It is a schematic diagram of an acceleration ratio provided by an embodiment of the present application;

[0087] Figure 3c It is another schematic diagram of an acceleration ratio provided by an embodiment of the present application;

[0088] Figure 4 It is a schematic flowchart of the third embodiment of a method of allocating land surface calculation tasks provided by an embodiment of the present application;

[0089] Figure 5 It is a schematic flowchart of the fourth embodiment of a method of allocating land surface calculation tasks provided by an embodiment of the present application;

[0090] Figure 6 It is a schematic structural diagram of an apparatus for allocating land surface calculation tasks provided by an embodiment of the present application;

[0091] Figure 7 This is a structural diagram of an electronic device provided for this application.

[0092] Through the above-mentioned drawings, specific embodiments of this application have been shown, and there will be more detailed descriptions hereinafter. These drawings and written descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. Specific Embodiments

[0093] Here, exemplary embodiments will be described in detail, and examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. On the contrary, they are merely examples of devices and methods consistent with some aspects of this application as detailed in the appended claims.

[0094] It should be noted that the method, device, equipment, medium, and product for allocating land surface calculation tasks of this application can be used in the field of earth science and can also be used in any field other than earth science. This application does not limit the application field of the method, device, equipment, medium, and product for allocating land surface calculation tasks.

[0095] In the field of earth science, land surface models are used to simulate physical processes related to vegetation cover, including hydrological cycle variables such as surface runoff, base flow, vegetation canopy evaporation, and soil evaporation, and can also be applied to the research of land surface processes such as frozen soil, forest fires, and urban canopies.

[0096] In the related art, in a land surface model, it is necessary to divide the earth's land surface into multiple grids based on longitude and latitude, and evenly distribute the land surface calculation tasks corresponding to the multiple grids to multiple central processing unit (CPU) cores according to the number of grids of the multiple grids for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0097] However, in the related art, the method of directly evenly distributing the land surface calculation tasks corresponding to the multiple grids to the multiple CPU cores according to the number of grids of the multiple grids has the problem of uneven load among the multiple CPU cores.

[0098] Based on the above technical problems, the technical concept of the embodiments of the present application is as follows: For each grid, the electronic device can obtain at least one land cover type corresponding to the grid, and determine the number of sub-grids corresponding to the grid according to the at least one land cover type. The electronic device can calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid, and allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the total number of sub-grids.

[0099] Through the above allocation method of land surface calculation tasks, the load balance among multiple CPU cores is improved.

[0100] Next, a method for allocating land surface calculation tasks provided by the embodiments of the present application will be described in detail.

[0101] For ease of understanding, first, in combination with Figure 1 the application scenario involved in the embodiments of the present application will be described.

[0102] Figure 1 FIG. is a schematic diagram of the scenario of a method for allocating land surface calculation tasks provided by the embodiments of the present application.

[0103] As Figure 1 shown, this scenario includes a terminal device 10, an electronic device 20, and at least one server. Exemplarily, Figure 1 four servers are shown, namely server 30, server 40, server 50, and server 60.

[0104] The electronic device 20 can be communicatively connected to the terminal device 10 and at least one server respectively.

[0105] It should be noted that the electronic device 20 can be a server, a server cluster, or a terminal device (such as a computer, etc.), and the embodiments of the present application do not limit this. It should also be noted that when the electronic device 20 is a terminal device, the electronic device 20 can be integrated with the terminal device 10 into one device.

[0106] It should also be noted that for any server, the server can include at least one CPU core (exemplarily, Figure 1 it is shown that each server includes two CPU cores).

[0107] In this application scenario, the electronic device 20 can, in response to an allocation request, perform a partitioning process on the earth's land surface to obtain multiple grids. Among them, the allocation request can be sent by the terminal device 10.

[0108] The electronic device 20 can obtain at least one land cover type corresponding to the grid.

[0109] The electronic device 20 may determine the number of sub-grids corresponding to a grid according to at least one surface coverage type.

[0110] The electronic device 20 may calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid.

[0111] The electronic device 20 may obtain the land surface calculation tasks corresponding to each grid.

[0112] The electronic device 20 may, according to the total number of sub-grids, allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids. It should be noted that the multiple CPU cores belong to at least one server.

[0113] It should be noted that Figure 1 is only a schematic diagram of an application scenario provided by the embodiments of the present application, and the embodiments of the present application do not Figure 1 limit the actual forms of various components included therein, nor do they limit Figure 1 the interaction manners between the components therein. In the application of the solution, it may be set according to actual requirements.

[0114] The technical solution of the present application and how the technical solution of the present application solves the above technical problems will be described in detail below with specific embodiments. These specific embodiments below may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the drawings.

[0115] Figure 2 is a schematic flowchart of the first embodiment of a method for allocating land surface calculation tasks provided by the embodiments of the present application. As Figure 2 shown, the method includes the following steps:

[0116] S201: In response to an allocation request, perform a partitioning process on the earth's land surface to obtain a plurality of grids.

[0117] In this embodiment, the earth's surface includes the earth's land surface and the earth's ocean.

[0118] The electronic device may obtain the allocation request sent by the terminal device.

[0119] The electronic device may, in response to the allocation request, perform a partitioning process on the earth's land surface to obtain a plurality of grids.

[0120] In one implementation, the electronic device partitions the earth's land surface according to longitude and latitude to obtain a plurality of grids.

[0121] S202: Obtain at least one surface coverage type corresponding to the grid.

[0122] In this embodiment, for any grid, the electronic device can obtain at least one surface cover type corresponding to the grid.

[0123] In one implementation, the grid can correspond to 100 surface cover types.

[0124] For example, the surface cover type can be a wetland type; for another example, the surface cover type can be a river type.

[0125] S203: Determine the number of sub-grids corresponding to the grid according to at least one surface cover type.

[0126] In this embodiment, the electronic device can determine the number of sub-grids corresponding to the grid according to at least one surface cover type.

[0127] In one implementation,

[0128] The electronic device can obtain the areas corresponding to the respective surface cover types.

[0129] The electronic device can determine the number of sub-grids corresponding to the respective surface cover types according to the areas corresponding to the respective surface cover types.

[0130] The electronic device can calculate the number of sub-grids corresponding to the grid according to the number of sub-grids corresponding to the respective surface cover types.

[0131] In one implementation,

[0132] The electronic device can obtain the areas corresponding to the respective surface cover types.

[0133] The electronic device can obtain the load factors corresponding to the respective surface cover types.

[0134] The electronic device can determine the number of sub-grids corresponding to the respective surface cover types according to the load factors corresponding to the respective surface types and the areas corresponding to the respective surface cover types.

[0135] The electronic device can calculate the number of sub-grids corresponding to the grid according to the number of sub-grids corresponding to the respective surface cover types.

[0136] In one implementation,

[0137] The electronic device can obtain the load factors corresponding to the respective surface cover types.

[0138] The electronic device can determine the number of sub-grids corresponding to the respective surface cover types according to the load factors corresponding to the respective surface types.

[0139] The electronic device can calculate the number of sub-grids corresponding to the grid according to the number of sub-grids corresponding to the respective surface cover types.

[0140] In one implementation,

[0141] The electronic device can determine the number of surface cover types according to at least one surface cover type corresponding to the grid.

[0142] The electronic device can determine the number of sub-grids corresponding to the grid according to the number of surface cover types.

[0143] S204: Calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid.

[0144] In this embodiment, after obtaining the number of sub-grids corresponding to each grid, the electronic device can calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid.

[0145] It can be understood that the total number of sub-grids is the sum of the number of sub-grids corresponding to each grid.

[0146] S205: Obtain the land surface calculation tasks corresponding to each grid.

[0147] In this embodiment, the electronic device can obtain the land surface calculation tasks corresponding to each grid.

[0148] For example, the land surface calculation task can be a task of calculating the ratio of carbon absorption to carbon release. For another example, the land surface calculation task can be a task of calculating the contribution rate of human activities to surface runoff.

[0149] S206: According to the total number of sub-grids, allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0150] In this embodiment, the electronic device can allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the total number of sub-grids for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0151] Next, the process of the electronic device allocating the land surface calculation tasks corresponding to multiple grids to multiple PU cores according to the total number of sub-grids will be described.

[0152] In one implementation,

[0153] For the nth CPU core, the electronic device can determine whether the sequence number value of the nth CPU core is greater than the target sequence number value; where n is a positive integer from 1 to N; N is the total number of CPU cores. In one implementation, the target sequence number value can be the sequence number value of the Nth CPU core.

[0154] If so, the electronic device can allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the number of grids corresponding to each CPU core.

[0155] Otherwise, the electronic device may calculate the number of CPU cores to be allocated according to the serial number value of the nth CPU core and N. The electronic device may calculate the nth average sub-grid number according to the number of sub-grids to be allocated and the number of CPU cores to be allocated obtained. The electronic device may determine the number of grids corresponding to the nth CPU core according to the starting position serial number of the grid to be allocated obtained and the nth average sub-grid number. The electronic device may perform an update process on the number of sub-grids to be allocated and the starting position serial number of the grid to be allocated.

[0156] Advantages of this embodiment: In response to an allocation request, the electronic device may perform a division process on the earth's land surface to obtain multiple grids. For each grid, the electronic device may obtain at least one land cover type corresponding to the grid and determine the number of sub-grids corresponding to the grid according to the at least one land cover type. The electronic device may calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid, and allocate the land surface calculation tasks corresponding to the multiple grids to multiple CPU cores according to the total number of sub-grids for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids. Through the above land surface calculation task allocation method, on the one hand, the load balance among multiple CPU cores can be improved, thereby improving the overall calculation efficiency of all land surface calculation tasks; on the other hand, the usage balance among the memories corresponding to multiple CPU cores is improved.

[0157] Figure 3a This is a schematic flowchart of the second embodiment of a method for allocating land surface calculation tasks provided by an embodiment of the present application. As Figure 3a shown, the method includes the following steps:

[0158] S301: In response to an allocation request, perform a division process on the earth's land surface to obtain multiple grids.

[0159] In this embodiment, the electronic device may perform a division process on the earth's land surface in response to an allocation request to obtain multiple grids.

[0160] The specific implementation process is the same as that of S201 and will not be elaborated here.

[0161] S302: Obtain at least one land cover type corresponding to the grid.

[0162] In this embodiment, the electronic device may obtain at least one land cover type corresponding to the grid.

[0163] The specific implementation process is the same as that of S202 and will not be elaborated here.

[0164] S303: Obtain the area corresponding to each land cover type.

[0165] In this embodiment, the electronic device can obtain the area corresponding to each surface coverage type.

[0166] For example, for a grid, the grid includes four surface coverage types. Among them, the four surface coverage types are wetland type, river type, grassland type, and snow mountain type respectively. The electronic device can obtain the area corresponding to each surface coverage type.

[0167] S304: Determine the number of sub-grids corresponding to each surface coverage type according to the area corresponding to each surface coverage type.

[0168] In this embodiment, the electronic device can determine the number of sub-grids corresponding to each surface coverage type according to the area corresponding to each surface coverage type.

[0169] In one implementation,

[0170] The electronic device can compare the areas corresponding to each surface coverage type and determine the surface coverage type corresponding to the smaller one as the reference surface coverage type.

[0171] The electronic device can determine that the number of sub-grids corresponding to the reference surface coverage type is 1.

[0172] For the second surface coverage type, the electronic device can determine the area ratio of the area of the second surface coverage type to the area of the reference surface coverage type. It should be noted that the second surface coverage type can be the surface coverage types included in the grid except the reference surface coverage type.

[0173] The electronic device can determine the number of sub-grids corresponding to the second surface coverage type according to the area ratio and the number of sub-grids corresponding to the reference surface coverage type. In one implementation, the ratio of the number of sub-grids corresponding to the second surface coverage type to the number of sub-grids corresponding to the reference surface coverage type is consistent with the area ratio.

[0174] In one implementation,

[0175] The electronic device can obtain the area corresponding to each surface coverage type.

[0176] The electronic device can obtain the load factor corresponding to each surface coverage type.

[0177] The electronic device can determine the number of sub-grids corresponding to each surface coverage type according to the load factor corresponding to each surface type and the area corresponding to each surface coverage type.

[0178] S305: Calculate the number of sub-grids corresponding to the grid according to the number of sub-grids corresponding to each surface coverage type.

[0179] In this embodiment, the electronic device can calculate the number of sub-grids corresponding to a grid according to the number of sub-grids corresponding to each surface coverage type. It can be understood that the number of sub-grids corresponding to a grid is the sum of the number of sub-grids corresponding to each surface coverage type.

[0180] S306: Calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid.

[0181] In this embodiment, the electronic device can calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid.

[0182] The specific implementation process is the same as that of S204 and will not be elaborated here.

[0183] S307: Obtain the land surface calculation tasks corresponding to each grid.

[0184] In this embodiment, the electronic device can obtain the land surface calculation tasks corresponding to each grid.

[0185] The specific implementation process is the same as that of S205 and will not be elaborated here.

[0186] S308: According to the total number of sub-grids, allocate the land surface calculation tasks corresponding to multiple grids to multiple central processing unit (CPU) cores for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0187] In this embodiment, the electronic device can allocate the land surface calculation tasks corresponding to multiple grids to multiple central processing unit (CPU) cores according to the total number of sub-grids for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0188] Through the above method, the load balance among multiple CPU cores and the usage balance of the memory corresponding to multiple CPU cores can be improved.

[0189] Figure 3b This is a schematic diagram of the speedup ratio provided by an embodiment of the present application. As Figure 3b shown, when the maximum value of the number of sub-grids included in the grid is 20, as the total number of CPU cores increases, the speedup ratio of the method of the present application and the method of the related art gradually increases. That is to say, the method of the present application has a significant acceleration effect.

[0190] Figure 3c This is another schematic diagram of the speedup ratio provided by an embodiment of the present application. As Figure 3c shown, when the maximum value of the number of sub-grids included in the grid is 60, as the total number of CPU cores increases, the speedup ratio of the method of the present application and the method of the related art gradually increases.

[0191] Beneficial effects of this embodiment: The electronic device can, in response to an allocation request, divide the land surface of the earth to obtain multiple grids. For each grid, the electronic device can obtain at least one land cover type corresponding to the grid. The electronic device can obtain the area corresponding to each land cover type, and determine the number of sub-grids corresponding to each land cover type according to the area corresponding to each land cover type. The electronic device can calculate the number of sub-grids corresponding to the grid according to the number of sub-grids corresponding to each land cover type. The electronic device can calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid, and allocate the land surface calculation tasks corresponding to the multiple grids to multiple CPU cores according to the total number of sub-grids, for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids. By the above method of determining the number of sub-grids corresponding to the grid using the area corresponding to each land cover type, the accuracy of determining the number of sub-grids corresponding to the grid is improved, and further, the allocation method of allocating the land surface calculation tasks corresponding to the multiple grids based on the total number of sub-grids (the sum of the number of sub-grids corresponding to the multiple grids) can improve the load balance among the multiple CPU cores and the usage balance among the memories corresponding to the multiple CPU cores.

[0192] Next, through Method Embodiment 3, the process of the electronic device allocating the land surface calculation tasks corresponding to the multiple grids to multiple CPU cores according to the total number of sub-grids will be described.

[0193] Figure 4 FIG. is a schematic flowchart of Method Embodiment 3 for allocating a land surface calculation task provided by an embodiment of the present application. As Figure 4 shown, the method includes the following steps:

[0194] S401: For the nth CPU core, determine whether the sequence number value of the nth CPU core is greater than the target sequence number value.

[0195] In this embodiment, the electronic device can determine to allocate a corresponding sequence number value to each CPU core.

[0196] For the nth CPU core, the electronic device can determine whether the sequence number value of the nth CPU core is greater than the target sequence number value. In one implementation, the target sequence number value can be the sequence number value of the Nth CPU core.

[0197] It should be noted that n is a positive integer from 1 to N; N is the total number of CPU cores.

[0198] If so, execute S402.

[0199] If not, execute S403.

[0200] In one implementation, the electronic device can determine whether the serial number value of the nth CPU core is greater than the target serial number value by executing "do n = 1, N". Among them, the target serial number value is N(ndivs), which is the total number of CPU cores.

[0201] S402: According to the number of grids corresponding to each CPU core, allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores.

[0202] In this embodiment, when the electronic device determines that the serial number value of the nth CPU core is greater than the target serial number value, it can allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the number of grids corresponding to each CPU core.

[0203] In one implementation,

[0204] For any CPU core, the electronic device can determine the first start position serial number and the first end position serial number according to the number of grids corresponding to the CPU core. It should be noted that the first start position serial number and the first end position serial number refer to the start position serial number and the end position serial number of at least one target grid that can be allocated to the CPU core. For example, if the position serial numbers of three target grids allocated to the CPU core are 1, 2, and 3, then the first start position serial number is 1 and the first end position serial number is 3.

[0205] Exemplarily, the electronic device can determine the first start position serial number and the first end position serial number based on the following statements.

[0206] pos = 1

[0207] do n = 1, N

[0208] istart(n) = pos

[0209] iend(n) = pos + my_npts(n) - 1

[0210] pos = pos + my_npts(n)

[0211] enddo

[0212] The electronic device can determine the target grid corresponding to the CPU core according to the first start position serial number and the first end position serial number.

[0213] The electronic device can allocate the land surface calculation task corresponding to the target grid to the CPU core.

[0214] S403: Calculate the number of CPU cores to be allocated according to the serial number value of the nth CPU core and N.

[0215] In this embodiment, when the electronic device determines that the serial number value of the nth CPU core is not the target serial number value, it can calculate the number of CPU cores to be allocated according to the serial number value of the nth CPU core and N.

[0216] In one implementation, the electronic device determines the difference between N and the serial number value of the nth CPU core as the number of CPU cores to be allocated.

[0217] S404: Calculate the nth average sub-grid number according to the number of sub-grids to be allocated and the number of CPU cores to be allocated obtained.

[0218] In this embodiment, the electronic device can calculate the nth average sub-grid number according to the number of sub-grids to be allocated (ncost_left) and the number of CPU cores to be allocated (ndivs_left) obtained.

[0219] In one implementation, the electronic device can execute "avg_cost = real(ncosts_left) / ndivs_left" to obtain the nth average sub-grid number. Where ndivs_left = N - n + 1. It should be noted that avg_cost is a real number.

[0220] It should be noted that before determining the number of grids corresponding to the 1st CPU core, the number of sub-grids to be allocated is the same as the total number of sub-grids (ncost_left = ncost).

[0221] In one implementation, the electronic device can determine the ratio of the number of sub-grids to be allocated and the number of CPU cores to be allocated as the nth average sub-grid number.

[0222] S405: Determine the number of grids corresponding to the nth CPU core according to the starting position serial number of the grid to be allocated obtained and the nth average sub-grid number.

[0223] In this embodiment, the electronic device can determine the number of grids corresponding to the nth CPU core according to the starting position serial number of the grid to be allocated obtained and the nth average sub-grid number.

[0224] In one implementation

[0225] For the jth grid to be allocated, the electronic device can increase the number of sub-grids corresponding to the nth CPU core according to the number of sub-grids included in the jth grid to be allocated to obtain the jth increased number of sub-grids.

[0226] The electronic device can determine whether the jth increased number of sub-grids is greater than the average sub-grid number.

[0227] The electronic device may increment the number of grids corresponding to the nth CPU core by 1 when it determines that the number of sub-grids after the jth increment is less than or equal to the average number of sub-grids.

[0228] Where j takes values of 1, 2,..., until the number of sub-grids after the jth increment is greater than the average number of sub-grids.

[0229] It should be noted that the position serial number of the first grid to be allocated is the starting position serial number of the grid to be allocated.

[0230] In one implementation

[0231] Exemplarily, the electronic device may determine the number of grids corresponding to the nth CPU core based on the following statements.

[0232]

[0233] do i=cur_pos,npts

[0234] cur_npts=cur_npts+1

[0235] cur_cost=cur_cost+cost(i)

[0236] if(cur_cost>avg_cost)exit

[0237] enddo

[0238] my_npts(n)=cur_npts–1

[0239] cur_cost=cur_cost–cost(i)

[0240] It should be noted that cur_pos is the starting position serial number of the grid to be allocated; npts is the total number of grids.

[0241] S406: Update the number of sub-grids to be allocated and the starting position serial number of the grid to be allocated.

[0242] In this embodiment, the electronic device may update the number of sub-grids to be allocated and the starting position serial number of the grid to be allocated.

[0243] In one implementation, the electronic device may update the number of sub-grids to be allocated based on the number of target grids. It can be understood that the difference between the number of sub-grids to be allocated before the update and the number of sub-grids included in all target grids is the number of sub-grids to be allocated after the update.

[0244] In one implementation, the electronic device may update the starting position serial number of the to-be-allocated grid based on the number of target grids. It can be understood that the sum of the starting position serial number before the update and the number of target grids is the updated starting position serial number.

[0245] Advantageous effects of this embodiment: In this embodiment, in the process of allocating the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the total number of sub-grids, for the nth CPU core, the electronic device may determine whether the serial number value of the nth CPU core is greater than the target serial number value. If so, the electronic device may allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the number of grids corresponding to each CPU core. If not, the electronic device may calculate the number of to-be-allocated CPU cores according to the serial number value of the nth CPU core and N; calculate the average number of sub-grids of the nth according to the number of to-be-allocated sub-grids and the number of to-be-allocated CPU cores; determine the number of grids corresponding to the nth CPU core according to the starting position serial number of the to-be-allocated grids and the average number of sub-grids of the nth; update the number of to-be-allocated sub-grids and the starting position serial number of the to-be-allocated grids. Through the above allocation method, on the one hand, multiple sub-grids can be evenly allocated to multiple CPU cores, improving the load balance between multiple CPU cores and the usage balance of the memory corresponding to multiple CPU cores; on the other hand, the method of determining the target grid from the to-be-allocated grids based on the continuously adjusted average number of sub-grids can improve the allocation average.

[0246] Figure 5 It is a schematic flowchart of Embodiment 4 of a method for allocating land surface calculation tasks provided by an embodiment of the present application. As Figure 5 shown, the method includes the following steps:

[0247] S501: In response to an allocation request, perform a partitioning process on the Earth's land surface to obtain multiple grids.

[0248] In this embodiment, the electronic device may perform a partitioning process on the Earth's land surface in response to an allocation request to obtain multiple grids.

[0249] The specific implementation process is the same as that of S201 and will not be elaborated here.

[0250] S502: Obtain at least one land cover type corresponding to the grid.

[0251] In this embodiment, the electronic device may obtain at least one land cover type corresponding to the grid.

[0252] The specific implementation process is the same as that of S202 and will not be elaborated here.

[0253] S503: Obtain the area corresponding to each land cover type.

[0254] In this embodiment, the electronic device can obtain the area corresponding to each land cover type.

[0255] The specific implementation process is the same as that of S303 and will not be elaborated here.

[0256] S504: Obtain the load factor corresponding to each land cover type.

[0257] In this embodiment, the electronic device can obtain the load factor corresponding to each land cover type.

[0258] Among them, the load factor indicates the computing load situation corresponding to the land cover type. It can be understood that in the case where one grid corresponds to one land cover type, the larger the load factor corresponding to the land cover type, the greater the load of the land surface calculation task of the grid, and the longer the time consumed by the CPU core to process the land surface calculation task corresponding to the grid.

[0259] For example, the load factor corresponding to the wetland type can be 0.9, the load factor corresponding to the river type can be 0.95, the load factor corresponding to the grassland type can be 0.9, and the load factor corresponding to the snow mountain type can be 0.5.

[0260] S505: Determine the number of sub-grids corresponding to each land cover type according to the load factor corresponding to each land surface type and the area corresponding to each land cover type.

[0261] In this embodiment, the electronic device can determine the number of sub-grids corresponding to each land cover type according to the load factor corresponding to each land surface type and the area corresponding to each land cover type.

[0262] In one implementation,

[0263] The electronic device can calculate the product value according to the load factor corresponding to each land surface type and the area corresponding to each land cover type.

[0264] The electronic device can compare the product values corresponding to each land cover type and determine the land cover type corresponding to the smaller one as the reference land cover type.

[0265] The electronic device can determine that the number of sub-grids corresponding to the reference land cover type is 1.

[0266] For the second land cover type, the electronic device can determine the ratio of the product value of the second land cover type to the product value of the reference land cover type. It should be noted that the second land cover type can be the land cover type included in the grid except the reference land cover type.

[0267] The electronic device can determine the number of sub - grids corresponding to the second land cover type according to this ratio and the number of sub - grids corresponding to the reference land cover type.

[0268] S506: Calculate the number of sub - grids corresponding to the grid according to the number of sub - grids corresponding to each land cover type.

[0269] In this embodiment, the electronic device can calculate the number of sub - grids corresponding to the grid (cost(Npts)). It should be noted that Npts is the total number of grids.

[0270] S507: Calculate the total number of sub - grids according to the number of sub - grids corresponding to each grid.

[0271] In this embodiment, the electronic device can calculate the total number of sub - grids (Ncost = sum(cost)) according to the number of sub - grids corresponding to each grid.

[0272] S508: Obtain the land surface calculation tasks corresponding to each grid.

[0273] In this embodiment, the electronic device can obtain the land surface calculation tasks corresponding to each grid.

[0274] S509: According to the total number of sub - grids, allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0275] In this embodiment, the electronic device can allocate the land surface calculation tasks corresponding to multiple grids to multiple central processing unit (CPU) cores according to the total number of sub - grids for the multiple CPU cores to perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0276] Next, the process of the electronic device allocating the land surface calculation tasks corresponding to multiple grids to multiple PU cores according to the total number of sub - grids will be described.

[0277] In one implementation,

[0278] For the nth CPU core, the electronic device can determine whether the serial number value of the nth CPU core is greater than the target serial number value; where n is a positive integer from 1 to N; and N is the total number of CPU cores.

[0279] If so, the electronic device may allocate the land surface calculation tasks corresponding to multiple grids to multiple CPU cores according to the number of grids corresponding to each CPU core. In one implementation, for any CPU core, the electronic device may determine a first starting position serial number and a first ending position serial number according to the number of grids corresponding to the CPU core, and determine the target grid corresponding to the CPU core according to the first starting position serial number and the first ending position serial number, and allocate the land surface calculation task corresponding to the target grid to the CPU core.

[0280] If not, the electronic device may calculate the number of CPU cores to be allocated according to the serial number value of the nth CPU core and N. The electronic device may calculate the average number of sub-grids of the nth according to the number of sub-grids to be allocated and the number of CPU cores to be allocated obtained. The electronic device may determine the number of grids corresponding to the nth CPU core according to the starting position serial number of the grid to be allocated obtained and the average number of sub-grids of the nth. The electronic device may perform update processing on the number of sub-grids to be allocated and the starting position serial number of the grid to be allocated.

[0281] Next, the process by which the electronic device determines the number of grids corresponding to the nth CPU core according to the starting position serial number of the grid to be allocated obtained and the average number of sub-grids of the nth will be described.

[0282] In one implementation,

[0283] For the jth grid to be allocated, the electronic device may increase the number of sub-grids corresponding to the nth CPU core according to the number of sub-grids included in the jth grid to be allocated, and obtain the increased number of sub-grids of the jth;

[0284] The electronic device may increment the number of grids corresponding to the nth CPU core by 1 when it is determined that the increased number of sub-grids of the jth is less than or equal to the average number of sub-grids.

[0285] Wherein, j takes 1, 2,... in sequence until the increased number of sub-grids of the jth is greater than the average number of sub-grids; the position serial number of the first grid to be allocated is the starting position serial number of the grid to be allocated.

[0286] In addition, in one implementation,

[0287] For any grid, the electronic device may also obtain the land surface calculation result corresponding to the grid. The land surface calculation result is obtained by the CPU core corresponding to the grid performing calculation processing on the land surface calculation task corresponding to the grid.

[0288] The electronic device can obtain the atmospheric calculation result corresponding to the grid. The atmospheric calculation result is obtained by the second CPU core corresponding to the grid calculating and processing the atmospheric calculation task corresponding to the grid. The second CPU core corresponding to the grid is determined by allocating and processing the atmospheric calculation tasks corresponding to multiple grids according to the number of grids of the multiple grids.

[0289] The electronic device can establish a correspondence between the land surface calculation result and the atmospheric calculation result.

[0290] Beneficial effects of this embodiment: The electronic device can, in response to an allocation request, divide the Earth's land surface to obtain multiple grids. For each grid, the electronic device can obtain at least one land cover type corresponding to the grid. The electronic device can obtain the area corresponding to each land cover type, and determine the number of sub-grids corresponding to each land cover type according to the area corresponding to each land cover type and the load factor. The electronic device can calculate the number of sub-grids corresponding to the grid according to the number of sub-grids corresponding to each land cover type. The electronic device can calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid, and allocate the land surface calculation tasks corresponding to the multiple grids to multiple CPU cores according to the total number of sub-grids for the multiple CPU cores to calculate and process the land surface calculation tasks corresponding to the multiple grids. By the above method of determining the number of sub-grids corresponding to the grid using the area corresponding to each land cover type, the accuracy of determining the number of sub-grids corresponding to the grid is improved, and further, the allocation method of allocating the land surface calculation tasks corresponding to the multiple grids based on the total number of sub-grids (the sum of the number of sub-grids corresponding to the multiple grids) can improve the load balance between multiple CPU cores and the usage balance of the memory corresponding to multiple CPU cores.

[0291] Figure 6 It is a schematic structural diagram of an apparatus for allocating land surface calculation tasks provided by an embodiment of the present application. As Figure 6 shown, the apparatus 60 for allocating land surface calculation tasks may include: a processing module 61 and an allocation module 62.

[0292] The processing module 61 is configured to, in response to an allocation request, divide the Earth's land surface to obtain multiple grids;

[0293] The processing module 61 is further configured to obtain at least one land cover type corresponding to the grid;

[0294] The processing module 61 is further configured to determine the number of sub-grids corresponding to the grid according to at least one land cover type;

[0295] The processing module 61 is further configured to calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid;

[0296] The processing module 61 is further configured to obtain the land surface calculation tasks corresponding to each grid;

[0297] An allocation module 62, configured to allocate the land surface calculation tasks corresponding to multiple grids to multiple central processing unit (CPU) cores according to the total number of sub-grids, so that the multiple CPU cores can perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

[0298] The land surface calculation task allocation device provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, and will not be elaborated here.

[0299] In one implementation, the processing module 61 is specifically configured to:

[0300] Obtain the areas corresponding to each surface cover type;

[0301] Determine the number of sub-grids corresponding to each surface cover type according to the areas corresponding to each surface cover type;

[0302] Calculate the number of sub-grids corresponding to the grid according to the number of sub-grids corresponding to each surface cover type.

[0303] The land surface calculation task allocation device provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, and will not be elaborated here.

[0304] In one implementation, the processing module 61 is specifically configured to:

[0305] Obtain the load coefficients corresponding to each surface cover type;

[0306] Determine the number of sub-grids corresponding to each surface cover type according to the load coefficients corresponding to each surface type and the areas corresponding to each surface cover type.

[0307] The land surface calculation task allocation device provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, and will not be elaborated here.

[0308] In one implementation, the allocation module 62 is specifically configured to:

[0309] For the nth CPU core, determine whether the serial number value of the nth CPU core is greater than the target serial number value; where n is a positive integer from 1 to N; N is the total number of CPU cores;

[0310] If so, allocate the land surface calculation tasks corresponding to the multiple grids to the multiple CPU cores according to the number of grids corresponding to each CPU core;

[0311] If not, calculate the number of CPU cores to be allocated according to the serial number value of the nth CPU core and N;

[0312] Calculate the nth average sub-grid number according to the number of sub-grids to be allocated and the number of CPU cores to be allocated obtained.

[0313] Determine the number of grids corresponding to the nth CPU core according to the starting position number of the grid to be allocated obtained and the nth average sub-grid number.

[0314] Perform update processing on the number of sub-grids to be allocated and the starting position number of the grid to be allocated.

[0315] The allocation device for land surface calculation tasks provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, which will not be elaborated here.

[0316] In one implementation manner, the allocation module 62 is specifically configured to:

[0317] For the jth grid to be allocated, increase the number of sub-grids corresponding to the nth CPU core according to the number of sub-grids included in the jth grid to be allocated, and obtain the number of sub-grids after the jth increase.

[0318] In the case where it is determined that the number of sub-grids after the jth increase is less than or equal to the average sub-grid number, perform an increment operation on the number of grids corresponding to the nth CPU core; where j takes 1, 2,..., until the number of sub-grids after the jth increase is greater than the average sub-grid number; the position number of the first grid to be allocated is the starting position number of the grid to be allocated.

[0319] The allocation device for land surface calculation tasks provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, which will not be elaborated here.

[0320] In one implementation manner, the allocation module 62 is specifically configured to:

[0321] For any CPU core, determine the first starting position number and the first ending position number according to the number of grids corresponding to the CPU core.

[0322] Determine the target grid corresponding to the CPU core according to the first starting position number and the first ending position number.

[0323] Allocate the land surface calculation task corresponding to the target grid to the CPU core.

[0324] The allocation device for land surface calculation tasks provided by the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, which will not be elaborated here.

[0325] Figure 7 It is a structural diagram of an electronic device provided by the present application. AsFigure 7 As shown, the electronic device 70 includes a processor 71 and a memory 72. Among them, the processor 71 is communicatively connected to the memory 72, and the memory 72 is used to store computer-executable instructions; the processor 71 is configured to execute the technical solutions in any of the foregoing method embodiments by executing the computer-executable instructions stored in the memory 72.

[0326] Optionally, the memory 72 can be either independent or integrated with the processor 71. Optionally, when the memory 72 is a device independent of the processor 71, the electronic device 70 may further include: a bus 73 for connecting the foregoing devices.

[0327] This electronic device is used to execute the technical solutions in any of the foregoing method embodiments, and its implementation principle and technical effects are similar, which will not be elaborated here.

[0328] This application embodiment also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the technical solutions provided in any of the foregoing method embodiments.

[0329] This application embodiment also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it is used to implement the technical solutions provided in the foregoing method embodiments.

[0330] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0331] Furthermore, it should be noted that although the steps in the flowchart are sequentially shown according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.

[0332] It should be understood that the above-described device embodiments are merely illustrative, and the devices of the present application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0333] In addition, without special instructions, in each embodiment of the present application, each functional unit / module can be integrated in one unit / module, or each unit / module can exist physically alone, or two or more units / modules can be integrated together. The above integrated unit / module can be implemented in the form of hardware or in the form of a software program module.

[0334] When the integrated unit / module is implemented in the form of hardware, the hardware can be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Without special instructions, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Without special instructions, the storage unit can be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc.

[0335] When the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs.

[0336] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as within the scope described in this specification.

[0337] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include well-known knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and the embodiments are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.

[0338] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. A method for allocating land surface computing tasks, characterized in that: include: In response to the allocation request, the earth's land surface is divided and processed to obtain a plurality of grids; Obtain at least one land cover type corresponding to the grid; Determining the number of sub-grids corresponding to the grid according to the at least one land cover type; According to the number of sub-grids corresponding to each grid, the total number of sub-grids is calculated; Get the land surface calculation tasks corresponding to each grid; According to the total number of sub-grids, the land surface calculation tasks corresponding to the multiple grids are distributed to multiple central processing unit CPU cores, so that the multiple CPU cores can perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

2. The method according to claim 1, characterized in that The step of determining the number of sub-grids corresponding to the grid according to the at least one surface cover type includes: Get the area corresponding to each surface coverage type; Determine the number of sub-grids corresponding to each surface coverage type according to the area corresponding to each surface coverage type; According to the number of sub-grids corresponding to each surface coverage type, the number of sub-grids corresponding to the grid is calculated.

3. The method according to claim 2, characterized in that The determining the number of sub-grids corresponding to each surface coverage type according to the area proportion corresponding to each surface coverage type includes: Get the load factor corresponding to each surface coverage type; The number of subgrids corresponding to each surface coverage type is determined according to the load coefficient corresponding to each surface type and the area corresponding to each surface coverage type.

4. The method according to any one of claims 1 to 3, characterized in that: The method of allocating the land surface calculation tasks corresponding to the plurality of grids to the plurality of CPU cores according to the total number of the sub-grids includes: For the nth CPU core, determining whether the sequence number value of the nth CPU core is greater than the target sequence number value; wherein n is a positive integer from 1 to N; and N is the total number of CPU cores; If so, the land surface calculation tasks corresponding to multiple grids are allocated to multiple CPU cores according to the number of grids corresponding to each CPU core; If not, the number of CPU cores to be allocated is calculated according to the sequence number value of the nth CPU core and N; Calculate the nth average number of subgrids according to the obtained number of subgrids to be allocated and the number of CPU cores to be allocated; Determine the number of grids corresponding to the nth CPU core according to the obtained starting position sequence number of the grid to be allocated and the nth average number of grids; The number of the sub-grids to be allocated and the starting position sequence numbers of the grids to be allocated are updated.

5. The method according to claim 4, characterized in that The step of determining the number of grids corresponding to the nth CPU core according to the obtained starting position sequence number of the grid to be allocated and the nth average number of grids comprises: For the jth grid to be allocated, according to the number of sub-grids included in the jth grid to be allocated, the number of sub-grids corresponding to the nth CPU core is increased to obtain the jth increased number of sub-grids; When it is determined that the number of sub-grids after the j-th increase is less than or equal to the average number of sub-grids, the number of grids corresponding to the n-th CPU core is increased by 1; wherein j is successively 1, 2, ..., until the number of sub-grids after the j-th increase is greater than the average number of sub-grids; the position number of the first grid to be allocated is the starting position number of the grid to be allocated.

6. The method according to claim 4, characterized in that The land surface calculation tasks corresponding to the plurality of grids are distributed to the plurality of CPU cores according to the number of grids corresponding to each CPU core, including: For any CPU core, determine a first starting position sequence number and a first ending position sequence number according to the number of grids corresponding to the CPU core; Determining a target grid corresponding to the CPU core according to the first starting position sequence number and the first ending position sequence number; The land surface calculation task corresponding to the target grid is allocated to the CPU core.

7. A device for allocating land surface computing tasks, characterized in that: include: A processing module, for dividing the earth's land surface into multiple grids in response to the allocation request; The processing module is further used to obtain at least one land cover type corresponding to the grid; The processing module is further used to determine the number of sub-grids corresponding to the grid according to the at least one surface cover type; The processing module is further used to calculate the total number of sub-grids according to the number of sub-grids corresponding to each grid; The processing module is also used to obtain the land surface calculation tasks corresponding to each grid; The allocation module is used to allocate the land surface calculation tasks corresponding to the multiple grids to multiple central processing unit CPU cores according to the total number of sub-grids, so that the multiple CPU cores can perform calculation processing on the land surface calculation tasks corresponding to the multiple grids.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Patent Citations

  • Method for calculating grid data of VIC land surface model

    CN109062695A

  • Data processing method and apparatus and electronic device

    US20230140242A1