Method, device and equipment for calculating interaction between particles, and storage medium

By distributing the task of calculating inter-particle interactions to multiple computing units and controlling the total number of computing units, the problem of long calculation time for inter-particle interactions is solved, and efficient calculation results are achieved.

CN117095760BActive Publication Date: 2025-10-24SHANGHAI SMARTLOGIC TECHNOLOGY LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310944533.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2025-10-24
Estimated Expiration
2043-07-28

AI Technical Summary

Technical Problem

In existing technologies, the computation time for inter-particle interactions is relatively long, especially when simulating protein motion, the computational load is enormous, resulting in low computational efficiency.

Method used

The particles in the target computing system are grouped and assigned to multiple different computing units for computation. By controlling the total number of computing units used by each particle within a preset threshold, data transmission time is reduced and computing efficiency is improved.

Benefits of technology

By optimizing task allocation and data transmission, the computational efficiency of inter-particle interactions has been significantly improved, and computation time has been reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117095760B_ABST
    Figure CN117095760B_ABST
Patent Text Reader

Abstract

The application discloses a particle interaction calculation method and device, equipment and a storage medium. The method comprises the following steps: determining a target calculation system, grouping the particles in the target calculation system, obtaining a plurality of tasks, and using the tasks to control the calculation units to calculate the interaction between a group of particles; distributing each task to a plurality of different calculation units, wherein the number of the calculation units is a preset value; determining the total number of the calculation units used by each particle according to the correspondence between the tasks and the calculation units; if the total number of the calculation units used by each particle is less than a preset threshold, controlling each calculation unit to execute the corresponding task, and obtaining the interaction calculation result between each particle according to the execution result of each calculation unit. The application distributes different tasks to different calculation units, controls the total number of the calculation units used by each particle within a certain range, improves the calculation efficiency of each task, and reduces the data transmission time.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of molecular dynamics simulation, and particularly relates to a method and device for calculating interaction between particles, equipment and a storage medium. BACKGROUND

[0002] In the field of life science, molecular dynamics is well known as an important tool for simulating the movement of proteins in solvents. The longer the simulation time of protein movement, for example, to the microsecond and millisecond level, the more accurate the simulation result. Molecular dynamics simulates the movement of proteins by describing the interaction between all particles within a certain range. Assuming that the simulated protein contains X particles, when simulating its movement, the interaction between the given particles and the distance between 1 / 2X(X-1) pairs of atoms need to be calculated at each step. The atom pairs within the range are used to calculate the interaction, and usually less than 5 femtoseconds are calculated for each step. Therefore, to achieve a calculation time of microsecond or millisecond level, 10 6 -10 9 orders of magnitude of steps need to be calculated. As can be seen, the calculation amount of long-time simulation of protein movement is huge, and how to improve the calculation efficiency of the interaction between particles has become a technical problem to be solved. SUMMARY

[0003] Therefore, the present application provides a method and device for calculating the interaction between particles, equipment and a storage medium to solve the problem of long calculation time of particle interaction.

[0004] In a first aspect, the present application provides a method for calculating the interaction between particles, which comprises: determining a target calculation system, grouping the particles in the target calculation system to obtain a plurality of tasks, the tasks being used to control a calculation unit to calculate the interaction between a group of particles; distributing each task to a plurality of different calculation units, the number of calculation units being a preset value; determining the total number of calculation units used by each particle according to the correspondence between the tasks and the calculation units; if the total number of calculation units used by each particle is less than a preset threshold, controlling each calculation unit to execute the corresponding task, and obtaining the interaction calculation result between each particle according to the execution result of each calculation unit.

[0005] The method provided by the present application embodiment distributes different tasks to different calculation units in order to reduce the task calculation time. In addition, the present application embodiment also controls the total number of calculation units used by each particle within a certain range, thereby improving the calculation efficiency of each task, reducing the data transmission time, and improving the total interaction calculation efficiency of each particle.

[0006] Further, the method provided by the embodiment of the present application further comprises: if the total number of the computing units used by one particle is greater than the preset threshold, decreasing the preset value by 1, returning to the step of distributing each task to the plurality of different computing units until the total number of the computing units used by each particle is less than the preset threshold; and controlling each computing unit to execute the corresponding task, and obtaining the interaction calculation result between the particles according to the execution result of each computing unit.

