Numerical Model Deployment Method, Device, Storage Medium, Chip and Electronic Device
By obtaining the target mode deployment indication data, determining the number of synchronous running cores and the target synchronous running cores, meshing and calculating the recommended indicator values, solving the problem of cumbersome and low efficiency in the existing technology, and achieving efficient and convenient numerical model deployment.
Patent Information
- Application Number
- CN202510252056.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-03-05
AI Technical Summary
The prior art is cumbersome to operate, prone to errors and low efficiency during the numerical mode deployment, making it difficult to achieve convenient numerical mode deployment.
By obtaining the target mode deployment indicator data, including the mesh information of the nested layer and the total number of central processor cores, determine the number of synchronous running cores and the number of target synchronous running cores, meshing based on this information, and calculate the recommended indicator value to determine the target recommended central processor core number.
Convenient numerical mode deployment is realized, deployment efficiency is improved, errors are reduced, and mode business operation efficiency is improved by optimizing the number of central processor cores.
Smart Images

Figure CN119782247B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technologies, and in particular, to a method, device, storage medium, chip, and electronic device for numerical model deployment. Background Art
[0002] Currently, there are a large number of deployment tasks in general for air quality operational forecasting models (i.e., air quality numerical models). Deployment personnel may try different parameters such as the number of CPU (Central Processing Unit) cores multiple times and still cannot run smoothly. Moreover, due to different requirements of different models for the number of grids in a certain grid block (i.e., data block), it is very difficult to achieve a general setting at the model itself level. That is to say, related technologies usually require a large amount of debugging and optimization to implement numerical model deployment (i.e., to implement the deployment of the model business system, which can also be simply referred to as model deployment), resulting in cumbersome operations and low efficiency. Based on this, there is currently no good solution for how to conveniently perform numerical model deployment, reduce numerical model deployment errors, and improve numerical model deployment efficiency. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a method, device, storage medium, chip, and electronic device for numerical model deployment to solve problems such as cumbersome operations, easy errors, and low efficiency in the process of numerical model deployment in related technologies. That is to say, embodiments of the present invention can conveniently perform numerical model deployment, effectively improve numerical model deployment efficiency, effectively reduce numerical model deployment errors, and optimize the numerical model deployment effect by the target recommended number of CPU cores.
[0004] According to one aspect of the embodiments of the present invention, there is provided a method for numerical model deployment, the method including:
[0005] Obtaining target model deployment indication data, where the target model deployment indication data includes the number of grid information and the total number of CPU cores in each of the M nested layers, and M is a positive integer;
[0006] Based on the total number of CPU cores in the target model deployment indication data, determining the total number of synchronous running cores, and based on the total number of synchronous running cores, determining at least one target synchronous running core number;
[0007] Respectively based on each target synchronous running core number in the at least one target synchronous running core number and the number of grid information of each nested layer, determining the grid division result corresponding to each target synchronous running core number;
[0008] Based on the grid division results corresponding to each of the target synchronous operation core numbers, determine a set of data indicating the recommended synchronous operation core numbers to be recommended, where the set of data indicating the recommended synchronous operation core numbers to be recommended includes the grid division results corresponding to each of the N recommended synchronous operation core numbers to be recommended, and N is a non-negative integer;
[0009] When N is greater than or equal to a preset quantity threshold, calculate the recommended index values of each of the recommended synchronous operation core numbers respectively based on the grid division results corresponding to each of the recommended synchronous operation core numbers to be recommended, and determine the target recommended core number based on the recommended index values of each of the recommended synchronous operation core numbers to be recommended, so as to determine the target recommended central processing unit core number under the target mode deployment indication data based on the target recommended core number, and the target recommended central processing unit core number supports numerical mode deployment.
[0010] According to another aspect of the embodiments of the present invention, there is provided a numerical mode deployment device, where the device includes:
[0011] An acquisition unit, configured to acquire target mode deployment indication data, where the target mode deployment indication data includes the grid number information of each of the M nested layers and the total number of central processing unit cores, and M is a positive integer;
[0012] A processing unit, configured to determine the total number of synchronous operation cores based on the total number of central processing unit cores in the target mode deployment indication data, and determine at least one target synchronous operation core number based on the total number of synchronous operation cores;
[0013] The processing unit is further configured to determine the grid division results corresponding to each of the target synchronous operation core numbers respectively based on each of the target synchronous operation core numbers in the at least one target synchronous operation core number and the grid number information of each of the nested layers;
[0014] The processing unit is further configured to determine a set of data indicating the recommended synchronous operation core numbers to be recommended based on the grid division results corresponding to each of the target synchronous operation core numbers, where the set of data indicating the recommended synchronous operation core numbers to be recommended includes the grid division results corresponding to each of the N recommended synchronous operation core numbers to be recommended, and N is a non-negative integer;
[0015] The processing unit is further configured to, when N is greater than or equal to a preset quantity threshold, calculate the recommended metric values of the respective to-be-recommended synchronous operation core numbers respectively based on the grid division results corresponding to the respective to-be-recommended synchronous operation core numbers, and determine a target to-be-recommended core number based on the recommended metric values of the respective to-be-recommended synchronous operation core numbers, so as to determine a target recommended central processing unit core number under the target mode deployment indication data based on the target to-be-recommended core number, and the target recommended central processing unit core number supports numerical mode deployment.
[0016] According to another aspect of the embodiments of the present invention, an electronic device is provided, which includes a processor and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to execute the method mentioned above.
[0017] According to another aspect of the embodiments of the present invention, a non-transitory computer-readable storage medium storing computer instructions is provided, and the computer instructions are used to cause a computer to execute the method mentioned above.
[0018] According to another aspect of the embodiments of the present invention, a chip is provided, which is located in an electronic device and is used to execute the method mentioned above.
[0019] Embodiments of the present invention can obtain target mode deployment indication data, where the target mode deployment indication data includes the grid number information of each nested layer in M nested layers and the total number of central processing unit cores. Based on the total number of central processing unit cores in the target mode deployment indication data, the total number of synchronous running cores is determined, and based on the total number of synchronous running cores, at least one target synchronous running core number is determined. Based on this, the grid division results corresponding to each target synchronous running core number can be determined respectively based on each target synchronous running core number in at least one target synchronous running core number and the grid number information of each nested layer; and based on the grid division results corresponding to each target synchronous running core number, a set of data indicating the number of recommended synchronous running cores to be determined, where the set of data indicating the number of recommended synchronous running cores to be determined includes the grid division results corresponding to each of the N recommended synchronous running core numbers in the N recommended synchronous running core numbers. Further, when N is greater than or equal to a preset quantity threshold, the recommended metric values of each of the N recommended synchronous running core numbers can be calculated respectively based on the grid division results corresponding to each of the N recommended synchronous running core numbers, and based on the recommended metric values of each of the N recommended synchronous running core numbers, the target recommended core number is determined, so as to determine the target recommended central processing unit core number under the target mode deployment indication data based on the target recommended core number. It can be seen that embodiments of the present invention can conveniently determine the target recommended central processing unit core number under the target mode deployment indication data through the target mode deployment indication data, so that the numerical mode deployment (i.e., mode deployment) can be quickly realized through the target recommended central processing unit core number. That is to say, embodiments of the present invention can conveniently perform numerical mode deployment to effectively improve the numerical mode deployment efficiency and effectively reduce numerical mode deployment errors; and embodiments of the present invention can optimize the numerical mode deployment effect through the target recommended central processing unit core number, thereby effectively improving the mode service operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In the following description of exemplary embodiments with reference to the accompanying drawings, more details, features and advantages of the present invention are disclosed. In the drawings:
[0021] Figure 1 FIG. shows a schematic flow chart of a numerical mode deployment method according to an exemplary embodiment of the present invention;
[0022] Figure 2 FIG. shows a schematic flow chart of an operation preprocessing module according to an exemplary embodiment of the present invention;
[0023] Figure 3 FIG. shows a schematic flow chart of another numerical mode deployment method according to an exemplary embodiment of the present invention;
[0024] Figure 4 FIG. shows a schematic diagram of the overall process of a numerical mode deployment according to an exemplary embodiment of the present invention;
[0025] Figure 5 shows a schematic block diagram of a numerical model deployment device according to an exemplary embodiment of the present invention;
[0026] Figure 6 shows a structural block diagram of an exemplary electronic device that can be used to implement an embodiment of the present invention. Detailed implementation manners
[0027] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to more thoroughly and completely understand the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not used to limit the protection scope of the present invention.
[0028] It should be understood that the steps recited in the method embodiments of the present invention can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this regard.
[0029] As used herein, the term "including" and its variations are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order of the functions executed by these devices, modules or units or their interdependent relationships.
[0030] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly specified in the context, it should be understood as "one or more".
[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0032] It should be noted that the execution subject of the numerical model deployment method provided in the embodiments of the present invention can be one or more electronic devices, and the present invention does not limit this; among them, the electronic device can be a terminal (i.e., a client) or a server. Then, when the execution subject includes multiple electronic devices, and at least one terminal and at least one server are included in the multiple electronic devices, the numerical model deployment method provided in the embodiments of the present invention can be jointly executed by the terminal and the server. Correspondingly, the terminals mentioned herein may include, but are not limited to: smart phones, tablet computers, laptop computers, desktop computers, intelligent voice interaction devices, smart home appliances, and so on. The server mentioned herein can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, and so on.
[0033] Based on the above description, the embodiments of the present invention propose a numerical model deployment method, which can be executed by the above-mentioned electronic devices (terminals or servers); or, this numerical model deployment method can be jointly executed by the terminal and the server. For the convenience of description, in the following, it will be described by taking the electronic device executing this numerical model deployment method as an example; as Figure 1 shown, this numerical model deployment method may include the following steps S101 - S105:
[0034] S101, obtain target model deployment indication data, where the target model deployment indication data includes the grid number information of each nested layer in M nested layers and the total number of central processing unit cores, and M is a positive integer.
[0035] Among them, the grid number information of a nested layer may include, but is not limited to: the horizontal grid number (i.e., the grid number in the x direction) and the vertical grid number (i.e., the grid number in the y direction) of the corresponding nested layer, etc., and the embodiments of the present invention do not limit this; optionally, the grid number information of a nested layer may also include the number of vertical layers (i.e., the grid number in the z direction) of the corresponding nested layer. In the embodiments of the present invention, the total number of central processing unit cores can be the maximum available CPU core number. In the embodiments of the present invention, the CPU core can be abbreviated as the core, that is, one core can be one CPU core.
[0036] Optionally, the target mode deployment indication data may further include, but is not limited to, at least one of the following: the number of CPU cores running asynchronously, the central processor utilization threshold (i.e., the minimum CPU utilization), the mode identifier of the target mode, and the CPU model, etc. Among them, the number of CPU cores running asynchronously is the number of CPU cores in the total number of central processor cores that do not participate in parallel operation (i.e., synchronous operation), that is, the CPU cores running asynchronously are the CPU cores that do not jointly execute any module in the target mode with the CPU cores running synchronously; for example, the CPU cores running asynchronously can be used for outputting data, etc. Optionally, the target mode (i.e., the target numerical mode) can be any air quality mode (i.e., the air quality service mode), and the embodiments of the present invention do not limit this; optionally, the mode identifier of a mode can be the mode number of the corresponding mode, or the mode name of the corresponding mode, etc., and the embodiments of the present invention do not limit this; based on this, the embodiments of the present invention may specifically relate to the technical field of air quality.
[0037] In the embodiments of the present invention, the acquisition methods of the target mode deployment indication data may include, but are not limited to, the following several:
[0038] The first acquisition method: Multiple mode deployment indication data may be stored in the own storage space of the electronic device, and the electronic device may sequentially use each mode deployment indication data among the multiple mode deployment indication data as the target mode deployment indication data. The second acquisition method: The target object (i.e., the user, such as the deployment personnel, etc.) may perform a mode deployment indication data input operation. Then, when the electronic device detects the mode deployment indication data input operation, it may respond to the detected mode deployment indication data input operation, thereby acquiring the mode deployment indication data indicated by the mode deployment indication data input operation, and using the mode deployment indication data indicated by the mode deployment indication data input operation as the target mode deployment indication data, etc. In this case, the mode deployment indication data input operation may carry at least one of the following data: the grid number information of each nested layer in the M nested layers, the total number of central processor cores, the number of CPU cores running asynchronously, the central processor utilization threshold, the mode identifier of the target mode, and the CPU model, etc. At this time, the target mode deployment indication data may include the data carried by the mode deployment indication data input operation.
[0039] Optionally, the target object may set the target mode deployment indication data in the parallel partition trial calculation preprocessing program (i.e., the following preprocessing module) setting file, that is, may perform a mode deployment indication data input operation (which may also be called a mode deployment indication data setting operation). At this time, the target mode deployment indication data may be read from the setting file to implement the acquisition of the target mode deployment indication data; or, the electronic device may also display a mode deployment indication data input interface. In this case, the target object may perform a mode deployment indication data input operation in the mode deployment indication data input interface, etc.
[0040] S102. Determine the total number of synchronized running cores based on the total number of central processing unit (CPU) cores in the target mode deployment indication data, and determine at least one target number of synchronized running cores based on the total number of synchronized running cores.
[0041] Optionally, the following target recommended number of CPU cores may be obtained by running a preprocessing module with the target mode deployment indication data. That is, the electronic device can run the preprocessing module to obtain the recommended number of CPU cores under any mode deployment indication data, and can save any mode deployment indication data of historical runs and / or the recommended number of CPU cores under any mode deployment indication data, etc., so as to save a historical record data set. Optionally, the electronic device can also obtain the historical record data set, where a historical record data includes a mode deployment indication data; and can determine whether to run the preprocessing module for the first time with the target mode deployment indication data based on the historical record data set and the target mode deployment indication data; if it is determined to run the preprocessing module for the first time with the target mode deployment indication data, then trigger the execution of determining the total number of synchronized running cores based on the total number of CPU cores in the target mode deployment indication data as described above; if it is determined that it is not the first time to run the preprocessing module with the target mode deployment indication data, then output a non-first-run prompt message. Optionally, if the target mode deployment indication data exists in the historical record data set, it can be determined that it is not the first time to run the preprocessing module with the target mode deployment indication data (that is, it is determined that the target mode deployment indication data is not used for the first time to run the preprocessing module, that is, the target mode deployment indication data is not input into the preprocessing module for the first time to run); if the target mode deployment indication data does not exist in the historical record data set, it can be determined that it is the first time to run the preprocessing module with the target mode deployment indication data (that is, it can be determined that the target mode deployment indication data is used for the first time to run the preprocessing module, that is, the target mode deployment indication data is input into the preprocessing module for the first time to run).
[0042] Optionally, a historical record data may further include the operation results of the preprocessing module under each of at least one mode deployment indication data; optionally, the operation result of the preprocessing module under a mode deployment indication data may be any one of the following: the recommended number of central processing unit cores under the corresponding mode deployment indication data, the mode deployment indication data adjustment prompt, and the no-recommendation prompt information, etc. Optionally, the non-first-run prompt information may be set according to experience or actual requirements, and the embodiments of the present invention do not limit this; optionally, the non-first-run prompt information may be used to prompt that the target object does not run the preprocessing module for the first time through the target mode deployment indication data, and / or may be used to prompt that the target object closes or comments out the program line for calling the preprocessing module, etc. Optionally, the historical record data set may be stored in the preprocessing module log, and then the electronic device may read the historical record data set from the preprocessing module log to obtain the historical record data set. It should be understood that from the perspective of improving the numerical mode deployment efficiency, in different projects or machines, if the target object finds that there are available CPU cores with little difference, the parameters such as the maximum available CPU core number can be set to the same parameters as before (that is, the target mode deployment indication data can be the mode deployment indication data used to run the preprocessing module before), then the target mode deployment indication data will be determined not to be the first time to be used to run the parallel partition trial calculation preprocessing program (that is, the preprocessing module), so the process of re-running the parallel partition trial calculation preprocessing program, etc. does not need to be performed, and the deployment efficiency can be improved; that is to say, when it is determined that the preprocessing module is not run for the first time through the target mode deployment indication data, the target recommended number of central processing unit cores under the target mode deployment indication data can be directly determined from the historical record data set, thereby improving the deployment efficiency. Optionally, when the target mode deployment indication data is not the first time to be used to run the preprocessing module, the electronic device may directly output the target recommended number of central processing unit cores under the target mode deployment indication data saved last time (that is, directly output the target recommended number of central processing unit cores saved in the historical record data set), as Figure 2 shown. Among them, the recommended number of central processing unit cores under a mode deployment indication data may also be referred to as the optimal recommended CPU core number or the optimal core information under the corresponding mode deployment indication data.
[0043] Optionally, when the target mode deployment indication data is not the first time to be used to run the preprocessing module, the electronic device may also modify the logical control variable to False (logical false, to indicate that the target mode deployment indication data is not the first time to be used to run the preprocessing module).
[0044] In an embodiment of the present invention, the target mode deployment indication data may further include the number of CPU cores operating asynchronously; correspondingly, the electronic device may use the difference between the total number of central processing unit cores and the number of CPU cores operating asynchronously as the total number of cores operating synchronously.
[0045] S103. Based on each target synchronous operation core number among at least one target synchronous operation core number and the grid number information of each nested layer, determine the grid division result corresponding to each target synchronous operation core number.
[0046] In an embodiment of the present invention, for any one of the at least one target synchronous operation core numbers, the electronic device may determine the grid division result corresponding to any one of the target synchronous operation core numbers based on any one of the target synchronous operation core numbers and the grid number information of each nested layer. Optionally, the electronic device may perform a Cartesian grid division (which may also be simply referred to as a load-balanced grid division or a Cartesian grid division, etc.) with approximate load balancing on each nested layer based on any one of the target synchronous operation core numbers and the grid number information of each nested layer to determine the grid division result corresponding to any one of the target synchronous operation core numbers; wherein, the Cartesian grid division usually uses a factorization method to allocate the number of CPU cores in each division direction for each nested layer to obtain the grid division result corresponding to any one of the target synchronous operation core numbers. The grid division result corresponding to one synchronous operation core number may include the grid number information of each grid block of each nested layer under the corresponding synchronous operation core number. Optionally, the number of grid blocks in the x direction of a nested layer under one synchronous operation core number may be the number of CPU cores in the x direction of the corresponding nested layer under the corresponding synchronous operation core number, and the number of grid blocks in the y direction of a nested layer under one synchronous operation core number may be the number of CPU cores in the y direction of the corresponding nested layer under the corresponding synchronous operation core number, that is, the number of grid blocks in one division direction of a nested layer under one synchronous operation core number may be the number of CPU cores in the corresponding division direction of the corresponding nested layer under the corresponding synchronous operation core number, and so on; wherein, the total number of grid blocks indicated by the grid division result corresponding to any one of the target synchronous operation core numbers (that is, the sum of the grid block numbers of each nested layer under any one of the target synchronous operation core numbers) may be any one of the target synchronous operation core numbers.
[0047] S104. Based on the grid division results corresponding to each target synchronous operation core number, determine a set of data indicating the core numbers to be recommended for synchronous operation. The set of data indicating the core numbers to be recommended for synchronous operation includes the grid division results corresponding to each core number to be recommended among N core numbers to be recommended for synchronous operation, where N is a non-negative integer.
[0048] In an embodiment of the present invention, for any one of at least one target synchronous operation core numbers, the electronic device may determine whether any one of the target synchronous operation core numbers is a recommended synchronous operation core number based on the grid division result corresponding to any one of the target synchronous operation core numbers; if any one of the target synchronous operation core numbers is a recommended synchronous operation core number, the electronic device may determine the data indicating the recommended synchronous operation core number corresponding to any one of the target synchronous operation core numbers, and add the data indicating the recommended synchronous operation core number corresponding to any one of the target synchronous operation core numbers to the set of data indicating the recommended synchronous operation core numbers, so as to determine the set of data indicating the recommended synchronous operation core numbers. Optionally, a piece of data indicating a recommended synchronous operation core number may include, but is not limited to, the grid division result corresponding to a recommended synchronous operation core number and / or the corresponding recommended synchronous operation core number; that is, the data indicating the recommended synchronous operation core number corresponding to any one of the target synchronous operation core numbers may include the grid division result corresponding to any one of the target synchronous operation core numbers and / or any one of the target synchronous operation core numbers, etc., and the embodiments of the present invention do not limit this.
[0049] Optionally, if there is no target grid block in the grid division result corresponding to any one of the target synchronous operation core numbers, it may be determined that any one of the target synchronous operation core numbers is a recommended synchronous operation core number; if there is a target grid block in the grid division result corresponding to any one of the target synchronous operation core numbers, it may be determined that any one of the target synchronous operation core numbers is not a recommended synchronous operation core number. Optionally, the target grid block may refer to a grid block in which the number of grids in any one of the division directions is less than the specified number of grids, such as a grid block in which the number of grids in any one of the division directions is less than the specified number of grids in the target mode. Optionally, the specified number of grids may be set according to experience, may be set according to actual requirements, or may be determined based on the target mode (in this case, the above specified number of grids may be the specified number of grids in the target mode), and the embodiments of the present invention do not limit this; for example, when the target mode is NAQPMS (a nested grid air quality forecasting model), the specified number of grids may be 2, and when the target mode is WRF-Chem (an online coupled atmospheric chemistry model), the specified number of grids may be 10, etc. In other words, the electronic device may determine whether the number of grids in each division direction of each grid block in the grid division result corresponding to any one of the target synchronous operation core numbers is less than the specified number of grids, so as to determine whether there is a target grid block in the grid division result corresponding to any one of the target synchronous operation core numbers, and further determine whether any one of the target synchronous operation core numbers is a recommended synchronous operation core number.
[0050] Based on this, the mesh division results that do not meet the requirements (also known as mesh division schemes) can be removed, that is, N candidate recommended synchronous operation core numbers with mesh division results meeting the requirements can be selected from at least one target synchronous operation core number, so as to obtain a set of candidate recommended synchronous operation core number indication data, which can effectively ensure the accuracy and stability of the mode operation results, and avoid using the target synchronous operation core number whose mesh division result does not meet the specified number of meshes in the target mode as a candidate recommended synchronous operation core number, thereby avoiding using the candidate recommended synchronous operation core number whose mesh division result does not meet the specified number of meshes in the target mode as the target recommended central processing unit core number.
[0051] S105. When N is greater than or equal to a preset quantity threshold, respectively calculate the recommended index values of each candidate recommended synchronous operation core number based on the mesh division results corresponding to each candidate recommended synchronous operation core number, and determine the target candidate recommended core number based on the recommended index values of each candidate recommended synchronous operation core number, so as to determine the target recommended central processing unit core number under the target mode deployment indication data based on the target candidate recommended core number. The target recommended central processing unit core number supports numerical mode deployment.
[0052] Optionally, the electronic device can also determine whether the number of candidate recommended synchronous operation core numbers is greater than or equal to a preset quantity threshold, that is, determine whether N is greater than or equal to the preset quantity threshold. The candidate recommended synchronous operation core number can be a synchronous operation core number that meets all requirements (such as not being a prime number, being greater than or equal to the synchronous operation core number threshold, and there is no target mesh block in the corresponding mesh division result, etc.), that is, it can be determined whether the number of synchronous operation core numbers that meet all requirements is greater than or equal to the preset quantity threshold; optionally, the preset quantity threshold can be set according to experience or according to actual needs, and the embodiments of the present invention do not limit this; exemplarily, the preset quantity threshold can be 1. Based on this, when N is greater than or equal to the preset quantity threshold (that is, the number of candidate recommended synchronous operation core numbers is greater than or equal to the preset quantity threshold), the above-mentioned calculation of the recommended index values of each candidate recommended synchronous operation core number based on the mesh division results corresponding to each candidate recommended synchronous operation core number can be triggered; when N is less than the preset quantity threshold (that is, the number of candidate recommended synchronous operation core numbers is less than the preset quantity threshold), a no-recommendation prompt message can be output. The no-recommendation prompt message can be used to prompt that there is no central processing unit core that meets the conditions under the target mode deployment indication data. Optionally, the no-recommendation prompt message can be set according to experience or according to actual needs, and the embodiments of the present invention do not limit this.
[0053] Optionally, after determining the target recommended number of central processing unit (CPU) cores, the electronic device may also write the target recommended number of CPU cores into the mode operation setting file of the target mode. Optionally, the electronic device may also determine the historical record data corresponding to the target mode deployment indication data and save the historical record data corresponding to the target mode deployment indication data to the preprocessing module log; Exemplarily, the historical record data corresponding to the target mode deployment indication data may include the target mode deployment indication data and / or the target recommended number of CPU cores, etc., so as to record the target mode deployment indication data, etc.
[0054] Embodiments of the present invention can obtain target mode deployment indication data, where the target mode deployment indication data includes the number of grid information and the total number of CPU cores in each of the M nested layers, so as to determine the total number of synchronous running cores based on the total number of CPU cores in the target mode deployment indication data, and determine at least one target synchronous running core number based on the total number of synchronous running cores. Based on this, the grid division results corresponding to each target synchronous running core number can be determined respectively based on each target synchronous running core number in the at least one target synchronous running core number and the grid number information of each nested layer; and based on the grid division results corresponding to each target synchronous running core number, a set of data indicating the number of cores to be recommended for synchronous operation is determined, and the set of data indicating the number of cores to be recommended for synchronous operation includes the grid division results corresponding to each of the N cores to be recommended for synchronous operation. Further, when N is greater than or equal to a preset quantity threshold, the recommendation index values of each core to be recommended for synchronous operation can be calculated respectively based on the grid division results corresponding to each core to be recommended for synchronous operation, and the target core to be recommended can be determined based on the recommendation index values of each core to be recommended for synchronous operation, so as to determine the target recommended number of CPU cores under the target mode deployment indication data based on the target core to be recommended. It can be seen that embodiments of the present invention can conveniently determine the target recommended number of CPU cores under the target mode deployment indication data through the target mode deployment indication data, so that the numerical mode deployment can be quickly realized through the target recommended number of CPU cores. That is to say, embodiments of the present invention can conveniently perform numerical mode deployment to effectively improve the numerical mode deployment efficiency and effectively reduce numerical mode deployment errors; and embodiments of the present invention can optimize the numerical mode deployment effect through the target recommended number of CPU cores, thereby effectively improving the mode service operation efficiency.
[0055] Based on the above description, embodiments of the present invention also propose a more specific numerical mode deployment method. Correspondingly, this numerical mode deployment method can be executed by the above-mentioned electronic device (terminal or server); or, this numerical mode deployment method can be jointly executed by the terminal and the server. For the convenience of elaboration, in the following, it is taken as an example that the electronic device executes this numerical mode deployment method for description; please refer to Figure 3, the numerical model deployment method may include the following steps S301 - S306:
[0056] S301, obtain target model deployment indication data, where the target model deployment indication data includes the grid number information of each nested layer in M nested layers and the total number of central processing unit cores, and M is a positive integer.
[0057] S302, determine the total number of synchronous running cores based on the total number of central processing unit cores in the target model deployment indication data, and determine at least one target synchronous running core number based on the total number of synchronous running cores.
[0058] Optionally, the target model deployment indication data may further include a central processing unit utilization threshold. Based on this, when determining at least one target synchronous running core number based on the total number of synchronous running cores, the electronic device may calculate a synchronous running core number threshold based on the total number of synchronous running cores and the central processing unit utilization threshold. For example, the product between the total number of synchronous running cores and the central processing unit utilization threshold may be used as the synchronous running core number threshold (that is, the synchronous running core number threshold may be the total number of synchronous running cores × the central processing unit utilization threshold); and determine the synchronous running core number to be determined in the current iteration (also referred to as the current synchronous running core number to be determined), and determine whether the synchronous running core number to be determined in the current iteration is a target synchronous running core number; where the synchronous running core number to be determined in the first iteration is the total number of synchronous running cores, that is to say, the total number of synchronous running cores may be used as the synchronous running core number to be determined in the first iteration. Optionally, the central processing unit utilization threshold may be set according to experience or according to actual requirements, and the embodiments of the present invention do not limit this; it should be understood that in order to balance resource utilization, the central processing unit utilization threshold cannot be set too small and usually can float in a small range. For example, the central processing unit utilization threshold may be 80%.
[0059] Optionally, when determining the synchronous running core number to be determined in the current iteration, if the current iteration is not the first iteration, it may be determined that the synchronous running core number to be determined in the current iteration is: the synchronous running core number to be determined in the previous iteration (also referred to as the previous synchronous running core number to be determined) - 1; or, assuming that the current iteration is the t-th iteration, it may be determined that the synchronous running core number to be determined in the current iteration is: the total number of synchronous running cores - t + 1, where t is a positive integer, so as to update the synchronous running core number to be determined in the current iteration, and so on.
[0060] Correspondingly, if the number of cores to be determined for synchronous operation in the current iteration is greater than or equal to the threshold of the number of cores for synchronous operation, and the number of cores to be determined for synchronous operation in the current iteration is not a prime number, then the number of cores to be determined for synchronous operation in the current iteration can be used as a target number of cores for synchronous operation, that is, it can be determined that the number of cores to be determined for synchronous operation in the current iteration is a target number of cores for synchronous operation, so that at least one target number of cores for synchronous operation can include the number of cores to be determined for synchronous operation in the current iteration; if the number of cores to be determined for synchronous operation in the current iteration is a prime number, then the number of cores to be determined for synchronous operation in the current iteration is not used as a target number of cores for synchronous operation, that is, it can be determined that the number of cores to be determined for synchronous operation in the current iteration is not a target number of cores for synchronous operation; further, the above determination of the number of cores to be determined for synchronous operation in the current iteration can be iteratively executed (that is, the next iteration can be used as the current iteration to determine the number of cores to be determined for synchronous operation in the current iteration) until the number of cores to be determined for synchronous operation in the current iteration is less than the threshold of the number of cores for synchronous operation, so as to realize the determination of at least one target number of cores for synchronous operation. Based on this, when the number of cores to be determined for synchronous operation in the current iteration is less than the threshold of the number of cores for synchronous operation, it can be determined that the iteration stop condition is reached, and thus the iteration is stopped. At this time, it can also be determined that the number of cores to be determined for synchronous operation in the current iteration is not a target number of cores for synchronous operation. It should be noted that Cartesian grid division generally uses the method of factorization to allocate the number of CPU cores in each direction. Therefore, the number of synchronous operation CPU cores cannot be a prime number; based on this, the embodiments of the present invention can effectively screen out the number of cores to be determined for synchronous operation that are prime numbers, so as to effectively avoid the target number of cores for synchronous operation being a prime number and ensure the stability of mode operation.
[0061] S303. Respectively based on each target number of cores for synchronous operation in at least one target number of cores for synchronous operation and the grid number information of each nested layer, determine the grid division result corresponding to each target number of cores for synchronous operation.
[0062] Among them, the grid division result corresponding to one number of cores for synchronous operation includes the grid number information of each grid block of each nested layer under the corresponding number of cores for synchronous operation. The grid number information of one grid block includes the number of grids in each division direction among multiple division directions. Optionally, the multiple division directions may include but are not limited to the x direction (i.e., the horizontal direction) and the y direction (i.e., the vertical direction); for example, when performing two-dimensional grid division on each nested layer (i.e., two-dimensional division of each grid block of each nested layer), the multiple division directions may include the x direction and the y direction. When performing three-dimensional grid division on each nested layer (i.e., three-dimensional division of each grid block of each nested layer), the multiple division directions may include the x direction, the y direction, and the z direction (i.e., the vertical direction), and so on.
[0063] In one implementation, after taking the number of cores to be determined for synchronous operation in the current iteration as a target number of cores for synchronous operation, the grid division result corresponding to the number of cores to be determined for synchronous operation in the current iteration can be determined based on the number of cores to be determined for synchronous operation in the current iteration and the grid number information of each nested layer; that is, if the number of cores to be determined for synchronous operation in the current iteration is greater than or equal to the threshold number of cores for synchronous operation and the number of cores to be determined for synchronous operation in the current iteration is not a prime number, the grid division result corresponding to the number of cores to be determined for synchronous operation in the current iteration can be determined based on the number of cores to be determined for synchronous operation in the current iteration and the grid number information of each nested layer, that is, the load balancing grid division (i.e., Cartesian grid division) can be performed on each nested layer based on the number of cores to be determined for synchronous operation in the current iteration and the grid number information of each nested layer to obtain the grid division result corresponding to the number of cores to be determined for synchronous operation in the current iteration.
[0064] In another implementation, the electronic device can also, after determining at least one target number of cores for synchronous operation, that is, after stopping the iteration, determine the grid division result corresponding to each target number of cores for synchronous operation based on each target number of cores for synchronous operation in the at least one target number of cores for synchronous operation and the grid number information of each nested layer, and so on; the embodiments of the present invention do not limit this.
[0065] S304. Based on the grid division results corresponding to each target number of cores for synchronous operation, determine a set of data indicating the number of cores for synchronous operation to be recommended, where the set of data indicating the number of cores for synchronous operation to be recommended includes the grid division results corresponding to each of the N numbers of cores for synchronous operation to be recommended in the set of N numbers of cores for synchronous operation to be recommended, and N is a non-negative integer.
[0066] In one embodiment, if there is no target grid block in the grid division result corresponding to the number of cores to be determined for synchronous operation in the current iteration, the number of cores to be determined for synchronous operation in the current iteration can be used as a number of cores to be recommended for synchronous operation, so as to add the data indicating the number of cores to be recommended for synchronous operation corresponding to the number of cores to be determined for synchronous operation in the current iteration to the set of data indicating the number of cores to be recommended for synchronous operation; that is to say, based on the grid division result corresponding to the number of cores to be determined for synchronous operation in the current iteration, it can be judged whether the number of cores to be determined for synchronous operation in the current iteration is a number of cores to be recommended for synchronous operation. When there is no target grid block in the grid division result corresponding to the number of cores to be determined for synchronous operation in the current iteration, it is determined that the number of cores to be determined for synchronous operation in the current iteration is a number of cores to be recommended for synchronous operation. When there is a target grid block in the grid division result corresponding to the number of cores to be determined for synchronous operation in the current iteration, it is determined that the number of cores to be determined for synchronous operation in the current iteration is not a number of cores to be recommended for synchronous operation. Among them, a piece of data indicating the number of cores to be recommended for synchronous operation includes the grid division result corresponding to a number of cores to be recommended for synchronous operation. The target grid block may refer to a grid block in which the number of grids in any division direction is less than the specified number of grids; after the iteration stops, the set of data indicating the number of cores to be recommended for synchronous operation can be obtained.
[0067] Based on this, in an iteration process, after using the number of cores to be determined for synchronous operation in the current iteration as a target number of cores for synchronous operation, the grid division result corresponding to the number of cores to be determined for synchronous operation in the current iteration (i.e., the target number of cores for synchronous operation, "the number of cores to be determined for synchronous operation in the current iteration") can be continuously determined. And after using the number of cores to be determined for synchronous operation in the current iteration as a number of cores to be recommended for synchronous operation, the data indicating the number of cores to be recommended for synchronous operation corresponding to the number of cores to be determined for synchronous operation in the current iteration (i.e., the number of cores to be recommended for synchronous operation, "the number of cores to be determined for synchronous operation in the current iteration") can be continuously added to the set of data indicating the number of cores to be recommended for synchronous operation (i.e., the data indicating the number of cores to be recommended for synchronous operation corresponding to the number of cores to be determined for synchronous operation in the current iteration can be saved), so as to complete the current iteration process, as Figure 2 shown.
[0068] In another implementation, after the electronic device stops iterating (i.e., after the loop ends), it can determine the data set of the recommended synchronous operation core number indication based on the grid division results corresponding to each target synchronous operation core number. That is, it can respectively determine whether each target synchronous operation core number is a recommended synchronous operation core based on the grid division results corresponding to each target synchronous operation core number, and add the data indicating the recommended synchronous operation core number corresponding to the target synchronous operation core number that is the recommended synchronous operation core number to the data set of the recommended synchronous operation core number indication, and so on. The embodiments of the present invention do not limit this.
[0069] It should be understood that in the parallel operation of the mode, it can be divided into synchronous operation of CPU cores and asynchronous operation of CPU cores. For different modes, there are also minimum limits on the number of grid points (such as the center point of a grid) in each division direction of each grid block. Otherwise, errors such as abnormal calculation results or inability to run will occur in the mode. And if the number of synchronous operation CPU cores is a prime number, the current mode Cartesian grid division algorithm program will not be able to execute. In this regard, the embodiments of the present invention can effectively avoid that there is a grid block in the grid division result corresponding to the recommended synchronous operation core number in which the number of grids in any division direction is less than the specified number of grids in the corresponding mode, thereby effectively avoiding errors such as abnormal calculation results or inability to run in the mode. And the embodiments of the present invention can avoid the number of synchronous operation cores being a prime number, so as to ensure the stable execution of the Cartesian grid division algorithm program.
[0070] S305. When N is greater than or equal to the preset quantity threshold, for any one of the N recommended synchronous operation core numbers, based on the grid division result corresponding to any one of the recommended synchronous operation core numbers, respectively determine the recommended index calculation information of each nested layer under any one of the recommended synchronous operation core numbers.
[0071] In one implementation, the electronic device may use the number of grids of each nested layer in each partitioning direction and the number of CPU cores of each nested layer in each partitioning direction under any to-be-recommended synchronous operation core number as the recommended metric calculation information of the corresponding nested layer under any to-be-recommended synchronous operation core number; in this case, the recommended metric calculation information of a nested layer under any to-be-recommended synchronous operation core number may include the number of grids of the corresponding nested layer in each partitioning direction (which can be determined from the grid number information of a nested layer) and the number of CPU cores of the corresponding nested layer in each partitioning direction under any to-be-recommended synchronous operation core number. Among them, the number of CPU cores of a nested layer in a partitioning direction under a synchronous operation core number (such as any to-be-recommended synchronous operation core number) may be the same as the number of grid blocks of the corresponding nested layer in the corresponding partitioning direction under the corresponding synchronous operation core number; optionally, the grid partitioning result corresponding to a synchronous operation core number may further include the number of CPU cores of each nested layer in each partitioning direction under the corresponding synchronous operation core number, and at this time, the number of CPU cores of each nested layer in each partitioning direction under any to-be-recommended synchronous operation core number can be directly determined from the grid partitioning result corresponding to any to-be-recommended synchronous operation core number; or, the grid partitioning result corresponding to a synchronous operation core number may further include the number of grid blocks of each nested layer in each partitioning direction under the corresponding synchronous operation core number, so as to respectively use the number of grid blocks of any nested layer in any partitioning direction under any to-be-recommended synchronous operation core number as the number of CPU cores of any nested layer in any partitioning direction under any to-be-recommended synchronous operation core number, and so on.
[0072] In another implementation, the grid partitioning result corresponding to a synchronous operation core number includes the grid number information of each grid block of each nested layer under the corresponding synchronous operation core number, and the grid number information of a grid block includes the number of grids of the corresponding grid block in each of the multiple partitioning directions. Based on this, the electronic device may respectively determine the recommended metric calculation information of each nested layer under any to-be-recommended synchronous operation core number based on the grid number information of each grid block of each nested layer under any to-be-recommended synchronous operation core number, and so on.
[0073] In a specific implementation, the recommended metric calculation information of a nested layer under any to-be-recommended synchronous operation core number may include the grid number information of each grid block of the corresponding nested layer under any to-be-recommended synchronous operation core number; that is to say, the grid number information of each grid block of each nested layer under any to-be-recommended synchronous operation core number may be respectively used as the recommended metric calculation information of the corresponding nested layer under any to-be-recommended synchronous operation core number, so as to realize respectively determining the recommended metric calculation information of each nested layer under any to-be-recommended synchronous operation core number based on the grid number information of each grid block of each nested layer under any to-be-recommended synchronous operation core number.
[0074] In another specific implementation, the recommendation metric calculation information of a nested layer at any number of cores for synchronous operation to be recommended may include the average number of grids in each division direction of the corresponding nested layer at any number of cores for synchronous operation to be recommended. Optionally, for any one of the M nested layers and any one of the multiple division directions, the electronic device may perform an averaging operation on the number of grids in any division direction of each grid block of any nested layer at any number of cores for synchronous operation to be recommended, to obtain the average number of grids in any division direction of any nested layer at any number of cores for synchronous operation to be recommended, so as to obtain the recommendation metric calculation information of any nested layer at any number of cores for synchronous operation to be recommended. At this time, the average number of grids in one division direction of a nested layer at any number of cores for synchronous operation to be recommended may also be referred to as the average number of grids between the grid blocks in the corresponding division direction of the corresponding nested layer at any number of cores for synchronous operation to be recommended, and so on. Exemplarily, taking any division direction as the x direction as an example for illustration, assuming that the grid blocks of any nested layer at any number of cores for synchronous operation to be recommended are successively grid block 1, grid block 2, grid block 3, and grid block 4, then an averaging operation may be performed on the number of grids in the x direction of grid block 1, the number of grids in the x direction of grid block 2, the number of grids in the x direction of grid block 3, and the number of grids in the x direction of grid block 4, to obtain the average number of grids in the x direction of any nested layer at any number of cores for synchronous operation to be recommended. Optionally, the electronic device may also use the number of grids in each division direction of any grid block of any nested layer at any number of cores for synchronous operation to be recommended, respectively, as the average number of grids in the corresponding division direction of any nested layer at any number of cores for synchronous operation to be recommended. That is to say, one grid block may be selected from the grid blocks of any nested layer at any number of cores for synchronous operation to be recommended (such as randomly selecting or designating any grid block (such as designating the first grid block), etc.), and the number of grids in each division direction of the selected grid block may be used, respectively, as the average number of grids in the corresponding division direction of any nested layer at any number of cores for synchronous operation to be recommended, and so on; the embodiments of the present invention do not limit this; exemplarily, assuming that the grid blocks of any nested layer at any number of cores for synchronous operation to be recommended are successively grid block 1, grid block 2, grid block 3, and grid block 4, and the selected grid block is grid block 1, then the number of grids in the x direction of grid block 1 may be used as the average number of grids in the x direction of any nested layer at any number of cores for synchronous operation to be recommended, and the number of grids in the y direction of grid block 1 may be used as the average number of grids in the y direction of any nested layer at any number of cores for synchronous operation to be recommended, and so on.
[0075] In S306, using the recommendation metric calculation information of each nested layer at any to-be-recommended synchronous operation core number, calculate the recommendation metric value of any to-be-recommended synchronous operation core number, and based on the recommendation metric values of each to-be-recommended synchronous operation core number, determine the target to-be-recommended core number, so as to determine the target recommended central processing unit core number under the target mode deployment indication data based on the target to-be-recommended core number, and the target recommended central processing unit core number supports numerical mode deployment.
[0076] It should be noted that from the perspective of improving computing efficiency, in parallel computing, both computing and communication consume time. To ensure (approximate) load balancing, the scheme with the relatively smallest communication volume should be adopted, which can further improve the computing speed. In other words, under the same number of grids and approximately the same number of CPU cores, the scheme with fewer communication grids (i.e., less communication volume) theoretically runs faster.
[0077] In one implementation, the recommendation metric calculation information of a nested layer at any to-be-recommended synchronous operation core number may include the number of grids in each division direction of the corresponding nested layer and the number of CPU cores in each division direction of the corresponding nested layer at any to-be-recommended synchronous operation core number.
[0078] In this case, the electronic device may use the recommendation metric calculation information of each nested layer at any to-be-recommended synchronous operation core number to calculate the total number of communication grids at any to-be-recommended synchronous operation core number, and use the total number of communication grids at any to-be-recommended synchronous operation core number as the recommendation metric value of any to-be-recommended synchronous operation core number. Optionally, taking two dimensions (i.e., multiple division directions include the x direction and the y direction) as an example, when the number of grids in each division direction of each nested layer can be divided evenly by the number of CPU cores in the corresponding division direction of the corresponding nested layer at any to-be-recommended synchronous operation core number, the electronic device may use Formula 1.1 to calculate the total number of communication grids at any to-be-recommended synchronous operation core number:
[0079] Formula 1.1
[0080] where N xi , N yi can be the number of grids in the x direction and the number of grids in the y direction of the i-th nested layer among the M nested layers respectively, i ∈ [1, M], and M is the total number of nested layers; P xi , P yi can be the number of CPU cores in the x direction and the number of CPU cores in the y direction of the i-th nested layer at any to-be-recommended synchronous operation core number respectively, N xi / P xi can represent the number of grids in the x direction of each grid block of the i-th nested layer at any to-be-recommended synchronous operation core number, N yi / Pyi can represent the number of grids in the y - direction of each grid block in the \(i\) - th nested layer under any number of cores to be recommended for synchronous operation, and \(f\) can represent the total number of communication grids under any number of cores to be recommended for synchronous operation.
[0081] It should be understood that for the function \(f\), when the ratio of the number of CPU cores in each partitioning direction (\(P\) xi / \(P\) yi ), and the ratio of the number of grids in each partitioning direction (\(N\) xi / \(N\) yi ) are the same, that is, the number of grids of each grid block in each partitioning direction is the same (\(N\) xi / \(P\) xi =\(N\) yi / \(P\) yi ), the total number of communication grids under any number of cores to be recommended for synchronous operation is the least (i.e., the communication volume is the least). Based on this, the embodiments of the present invention can adopt the following method to approach the optimal solution as much as possible, so as to calculate the recommended index value of any number of cores to be recommended for synchronous operation.
[0082] In another implementation, the recommended index calculation information of a nested layer under any number of cores to be recommended for synchronous operation may include the grid number information of each grid block of the corresponding nested layer under any number of cores to be recommended for synchronous operation; for example, taking the multiple partitioning directions including the \(x\) - direction and the \(y\) - direction as an example for illustration, when using the recommended index calculation information of each nested layer under any number of cores to be recommended for synchronous operation to calculate the recommended index value of any number of cores to be recommended for synchronous operation (at this time, that is, using the grid number information of each grid block of each nested layer under any number of cores to be recommended for synchronous operation to calculate the recommended index value of any number of cores to be recommended for synchronous operation), the electronic device can use Equation 1.2 to calculate the recommended index value of any number of cores to be recommended for synchronous operation:
[0083] Equation 1.2
[0084] Among them, \(nblocks\) can be the total number of grid blocks divided by the grids of each nested layer under any number of cores to be recommended for synchronous operation (that is, the sum of the grid block numbers of each nested layer under any number of cores to be recommended for synchronous operation), \(nblock\_i\) can represent the number of grid blocks of the \(i\) - th nested layer under any number of cores to be recommended for synchronous operation, \(NB\) xji can represent the number of grids in the \(x\) - direction of the \(j\) - th grid block of the \(i\) - th nested layer under any number of cores to be recommended for synchronous operation (the number of grids in the \(x\) - direction of a grid block can also be referred to as the \(x\) - direction grid number of the corresponding grid block), \(NB\) yjiIt can represent the number of grids of the j-th grid block in the y direction at any recommended synchronous operation core number of the i-th nested layer (the number of grids of a grid block in the y direction can also be referred to as the number of grids of the corresponding grid block in the y direction). It should be understood that when S is 0, the ratio of the number of CPU cores in each partitioning direction is the same as the ratio of the number of grids in each partitioning direction, that is, the number of grids in each partitioning direction of each grid block is the same, and the optimal solution will be obtained. That is to say, the smaller the recommended index value of any recommended synchronous operation core number, the smaller the communication volume. It should be noted that Formula 1.2 only exemplarily illustrates the implementation manner of calculating the recommended index value of any recommended synchronous operation core number by using the grid number information of each grid block at any recommended synchronous operation core number of each nested layer. The embodiments of the present invention do not limit this.
[0085] In the embodiments of the present invention, the electronic device can determine at least one partitioning direction group from multiple partitioning directions. A partitioning direction group can include any two partitioning directions among the multiple partitioning directions, that is, any two partitioning directions can be used as a partitioning direction group, so that at least one partitioning direction group can include the partitioning direction groups respectively formed by any one of the multiple partitioning directions and each of the other partitioning directions except any one of the multiple partitioning directions; exemplarily, when the multiple partitioning directions include the x direction and the y direction, the number of partitioning direction groups in at least one partitioning direction group can be 1 (that is, the partitioning direction group "x direction and y direction"), and when the multiple partitioning directions include the x direction, the y direction, and the z direction, at least one partitioning direction group can include the partitioning direction groups "x direction and y direction", "x direction and z direction", and "y direction and z direction". Based on this, for any grid block among all the grid blocks at any recommended synchronous operation core number of each nested layer, the grid number difference of any grid block under each partitioning direction group in at least one partitioning direction group can be determined respectively based on the grid number information of any grid block (for example, the grid number difference under the partitioning direction group "x direction and y direction" can be NB in Formula 1.2 xji -NB yji )), so that after obtaining the grid number differences of each grid block at any recommended synchronous operation core number of each nested layer under each partitioning direction group, the recommended index value of any recommended synchronous operation core number can be calculated based on the grid number differences of each grid block at any recommended synchronous operation core number of each nested layer under each partitioning direction group, so as to implement calculating the recommended index value of any recommended synchronous operation core number by using the grid number information of each grid block at any recommended synchronous operation core number of each nested layer. Exemplarily, the sum of the squares of the grid number differences of each grid block at any recommended synchronous operation core number of each nested layer under each partitioning direction group can be calculated to obtain the recommended index value of any recommended synchronous operation core number, and so on.
[0086] In another implementation, the recommendation metric calculation information of a nested layer at any number of recommended synchronous running cores may include the average number of grids in each division direction of the corresponding nested layer at any number of recommended synchronous running cores; for example, taking the multiple division directions including the x direction and the y direction as an example, when using the recommendation metric calculation information of each nested layer at any number of recommended synchronous running cores to calculate the recommendation metric value of any number of recommended synchronous running cores (at this time, that is, using the average number of grids in each division direction of each nested layer at any number of recommended synchronous running cores to calculate the recommendation metric value of any number of recommended synchronous running cores), the electronic device may use Formula 1.3 to calculate the recommendation metric value of any number of recommended synchronous running cores:
[0087] Formula 1.3
[0088] wherein, NB xi may represent the average number of grids in the x direction of the i-th nested layer at any number of recommended synchronous running cores, and NB yi may represent the average number of grids in the y direction of the i-th nested layer at any number of recommended synchronous running cores. It should be noted that Formula 1.3 only exemplarily illustrates using the average number of grids in each division direction of each nested layer at any number of recommended synchronous running cores to calculate the recommendation metric value of any number of recommended synchronous running cores, and the embodiments of the present invention are not limited thereto.
[0089] In the embodiments of the present invention, the electronic device may determine at least one division direction group from multiple division directions; based on this, for any one of the M nested layers, the average grid number difference of each division direction group of any one of the nested layers at any number of recommended synchronous running cores may be determined respectively based on the average number of grids in each division direction of any one of the nested layers at any number of recommended synchronous running cores (for example, the average grid number difference of the division direction group "x direction and y direction" may be NB xi -NB yi in Formula 1.3), so that after obtaining the average grid number difference of each division direction group of each nested layer at any number of recommended synchronous running cores, the recommendation metric value of any number of recommended synchronous running cores may be calculated based on the average grid number difference of each division direction group of each nested layer at any number of recommended synchronous running cores, so as to realize using the average number of grids in each division direction of each nested layer at any number of recommended synchronous running cores to calculate the recommendation metric value of any number of recommended synchronous running cores. For example, the sum of the squares of the average grid number differences of each division direction group of each nested layer at any number of recommended synchronous running cores may be calculated to obtain the recommendation metric value of any number of recommended synchronous running cores, and so on.
[0090] In summary, if the recommendation metric calculation information of a nested layer under any recommended synchronous operation core number is determined based on the grid number information of each grid block of the corresponding nested layer under any recommended synchronous operation core number, then regardless of whether the grid numbers in each division direction of each nested layer can be divided evenly by the CPU core numbers in the corresponding division direction of the corresponding nested layer under any recommended synchronous operation core number, the recommendation metric values of each nested layer under any recommended synchronous operation core number can be obtained. Preferably, the embodiments of the present invention can respectively determine the recommendation metric calculation information of each nested layer under any recommended synchronous operation core number based on the grid number information of each grid block of each nested layer under any recommended synchronous operation core number, so that the embodiments of the present invention are not only applicable when the grid numbers in each division direction can be divided evenly by the corresponding core numbers, but also can be applied to the more common scenario where the grid numbers in each direction cannot be divided evenly by the corresponding core numbers, thereby accurately representing the recommendation metric values of each recommended synchronous operation core number.
[0091] Furthermore, when determining the target recommended core number based on the recommendation metric values of each recommended synchronous operation core number, the recommended synchronous operation core number with the smallest recommendation metric value can be determined from the N recommended synchronous operation core numbers based on the recommendation metric values of each recommended synchronous operation core number, so as to obtain the recommended synchronous operation core number with the smallest communication volume, that is, the recommended synchronous operation core number with the smallest communication volume can be the recommended synchronous operation core number with the smallest recommendation metric value; and based on the recommended synchronous operation core number with the smallest recommendation metric value, the target recommended core number is determined. Optionally, the electronic device can directly determine the recommended synchronous operation core number with the smallest recommendation metric value from the N recommended synchronous operation core numbers; or, the N recommended synchronous operation core numbers can also be sorted in ascending order of the recommendation metric values to obtain a sorting result (i.e., a sorting for the communication volume), so as to select the recommended synchronous operation core number with the smallest recommendation metric value from the sorting result, such as the first recommended synchronous operation core number in the sorting result, or the first P recommended synchronous operation core numbers, etc., where the recommendation metric values of each of the first P recommended synchronous operation core numbers are the same (i.e., all equal to the recommendation metric value of the first recommended synchronous operation core number), and P is a positive integer, and so on.
[0092] Optionally, when determining the target recommended core count based on the recommended core count with the smallest recommended metric value for synchronous operation, the recommended CPU core count for synchronous operation (also referred to as the recommended available CPU core count for synchronous operation) can be determined based on the recommended core count with the smallest recommended metric value for synchronous operation, and the sum of the recommended CPU core count for synchronous operation and the CPU core count for asynchronous operation can be used as the target recommended core count. Optionally, if the number of recommended core counts with the smallest recommended metric value for synchronous operation is 1, the recommended core count with the smallest recommended metric value for synchronous operation can be used as the recommended CPU core count for synchronous operation; if the number of recommended core counts with the smallest recommended metric value for synchronous operation is greater than 1, the largest recommended core count for synchronous operation can be determined from the multiple recommended core counts with the smallest recommended metric value for synchronous operation, and the largest recommended core count for synchronous operation can be used as the recommended CPU core count for synchronous operation. For example, the multiple recommended core counts with the smallest recommended metric value for synchronous operation can be sorted in descending order to determine the first recommended core count for synchronous operation in the descending order result as the largest recommended core count for synchronous operation. In other embodiments, one recommended core count for synchronous operation can also be randomly selected from the multiple recommended core counts with the smallest recommended metric value for synchronous operation, and the randomly selected recommended core count for synchronous operation can be used as the recommended CPU core count for synchronous operation, and so on.
[0093] Optionally, after obtaining the target recommended core count, the electronic device can also return a preprocessing correct end message (such as 0, etc.) to indicate that the target recommended core count is correctly obtained, and so on. Optionally, the preprocessing correct end message can be set according to experience or actual requirements, and the embodiments of the present invention do not limit this.
[0094] Optionally, the electronic device can start the operation of the target mode according to the target recommended core count and the grid count information of each nested layer, obtain the mode case operation time of the target mode for the target recommended core count, and check whether the mode case operation time is less than the preset mode operation time threshold; optionally, a submission command or script corresponding to the scheduling system can be generated using the modified mode parameters to start the mode operation (i.e., start the operation of the target mode); optionally, the modified mode parameters can include, but are not limited to, the target recommended core count (which can correspond to the total number of CPU cores), the grid count information of each nested layer, the CPU core count for asynchronous operation, etc., and the embodiments of the present invention do not limit this. Optionally, the preset mode operation time threshold can be set according to experience or actual requirements, and the embodiments of the present invention do not limit this.
[0095] Correspondingly, if the running time of the pattern case is less than the preset pattern running time threshold, the target recommended central processing unit (CPU) core number under the target pattern deployment indication data is triggered to be executed, that is, the target recommended core number can be used as the target recommended central processing unit core number under the target pattern deployment indication data; if the running time of the pattern case is greater than or equal to the preset pattern running time threshold, a pattern deployment indication data adjustment prompt is output. Optionally, the pattern deployment indication data adjustment prompt can be set according to experience or according to actual requirements, and the embodiments of the present invention do not limit this; for example, the pattern deployment indication data adjustment prompt can be used to prompt the target object to increase the maximum available CPU core number (i.e., the total number of central processing unit cores) and / or decrease the minimum CPU utilization, etc. Based on this, the target object can modify the target pattern deployment indication data according to the pattern deployment indication data adjustment prompt, that is, perform the pattern deployment indication data input operation again, so as to use the modified pattern deployment indication data as the target pattern deployment indication data, so that the electronic device can re-enter step S301, and thus loop continuously, etc.
[0096] It can be seen that the embodiments of the present invention can set pattern parameters and perform grid division according to the target recommended core number. Under the same grid and approximate core number, a grid division scheme with relatively small communication volume can be adopted, which can improve the pattern running (i.e., pattern service running) speed, so as to obtain a pattern deployment method with relatively high running efficiency (the running speed is relatively high when the approximate CPU core numbers in each division direction are the same, that is, the running speed is relatively high when the number of grids in each division direction of each grid block is approximately the same); and, the running time can be further detected through the pattern case running time to meet the pattern running timeliness (that is, whether the pattern case running time is less than the preset pattern running time threshold), so as to further ensure the pattern service running efficiency; based on this, the embodiments of the present invention can optimize the pattern running speed and effectively improve the pattern service running efficiency.
[0097] Optionally, after obtaining the target recommended central processing unit core number, the electronic device can also write the target recommended central processing unit core number into the pattern running setting file of the target pattern to modify the pattern running CPU core number in the pattern running setting file to the target recommended central processing unit core number; and / or, use the target recommended central processing unit core number and the target pattern deployment indication data as a historical record data (that is, the historical record data can include the target recommended central processing unit core number and the target pattern deployment indication data), so as to add it to the historical record data set, and thus save it to the log. In summary, as Figure 4As shown, the electronic device can determine whether the running time of the mode case meets the mode running timeliness based on the magnitude relationship between the running time of the mode case and the preset mode running time threshold. That is, when the running time of the mode case is less than the preset mode running time threshold, it can be determined that the running time of the mode case meets the mode running timeliness; when the running time of the mode case is greater than or equal to the preset mode running time threshold, it can be determined that the running time of the mode case does not meet the mode running timeliness. Thus, when the mode running timeliness is met, the target recommended number of central processing unit cores can be obtained, written into the mode running setting file, and saved to the log.
[0098] Optionally, when outputting the mode deployment instruction data adjustment prompt or the no-recommendation prompt message, the electronic device can also record the target mode deployment instruction data, and / or record the mode deployment instruction data adjustment prompt or the no-recommendation prompt message, etc. This embodiment of the present invention does not make any limitations in this regard. That is to say, when inputting the mode deployment instruction data adjustment prompt or the no-recommendation prompt message, the target mode deployment instruction data, and / or the output mode deployment instruction data adjustment prompt or the no-recommendation prompt message can also be stored in the log to obtain the corresponding historical record data, etc.
[0099] After obtaining the target mode deployment instruction data, the embodiment of the present invention can determine the total number of synchronized running cores based on the total number of central processing unit cores in the target mode deployment instruction data, and determine at least one target synchronized running core number based on the total number of synchronized running cores. Correspondingly, the grid division results corresponding to each target synchronized running core number can be determined respectively based on each target synchronized running core number in the at least one target synchronized running core number and the grid number information of each nested layer; and based on the grid division results corresponding to each target synchronized running core number, a set of data indicating the recommended synchronized running core numbers to be determined, where the set of data indicating the recommended synchronized running core numbers to be determined includes the grid division results corresponding to each recommended synchronized running core number among the N recommended synchronized running core numbers. Based on this, when N is greater than or equal to the preset quantity threshold, for any one of the N recommended synchronized running core numbers, the recommended index calculation information of each nested layer under any one of the recommended synchronized running core numbers can be determined respectively based on the grid division result corresponding to any one of the recommended synchronized running core numbers. Further, the recommended index calculation information of each nested layer under any one of the recommended synchronized running core numbers can be used to calculate the recommended index value of any one of the recommended synchronized running core numbers, and based on the recommended index values of each recommended synchronized running core number, the target recommended core number can be determined, so as to determine the target recommended central processing unit core number under the target mode deployment instruction data based on the target recommended core number. It can be seen that the embodiment of the present invention can realize the optimal setting of the CPU core number through the target recommended central processing unit core number, reduce incorrect settings, and reduce the numerical mode deployment time. That is to say, the embodiment of the present invention proposes a parallel partition trial calculation preprocessing program algorithm for the target mode, thereby proposing a CPU core number determination process scheme in the deployment of the mode (such as the air quality mode), which can conveniently perform numerical mode deployment, and then effectively improve the numerical mode deployment efficiency, quickly give the most appropriate core number (i.e., the target recommended central processing unit core number), ensure meeting the timeliness requirements, save the deployment parameter setting and debugging time; among them, parameter setting and debugging are key processes in the numerical mode deployment process. The embodiment of the present invention can effectively reduce the work pressure and time occupation of this process, effectively reduce costs, improve performance, and can improve the running performance, running speed and even the accuracy of the mode prediction result through the grid division result corresponding to the target recommended central processing unit core number.
[0100] Based on the description of the related embodiments of the above numerical mode deployment method, the embodiment of the present invention also proposes a numerical mode deployment device, which can be a computer program (including program code) running in an electronic device; as Figure 5 shown, the numerical mode deployment device can include an acquisition unit 501 and a processing unit 502. The numerical mode deployment device can execute Figure 1 or Figure 3The numerical model deployment method shown, that is, the numerical model deployment device can run the above units:
[0101] An acquisition unit 501, configured to acquire target model deployment indication data, where the target model deployment indication data includes grid number information of each nested layer in M nested layers and the total number of central processing unit cores, and M is a positive integer;
[0102] A processing unit 502, configured to determine the total number of cores running synchronously based on the total number of central processing unit cores in the target model deployment indication data, and determine at least one target number of cores running synchronously based on the total number of cores running synchronously;
[0103] The processing unit 502 is further configured to determine, respectively based on each target number of cores running synchronously in the at least one target number of cores running synchronously and the grid number information of each nested layer, a grid division result corresponding to each target number of cores running synchronously;
[0104] The processing unit 502 is further configured to determine, based on the grid division results corresponding to the respective target numbers of cores running synchronously, a set of data indicating the number of cores running synchronously to be recommended, where the set of data indicating the number of cores running synchronously to be recommended includes grid division results corresponding to each of the N numbers of cores running synchronously to be recommended, and N is a non-negative integer;
[0105] The processing unit 502 is further configured to, when N is greater than or equal to a preset quantity threshold, calculate a recommended metric value for each of the numbers of cores running synchronously to be recommended respectively based on the grid division results corresponding to the respective numbers of cores running synchronously to be recommended, and determine a target number of cores to be recommended based on the recommended metric values of the respective numbers of cores running synchronously to be recommended, so as to determine a target recommended central processing unit core number under the target model deployment indication data based on the target number of cores to be recommended, and the target recommended central processing unit core number supports numerical model deployment.
[0106] In one implementation, the target mode deployment indication data further includes a central processing unit utilization threshold; when determining at least one target synchronous operation core number based on the total number of synchronous operation cores, it can be specifically used for: calculating a synchronous operation core number threshold based on the total number of synchronous operation cores and the central processing unit utilization threshold; and determining the synchronous operation core number to be determined in the current iteration, and determining whether the synchronous operation core number to be determined in the current iteration is a target synchronous operation core number; wherein, the synchronous operation core number to be determined in the first iteration is the total number of synchronous operation cores; if the synchronous operation core number to be determined in the current iteration is greater than or equal to the synchronous operation core number threshold and the synchronous operation core number to be determined in the current iteration is not a prime number, then use the synchronous operation core number to be determined in the current iteration as a target synchronous operation core number; if the synchronous operation core number to be determined in the current iteration is a prime number, then do not use the synchronous operation core number to be determined in the current iteration as a target synchronous operation core number; iteratively execute the determination of the synchronous operation core number to be determined in the current iteration until the synchronous operation core number to be determined in the current iteration is less than the synchronous operation core number threshold, so as to determine the at least one target synchronous operation core number.
[0107] In another implementation, the grid division result corresponding to one synchronous operation core number includes the grid number information of each grid block of each nested layer under the corresponding synchronous operation core number, and the grid number information of one grid block includes the number of grids in each division direction among multiple division directions; when the processing unit 502 determines the grid division results corresponding to the respective target synchronous operation core numbers based on the respective target synchronous operation core numbers in the at least one target synchronous operation core number and the grid number information of each nested layer, it can be specifically used for: after using the synchronous operation core number to be determined in the current iteration as a target synchronous operation core number, determining the grid division result corresponding to the synchronous operation core number to be determined in the current iteration based on the synchronous operation core number to be determined in the current iteration and the grid number information of each nested layer;
[0108] When determining the set of data indicating the number of cores to be recommended for synchronous operation based on the grid division results corresponding to the respective target synchronous operation core counts, the processing unit 502 may specifically be configured to: If there is no target grid block in the grid division result corresponding to the number of cores to be determined for synchronous operation in the current iteration, then use the number of cores to be determined for synchronous operation in the current iteration as a number of cores to be recommended for synchronous operation, so as to add the data indicating the number of cores to be recommended for synchronous operation corresponding to the number of cores to be determined for synchronous operation in the current iteration to the set of data indicating the number of cores to be recommended for synchronous operation; wherein, a piece of data indicating the number of cores to be recommended for synchronous operation includes the grid division result corresponding to a number of cores to be recommended for synchronous operation, and the target grid block refers to a grid block where the number of grids in any division direction is less than the specified number of grids; after stopping the iteration, the set of data indicating the number of cores to be recommended for synchronous operation is obtained.
[0109] In another implementation manner, the target recommended number of CPU cores is obtained by running the preprocessing module with the target mode deployment indication data; the obtaining unit 501 may further be configured to: obtain a set of historical record data, and one historical record includes a piece of mode deployment indication data;
[0110] The processing unit 502 may further be configured to: based on the set of historical record data and the target mode deployment indication data, determine whether to run the preprocessing module for the first time with the target mode deployment indication data; if it is determined to run the preprocessing module for the first time with the target mode deployment indication data, then trigger the execution of determining the total number of cores for synchronous operation based on the total number of CPU cores in the target mode deployment indication data; if it is determined that it is not the first time to run the preprocessing module with the target mode deployment indication data, then output a non-first-run prompt message.
[0111] In another implementation manner, the processing unit 502 may further be configured to: when N is less than the preset quantity threshold, output a no-recommendation prompt message, and the no-recommendation prompt message is used to prompt that there are no CPU cores meeting the conditions under the target mode deployment indication data.
[0112] In another implementation manner, when calculating the recommendation metric values of the respective numbers of cores to be recommended for synchronous operation based on the grid division results corresponding to the respective numbers of cores to be recommended for synchronous operation, the processing unit 502 may specifically be configured to: for any one of the N numbers of cores to be recommended for synchronous operation, based on the grid division result corresponding to the any one of the numbers of cores to be recommended for synchronous operation, respectively determine the recommendation metric calculation information of each nested layer under the any one of the numbers of cores to be recommended for synchronous operation; and use the recommendation metric calculation information of each nested layer under the any one of the numbers of cores to be recommended for synchronous operation to calculate the recommendation metric value of the any one of the numbers of cores to be recommended for synchronous operation.
[0113] In another embodiment, when determining the target core number to be recommended based on the recommendation metric values of the respective core numbers for synchronous operation to be recommended, the processing unit 502 may specifically be configured to: determine, from the N core numbers for synchronous operation to be recommended, the core number for synchronous operation to be recommended with the smallest recommendation metric value based on the recommendation metric values of the respective core numbers for synchronous operation to be recommended; and determine the target core number to be recommended based on the core number for synchronous operation to be recommended with the smallest recommendation metric value.
[0114] In another embodiment, the processing unit 502 may further be configured to: start the operation of the target mode according to the target core number to be recommended and the grid number information of each nested layer, obtain the running time of the mode case of the target mode for the target core number to be recommended, so as to check whether the running time of the mode case is less than a preset mode running time threshold; if the running time of the mode case is less than the preset mode running time threshold, trigger the execution of the target recommended central processing unit core number under the target mode deployment instruction data determined based on the target core number to be recommended; if the running time of the mode case is greater than or equal to the preset mode running time threshold, output a prompt for adjusting the mode deployment instruction data.
[0115] According to an embodiment of the present invention, Figure 5 Each unit in the numerical mode deployment device shown can be separately or all combined into one or several other units to form, or a certain one (or some) of the units can be further split into multiple smaller units with functions to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. According to another embodiment of the present invention, it can be achieved by running a computer program (including program code) capable of executing the respective steps involved in the corresponding method shown in Figure 1 or Figure 3 on a general-purpose electronic device such as a computer including processing elements and storage elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM), to construct the numerical mode deployment device shown in Figure 5 and to implement the numerical mode deployment method of the embodiments of the present invention.
[0116] Based on the descriptions of the above method embodiments and device embodiments, an exemplary embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program capable of being executed by the at least one processor, and when the computer program is executed by the at least one processor, it is used to cause the electronic device to execute the method according to the embodiments of the present invention.
[0117] An exemplary embodiment of the present invention also provides a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is configured to cause the computer to execute the method according to the embodiment of the present invention.
[0118] An exemplary embodiment of the present invention also provides a chip, wherein the chip is located in an electronic device, and the chip is configured to execute the method according to the embodiment of the present invention.
[0119] An exemplary embodiment of the present invention also provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is configured to cause the computer to execute the method according to the embodiment of the present invention.
[0120] Reference Figure 6 , a block diagram of an electronic device 600 that can be a server or a client of the present invention will now be described. It is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices or various forms of mobile devices. The components shown herein, their connections and relationships, and their functions are merely illustrative. As Figure 6 shown, the electronic device 600 includes a computing unit 601, which can execute various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0121] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 can be any type of device capable of inputting information into the electronic device 600. The input unit 606 can receive input digital or character information and generate key signal inputs related to user settings and / or function controls of the electronic device. The output unit 607 can be any type of device capable of presenting information and can include, but is not limited to, a display, a vibrator, and / or a printer. The storage unit 608 can include, but is not limited to, magnetic disks and optical discs. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks and can include, but is not limited to, a modem, a wireless communication transceiver, and / or a chipset, etc. The computing unit 601 can be various general-purpose and / or dedicated processing components having processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), and any suitable processor, controller, microcontroller, etc. The computing unit 601 executes the various methods and processes described above. For example, in some embodiments, the numerical mode deployment method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 600 via the ROM 602 and / or the communication unit 609. In some embodiments, the computing unit 601 can be configured to execute the numerical mode deployment method by any other suitable means (e.g., by means of firmware).
[0122] Also, it should be understood that the above-disclosed is only the preferred embodiment of the present invention, and of course, it cannot be used to limit the scope of the rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.
Claims
1. A numerical model deployment method, characterized in that: include: Obtain target mode deployment indication data, wherein the target mode deployment indication data includes information on the number of grids in each of the M nested layers and the total number of CPU cores, where M is a positive integer; Determine the total number of cores running simultaneously based on the total number of CPU cores in the target mode deployment indication data, and determine at least one target number of cores running simultaneously based on the total number of cores running simultaneously; Determine the grid division results corresponding to the target synchronous running core numbers in the at least one target synchronous running core number and the grid number information of the respective nested layers, respectively; wherein the grid division result corresponding to one synchronous running core number includes the grid number information of each grid block of the respective nested layers under the corresponding synchronous running core number; Determine a set of indication data of the number of synchronous running cores to be recommended based on the grid division results corresponding to each target number of synchronous running cores, wherein the set of indication data of the number of synchronous running cores to be recommended includes the grid division results corresponding to each number of synchronous running cores to be recommended among N numbers of synchronous running cores to be recommended, where N is a non-negative integer; When N is greater than or equal to a preset number threshold, the recommended index value of each to-be-recommended number of cores running simultaneously is calculated based on the grid division results corresponding to each to-be-recommended number of cores running simultaneously, and the target to-be-recommended number of cores is determined based on the recommended index value of each to-be-recommended number of cores running simultaneously, so as to determine the target recommended number of central processing unit cores under the target mode deployment indication data based on the target number of cores to be recommended, and the target recommended number of central processing unit cores supports the use of numerical mode deployment.
2. The method according to claim 1, characterized in that The target mode deployment indication data also includes a CPU utilization threshold; The determining at least one target number of synchronously running cores based on the total number of synchronously running cores comprises: Based on the total number of synchronously running cores and the CPU utilization threshold, a synchronously running core number threshold is calculated; and the number of synchronously running cores to be determined in the current iteration is determined, and whether the number of synchronously running cores to be determined in the current iteration is a target number of synchronously running cores; wherein the number of synchronously running cores to be determined in the first iteration is the total number of synchronously running cores; If the number of synchronous running cores to be determined in the current iteration is greater than or equal to the synchronous running core number threshold, and the number of synchronous running cores to be determined in the current iteration is not a prime number, the number of synchronous running cores to be determined in the current iteration is used as a target number of synchronous running cores; If the number of synchronously running cores to be determined in the current iteration is a prime number, the number of synchronously running cores to be determined in the current iteration is not used as a target number of synchronously running cores; The determining of the number of synchronously running cores to be determined in the current iteration is iteratively performed until the number of synchronously running cores to be determined in the current iteration is less than the synchronously running core number threshold, so as to achieve the determination of the at least one target synchronously running core number.
3. The method according to claim 2, characterized in that The grid division result corresponding to a synchronous running core number includes grid number information of each grid block under the corresponding synchronous running core number at each nested layer, and the grid number information of a grid block includes the grid number of each grid block in multiple division directions; the determining the grid division result corresponding to each target synchronous running core number based on each target synchronous running core number in the at least one target synchronous running core number and the grid number information of each nested layer, includes: After taking the number of synchronous running cores to be determined in the current iteration as a target number of synchronous running cores, determining a grid division result corresponding to the number of synchronous running cores to be determined in the current iteration based on the number of synchronous running cores to be determined in the current iteration and the grid number information of each nested layer; The determining of a set of indication data of the number of synchronously running cores to be recommended based on the grid division results corresponding to the respective target numbers of synchronously running cores comprises: If there is no target grid block in the grid division result corresponding to the number of synchronous running cores to be determined in the current iteration, the number of synchronous running cores to be determined in the current iteration is taken as a number of synchronous running cores to be recommended, so as to add the indication data of the number of synchronous running cores to be recommended corresponding to the number of synchronous running cores to be determined in the current iteration to the indication data set of the number of synchronous running cores to be recommended; wherein one indication data of the number of synchronous running cores to be recommended includes a grid division result corresponding to the number of synchronous running cores to be recommended, and the target grid block refers to a grid block in which the number of grids in any division direction is less than the specified number of grids; After the iteration is stopped, the to-be-recommended synchronously-running core number indication data set is obtained.
4. The method according to any one of claims 1 to 3, characterized in that: The target recommended number of CPU cores is obtained by running a preprocessing module on the target mode deployment indication data; the method further comprises: Obtain a historical record data set, where each historical record data includes a pattern deployment indication data; Based on the historical record data set and the target mode deployment indication data, determining whether to run the preprocessing module for the first time through the target mode deployment indication data; If it is determined that the preprocessing module is run for the first time through the target mode deployment indication data, triggering the execution of the method based on the total number of CPU cores in the target mode deployment indication data to determine the total number of synchronously running cores; If it is determined that this is not the first time that the preprocessing module is run through the target mode deployment indication data, a prompt message indicating that it is not the first time that the preprocessing module is run is output.
5. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When N is less than the preset number threshold, a no-recommendation prompt message is output, where the no-recommendation prompt message is used to prompt that there is no CPU core that meets the conditions under the target mode deployment indication data.
6. The method according to any one of claims 1 to 3, characterized in that: The calculating the recommended index value of each number of cores to be recommended for simultaneous operation based on the grid division results corresponding to each number of cores to be recommended for simultaneous operation, comprises: For any number of cores to be recommended for simultaneous operation among the N numbers of cores to be recommended for simultaneous operation, based on a grid division result corresponding to the number of cores to be recommended for simultaneous operation, respectively determine the recommended index calculation information of each nested layer under the number of cores to be recommended for simultaneous operation; The recommended index calculation information of each nested layer under any number of cores to be recommended for simultaneous operation is used to calculate the recommended index value of any number of cores to be recommended for simultaneous operation.
7. The method according to any one of claims 1 to 3, characterized in that: The determining the target number of cores to be recommended based on the recommendation indicator values of the respective numbers of cores to be recommended for simultaneous operation includes: Based on the recommendation index values of the respective numbers of synchronously running cores to be recommended, determining a number of synchronously running cores to be recommended with a minimum recommendation index value from the N numbers of synchronously running cores to be recommended; Based on the number of cores to be recommended for synchronous operation with the smallest recommended index value, a target number of cores to be recommended is determined.
8. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: According to the target number of cores to be recommended and the number of grids of each nested layer, the operation of the target mode is started, and the mode case running time of the target mode for the target number of cores to be recommended is obtained to check whether the mode case running time is less than a preset mode running time threshold; If the mode case running time is less than the preset mode running time threshold, triggering the step of determining the target recommended number of CPU cores under the target mode deployment indication data based on the target number of cores to be recommended; If the mode case running time is greater than or equal to the preset mode running time threshold, a mode deployment indication data adjustment prompt is output.
9. A numerical model deployment device, characterized in that: The device comprises: An acquisition unit, used to acquire target mode deployment indication data, wherein the target mode deployment indication data includes information on the number of grids in each of the M nested layers and the total number of CPU cores, where M is a positive integer; a processing unit, configured to determine a total number of synchronously operating cores based on a total number of central processing unit cores in the target mode deployment indication data, and determine at least one target number of synchronously operating cores based on the total number of synchronously operating cores; The processing unit is further configured to determine the grid division results corresponding to each target number of synchronous running cores in the at least one target number of synchronous running cores and the grid number information of each nested layer, respectively; wherein the grid division result corresponding to one number of synchronous running cores includes the grid number information of each grid block of each nested layer under the corresponding number of synchronous running cores; The processing unit is further configured to determine a set of indication data of the number of synchronous running cores to be recommended based on the grid division results corresponding to each target number of synchronous running cores, wherein the set of indication data of the number of synchronous running cores to be recommended includes a grid division result corresponding to each number of synchronous running cores to be recommended among N numbers of synchronous running cores to be recommended, where N is a non-negative integer; The processing unit is also used to calculate the recommended index value of each to-be-recommended number of cores to be run simultaneously based on the grid division results corresponding to each to-be-recommended number of cores to be run simultaneously, and determine the target to-be-recommended number of cores based on the recommended index value of each to-be-recommended number of cores to be run simultaneously, when N is greater than or equal to a preset number threshold, so as to determine the target recommended number of central processing unit cores under the target mode deployment indication data based on the target number of cores to be recommended, and the target recommended number of central processing unit cores supports the use of numerical mode deployment.
10. An electronic device, characterized in that: include: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-8.
12. A chip, characterized in that: The chip is located in an electronic device, and the chip is used to execute the method according to any one of claims 1-8.
Citation Information
Patent Citations
Air quality mode operation method and device, storage medium and electronic equipment
CN116954932A