A molecular dynamics covalent bond calculation method and apparatus
Patent Information
- Application Number
- CN202410259840.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-03-07
AI Technical Summary
[0010]本发明的主要贡献和创新点如下:本申请实施例采用FPGA作为硬件设计的核心工具,在FPGA上采用HBM2存储设备进行存储,由于HBM2存储设备支持多通道读写,可以更加快速地在HBM2存储设备获取连键信息表与共价键查找表中的数据,涵盖数据读取、数据预处理、数据计算以及数据存储的处理全流程,从根本上提升硬件电子电路的性能,提高计算效率;另外,本方案采用FPGA来构建不同力场需求的共价键计算流水线,从根本上提高了分子动力学共价键的计算效率,优化逻辑资源;
Smart Images

Figure CN118098384B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of molecular dynamics, and in particular to a method and apparatus for calculating covalent bonds in molecular dynamics. Background Technology
[0002] Molecular dynamics is a simulation technique that uses the principles of statistical physics to study the dynamic rheology of atoms and molecules in molecular systems through calculations. It simulates intermolecular interactions and their effects on the laws of gravity, quantum mechanics, and other physical laws. This method primarily relies on Newtonian mechanics to simulate the motion of molecular systems. It samples the system from different states of the molecular system to calculate the configuration integral, and then uses the result of the configuration integral to further calculate the system's thermodynamic quantities and other macroscopic properties.
[0003] A molecular covalent bond refers to a strong interaction formed by two or more atoms sharing their outer electrons, ideally reaching an electron saturation state. This is achieved through the sharing of electrons between several adjacent atoms. Generally, for covalent bonds, parameters such as bond length, bond angle, bond energy, and bond polarity are required. While molecular dynamics simulations have some value, they are limited by hardware computing platforms. Molecular dynamics requires processing large numbers of atoms and molecules and calculating their interactions, typically demanding significant computational resources. This often results in long physics times, larger physical systems, and more detailed models for optimization, frequently involving experiments on large computing clusters running for months at a time.
[0004] In summary, while current molecular dynamics methods can obtain valuable covalent bond parameters, they are limited by hardware computing platforms, resulting in a large overall computational load and low computational efficiency. Summary of the Invention
[0005] This application provides a method and apparatus for calculating molecular dynamics covalent bonds. By using a heterogeneous hardware design combining an FPGA and a CPU processor, the computational power of each component is fully utilized to improve the computational efficiency of molecular dynamics covalent bonds.
[0006] In a first aspect, embodiments of this application provide a method for calculating molecular dynamics covalent bonds, the method comprising: The CPU obtains the force field file corresponding to the molecular structure and extracts the calculation parameters of each particle to generate a particle information lookup table, in which each particle information lookup table records each particle and its corresponding calculation parameters. The FPGA acquires the force field file and particle information lookup table, and allocates an independent covalent bond storage area for each particle within the FPGA based on the particle information lookup table; A covalent bond calculation pipeline is constructed in the FPGA. The execution of the covalent bond calculation pipeline is controlled by the pipeline instruction control module. For each particle in the covalent bond pipeline, the calculation parameters are read from the corresponding covalent bond storage area, and the force of the particle is obtained by pipeline calculation based on the read calculation parameters and stored in the particle information lookup table.
[0007] Secondly, embodiments of this application provide a molecular dynamics covalent bond calculation device, comprising: The acquisition module is used to acquire the force field file corresponding to the molecular structure through the CPU and extract the calculation parameters of each particle to generate a particle information lookup table, wherein each particle information lookup table records each particle and its corresponding calculation parameters. The storage module is used to acquire force field files and particle information lookup tables through the FPGA, and allocate an independent covalent bond storage area for each particle within the FPGA based on the particle information lookup table. The computation module is used to construct a covalent bond computation pipeline in the FPGA. The pipeline instruction control module controls the execution of the covalent bond computation pipeline. For each particle in the covalent bond pipeline, the computation parameters are read from the corresponding covalent bond storage area, and the force of the particle is obtained by pipeline calculation based on the read computation parameters and stored in the particle information lookup table.
[0008] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform a molecular dynamics covalent bond calculation method.
[0009] Fourthly, embodiments of this application provide a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including a molecular dynamics covalent bond calculation method.
[0010] The main contributions and innovations of this invention are as follows: This application uses an FPGA as the core tool for hardware design, and employs an HBM2 storage device on the FPGA for storage. Since the HBM2 storage device supports multi-channel read / write, data in the bond information table and covalent bond lookup table can be retrieved more quickly from the HBM2 storage device, covering the entire process of data reading, data preprocessing, data calculation, and data storage. This fundamentally improves the performance of the hardware electronic circuit and increases computational efficiency. Furthermore, this solution uses an FPGA to construct covalent bond calculation pipelines with different force field requirements, fundamentally improving the computational efficiency of molecular dynamics covalent bonds and optimizing logic resources. Furthermore, this solution combines heterogeneous computing with FPGA and GPU processors, making full use of the computing power of each component to reserve design space for more processing tasks. The calculation of covalent bond forces on the CPU processor is offloaded to the FPGA accelerator. By constructing a covalent bond lookup table, with each particle in the lookup table having an independent storage space, the time required to obtain particle parameters is reduced, thus achieving collaborative processing of software and hardware.
[0011] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0012] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of a molecular dynamics covalent bond calculation method according to an embodiment of this application; Figure 2 This is a logic flowchart of a molecular dynamics covalent bond calculation method according to an embodiment of this application; Figure 3 This is a flowchart illustrating the computational logic for calculating covalent bonds in molecular dynamics according to an embodiment of this application. Figure 4 This is a flowchart of a covalent bond calculation pipeline according to an embodiment of this application, performing molecular dynamics covalent bond calculations; Figure 5 This is a structural diagram of a covalent bond calculation pipeline according to an embodiment of this application; Figure 6 This is a structural block diagram of a molecular dynamics covalent bond calculation device according to an embodiment of this application; Figure 7 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0013] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0014] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.
[0015] Example 1 This application provides a method for calculating covalent bonds in molecular dynamics. By using an FPGA acceleration platform to perform pipelined calculations of covalent bond forces in molecular dynamics, the computational efficiency of molecular dynamics is improved. Specifically, refer to... Figure 1 and Figure 2 The method includes: The CPU obtains the force field file corresponding to the molecular structure and extracts the calculation parameters of each particle to generate a particle information lookup table, in which each particle information lookup table records each particle and its corresponding calculation parameters. The FPGA acquires the force field file and particle information lookup table, and allocates an independent covalent bond storage area for each particle within the FPGA based on the particle information lookup table; A covalent bond calculation pipeline is constructed in the FPGA. The execution of the covalent bond calculation pipeline is controlled by the pipeline instruction control module. For each particle in the covalent bond pipeline, the calculation parameters are read from the corresponding covalent bond storage area, and the force of the particle is obtained by pipeline calculation based on the read calculation parameters and stored in the particle information lookup table.
[0016] Molecular dynamics calculations of covalent bond forces require traversing every single particle, consuming significant computational resources. However, limitations in hardware computing platforms hinder algorithm execution speed, making it difficult to meet practical computational demands. This solution utilizes an FPGA as the core tool for hardware design, constructing a covalent bond calculation pipeline via FPGA to fundamentally improve the computational efficiency of molecular dynamics covalent bond forces. Furthermore, it allows for optimization of the computational logic, contributing to a fundamental improvement in the performance of the hardware electronic circuitry.
[0017] FPGA stands for Field Programmable Gate Array. The biggest difference between FPGA and microprocessor is that FPGA can process in parallel. Because it can achieve highly customized hardware parallelism, it allows multiple data points to be processed at the same time, and has a low clock cycle and latency. Therefore, it can perform real-time simulation and fast calculation to efficiently perform molecular dynamics calculations.
[0018] This scheme is based on the force field file of molecular force field calculation and analysis. According to the Born-Oppenheimer approximation of quantum mechanics, the energy of a molecule can be approximated as a function of the spatial coordinates of the atoms constituting the molecule. Simply put, the energy of a molecule changes with the molecular configuration, and the molecular force field function describes this relationship between molecular energy and molecular structure. Generally speaking, the molecular force field function consists of bond stretching energy, bond angle bending energy, dihedral angle torsion field, nonbonded interactions, and cross-energy terms. To construct a set of force field function systems, a set of functions relating molecular energy and configuration is needed, as well as the physical parameters of various atoms under different bonding conditions, such as normal bond lengths, bond angles, and dihedral angles. These force field parameters are mostly derived from experiments or quantum chemical calculations.
[0019] This scheme uses CHARMM36m as the molecular force field. The formula for calculating the force field of CHARMM36m is as follows:
[0020] Among them, bonds are the bond stretching energy, representing the covalent bond interaction between two adjacent particles in the molecular structure; angles are the bond angle bending energy, representing the interaction of three adjacent particles forming an angle in the molecular structure; Urey-Bradley is the interaction between three non-adjacent particles in the molecular structure; dihedrals are the dihedral torsion energy, representing the two dihedral interactions between two adjacent particles in the molecular structure; residues are the interactions between different residues (amino molecule fragments, etc.); impropers are the incorrect geometric configurations of dihedrals formed by non-adjacent particles; and nonbonded pairs are the interactions between non-adjacent particles, including van der Waals forces and electrostatic interactions.
[0021] It should be noted that, to balance resource and computational accuracy requirements, this solution uses a covalent bond calculation pipeline on the FPGA to calculate the values of bond, angle, dihedrals, impropers, and Urey-Bradley forces, while reserving computational resource modules for cmap or other force fields to accommodate other designs with higher precision. In other words, the step of "building a covalent bond calculation pipeline in the FPGA" involves constructing pipelines for bond force calculation, angle force calculation, dihedrals force calculation, impropers force calculation, and Urey-Bradley force calculation. Correspondingly, after each pipeline calculates the corresponding forces, the covalent bonds of the current molecule are calculated by summing them according to the formula for molecular force fields.
[0022] In the step of "obtaining the force field file corresponding to the molecular structure on the CPU side," the force field file characterizes the interaction forces between atoms in the molecule. In some embodiments, the force field file contains information such as bond lengths, bond angles, dihedral angles, and potential energy parameters between atoms. By defining the interaction potential energy and mechanical behavior of molecular atoms, it helps to understand the molecular structure, dynamic behavior, and properties.
[0023] In the step of "extracting computational parameters for each particle to generate a particle information lookup table," the particle information lookup table records the computational parameters of each particle using its particle number as an index. In some implementations, the computational parameters of a particle include information such as particle position, bond length, bond angle, and dihedral angle. The method used in this scheme to construct the particle information lookup table facilitates subsequent indexing of particles.
[0024] Furthermore, in actual molecular dynamics simulations, due to the complexity of protein systems, each particle contains multiple covalent bond information. Therefore, this scheme also needs to construct a covalent bond lookup table based on the force field file. This lookup table stores the bonding pairing information between particles. In some embodiments, the covalent bond lookup table stores the bonding pairing information between particles using 32-bit single-precision floating-point numbers. The specific data storage format is as follows: 0~16 bits represent the index i information, and 17~32 bits represent the index j information, where index i and index j represent the two bonded particles. This scheme constructs a covalent bond lookup table to facilitate subsequent indexing of the bonding relationships corresponding to each particle for pipelined computation, and the covalent bond lookup table stores bonding pairing information with a low data volume.
[0025] Specifically, the particle information lookup table stores the two-body forces between particles by constructing a two-body force storage area, storing the three-body forces between particles by constructing a three-body force storage area, and storing the four-body forces between particles by constructing a four-body force storage area. The addresses of the two-body force storage area, the three-body force storage area, and the four-body force storage area are relatively fixed.
[0026] Furthermore, the two-body force storage region, the three-body force storage region, and the four-body force storage region each select three different base addresses.
[0027] Specifically, this scheme reserves appropriate storage space at each base address location.
[0028] In the step of "FPGA acquires force field file and particle information lookup table, and allocates independent covalent bond storage area for each particle in FPGA based on particle information lookup table", the CPU transmits the force field file and particle information lookup table to the FPGA. The HBM2 storage device on the FPGA stores the calculation parameters of each particle in the corresponding covalent bond storage area based on the particle information lookup table.
[0029] In some embodiments, the low-order bits of the data storage address within the covalent bond storage area store the bonding index force of the data.
[0030] Specifically, since the HBM2 storage device supports multi-channel read and write, calculation parameters can be obtained from the HBM2 storage device more quickly during covalent bond calculation pipeline calculation, further improving calculation efficiency.
[0031] As shown in Table 1 below, the CPU transfers each particle and its corresponding calculation parameters to the HBM2 storage device in the form of a table: Table 1 Storage Information for HBM2 Storage Devices
[0032] Specifically, in actual molecular dynamics simulations, due to the complexity of macromolecules such as proteins, each particle contains multiple covalent bond information. Therefore, this scheme uses a particle information lookup table, which only needs to find the parameters corresponding to the particle to be calculated in the particle information lookup table during each calculation. In addition, each particle in this scheme has an independent storage space, which greatly reduces the pairing and comparison time and thus improves the computational efficiency.
[0033] In the step of "reading computational parameters from the corresponding covalent bond storage area for each particle in the covalent bond pipeline", the computational parameters are read from the corresponding covalent bond storage area by the particle's index or number.
[0034] As previously mentioned, a bond force calculation pipeline, an angle force calculation pipeline, a dihedrals force calculation pipeline, an impropers force calculation pipeline, and a Urey-Bradley force calculation pipeline are constructed in the FPGA. In this embodiment, the bond force calculation pipeline, angle force calculation pipeline, dihedrals force calculation pipeline, impropers force calculation pipeline, and Urey-Bradley force calculation pipeline perform calculations in parallel, and the calculation results of each covalent bond calculation pipeline are stored in a particle information lookup table.
[0035] Specifically, this solution utilizes an FPGA to execute a covalent bond calculation pipeline, which reduces the interaction between the FPGA and the CPU and facilitates rapid invocation by other pipelines, thereby improving computational efficiency.
[0036] Specifically, the BOND force calculation pipeline is used to calculate the covalent bond force between two particles. In the BOND force calculation pipeline, the two particles to be calculated are obtained through a covalent bond lookup table, and the calculation parameters are retrieved from the covalent bond storage area of the particles to calculate the BOND force.
[0037] The impropers force calculation pipeline is used to calculate the improper dihedral forces that form incorrect geometric configurations between four particles. In the impropers force calculation pipeline, the four particles to be calculated are obtained through a covalent bond lookup table, the calculation parameters are retrieved from the covalent bond storage area of the particles, the angle between the particle to be calculated and the other three particles is calculated, and the impropers force is calculated based on the angle.
[0038] The angle force calculation pipeline is used to calculate the interaction force between three adjacent particles forming a bond angle. In this pipeline, the three particles to be calculated are obtained through a covalent bond lookup table. Calculation parameters are retrieved from the covalent bond storage region of the particles, and the angle force is calculated after calculating the included angle between the three particles. In this embodiment, the angle force calculation pipeline uses the DSP built into the FPGA platform to calculate the IP value.
[0039] The Urey-Bradley force computation pipeline is used to calculate the interactions between three non-adjacent particles in a molecular structure. In this pipeline, the three particles to be calculated are obtained through a covalent bond lookup table. Calculation parameters are retrieved from the covalent bond storage region of the particles, and the included angles between the three particles are calculated to obtain the Urey-Bradley force. The Urey-Bradley force calculation considers the forces generated by two indirectly connected particles and simultaneously calculates the information of all three particles. This information is directly derived from the three particles themselves, so the input coordinates of the three particles are the same as those in the angle force computation pipeline.
[0040] The dihedrals force calculation pipeline is used to calculate the bond angle forces between four atoms. In the dihedrals force calculation pipeline, the four particles to be calculated are obtained through a covalent bond lookup table. The calculation parameters are retrieved from the covalent bond storage area of the particles, and the dihedral angles between the four particles are calculated to obtain the dihedrals force. In order to obtain the input information of the particles, it is necessary to determine the dihedral angles between them by calculating the normal vector angles of the four particles.
[0041] Specifically, the calculation results of each covalent bond calculation pipeline are merged to obtain the molecular dynamics covalent bond calculation results of the entire molecule.
[0042] Specifically, a calculation buffer storage area is constructed. After the angle force, dihedrals force, and Urey-Bradley force are all calculated, the calculation results of the angle force, dihedrals force, and Urey-Bradley force are cached in the buffer storage area.
[0043] In some embodiments, the computational logic flowchart for molecular dynamics calculations in this scheme is as follows: Figure 3 As shown, after all computing units have finished their calculations, the CPU performs constraint optimization on the covalent bonds to obtain a more stable and realistic molecular structure, thereby improving the accuracy and reliability of covalent bond calculations. Since constraint optimization involves many mathematical operations and does not require parallel computing, this scheme performs covalent bond constraint optimization on the CPU to achieve hardware and software collaborative processing.
[0044] In a specific embodiment of this solution, the CPU performs constraint optimization on the oh key.
[0045] Specifically, this scheme uses the SHAKE algorithm for constraint optimization, and obtains the index of the particle to be constrained from the particle information lookup table during constraint optimization.
[0046] Specifically, the covalent bond calculation pipeline performs molecular dynamics covalent bond calculations. Figure 4 As shown, the computational content of the covalent bond-based computational pipeline obtains the particle coordinates and the computational parameters required for calculating the covalent bonds from the corresponding covalent bond storage area. For example, to obtain the bond force between ID1 and ID2, the computational parameters are retrieved from the corresponding covalent bond storage area according to the particle number, and the calculation results are stored in the particle information lookup table. Similarly, to obtain the angle force between ID1, ID2, and ID3, the computational parameters are retrieved from the corresponding covalent bond storage area according to the particle number, and the calculation results are stored in the particle information lookup table. The same applies to obtaining the dihedral force between ID1, ID2, ID3, and ID4.
[0047] It should be noted that the covalent bond computation pipeline in this scheme is executed in parallel. During the parallel solution process for each covalent bond computation pipeline, methods such as grouped operations, multi-mesh partitioning, and graph coloring are typically used to accelerate the convergence of computational results. To improve the computation speed of covalent bond forces, multiple covalent bond computation pipelines need to be operated collaboratively to achieve more efficient computation. These operations require reading the covalent bond storage region of each particle and storing it in blocks according to different computational needs. Although the calculation of pairwise forces is not lengthy, this scheme adopts a fully parallel computing strategy to explore deeper levels of computational parallelism. This part of the computation uses DSP and Cordic IP for data processing, and 32-bit single-precision floating-point numbers are used for data processing. Before performing FPGA calculations, the CPU needs to convert to IEEE 754 to optimize computational efficiency.
[0048] Furthermore, since some calculation modules in the covalent bond calculation pipeline of this scheme have the same calculation function, intermediate calculation processing is required when calculating the vector forces in the force calculation, especially when calculating the angular and dihedral forces. The result after vector processing is then processed by the normal vector calculation module, which uses trigonometric functions to calculate the Cordic coreIP to calculate the angle between the two vectors. In other words, the bond force calculated in this scheme can be used to calculate the Urey-Bradley force and the imporpers force. Therefore, saving the bond force using intermediate results from other calculations can save computational resources.
[0049] Therefore, in the step of "controlling the execution of the covalent bond calculation pipeline through the pipeline instruction control module", this solution controls the covalent bond calculation pipeline to execute in parallel, and caches the cached results generated in the covalent bond calculation pipeline, and uses the cached results for calculation in other covalent bond calculation pipelines.
[0050] In this solution, a pipeline instruction control module is constructed to continuously monitor the calculations of different covalent bond calculation pipelines, so as to facilitate timely accumulation and subsequent processing of data, thereby saving on-chip resources of the FPGA.
[0051] In some embodiments, the covalent bond computation pipeline is constructed as follows: Figure 5As shown, the cached results generated during the calculation of the bond force between particles i and j in the bond force calculation pipeline are used in the Urey-Bradley force calculation pipeline and the imporpers force calculation pipeline. Simultaneously, the triangular forces between particles i, j, and k construct a three-stage calculation pipeline, calculating the cosine angle between the vectors of the three particles. This cosine angle, along with the cached results from the Urey-Bradley force calculation pipeline, is used in the angle force calculation pipeline. For the four-body forces between particles i, j, k, and t, the cosine angles of the different normal vectors formed are calculated. These cosine angles, along with the cached results from the imporpers force calculation pipeline, are used in the dihedral force calculation pipeline.
[0052] Specifically, any form of covalent bond computation pipeline can be constructed to perform covalent bond computation.
[0053] Example 2 Based on the same concept, referencing Figure 6 This application also proposes a molecular dynamics covalent bond calculation device, comprising: The acquisition module is used to acquire the force field file corresponding to the molecular structure through the CPU and extract the calculation parameters of each particle to generate a particle information lookup table, wherein each particle information lookup table records each particle and its corresponding calculation parameters. The storage module is used to acquire force field files and particle information lookup tables through the FPGA, and allocate an independent covalent bond storage area for each particle within the FPGA based on the particle information lookup table. The computation module is used to construct a covalent bond computation pipeline in the FPGA. The pipeline instruction control module controls the execution of the covalent bond computation pipeline. For each particle in the covalent bond pipeline, the computation parameters are read from the corresponding covalent bond storage area, and the force of the particle is obtained by pipeline calculation based on the read computation parameters and stored in the particle information lookup table.
[0054] Example 3 This embodiment also provides an electronic device, see reference. Figure 7 It includes a memory 404 and a processor 402, the memory 404 storing a computer program and the processor 402 being configured to run the computer program to perform the steps in the above-described molecular dynamics covalent bond calculation method.
[0055] Specifically, the processor 402 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0056] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.
[0057] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.
[0058] The processor 402 reads and executes computer program instructions stored in the memory 404 to implement any of the molecular dynamics covalent bond calculation methods in the above embodiments.
[0059] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402, and the input / output device 408 is connected to the processor 402.
[0060] Transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0061] Input / output device 408 is used to input or output information. In this embodiment, the input information may be force field files, calculation parameters, etc., and the output information may be molecular dynamics covalent bond calculation results, etc.
[0062] Optionally, in this embodiment, the processor 402 can be configured to perform the following steps via a computer program: S101: The CPU obtains the force field file corresponding to the molecular structure and extracts the calculation parameters of each particle to generate a particle information lookup table, in which each particle information lookup table records each particle and its corresponding calculation parameters. S102, FPGA acquires force field file and particle information lookup table, and allocates independent covalent bond storage area for each particle in FPGA based on particle information lookup table; S103. Construct a covalent bond calculation pipeline in the FPGA. Control the execution of the covalent bond calculation pipeline through the pipeline instruction control module. For each particle in the covalent bond pipeline, read the calculation parameters from the corresponding covalent bond storage area, and perform pipeline calculation based on the read calculation parameters to obtain the particle's force, which is stored in the particle information lookup table.
[0063] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0064] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented in firmware or software that can be executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.
[0065] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 5 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.
[0066] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0067] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for calculating covalent bonds in molecular dynamics, characterized in that, include: The CPU obtains the force field file corresponding to the molecular structure and extracts the calculation parameters of each particle to generate a particle information lookup table, in which each particle information lookup table records each particle and its corresponding calculation parameters. The FPGA acquires the force field file and particle information lookup table, and allocates an independent covalent bond storage area for each particle within the FPGA based on the particle information lookup table; A covalent bond calculation pipeline is constructed in the FPGA. The execution of the covalent bond calculation pipeline is controlled by the pipeline instruction control module. For each particle in the covalent bond pipeline, the calculation parameters are read from the corresponding covalent bond storage area, and the covalent bond force of the particle is obtained by pipeline calculation based on the read calculation parameters and stored in the particle information lookup table.
2. The molecular dynamics covalent bond calculation method according to claim 1, characterized in that, Constraint optimization of the oh key is performed using the CPU.
3. The molecular dynamics covalent bond calculation method according to claim 1, characterized in that, In the step of allocating an independent covalent bond storage area for each particle within the FPGA based on a particle information lookup table, the FPGA uses an HBM2 storage device for storage.
4. The molecular dynamics covalent bond calculation method according to claim 1, characterized in that, The FPGA stores each particle and its corresponding calculation parameters in 32-bit single-precision floating-point numbers.
5. The molecular dynamics covalent bond calculation method according to claim 1, characterized in that, In the step of reading computational parameters from the corresponding covalent bond storage area for each particle in the covalent bond pipeline, the computational parameters are obtained from the corresponding covalent bond storage area by the particle's index or number.
6. The molecular dynamics covalent bond calculation method according to claim 1, characterized in that, The covalent bond calculation pipeline contains at least two independent sub-pipelines, and each sub-pipeline performs calculations independently.
7. The molecular dynamics covalent bond calculation method according to claim 6, characterized in that, The calculation results for each sub-pipeline are stored in the particle information lookup table.
8. A molecular dynamics covalent bond calculation device, characterized in that, include: The acquisition module is used to acquire the force field file corresponding to the molecular structure through the CPU and extract the calculation parameters of each particle to generate a particle information lookup table, wherein each particle information lookup table records each particle and its corresponding calculation parameters. The storage module is used to acquire force field files and particle information lookup tables through the FPGA, and allocate an independent covalent bond storage area for each particle within the FPGA based on the particle information lookup table. The computation module is used to construct a covalent bond computation pipeline in the FPGA. The pipeline instruction control module controls the execution of the covalent bond computation pipeline. For each particle in the covalent bond pipeline, the computation parameters are read from the corresponding covalent bond storage area, and the force of the particle is obtained by pipeline calculation based on the read computation parameters and stored in the particle information lookup table.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform a molecular dynamics covalent bond calculation method according to any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a computer program, the computer program including program code for controlling a process to execute the process, the process including a molecular dynamics covalent bond calculation method according to any one of claims 1-7.