[0007] Further, the particles in the target computing system are grouped to obtain a plurality of tasks, which comprises: determining the interaction type between the particles in the target computing system; and grouping the particles according to the interaction type between the particles to obtain at least one task set, one interaction type corresponding to one task set, and one task set comprising at least one task.

[0008] Further, the interaction type between the particles comprises a first dihedral interaction, a second dihedral interaction and a CMAP interaction, the CMAP interaction is used to represent the interaction between the particles in a particle set, the particle set comprising a first particle subset and a second particle subset, the first dihedral interaction is used to represent the interaction between the particles in the first particle subset, and the second dihedral interaction is used to represent the interaction between the particles in the second particle subset; and the step of distributing each task to the plurality of different computing units comprises: distributing each first task in the task set corresponding to the first dihedral interaction to the plurality of different computing units; distributing each second task in the task set corresponding to the second dihedral interaction to the plurality of different computing units; and if the first task corresponding to the first particle subset and the second task corresponding to the second particle subset in the same particle set are distributed to different computing units, distributing a third task corresponding to the particle set to the computing unit where the first task corresponding to the first particle subset is located.

[0009] Further, the interaction type between the particles further comprises a bond angle interaction and a bond length interaction, and the step of distributing each task to the plurality of different computing units further comprises: distributing each fourth task in the task set corresponding to the bond angle interaction to the plurality of different computing units; and distributing each fifth task in the task set corresponding to the bond length interaction to the plurality of different computing units.

[0010] Further, one computing unit corresponds to the tasks in a plurality of task sets, and the number of the tasks in one computing unit belonging to the same task set is less than or equal to D i / N, wherein, D i represents the number of tasks in the i th task set, and N represents the number of computing units.

[0011] Further, the control unit controls the computing units to execute corresponding tasks, and obtains interaction calculation results between the particles according to execution results of the computing units, including: controlling the computing units to execute corresponding tasks to obtain interaction calculation results corresponding to the tasks; transmitting the interaction calculation results corresponding to the same particle to a target computing unit; and calculating a sum of the interaction calculation results corresponding to the same particle by the target computing unit to obtain a total interaction of the particle.

[0012] In a second aspect, the present application provides an interaction calculation device between particles, which comprises:

[0013] a task determination module, configured to determine a target computing system, group the particles in the target computing system, and obtain a plurality of tasks, the tasks being used to control the computing units to calculate interactions between a group of particles; a task allocation module, configured to allocate the tasks to a plurality of different computing units, the number of the computing units being a preset value; a total number of computing units calculation module, configured to determine a total number of computing units used by each particle according to a correspondence between the tasks and the computing units; and an interaction calculation module, configured to control the computing units to execute corresponding tasks to obtain interaction calculation results between the particles according to execution results of the computing units, if the total number of computing units used by each particle is less than a preset threshold.

[0014] In a third aspect, the present application provides a computer device, which comprises: a memory and a processor, the memory and the processor being communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the interaction calculation method between particles according to the first aspect or any one of the corresponding embodiments thereof.

[0015] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions, the computer instructions being used to make a computer perform the interaction calculation method between particles according to the first aspect or any one of the corresponding embodiments thereof. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0017] Figure 1 is a flowchart of the interaction calculation method between particles according to an embodiment of the present application;

[0018] Figure 2is a schematic diagram of a dihedral angle of a molecular structure in an embodiment of the present application;

[0019] Figure 3 is a schematic diagram of a flow of another inter-particle interaction calculation method according to an embodiment of the present application;

[0020] Figure 4 is a schematic diagram of a flow of yet another inter-particle interaction calculation method according to an embodiment of the present application;

[0021] Figure 5 is a structural block diagram of an inter-particle interaction calculation device according to an embodiment of the present application;

[0022] Figure 6 is a schematic diagram of a hardware structure of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0023] To make the objectives, technical solutions and advantages of embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0024] In order to obtain accurate protein motion results, a supercomputer capable of providing high-speed computing capability is needed. In the related art, a plurality of computing units are used in parallel to perform accelerated calculation. When a plurality of computing units are used in parallel, a computing task is split into several parts and then distributed to different computing units for simultaneous calculation. Thus, the amount of calculation borne by each computing unit is significantly reduced, and the overall calculation time is significantly shortened.

[0025] However, for a computing system containing X particles, any particle has a computing interaction task with a plurality of particles. When parallel computing is performed, these tasks may be distributed to different computing units. After the calculation is completed, the computing results of the interactions are transmitted from the different computing units to the computing unit where the particle is located for summation. The total interaction of the particle in the calculation process is obtained. It can be seen that the more the computing units to which the computing task is distributed, the more data is transmitted, and the more time is used for transmission.

[0026] According to an embodiment of the present application, a kind of inter-particle interaction calculation method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.

[0027] In the embodiment, a method for calculating interaction between particles is provided, Figure 1 is a flowchart of the method for calculating interaction between particles according to the embodiment of the application, as shown in the figure, the flow includes the following steps: Figure 1

[0028] In step S11, a target calculation system is determined, and particles in the target calculation system are grouped to obtain a plurality of tasks, the tasks being used to control a calculation unit to calculate interaction between a group of particles.

[0029] In the embodiment, the target calculation system refers to a calculation system in molecular dynamics, and the target calculation system is used to simulate the movement of a protein, and the particles in the target calculation system refer to particles in the simulated protein.

[0030] The calculated interaction in the molecular dynamics includes bond length, bond angle, dihedral angle, CMAP, etc. The parallel acceleration modes of the two kinds of interactions are different. The calculation objects of the bond interaction, such as which particles need to calculate the bond length, bond angle, dihedral angle, and CMAP, are given for a certain protein; the calculation objects of the non-bond interaction change with the simulation. The method for calculating interaction between particles provided in the embodiment is suitable for the bond interaction. Since the interactions to be calculated between different particles are different, the particles in the target system need to be grouped, and each group contains at least two particles, and the particles in each group have interaction.

[0031] In step S12, each task is distributed to a plurality of different calculation units, and the number of calculation units is a preset value.

[0032] In the embodiment, in order to improve the calculation efficiency of the interaction between particles, each task is uniformly distributed to a plurality of different calculation units.

[0033] In step S13, the total number of calculation units used by each particle is determined according to the correspondence between the tasks and the calculation units.

[0034] In the embodiment, since the same particle may have interaction relationship with multiple particles, one particle may exist in different tasks and be distributed to different calculation units.

[0035] If the total number of calculation units used by each particle is less than a preset threshold, step S14 is executed, each calculation unit is controlled to execute the corresponding task, and the calculation result of the interaction between each particle is obtained according to the execution result of each calculation unit.

[0036] ​If the total number of computing units used by one particle is greater than the preset threshold, the preset value is reduced by 1, and the step of distributing each task to different computing units is returned until the total number of computing units used by each particle is less than the preset threshold, and then step S14 is executed.

[0037] In the embodiment of the application, different tasks are distributed to different computing units for processing in order to improve the calculation efficiency of interaction. Since there is an interaction relationship between one particle and different particles, one particle is divided into different tasks and distributed to different computing units. When calculating the total interaction of one particle, the interaction calculation results of the particle calculated by all computing units need to be transmitted to one computing unit to complete the final total interaction calculation. In the embodiment of the application, if it is determined that the total number of computing units used by one particle is greater than the preset threshold, it is determined that the current task distribution is relatively dispersed, and the subsequent data transmission process will take a long time. At this time, the number of computing units needs to be reduced to re-distribute the tasks and concentrate the tasks in a few computing units for processing to reduce the data transmission time.

[0038] In the embodiment of the application, the preset threshold can be set according to actual needs. The setting of the preset threshold needs to reduce the data transmission time on the basis of ensuring the calculation efficiency of the tasks by the computing units.

[0039] The method provided by the embodiment of the application distributes different tasks to different computing units in order to reduce the task calculation time. In addition, the embodiment of the application also controls the total number of computing units used by each particle within a certain range, improves the calculation efficiency of each task, reduces the data transmission time, and improves the calculation efficiency of the total interaction of each particle.

[0040] In the embodiment of the application, the above step S11 specifically includes:

[0041] Step a1, determining the interaction type between particles in the target computing system.

[0042] Step a2, grouping the particles according to the interaction type between the particles to obtain at least one task set. One interaction type corresponds to one task set, and one task set includes at least one task.

[0043] In the embodiments of the present application, the interactions include bond length, bond angle, dihedral angle, CMAP, etc. In the target calculation system, a plurality of groups of particles whose bond lengths need to be calculated form a task set corresponding to the bond length, the task set including a plurality of tasks, each task corresponding to a group of particles whose bond length needs to be calculated; a plurality of groups of particles whose bond angles need to be calculated form a task set corresponding to the bond angle, the task set including a plurality of tasks, each task corresponding to a group of particles whose bond angle needs to be calculated; a plurality of groups of particles whose dihedral angles need to be calculated form a task set corresponding to the dihedral angle, the task set including a plurality of tasks, each task corresponding to a group of particles whose dihedral angle needs to be calculated; and a plurality of groups of particles whose CMAPs need to be calculated form a task set corresponding to the CMAP, the task set including a plurality of tasks, each task corresponding to a group of particles whose CMAP needs to be calculated.

[0044] In the embodiments of the present application, the types of interactions between particles include a first dihedral angle interaction, a second dihedral angle interaction, and a CMAP interaction. The CMAP interaction is used to represent the interactions between particles in a particle set, the particle set including a first particle subset and a second particle subset. The first dihedral angle interaction is used to represent the interactions between particles in the first particle subset, and the second dihedral angle interaction is used to represent the interactions between particles in the second particle subset.

[0045] In the process of simulating the molecular dynamics simulation of a biological system, in order to accurately describe the interactions between particles, a potential energy term named CMAP is usually introduced into the original potential energy function of the force field, so that the distribution of the dihedral angle formed by the particles can be more accurately described. The CMAP potential energy term describes the C-N-C-C-N main chain particles of several groups of proteins, the first four particles form a dihedral angle, and the last four particles form a dihedral angle. When the peptide bond formed by the dehydration condensation of amino acids has the property of a double bond, the rotation is limited, and therefore the rotation of the two main chain dihedral angles φ and ψ plays a key role in the conformation of the protein, as shown in Figure 2 . Figure 2 The solid line, the dashed line and the dotted line areas shown in the above figure respectively represent three amino acids, which are dehydrated and condensed to form a short peptide. C, O, N and H represent carbon atoms, oxygen atoms, nitrogen atoms and hydrogen atoms, respectively. The dihedral angle φ is C-N-C-C, and the dihedral angle ψ is N-C-C-N. The N-C-C of φ and the N-C-C of ψ are common particles.

[0046] The above step S12 includes:

[0047] Step b1, distributing each first task in the task set corresponding to the first dihedral angle interaction to a plurality of different computing units.

[0048] Step b2, each second task in the task set corresponding to the second dihedral angle interaction is assigned to a different computing unit.

[0049] If the first task and the second task corresponding to the first particle subset and the second particle subset in the same particle set are assigned to different computing units, step b3 is performed to assign the third task corresponding to the particle set to the computing unit where the first task corresponding to the first particle subset is located.

[0050] If the first task and the second task corresponding to the first particle subset and the second particle subset in the same particle set are assigned to the same computing unit, step b4 is performed to assign the third task corresponding to the particle set to the computing unit.

[0051] Because a group of CMAPs describe two dihedral angles φ and ψ of the main chain particles, although it is ensured that the four particles of φ and ψ respectively are in the same computing unit when all dihedral angles are assigned, the φ and ψ in a group of CMAPs may not be assigned to the same computing unit. Therefore, the embodiment of the application further assigns CMAPs on the basis of the assignment results of all dihedral angles in the system to consider the assignment of the computing tasks of CMAPs and dihedral angles, so that more interactions between the same particles can be calculated in one computing unit as much as possible, and data transmission is reduced.

[0052] In the embodiment of the application, the types of interactions between particles further include bond angle interactions and bond length interactions, and the step S12 further includes:

[0053] Step b5, each fourth task in the task set corresponding to the bond angle interaction is assigned to a different computing unit.

[0054] Step b6, each fifth task in the task set corresponding to the bond length interaction is assigned to a different computing unit.

[0055] In the embodiment of the application, in the method provided by the embodiment of the application, one computing unit corresponds to tasks in multiple task sets, and the number of tasks in one computing unit belonging to the same task set is less than or equal to D i / N, where D i represents the number of tasks in the ith task set, and N represents the number of computing units.

[0056] In the embodiment of the application, when tasks are assigned, the tasks in the task sets corresponding to different types of interactions are sequentially assigned, and when each task set is assigned, the tasks in the task set are as evenly as possible assigned to the computing units, so that the number of tasks in one computing unit belonging to the same task set is less than or equal to D i / N.

[0057] In an embodiment of the present application, in the method provided in an embodiment of the present invention, after executing the above step S14, the method further includes:

[0058] Step c1, controlling each computing unit to execute a corresponding task, and obtaining an interaction computing result corresponding to each task.

[0059] Step c2: transmitting multiple interaction calculation results corresponding to the same particle to a target computing unit.

[0060] Step c3: Calculate the sum of multiple interaction calculation results corresponding to the same particle through the target calculation unit to obtain the total interaction of the particle.

[0061] As described in the above embodiment, since the same particle interacts with multiple particles, when calculating the total interaction of a particle, it is necessary to transmit the interaction calculation results of the particle obtained by each calculation unit to one calculation unit, and calculate the total interaction of the particle through this calculation unit.

[0062] In a specific embodiment of the present application, in a parallel computing process, assuming that there are N computing units, the total number of computing units that each particle can use cannot be greater than a certain value A due to the need to reduce data transmission. When only considering the calculation of CMAP, for any simulation system, the number of CMAP groups M is given, each group contains five particles, and the five particles in each group need to meet the requirement of being calculated in the same computing unit. In order to meet the above requirements, the particle interaction calculation method is as follows: Figure 3 As shown:

[0063] In step S301 , all CMAPs are distributed to different computing units without duplication in a manner such that each computing unit calculates M / N groups of CMAPs.

[0064] Step S302: Determine the computing unit used by each particle according to the allocation situation, and count the total number of computing units used by each particle in this allocation.

[0065] If the total number of computing units used by each particle is ≤ A, then it is the final allocation result. Otherwise, one computing unit (N-1) needs to be reduced to calculate CMAP.

[0066] For (N-1) computational units, each computational unit is assigned M / (N-1) sets of CMAPs without duplication. Similarly, the total number of computational units used by each particle in this case is counted and compared with A. If all the numbers are ≤ A, the final allocation is obtained. If not, one computational unit (N-2) is reduced. Repeat the above process in an iterative loop until the condition is met.

[0067] In a specific embodiment, since the bonding interaction of molecular dynamics includes not only CMAP, but also bond length, bond angle, dihedral angle and other calculations, if each type of interaction is considered separately and each is allocated according to the above allocation method of CMAP, there will still be a situation that the number of calculation units used by some particles is greater than a certain value A, which will reduce the transmission efficiency. In order to further improve the supercomputing speed, the particle interaction calculation method provided in the embodiment of the present application can effectively calculate and transmit CMAP while taking into account the allocation of bond length, bond angle, dihedral angle and other calculations. Because a group of CMAPs describes the two dihedral angles φ and ψ of the main chain particles, these two dihedral angles also belong to all dihedral angles of the simulated system. Although it can be ensured that the four particles of φ and ψ are respectively in the same calculation unit when allocating all dihedral angles, there may be a situation that φ and ψ in a group of CMAPs are not allocated to the same calculation unit. Therefore, the method provided in the embodiment of the present application further allocates CMAP based on the allocation results of all dihedral angles in the system to take into account the calculation task allocation of CMAP and dihedral angle. As shown in the following formula, the method includes: Figure 4

[0068] Step S401, dihedral angles are allocated to N calculation units without repetition, and each calculation unit is allocated D / N dihedral angles, wherein D represents the number of dihedral angles.

[0069] Step S402, the calculation unit number used by each particle contained in the dihedral angle is counted, and the results of φ and ψ dihedral angles in each group of CMAPs in the dihedral angle allocation are found.

[0070] If the two dihedral angles are allocated to different calculation units, step S403 is performed to allocate the fourth particle (i.e. the fifth particle of CMAP) of the ψ dihedral angle in the group of CMAPs to the same calculation unit as the φ dihedral angle of the group of CMAPs.

[0071] Step S404, bond angles and bond lengths are uniformly allocated to calculation units.

[0072] Step S405, the calculation units used by each particle in different interactions are summarized, and the total number of calculation units is counted after removing the duplicates.

[0073] The total number of calculation units is compared with a certain value A, if ≤ A, it is the final allocation result, otherwise, one calculation unit (N-1) is reduced. The above process is repeated until the total number of calculation units used by each particle ≤ A.

[0074] ​In the embodiment, an inter-particle interaction computing device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and the description of which has been made above. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.

[0075] The embodiment provides an inter-particle interaction computing device, as shown in the accompanying drawings, comprising: Figure 5

[0076] A task determining module 501 is configured to determine a target computing system, group particles in the target computing system, and obtain a plurality of tasks, the tasks being used to control a computing unit to calculate an interaction between a group of particles.

[0077] A task assigning module 502 is configured to assign each task to a plurality of different computing units, the number of the computing units being a preset value.

[0078] A total number of computing units calculating module 503 is configured to determine a total number of computing units used by each particle according to a correspondence between the tasks and the computing units.

[0079] An interaction calculating module 504 is configured to control each computing unit to execute the corresponding task if the total number of computing units used by each particle is less than a preset threshold, and obtain an interaction calculation result between each particle according to an execution result of each computing unit.

[0080] Further function descriptions of the above-mentioned modules and units are the same as those of the corresponding embodiments, and will not be repeated here.

[0081] The inter-particle interaction computing device in the embodiment is presented in the form of functional units, where the units refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.

[0082] The embodiment of the present application also provides a computer device with the above-mentioned inter-particle interaction computing device. Figure 6

[0083] Please refer to Figure 6 , Figure 6 is a structural schematic diagram of a computer device provided by an optional embodiment of the present application, as shown in the accompanying drawings. Figure 6 ​​As shown, the computer device includes one or more processors 10, memory 20, and interfaces 50 for external devices such as modems and network interfaces. The one or more processors 10 can be implemented as one or more central processing units (CPUs), one or more microprocessors, microcontrollers, digital signal processors, specialized processors or controller, or one or more processors of any equivalent known in the art. In some embodiments, the one or more processors 10 can be implemented as a combination of one or more of the above physical machines. The memory 20 can include volatile and nonvolatile memory such as read only memory (ROM) 21, random access memory (RAM) 22, and electrically erasable programmable read only memory (EEPROM) 23. The memory 20 can also include a storage 24, such as a magnetic or optical hard disk, a floppy disk, a CD-ROM, a DVD, a Blu-ray disc, a flash memory, or other suitable storage devices. The memory 20 can include a storage medium configured to store data received from external devices, such as the input device 30, or to store data to be transmitted to external devices, such as the output device 40. The memory 20 can also include a storage medium configured to store instructions executable by the one or more processors 10, such as software or firmware. The memory 20 can include a storage medium configured to store data or instructions that are not executable by the one or more processors 10, such as data files. Figure 6 The processor 10 is taken as an example in the embodiment.

[0084] The processor 10 can be a central processing unit, a network processor or a combination thereof. The processor 10 can further include a hardware chip. The hardware chip can be an application specific integrated circuit, a programmable logic device or a combination thereof. The programmable logic device can be a complex programmable logic device, a field programmable logic gate array, a generic array logic or any combination thereof.

[0085] The memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiment.

[0086] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required by at least one function, and the like. The data storage area can store data created according to the use of the computer device, and the like. In addition, the memory 20 can include a high-speed random access memory, and can further include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid state memory device. In some alternative embodiments, the memory 20 can optionally include a memory disposed remotely from the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0087] The memory 20 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk or a solid state disk; the memory 20 can also include a combination of the above kinds of memories.

[0088] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 can be connected by a bus or other means,Figure 6 The bus connections are exemplary only. Other types of connections and media can also be used to connect the chosen devices.

[0089] The input device 30 can receive input of digital or character information, and generate key signal input related to user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 can include a display device, an auxiliary lighting device (e.g., an LED), a tactile feedback device (e.g., a vibration motor), etc. The display device includes, but is not limited to, a liquid crystal display, a light-emitting diode, a display, and a plasma display. In some alternative embodiments, the display device can be a touch screen.

[0090] The embodiments of the present application also provide a computer readable storage medium, the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium through network, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned types of memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0091] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be suggested by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes are intended to fall within the scope of the appended claims.

Claims

1. A method of calculating an interaction between particles, characterized by, The method comprises: determining a target computing system, grouping particles in the target computing system to obtain a plurality of tasks, the tasks being used to control a computing unit to calculate interaction between a group of particles; allocating each task to a plurality of different computing units, the number of computing units being a preset value; determining the total number of computing units used by each particle according to the correspondence between the tasks and the computing units; if the total number of computing units used by each particle is less than a preset threshold, controlling each computing unit to execute the corresponding task, and obtaining the calculation result of the interaction between each particle according to the execution result of each computing unit; the method further comprises: if the total number of computing units used by one particle is greater than the preset threshold, reducing the preset value by 1, returning to the step of allocating each task to a plurality of different computing units, until the total number of computing units used by each particle is less than the preset threshold, and then executing the control of each computing unit to execute the corresponding task, and obtaining the calculation result of the interaction between each particle according to the execution result of each computing unit; or if it is determined that the total number of computing units used by one particle is greater than the preset threshold, it is determined that the current task allocation is relatively dispersed, at which time the number of computing units is reduced to re-allocate the tasks and concentrate the tasks in a small number of computing units for processing.

2. The method of claim 1, wherein, Further comprising: if the total number of computing units used by one particle is greater than the preset threshold, reducing the preset value by 1, returning to the step of allocating each task to a plurality of different computing units, until the total number of computing units used by each particle is less than the preset threshold; controlling each computing unit to execute the corresponding task, and obtaining the calculation result of the interaction between each particle according to the execution result of each computing unit.

3. The method of claim 1, wherein, The grouping of particles in the target computing system to obtain a plurality of tasks comprises: determining the interaction type between particles in the target computing system; grouping particles according to the interaction type between particles to obtain at least one task set, one interaction type corresponding to one task set, and one task set including at least one task.

4. The method of claim 3, wherein, The interaction type between particles includes a first dihedral angle interaction, a second dihedral angle interaction, and a CMAP interaction, wherein the CMAP interaction is used to represent the interaction between particles in a particle set, the particle set including a first particle subset and a second particle subset, the first dihedral angle interaction is used to represent the interaction between particles in the first particle subset, and the second dihedral angle interaction is used to represent the interaction between particles in the second particle subset; the step of allocating each task to a plurality of different computing units comprises: allocating each first task in the task set corresponding to the first dihedral angle interaction to a plurality of different computing units; allocating each second task in the task set corresponding to the second dihedral angle interaction to a plurality of different computing units; If the first task and the second task corresponding to the first particle subset and the second particle subset in the same particle set are allocated to different computing units, a third task corresponding to the particle set is allocated to the computing unit where the first task corresponding to the first particle subset is located.

5. The method of claim 4, wherein, The interaction types between the particles further include bond angle interactions and bond length interactions, and the step of allocating each task to a plurality of different computing units further includes: allocating each fourth task in a task set corresponding to the bond angle interactions to a plurality of different computing units; allocating each fifth task in a task set corresponding to the bond length interactions to a plurality of different computing units.

6. The method of claim 3 or 4 or 5, wherein One computing unit corresponds to tasks in multiple task sets, and the number of tasks in one computing unit that belong to the same task set is less than or equal to D i / N, wherein D i represents the number of tasks in the ith task set, and N represents the number of computing units.

7. The method of claim 1, wherein, the control of each computing unit to perform a corresponding task to obtain an interaction calculation result between each particle according to an execution result of each computing unit includes: controlling each computing unit to perform a corresponding task to obtain an interaction calculation result corresponding to each task; transmitting a plurality of interaction calculation results corresponding to the same particle to a target computing unit; calculating a sum of the plurality of interaction calculation results corresponding to the same particle by the target computing unit to obtain a total interaction of the particle.

8. An apparatus for calculating an interaction between particles, characterized by The device includes: a task determination module configured to determine a target computing system, group particles in the target computing system, and obtain a plurality of tasks, the tasks being used to control a computing unit to calculate an interaction between a group of particles; a task allocation module configured to allocate each task to a plurality of different computing units, the number of computing units being a preset value; a total number of computing units calculation module configured to determine a total number of computing units used by each particle according to a correspondence between the tasks and the computing units; an interaction calculation module configured to, if the total number of computing units used by each particle is less than a preset threshold, control each computing unit to perform a corresponding task to obtain an interaction calculation result between each particle according to an execution result of each computing unit; the interaction calculation module is configured to, if the total number of computing units used by one particle is greater than the preset threshold, reduce the preset value by 1 and return to the step of allocating each task to a plurality of different computing units until the total number of computing units used by each particle is less than the preset threshold, and then perform the control of each computing unit to perform a corresponding task to obtain an interaction calculation result between each particle according to an execution result of each computing unit; or, if it is determined that the total number of computing units used by one particle is greater than the preset threshold, it is determined that the current task allocation is relatively dispersed, at which time the number of computing units is reduced and the tasks are allocated again to concentrate the tasks in a small number of computing units for processing.

9. A computer device, comprising: It includes: a memory and a processor, which are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the particle interaction calculation method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores therein computer instructions for causing a computer to execute the inter-particle interaction calculation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Neighbor particle pair searching method, molecular dynamics calculation method and many-core processing system

    CN102945298A

  • Particle motion simulation method, device, equipment and medium

    CN110866343A