A particle screening method, device, electronic equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-22
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]本发明提供了一种粒子筛选方法、装置、电子设备及存储介质,以解决对所有粒子计算作用力时计算量较大和效率较低的问题
[0020]本发明实施例的技术方案,通过接收粒子筛选信号,根据所述粒子筛选信号获取至少一个待筛选粒子的待筛选粒子数据,获取当前基准粒子集合对应的基准粒子参数;在满足基准粒子获取条件时,根据所述基准粒子参数获取当前基准粒子集合中的基准粒子的基准粒子数据;根据所述基准粒子参数、各所述待筛选粒子数据和基准粒子数据计算待筛选粒子与基准粒子的距离,根据所述距离筛选出有效粒子并根据所述基准粒子参数对所述有效粒子的有效粒子数据进行存储;在满足中断条件的情况下,生成并向粒子处理设备发送中断信号,以便所述粒子处理设备对所述有效粒子数据进行读取,解决了计算所有粒子的作用力时计算量较大和效率较低的问题,通过基准粒子参数获取基准粒子数据,基于基准粒子参数、基准粒子数据和待筛选粒子数据计算待筛选粒子和基准粒子之间的距离,通过距离对待筛选粒子进行筛选,筛选出有效粒子并进行存储以便粒子处理设备进行读取和计算,粒子处理设备在计算作用力时可以根据读取到的有效粒子数据进行计算,无需对所有的粒子均进行计算,降低了数据运算量,提高数据处理速度。
Smart Images

Figure CN117358611B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a particle screening method, apparatus, electronic device, and storage medium. Background Technology
[0002] In nature, forces typically exist between objects, such as short-range forces. Short-range forces are a physical phenomenon referring to the interaction force between two closely spaced objects. A characteristic of short-range forces is that they decrease rapidly, or even become negligible, as the distance between the objects increases. For example, van der Waals forces are the attractive force between two neutral molecules, arising from the instantaneous shift of charge within the molecules. The magnitude of this force depends on the polarizability of the molecules, i.e., the degree to which the molecules respond to an external electric field. Van der Waals forces decay rapidly with increasing intermolecular distance; when the intermolecular distance exceeds a certain value, the van der Waals force becomes negligible.
[0003] Molecular dynamics simulation is a numerical method that simulates the motion and interactions of molecules. Molecules are particles, and when simulating particle motion and interactions, it is necessary to consider the interactions between each particle and all surrounding particles. Current techniques for calculating the forces between particles typically perform calculations on all particles, resulting in a large computational load and low efficiency. Summary of the Invention
[0004] This invention provides a particle screening method, apparatus, electronic device, and storage medium to solve the problems of large computational load and low efficiency when calculating the force on all particles.
[0005] According to one aspect of the present invention, a particle screening method is provided, comprising:
[0006] Receive a particle screening signal, obtain the particle data to be screened for at least one particle according to the particle screening signal, and obtain the reference particle parameters corresponding to the current reference particle set.
[0007] When the conditions for obtaining the reference particle are met, the reference particle data of the reference particle in the current reference particle set is obtained according to the reference particle parameters.
[0008] The distance between the particle to be screened and the reference particle is calculated based on the reference particle parameters, the particle data to be screened, and the reference particle data. Valid particles are screened based on the distance, and the valid particle data of the valid particles are stored based on the reference particle parameters.
[0009] If the interruption condition is met, an interrupt signal is generated and sent to the particle processing device so that the particle processing device can read the valid particle data.
[0010] According to another aspect of the present invention, a particle screening apparatus is provided, comprising:
[0011] The filtering signal receiving module is used to receive particle filtering signals, obtain the particle data to be filtered of at least one particle according to the particle filtering signals, and obtain the reference particle parameters corresponding to the current reference particle set.
[0012] The reference particle data acquisition module is used to acquire the reference particle data of the reference particles in the current reference particle set according to the reference particle parameters when the reference particle acquisition conditions are met.
[0013] The data storage module is used to calculate the distance between the particle to be screened and the reference particle based on the reference particle parameters, the particle data to be screened, and the reference particle data; to screen out effective particles based on the distance; and to store the effective particle data of the effective particles based on the reference particle parameters.
[0014] An interrupt signal sending module is used to generate and send an interrupt signal to the particle processing device when an interrupt condition is met, so that the particle processing device can read the valid particle data.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] At least one processor; and
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the particle screening method according to any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the particle screening method according to any embodiment of the present invention.
[0020] The technical solution of this invention involves receiving a particle screening signal, obtaining particle data for at least one particle to be screened based on the particle screening signal, and obtaining reference particle parameters corresponding to the current reference particle set. When the reference particle acquisition condition is met, the reference particle data of the reference particles in the current reference particle set is obtained based on the reference particle parameters. The distance between the particle to be screened and the reference particle is calculated based on the reference particle parameters, the particle data to be screened, and the reference particle data. Valid particles are screened based on the distance, and the valid particle data of the valid particles are stored based on the reference particle parameters. When an interruption condition is met, the particle is generated and sent to the particle processing unit. The particle processing device sends an interrupt signal to enable the particle processing device to read the effective particle data, which solves the problems of large computational load and low efficiency when calculating the force of all particles. The reference particle data is obtained through reference particle parameters. The distance between the particle to be screened and the reference particle is calculated based on the reference particle parameters, the reference particle data and the particle data to be screened. The particle to be screened is screened by distance, and the effective particles are selected and stored for the particle processing device to read and calculate. When calculating the force, the particle processing device can calculate based on the read effective particle data, without having to calculate all particles, which reduces the amount of data operation and improves the data processing speed.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a flowchart of a particle screening method provided in Embodiment 1 of the present invention;
[0024] Figure 2 This is a flowchart of a particle screening method provided in Embodiment 2 of the present invention;
[0025] Figure 3 This is a schematic diagram of the structure of a particle screening device according to Embodiment 3 of the present invention;
[0026] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the particle screening method of this invention. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] Example 1
[0030] Figure 1 This is a flowchart of a particle screening method provided in Embodiment 1 of the present invention. This embodiment can be applied to particle screening when calculating the interaction force between particles. The method can be executed by a particle screening device, which can be implemented in hardware and / or software and can be configured in an electronic device.
[0031] It should be noted that in existing technologies, the calculation of forces between particles typically involves calculating the forces between all acquired particles. When the direct forces between particles are negligible, this method results in excessive computation and wastes processor resources. This embodiment reduces computation and saves computing resources by filtering out invalid particle data through particle screening. The execution entity of the method provided in this embodiment can be a processor, a filter, or other device with data processing capabilities; the execution entity for calculating the forces between particles can be a terminal, a computer, or other device, and the specific calculation can be performed by a unit or module within the device that has data processing capabilities. After the particle screening device performs the screening, the screening results can be read by the execution entity for calculating the forces between particles, so that the forces can be calculated based on the read screening results.
[0032] like Figure 1 As shown, the method includes:
[0033] S101. Receive the particle screening signal, obtain the particle data to be screened for at least one particle according to the particle screening signal, and obtain the reference particle parameters corresponding to the current reference particle set.
[0034] In this embodiment, the particle screening signal can be specifically understood as a signal instructing the execution device to screen particles; the particles to be screened can be specifically understood as particles with screening requirements; the particle data to be screened can be specifically understood as the data of the particles to be screened, such as coordinates, charge, and net force. The current reference particle set can be specifically understood as the set of reference particles currently used to screen the particles to be screened; the reference particles can be specifically understood as particles used as standards for screening the particles to be screened; and the reference particle parameters can be specifically understood as the parameters used when storing, retrieving, or performing other operations on the reference particles.
[0035] The particle selection signal can be generated and sent to this execution device by a device that calculates the interaction forces between particles. Alternatively, it can be triggered and sent to this execution device by an external interrupt controller. The particle selection signal includes information about the particle's storage address, used to specify the particles to be selected. Particles to be selected are pre-stored, and related storage information is recorded. When particle selection is required, the particle selection signal is generated based on the recorded storage information. The particle selection requirement can be automatically determined according to set rules or determined by user operation. Upon receiving the particle selection signal, this execution device parses it to determine the storage address, storage method, etc., of the particles to be selected. Data is read based on the parsed data to obtain the particle data corresponding to the particles to be selected. The number of particles to be selected can be one or more; in practical applications, the number is usually multiple.
[0036] One or more baseline particle sets are pre-defined. The baseline particles in each set can be the same or different. Different baseline particle sets correspond to the same type of baseline particle parameters, whose values can be the same or different, or partially the same and partially different. During particle filtering, the current baseline particle set for filtering can be determined first. This set can be pre-defined or indicated by a signal, such as carrying an identifier for the current set in the particle filtering signal. The baseline particle parameters corresponding to the current set need to be pre-configured, and these configurations can be updated. The current baseline particle set can be switched during the filtering process. For example, when filtering based on one current baseline particle set, while waiting for the filtering results to be read, the baseline particle parameters for other sets can be configured. After the filtering results are read, the system can switch to the pre-configured set and start filtering again, saving time by eliminating the need for configuration. Setting different baseline particle sets also allows for data filtering of different baseline particles. After determining the current set of reference particles, obtain the reference particle parameters corresponding to the current set of reference particles. The reference particle parameters usually include various types of parameters, such as particle data, particle data type, placement method, starting address for storing the filtering results, etc.
[0037] Optionally, the particle screening signal includes: the number of data blocks, the starting address of the data storage, the calculation parameters of the data address, and the offset parameters of the data blocks.
[0038] In this embodiment, the starting address of data storage can be understood as the starting position for storing the particle data to be screened.
[0039] The particle data to be screened is stored in the data memory DM according to different blocks, and can be obtained through the information carried in the particle screening signal. When acquiring the particle data to be screened, firstly, the first data of the first block is obtained through the starting address StartAddr of the data storage, which indicates the total number of particles in the block; then, according to the calculation parameters of the data address, the address of the particle data to be screened is calculated sequentially until all the particle data to be screened in the block has been acquired; according to the offset parameter of the data block, the starting address of the next data block is calculated, and so on, until the particle data to be screened stored in all data blocks is acquired. The number of data blocks can be used to determine whether the particle data to be screened stored in all data blocks has been acquired.
[0040] Optionally, the particle data to be screened includes the coordinates and charge of the particles.
[0041] The coordinates of the particles to be screened include their coordinates along the X-axis, Y-axis, and Z-axis in a three-dimensional coordinate system. The electric charge is used to calculate the forces between the particles.
[0042] S102. When the conditions for obtaining reference particles are met, obtain the reference particle data of the reference particles in the current reference particle set according to the reference particle parameters.
[0043] In this embodiment, the conditions for acquiring reference particles can be specifically understood as the conditions for determining whether to acquire reference particles. For example, whether the reference particle data has completed the screening of particles to be screened, whether the execution device has performed the screening work normally, etc. The reference particle data can be specifically understood as the data of reference particles, such as coordinates, charge, etc.
[0044] When there are multiple reference particle data in the reference particle set, each reference particle data needs to be acquired sequentially. It is determined whether the reference particle acquisition conditions are met. If so, the reference particle data is read according to the data storage method, data type, and other parameters defined in the reference particle parameters to acquire the reference particle data.
[0045] Optionally, the conditions for acquiring reference particles include: the execution device is working normally, the acquired reference particle data has been filtered, and there is reference particle data that has not been acquired.
[0046] In this embodiment, normal operation of the execution device can be understood as the execution device performing particle screening normally; the execution device can also pause operation when certain conditions are met.
[0047] When acquiring reference particle data, the system determines whether the execution device is functioning normally, whether the acquired reference particle data has been filtered, and whether there are any unacquired reference particle data. If all the above conditions are met, the reference particle parameters of one reference particle are acquired. Acquiring reference particle data presupposes that the execution device is functioning normally; therefore, it is necessary to first determine whether the execution device is functioning normally. If the execution device is functioning normally, the system first acquires the reference particle parameters of the first reference particle. Then, it filters the particles to be filtered based on this reference particle. After filtering is completed based on this reference particle, it determines whether there are any unread reference particle parameters. If so, another reference particle is acquired and filtered again. This process is repeated to acquire each reference particle data sequentially until all reference particle data in the current reference particle set has been acquired.
[0048] S103. Calculate the distance between the particle to be screened and the reference particle based on the reference particle parameters, the data of each particle to be screened and the reference particle data, screen out the effective particles based on the distance and store the effective particle data of the effective particles based on the reference particle parameters.
[0049] In this embodiment, an effective particle can be specifically understood as a particle that can be used to calculate the force. Effective particle data can be specifically understood as data of the effective particles, such as coordinates and charge.
[0050] Based on the reference particle parameters, a distance calculation method or formula is determined. This method or formula is then used to calculate the distance between each particle to be screened and the reference particle data. The distance is used to determine if there is an interaction force between the particles. Particles exhibiting interaction force are considered valid particles. The storage method and address for the screening results are determined based on the reference particle parameters. The valid particle data is then stored according to these rules. This valid particle data can be stored in a data storage device (DM).
[0051] S104. If the interruption condition is met, generate and send an interrupt signal to the particle processing device so that the particle processing device can read the valid particle data.
[0052] In this embodiment, the interruption condition can be specifically understood as a condition used to determine whether to read the already screened valid particles. For example, the number of valid particles reaches a certain threshold, the reference particles have been screened and the screened valid particle data has not been read, etc. The particle processing device can be specifically understood as a device used to calculate the interaction forces between particles, which can be a computer processor, kernel, etc.; the interrupt signal can be specifically understood as a signal used to instruct the particle processing device to read the valid particle data.
[0053] Interrupt conditions are pre-set. During particle screening, it is checked in real time whether the interrupt conditions are met. If the interrupt conditions are met, an interrupt signal is generated and sent to the particle processing device. After receiving the interrupt signal, the particle processing device can access the data storage space to read valid particle data and calculate the interaction forces between particles based on the read valid particle data. When the particle processing device is a kernel, the interrupt signal can be sent to the kernel's communication and synchronization unit.
[0054] It should be noted that steps S102 and S103 in this embodiment are typically executed repeatedly when there are multiple reference particles. Steps S102 and S103 can be repeated whenever the reference particle acquisition conditions are met. By repeatedly acquiring reference particle data and calculating the distance between the particle to be screened and the reference particles, effective particles are determined, thus achieving particle screening. Furthermore, during the screening process, an interrupt signal can be triggered to instruct the particle processing device to read the screened effective particle data.
[0055] The particle screening method provided in this invention solves the problems of large computational load and low efficiency when calculating the force of all particles. It obtains reference particle data through reference particle parameters, calculates the distance between the particle to be screened and the reference particle based on the reference particle parameters, reference particle data and particle data to be screened, and screens the particles based on the distance. The effective particles are screened out and stored for reading and calculation by the particle processing device. When calculating the force, the particle processing device can calculate based on the read effective particle data, without having to calculate all particles, thus reducing the amount of data computation and improving the data processing speed.
[0056] Example 2
[0057] Figure 2 This is a flowchart of a particle screening method provided in Embodiment 2 of the present invention. This embodiment is a refinement based on the above embodiments. Figure 2 As shown, the method includes:
[0058] S201. Receive the particle screening signal, obtain the particle data to be screened for at least one particle according to the particle screening signal, and obtain the reference particle parameters corresponding to the current reference particle set.
[0059] S202. When the conditions for obtaining the reference particle are met, obtain the index value of the reference particle in the current reference particle set.
[0060] In this embodiment, the index value of each reference particle can uniquely identify it. Reference particle data can be stored as key-value pairs. For example, the index value of a reference particle can be a number such as 1 or 2, with the index value as the key and the reference particle data as the corresponding value. When retrieving the index value of a reference particle in the current reference particle set, it can be retrieved sequentially according to the storage order of the index values. Reference particle data can be stored sequentially according to the index values, with each reference particle's index value and reference particle data stored together to form a single data entry corresponding to each reference particle.
[0061] S203. Based on the index value and the particle data type and reference particle data storage method in the reference particle parameters, query the data stored in the register to obtain the reference particle data.
[0062] In this embodiment, the particle data type can be a fixed-point number, a floating-point number, etc., and the floating-point number can be double-precision data or single-precision data. The reference particle data storage method can be specifically understood as data describing the storage method of the reference particle data, which can describe the storage method of the coordinate data in the reference particle data, such as the storage order of x, y, and z.
[0063] Determine the particle data type and data storage method in the baseline particle parameters. Query and match all baseline particle data based on the index value to obtain one baseline particle data corresponding to the index value. Read the baseline particle data according to the particle data type and data storage method to obtain the baseline particle data whose data type matches the particle data type. Based on the data storage method, the x-coordinate, y-coordinate, or z-coordinate can be read as needed. For example, first read the x-coordinate, then read the z-coordinate, and finally read the y-coordinate.
[0064] Since there may be multiple reference particles, in this embodiment, the reference particle data of different reference particles can be obtained sequentially according to the index value. During the reading process, the index value of each reference particle is obtained sequentially and the corresponding data is read.
[0065] S204. Determine the particle data type in the reference particle parameters.
[0066] S205. For each particle data to be screened, calculate the distance between the particle data to be screened and the reference particle data according to the particle data type, and determine the distance between the particle to be screened and the reference particle.
[0067] Different distance calculation methods are pre-set for different particle data types. These methods may include data processing methods and calculation formulas. After determining the particle data type, the corresponding distance calculation method is determined. Based on the distance calculation method, the particle data to be screened and the reference particle data are processed and calculated to obtain the distance between the particle to be screened and the reference particle.
[0068] When the particle data type is a fixed number of points, as an optional embodiment of this example, this optional embodiment further calculates the distance between the particle data to be screened and the reference particle data based on the particle data type to determine the distance between the particle to be screened and the reference particle, optimized as follows:
[0069] A1. Obtain the coordinate data of the high bits in the particle data to be screened according to the first preset quantity to obtain the first coordinate data. Obtain the coordinate data of the high bits in the reference particle data according to the first preset quantity to obtain the second coordinate data.
[0070] In this embodiment, the first preset quantity can be understood as a pre-set quantity, such as 10, 20, etc. The first coordinate data can be understood as the data corresponding to the coordinates in the particle data to be screened, determined according to the first preset quantity; the second coordinate data can be understood as the data corresponding to the coordinates in the reference particle data, determined according to the first preset quantity.
[0071] The particle data to be screened contains the coordinates of the particles. This coordinate data is typically multi-bit data. When calculating distance, values are taken sequentially from the highest bit to the lowest bit to obtain a first preset number of bits of coordinate data, which serves as the first coordinate data. Similarly, for the reference particle data, values are taken sequentially from the highest bit to the lowest bit to obtain a first preset number of bits of coordinate data, which serves as the second coordinate data. Both the first and second coordinate data include coordinates in the x, y, and z directions.
[0072] A2. Determine the first difference result based on the first coordinate data and the second coordinate data.
[0073] In this embodiment, the first difference result can be specifically understood as the result obtained by calculating the difference between coordinates, including the difference between coordinates in different directions. The first coordinate data and the second coordinate data are subtracted, along with other operations, and the result is used as the first difference result. When performing the subtraction, coordinates in the same direction are subtracted separately.
[0074] As an optional embodiment of this example, the first difference result determined based on the first coordinate data and the second coordinate data is further optimized as follows:
[0075] A21. Calculate the difference between the first coordinate data and the second coordinate data. The difference includes the difference in different coordinate axis directions.
[0076] Calculating the difference between the first coordinate data and the second coordinate data includes calculating the difference in each coordinate axis direction, for example, calculating the difference in the xyz coordinate axis direction.
[0077] A22. For the difference in each coordinate axis direction, if the difference is greater than 0, the result of subtracting 1 from the difference is taken as the processing result; if the difference is less than 0, the result of adding 1 to the difference is taken as the processing result; if the difference is equal to 0, the difference is taken as the processing result.
[0078] In this embodiment, the processing result can be understood as the data obtained by processing the coordinate difference. For the coordinate difference in each coordinate axis direction, it is determined whether the difference in this coordinate axis direction is greater than 0. If it is greater than 0, the result of subtracting 1 from the difference is taken as the processing result; if it is less than 0, the result of adding 1 to the difference is taken as the processing result; if it is equal to 0, it is taken directly as the processing result.
[0079] A23. The first difference result is formed based on the processing results corresponding to the differences in each coordinate axis direction.
[0080] The above method yields the corresponding processing results for each coordinate axis direction. These processing results constitute the first difference result, thus obtaining the first difference result. This application embodiment determines the first difference result by judging and processing the coordinate differences in each coordinate axis direction.
[0081] It's important to know that, using three-dimensional coordinates as an example, when calculating the distance between the particle to be screened and the reference particle, there can be at most two coordinate differences of 0. If all three coordinate differences are 0, the two particles are actually at the same point, and there's no need to calculate the interaction force.
[0082] A3. If the first difference result is within the bit representation range and the right shift of the comparison position in the reference particle parameters is 0, obtain the data of the high bits in the first difference result according to the second preset quantity to obtain the first coordinate difference data.
[0083] In this embodiment, the bit representation range can be specifically understood as whether the number of bits in the first difference result is within a certain range. The bit representation range can be preset based on a first preset number. The right shift amount of the comparison position can be specifically understood as the amount by which the data is shifted to the right when the coordinate data is acquired for calculation. The second preset number can be specifically understood as a preset number, which is not greater than the first preset number; the first coordinate difference data can be specifically understood as the data obtained by reading the first difference result according to certain rules.
[0084] If the first difference result is within the bit representation range, then check if the right shift of the comparison position in the reference particle parameters is 0. If it is 0, then sequentially take values from the high bit to the low bit to obtain the coordinate data of the second preset number of bits, which will be used as the first coordinate difference data. If it is not within the bit representation range, then determine that the particle to be screened is an invalid particle.
[0085] A4. If the first difference result is within the bit representation range and the right shift of the comparison position in the reference particle parameters is not 0, determine the offset based on the right shift of the comparison position, obtain the data of the high bits in the first difference result based on the second preset quantity and the offset, and obtain the first coordinate difference data.
[0086] If the first difference result is within the bit representation range and the right shift of the comparison position in the reference particle parameters is not 0, the right shift of the comparison position is determined as the offset. The starting bit of the data is determined according to the offset. Starting from the starting bit, values are taken sequentially from the high bit to the low bit. The coordinate data of the second preset number of bits are obtained from the first difference result as the first coordinate difference data.
[0087] A5. Calculate the distance between the particle to be screened and the reference particle based on the first coordinate difference data.
[0088] The first coordinate difference data obtained in this step includes coordinate differences in different directions. The coordinate differences in multiple directions are calculated, for example, by taking the sum of squares. The result of the calculation is used as the distance between the particle to be screened and the reference particle.
[0089] For example, taking a first preset quantity of 20, a second preset quantity of 10, and a bit representation range of 20 bits as an example, the calculation process of the distance between the particle to be screened and the reference particle is explained, including the following steps:
[0090] (1) Take the high 20 bits of the xyz coordinates of the particle data to be screened and the reference particle data, and subtract them. The result of the subtraction is represented as (AB). If the result of the subtraction is positive, take (AB-1) as the first difference result; if the result of the subtraction is negative, take (A-B+1) as the first difference result. Determine whether the first difference result exceeds the 20-bit representation range. If it does, directly determine that the particle to be screened is an invalid particle; otherwise, proceed to step (2).
[0091] (2) Obtain the right shift amount DataShiftNum of the comparison position. If DataShiftNum is 0, obtain the first coordinate difference data from the high 10 bits of the first difference result (i.e., take the high 10 bits of 20 bits); otherwise, determine the offset according to DataShiftNum, take the 10 bits starting from the (DataShiftNum+1)th bit from the high bit downwards, and obtain the first coordinate difference data.
[0092] (3) Sum the squares of the first coordinate difference data obtained in step (2) to obtain the distance Dist between the particle to be screened and the reference particle.
[0093] When the particle data type is a floating-point number, as an optional embodiment of this example, this optional embodiment further calculates the distance between the particle data to be screened and the reference particle data based on the particle data type to determine the distance between the particle to be screened and the reference particle, optimized as follows:
[0094] B1. Align the coordinates in the particle data to be screened with the coordinates in the reference particle data, and then perform a subtraction operation to obtain the second difference result.
[0095] In this embodiment, the second difference result can be specifically understood as the result obtained by calculating the difference between coordinates, including the difference between coordinates in different directions. The coordinates in the particle data to be screened and the coordinates in the reference particle data are aligned, and the aligned coordinates are subtracted to obtain the second difference result. During the subtraction, coordinates in the same direction are subtracted separately.
[0096] B2. Align the second difference result with the distance order in the reference particle parameters.
[0097] In this embodiment, the distance index can be specifically understood as the index used for index alignment during distance calculation. The distance index is pre-written into the reference particle parameters. During distance calculation, the distance index is determined based on the obtained reference particle parameters, and the second difference result is aligned with the distance index.
[0098] B3. Obtain the high-order bits of the second difference result after alignment based on the third preset quantity to obtain the second coordinate difference data.
[0099] In this embodiment, the third preset quantity can be understood as a pre-set quantity, which can be the same as or different from the second preset quantity or the first preset quantity. The second coordinate difference data can be understood as data obtained by reading the second difference result according to certain rules.
[0100] For the second difference result after alignment, in the mantissa, values are taken sequentially from the high bit to the low bit to obtain the data of the third preset number of bits, thus obtaining the second coordinate difference data.
[0101] B4. Calculate the distance between the particle to be screened and the reference particle based on the second coordinate difference data.
[0102] The second coordinate difference data obtained in this step includes coordinate differences in different directions. The coordinate differences in multiple directions are calculated, for example, by taking the sum of squares. The result of the calculation is used as the distance between the particle to be screened and the reference particle.
[0103] For example, taking a third preset quantity of 10 as an example, the calculation process of the distance between the particle to be screened and the reference particle is explained, including the following steps:
[0104] (1) The particle to be screened is compared with the reference particle in order, and then the subtraction calculation is performed to obtain the second difference result.
[0105] (2) Align the second difference result from step (1) with the distance exponent RCutExp.
[0106] (3) Take the high 10 bits of the second difference result after alignment as the second coordinate difference data; calculate the sum of squares of the second coordinate difference data to obtain the distance Dist between the particle to be screened and the reference particle.
[0107] S206. If the distance is not greater than the distance threshold in the baseline particle parameters, the particle to be screened is determined to be a valid particle.
[0108] In this embodiment, the distance threshold can be specifically understood as a threshold used to determine whether the distance exceeds a required threshold. The distance threshold can be preset according to the relationship between the interaction force between particles and the distance, and after being set, the distance threshold can be written into the reference particle parameters.
[0109] After obtaining the baseline particle parameters, the distance threshold is read from them. The distance is compared with the distance threshold. If the distance is not greater than the distance threshold in the baseline particle parameters, the particle to be screened is determined as a valid particle. Otherwise, the particle to be screened is an invalid particle.
[0110] In this embodiment of the application, the basic formula for determining whether the particle distance is within the distance threshold can be expressed as:
[0111] (Xa-Xb) 2 +(Ya-Yb) 2 +(Za-Zb) 2 <=R 2
[0112] Where Xa, Ya, and Za represent the three-dimensional coordinates of the particles to be screened; Xb, Yb, and Zb represent the three-dimensional coordinates of the reference particles; R 2 The effective radius is the square of RCutData, which is pre-configured in the baseline particle parameters. Based on the above formula, and according to the particle data type and other parameters in the baseline particle parameters, it is calculated in a conventional form whether the particle to be screened is less than or equal to the distance threshold.
[0113] S207. Determine the first starting address of the effective particle data storage corresponding to the effective particle based on the reference particle parameters.
[0114] In this embodiment, the first starting address can be specifically understood as the starting address when storing valid particle data. The first starting address is pre-written into the reference particle parameters. After obtaining the reference particle parameters, the first starting address is read from the reference particle parameters. The first starting address is used to store the valid particle data.
[0115] S208. Determine the data storage address based on the index of the reference particle, the first starting address, and the first reference particle offset in the reference particle parameters. Use the data storage address as the starting address to store the effective particle coordinates and charge in each effective particle data in sequence.
[0116] In this embodiment, the first reference particle offset can be specifically understood as the offset between each reference particle when outputting the result of the filtered valid particle data; the data storage address can be specifically understood as the address where the valid particle data is stored.
[0117] Reference particles can be numbered during storage; the numbers can be 1, 2, 3, etc., or they can be directly used as sequence values. The offset of the first reference particle can be pre-written into the reference particle parameters. After obtaining the reference particle parameters, the offset of the first reference particle is read from them. The offset of this reference particle is calculated based on the reference particle's sequence number and the offset of the first reference particle. The data storage address is determined based on the first starting address and the calculated offset of the reference particle. This data storage address is used as the starting address, and the coordinates and charges of the effective particles selected from the reference particle data are stored sequentially. The coordinates and charges of the effective particles can be stored in DM.
[0118] For example, this application provides a data storage address determination method. For the nth reference particle, the XYZQ of the output effective particle comes from the XYZQ obtained in the stage of reading the particle data to be screened. The corresponding data starting address value is (TDataAddr+TDataOffset*n), where TDataAddr is the first starting address, TDataOffset is the first reference particle offset, and n is the index of the reference particle.
[0119] Optionally, the particle data to be screened may also include the starting address of the net force acting on the particle at the time of storage;
[0120] Each block's data also contains an address, Addr, which represents the starting address of the net force acting on the particle when stored. This address can be read while reading the data of the particles to be filtered, and this address can be used as the data of the particles to be filtered. This force can be used to perform comprehensive calculations with the forces between particles to calculate the net force acting on the particles.
[0121] As an optional embodiment of this example, this optional embodiment is further optimized by including:
[0122] C1. Determine the second starting address for storing valid particle data based on the reference particle parameters.
[0123] In this embodiment, the second starting address can be understood as the starting address when storing addresses. Assuming the second starting address is the starting address when storing address A, where address A refers to the address of the net force acting on the effective particle at the time of storage, address A is determined based on the starting address Addr of the net force acting on the particle at the time of storage. The second starting address is pre-written into the reference particle parameters. After obtaining the reference particle parameters, the second starting address is read from the reference particle parameters.
[0124] C2. Determine the target address based on the starting address of the resultant force acting on each particle in the effective particle data at storage, the right shift of the output address, and the number of the effective particle corresponding to the effective particle data in the data block.
[0125] In this embodiment, the right shift of the output address can be specifically understood as the offset of the address of the resultant force on different effective particles at storage relative to the starting address; the target address can be specifically understood as the address of the resultant force on the effective particles at storage.
[0126] The particle data to be screened includes the starting address of the net force acting on the particle at storage. After the particle to be screened is identified as a valid particle, the valid particle data also includes the starting address of the net force acting on the particle at storage. The right shift of the output address can be pre-written into the reference particle parameters. After obtaining the reference particle parameters, the right shift of the output address is read from the reference particle parameters. The offset is determined based on the right shift of the output address and the number of the valid particle corresponding to the valid particle data in the data block. The target address is determined based on the offset and the starting address of the net force acting on the particle at storage.
[0127] C3. Determine the address storage address based on the index of the reference particle, the second starting address, and the second reference particle offset in the reference particle parameters. Use the address storage address as the starting address to store the target addresses corresponding to each valid particle data in sequence.
[0128] In this embodiment, the second reference particle offset can be specifically understood as the offset between each reference particle when the address in the output filtering result is displayed; the address storage address can be specifically understood as the address for storing the starting address in the valid particle data.
[0129] The second reference particle offset can be pre-written into the reference particle parameters. After obtaining the reference particle parameters, the second reference particle offset is read from them. The offset of this reference particle is calculated based on its sequence number and the second reference particle offset. The address storage address is determined based on the second starting address and the calculated offset of the reference particle. This address storage address is used as the starting address, and the target addresses corresponding to each valid particle data selected from this reference particle are stored sequentially. The target addresses can be stored in DM.
[0130] Exemplarily, an embodiment of the present application provides a method for determining an address to store an address. The target address AtomAddr is derived from the Addr included in each Block during the stage of reading the data of the particles to be screened. AtomAddr = Addr + k << AddrOffset, where Addr is the starting address of the resultant force of the particles during storage, k is the number of the valid particles in the Block, and AddrOffset is the right shift amount of the output address; AtomAddr is the address where the resultant force of the specific valid particles is stored in the DM. The address to store the address is TAddr + TOffset * n, where TAddr is the second starting address, TOffset is the second reference particle offset, and n is the serial number of the reference particles.
[0131] After the target address is stored, it can be obtained and used by the particle processing device. After calculating the force received by the valid particles, the particle processing device will accumulate the new force with the force at the AtomAddr address to obtain a new resultant force.
[0132] S209. When the interruption condition is satisfied, generate and send an interruption signal to the particle processing device so that the particle processing device reads the valid particle data.
[0133] As an optional embodiment of this embodiment, this optional embodiment further optimizes the interruption condition, and the interruption condition includes at least one of the following:
[0134] The number of unread valid particles screened out by the reference particles exceeds the first quantity threshold;
[0135] The number of valid particles screened out by the reference particles exceeds the second quantity threshold;
[0136] All the reference particles have been screened and the screening results have not been read.
[0137] In this embodiment, the first quantity threshold and the second quantity threshold can be set according to the hardware performance and requirements of the memory, and the second quantity threshold can be determined according to the size of the storage space. The first quantity threshold is usually less than the second quantity threshold.
[0138] When the number of unread valid particles screened out by the reference particles exceeds the first quantity threshold, in order to avoid the subsequent screening results being unable to be stored due to excessive data, an interruption signal is generated to instruct the particle processing device to read the screened data as soon as possible.
[0139] When the number of valid particles selected by the reference particle exceeds the second threshold, considering the limited data storage space, it is no longer possible to store data. An interrupt signal is generated to instruct the particle processing device to quickly read the selected data to release the space. For example, after selecting valid particles based on each reference particle, the selection results can be stored in a designated storage space of the DM. The range of the storage space is determined by MaxNum, which typically ranges from 6 to 14. That is, for each reference particle, the DM can store a maximum of 2... MaxNum Data for 2 effective particles, 2 MaxNum This is the second quantity threshold. When the number of effective particles selected exceeds 2... MaxNum At this time, the execution device will trigger an interrupt and suspend operation until the memory space is released and then restart operation.
[0140] When all reference particles in the current reference particle set have been screened and the screening results have not been read, an interrupt signal is generated to instruct the particle processing device to read the screened data.
[0141] In this embodiment, an interrupt signal is generated when any one of the above three conditions is met. Upon receiving the interrupt signal, the particle processing device accesses the storage space to read valid particle data. After triggering the interrupt signal, the execution device can continue the screening process, or it can pause the process when certain conditions are met.
[0142] As an optional embodiment of this example, this optional embodiment is further optimized by: when the number of effective particles screened by the reference particle exceeds the second quantity threshold, pausing the screening process until the storage space of the effective particle data is released.
[0143] When the number of valid particles selected by the benchmark particle exceeds the second threshold, the selection process is paused because the storage space is full, awaiting the valid particle data to be read by the particle processing device. After the valid particle data is read by the particle processing device, the corresponding storage space can be released. Once the storage space is released, the device can resume the selection process, continue selecting particles, and continue storing the selected results into the released storage space.
[0144] As an optional embodiment of this example, when the interruption condition is met, this optional embodiment is further optimized by including:
[0145] D1. Determine the reference particle to be read.
[0146] In this embodiment, the reference particle to be read can be specifically understood as the reference particle whose corresponding valid particle data is read. Each reference particle can correspond to multiple valid particles. In this embodiment, during the reading process, the valid particles corresponding to each reference particle are read sequentially. The selection rules for the reference particles to be read are preset, for example, different priorities are set according to the number of filtered valid particles, the acquisition time of the reference particles, etc., and the reference particles to be read are selected according to the priority.
[0147] D2. Write the number of currently selected effective particles and the data storage address corresponding to the reference particle to be read into the reference particle parameters so that the particle processing device can read the effective particle data according to the number of effective particles and the data storage address.
[0148] The number of valid particles currently selected from the baseline particle to be read is determined. The number of valid particles can be counted by incrementing the count by 1 for each valid particle selected during the selection process. After determining the baseline particle to be read, the number of valid particles currently selected and their data storage address can be determined accordingly. The number of valid particles currently selected and their data storage address corresponding to the baseline particle to be read are written into the baseline particle parameters. For example, the number of valid particles is written to ResultNum, and the data storage address is written to ReadAddr. When reading valid particle data, the particle processing device can perform a read-only operation on the number of valid particles and the data storage address recorded in the baseline particle parameters to determine the number of valid particles and the data storage address, and then read the valid particle data based on the number of valid particles and the data storage address.
[0149] It is important to know that when selecting a reference particle to be read, only the number of valid particles and the data storage address corresponding to one reference particle are written into the reference particle parameters at a time. After the particle processing device finishes reading, a new reference particle to be read is selected and the data is written so that the particle processing device can read it.
[0150] In this embodiment, when the interruption condition is met, the particle processing device is assisted in reading data by writing the number of currently selected valid particles and the data storage address corresponding to the reference particle to be read into the reference particle parameters. There is no strict order in which the reference particle to be read is determined and the interrupt signal is generated and sent, as long as it occurs before the particle processing device reads the data.
[0151] As an optional embodiment of this example, the determination of the reference particle to be read is further optimized as follows: determine whether all reference particles in the current reference particle set have been filtered. If so, determine the reference particles to be read in sequence according to the remaining address space and order of the unread reference particles; otherwise, determine the reference particles to be read in sequence according to the number of valid particles corresponding to the unread reference particles.
[0152] First, determine if all benchmark particles in the current benchmark particle set have been filtered. If so, identify the unread benchmark particles and further determine the remaining address space of these particles and the filtering order. Prioritize selecting benchmark particles with remaining address space not exceeding a certain threshold; for example, prioritize selecting benchmark particles with remaining address space not exceeding 2. TriggerIntNum First, a limited set of reference particles are selected; then, selection is made according to the order in which the reference particles are selected. This method of selecting reference particles allows for the priority reading and release of data corresponding to reference particles with less remaining storage space, so that subsequent data storage can be carried out.
[0153] If not all reference particles in the current reference particle set have been filtered, determine the number of valid particles that have been filtered out from the unread reference particles. Based on the number of valid particles, prioritize the reference particles with the larger number of valid particles as the reference particles to be read. For example, prioritize those with 2 or more valid particles. MaxNum The baseline particle with constraints is then selected to reach 2. TriggerIntNum The reference particle is subject to the constraint conditions; otherwise, the interruption condition is not met, and the ResultNum parameter in the reference particle is 0.
[0154] In the internal implementation of the filtering software, the filtering result of each benchmark particle in each benchmark particle set is recorded in a result buffer. Each record contains the XYZQ information of the benchmark particle, the number of effective particles, the address where the filtering result is located, etc., and is read by the particle processing device.
[0155] As an optional embodiment of this example, this optional embodiment is further optimized by including:
[0156] E1, Receive particle processing device write operation on the interrupt clear count in the reference particle parameters.
[0157] In this embodiment, the interrupt clear count indicates how many read operations are cleared.
[0158] The parameter types in the reference particle parameters also include the interrupt clearing count. After completing the data reading, the particle processing device performs a write operation on the interrupt clearing count in the reference particle parameters based on the number of reads, writing the specific value of the interrupt clearing count into the interrupt clearing count field. This execution device can receive the write operation on the interrupt clearing count from the particle processing device through this step.
[0159] E2. Release the storage space of the valid particle data corresponding to the reference particle based on the number of interrupt clearing operations.
[0160] The number of interrupts cleared during writing determines how many read operations need to be cleared, the valid particle data read by the read operations that need to be cleared is determined, and the storage space for this portion of valid particle data is released.
[0161] As an optional embodiment of this example, this optional embodiment further optimizes the release of storage space for effective particles corresponding to the reference particle based on the number of write interruption clearing operations, as follows:
[0162] F1. Obtain at least one target read record based on the number of interruption clearings. The target read record is formed based on the reading of effective particle data by the particle processing device. The target read record includes the number of reference particles and effective particles read.
[0163] In this embodiment, the target read record can be specifically understood as a record of read operations corresponding to the number of interrupted clearing operations. When the particle processing device reads valid particle data, it generates a read record that records the reference particle read in this read operation and the number of valid particles read.
[0164] The number of interrupts cleared determines the read operations that need to be cleared, the corresponding read record for each read operation is determined, and the read record corresponding to the read operation is determined as the target read record; the target read record includes the number of reference particles and effective particles read.
[0165] F2. Release the storage space for the valid particle data corresponding to each target read record.
[0166] The storage space for the valid particle data recorded in the reading record for each target is released separately.
[0167] For example, when writing the interrupt clear count (CleanNum) in the reference particle parameters, the execution device will release the storage space of the filtering results corresponding to the reference particle based on the recorded read information. For instance, if the particle processing device reads data under interrupt conditions twice, first reading the result of reference particle 0 with ResultNum of 16, and second reading the result of reference particle 1 with ResultNum of 3, and then configures the interrupt clear count (CleanNum) to 2, the execution device will release the storage space of reference particle 0 and reference particle 1. The released address range is the address range occupied by the results of the two read operations.
[0168] As an optional embodiment of this example, this optional embodiment is further optimized to include switching the current reference particle set after receiving the switching signal.
[0169] In this embodiment, the switching signal can be specifically understood as a signal used to indicate the switching of the reference particle set. The switching signal may include characters such as 0 and 1. For example, 0 indicates the set switching, 1 indicates that it remains unchanged, and so on.
[0170] After the current reference particle set has been filtered, this execution device can send a clear interrupt signal to an external source, such as an external interrupt controller. If the filtering result is read and a new interrupt signal is received, the current reference particle set will continue to be used for filtering the new interrupt. If a switching signal is received, another reference particle set will be used for filtering. If the number of reference particles in the switched reference particle set is 0, this execution device will stop working.
[0171] In this embodiment, different sets of reference particles can be configured in registers. Taking this execution device as a filter as an example, two sets of registers are configured in the filter. The reference particle parameters of the two sets of registers are of the same type, and the specific parameter configurations are partially the same and partially different. They can interact with the kernel in the particle processing device, and the kernel reads the data.
[0172] For example, Table 1 provides a parameter configuration data table, which includes different types of parameters in the reference particle parameters and different types of data in the reference particle data. The table includes the names and descriptions of different types of parameters and categorizes them into basic configuration, reference particle parameters, and reference particle interruption states. There can be multiple reference particle sets, with each set corresponding to a set of reference particle parameters. Table 1 uses two reference particle sets as an example. When there are multiple reference particle sets, the parameters categorized as basic configuration are the same, the reference particle parameters are different, and the parameters for the reference particle interruption states can change dynamically during the selection process.
[0173] Table 1
[0174]
[0175]
[0176] The reference particle has multiple sets of parameters with the same structure, the number of which is the same as the number of reference particles. TDataGran, TDataCGran, and TDataSize determine the placement addresses of the xyz coordinates and charge Q. BaseData0-BaseData3 are used to store the xyz coordinates and charge Q of the reference particle.
[0177] In this embodiment of the application, if all the particles to be screened have been screened, new particles to be screened can be obtained again to continue screening. When obtaining new particles to be screened, the current reference particle set can be switched.
[0178] The particle screening method provided in this invention solves the problems of high computational load and low efficiency when calculating the force of all particles. It obtains reference particle data through reference particle parameters, selects different distance calculation methods based on the data type of the reference particles, and calculates the distance between the particle to be screened and the reference particle. The distance calculation result is more accurate. The particle to be screened is then screened based on the distance, and valid particles are selected and stored according to a first starting address, the index of the reference particle, and the offset of the first reference particle. This allows for separate storage of screening results for different reference particles, enabling fast data retrieval. By setting different interrupt conditions to trigger interrupts, the particle processing device is prompted to read the screening results in a timely manner, avoiding data congestion. Furthermore, the storage space of already read data is released based on the number of interrupt clearing cycles, preventing data from occupying memory space for extended periods and further improving data processing efficiency. When calculating the force, calculations can be performed based on the read valid particle data, eliminating the need to calculate for all particles, reducing the amount of data computation, and increasing data processing speed.
[0179] Example 3
[0180] Figure 3 This is a schematic diagram of a particle screening device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a screening signal receiving module 31, a reference particle data acquisition module 32, a data storage module 33, and an interrupt signal sending module 34.
[0181] Among them, the screening signal receiving module 31 is used to receive the particle screening signal, obtain the particle data to be screened of at least one particle according to the particle screening signal, and obtain the reference particle parameters corresponding to the current reference particle set.
[0182] The reference particle data acquisition module 32 is used to acquire the reference particle data of the reference particles in the current reference particle set according to the reference particle parameters when the reference particle acquisition conditions are met.
[0183] The data storage module 33 is used to calculate the distance between the particle to be screened and the reference particle based on the reference particle parameters, the particle data to be screened and the reference particle data, screen out effective particles based on the distance, and store the effective particle data of the effective particles based on the reference particle parameters.
[0184] The interrupt signal sending module 34 is used to generate and send an interrupt signal to the particle processing device when the interrupt conditions are met, so that the particle processing device can read the valid particle data.
[0185] The particle screening device provided in this invention solves the problems of large computational load and low efficiency when calculating the force of all particles. It obtains reference particle data through reference particle parameters, calculates the distance between the particle to be screened and the reference particle based on the reference particle parameters, reference particle data and particle data to be screened, and screens the particles to be screened by distance, screens out effective particles and stores them for the particle processing device to read and calculate. When calculating the force, the particle processing device can calculate based on the read effective particle data, without having to calculate all particles, thus reducing the amount of data computation and improving the data processing speed.
[0186] Optionally, the reference particle data acquisition module 32 includes:
[0187] The index acquisition unit is used to acquire the index value of the reference particle in the current reference particle set;
[0188] The reference particle data acquisition unit is used to query the data stored in the register according to the index value and the particle data type and reference particle data storage method in the reference particle parameters, and to obtain the reference particle data of the reference particle.
[0189] Optionally, the data storage module 33 includes:
[0190] A data type determination unit is used to determine the particle data type in the reference particle parameters;
[0191] The distance calculation unit is used to perform distance calculation on the particle data to be screened and the reference particle data according to the particle data type for each particle data to be screened, and to determine the distance between the particle to be screened and the reference particle.
[0192] Optionally, when the particle data type is a fixed number, the distance calculation unit includes:
[0193] The coordinate data acquisition subunit is used to acquire the coordinate data of the high bits in the particle data to be screened according to a first preset number to obtain the first coordinate data, and to acquire the coordinate data of the high bits in the reference particle data according to the first preset number to obtain the second coordinate data.
[0194] The first difference determination subunit is used to determine the first difference result based on the first coordinate data and the second coordinate data;
[0195] The first coordinate difference determination subunit is used to obtain the data of the high bits in the first difference result according to the second preset quantity if the first difference result is within the bit representation range and the right shift of the comparison position in the reference particle parameter is 0, thereby obtaining the first coordinate difference data.
[0196] The second coordinate difference determination subunit is used to determine the offset based on the right shift of the comparison position if the first difference result is within the bit representation range and the right shift of the comparison position in the reference particle parameters is not 0, and to obtain the data of the high bits in the first difference result based on the second preset quantity and the offset to obtain the first coordinate difference data.
[0197] The first distance calculation subunit is used to calculate the distance between the particle to be screened and the reference particle based on the first coordinate difference data.
[0198] Optionally, the first difference determination subunit is specifically used to calculate the difference between the first coordinate data and the second coordinate data, the difference including the difference in different coordinate axis directions; for the difference in each coordinate axis direction, if the difference is greater than 0, the result of subtracting 1 from the difference is taken as the processing result; if the difference is less than 0, the result of adding 1 to the difference is taken as the processing result; if the difference is equal to 0, the difference is taken as the processing result; a first difference result is formed based on the processing results corresponding to the differences in each coordinate axis direction.
[0199] Optionally, when the particle data type is a floating-point number, the distance calculation unit includes:
[0200] The second difference determination subunit is used to align the coordinates in the particle data to be screened with the coordinates in the reference particle data and perform a subtraction operation to obtain the second difference result.
[0201] The order-aligning subunit is used to align the second difference result with the distance order in the reference particle parameters;
[0202] The third coordinate difference determination subunit is used to obtain the high-order bits of the second difference result after alignment according to the third preset quantity, and to obtain the second coordinate difference data.
[0203] The second distance calculation subunit is used to calculate the distance between the particle to be screened and the reference particle based on the second coordinate difference data.
[0204] Optionally, the data storage module 33 includes:
[0205] An effective particle determination unit is used to determine the particle to be screened as an effective particle if the distance is not greater than the distance threshold in the reference particle parameters.
[0206] The first starting address determination unit is used to determine the first starting address of the effective particle data storage corresponding to the effective particle based on the reference particle parameters.
[0207] The data storage unit is used to determine the data storage address based on the index of the reference particle, the first starting address, and the first reference particle offset in the reference particle parameters, and to store the effective particle coordinates and charge in each effective particle data sequentially using the data storage address as the starting address.
[0208] Optionally, the interruption condition includes at least one of the following:
[0209] The number of unread valid particles selected by the reference particle exceeds a first quantity threshold.
[0210] The number of effective particles selected by the reference particle exceeds the second quantity threshold;
[0211] All benchmark particles have been screened, but the screening results have not been read.
[0212] Optionally, the device may also include:
[0213] The filtering stop module is used to pause the filtering process when the number of effective particles filtered by the reference particle exceeds a second quantity threshold, until the storage space of the effective particle data is released.
[0214] Optionally, the device may also include:
[0215] The particle to be read determination module is used to determine the reference particle to be read when the interrupt condition is met.
[0216] The parameter writing module is used to write the number of currently selected effective particles and the data storage address corresponding to the reference particle to be read into the reference particle parameters, so that the particle processing device can read the effective particle data according to the number of effective particles and the data storage address.
[0217] Optionally, the particle to be read determination module is specifically used to: determine whether all reference particles in the current reference particle set have been filtered; if so, determine the reference particles to be read in sequence according to the remaining address space and order of the unread reference particles; otherwise, determine the reference particles to be read in sequence according to the number of valid particles corresponding to the unread reference particles.
[0218] Optionally, the device may also include:
[0219] The write operation receiving module is used to receive write operations from the particle processing device on the interrupt clearing count in the reference particle parameters.
[0220] The space release module is used to release the storage space of the valid particle data corresponding to the reference particle based on the number of interrupt clearing operations during writing.
[0221] Optional, space release module, including:
[0222] A read record acquisition unit is used to acquire at least one target read record based on the number of interruption clearings. The target read record is formed based on the reading of effective particle data by the particle processing device. The target read record includes the number of reference particles and effective particles read.
[0223] The space release unit is used to release the storage space of the valid particle data corresponding to each target reading record.
[0224] Optionally, the device may also include:
[0225] The set switching module is used to switch the current reference particle set after receiving a switching signal.
[0226] The particle screening device provided in the embodiments of the present invention can execute the particle screening method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0227] Example 4
[0228] Figure 4 A schematic diagram of an electronic device 40 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0229] like Figure 4 As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42 or a random access memory (RAM) 43, communicatively connected to the at least one processor 41. The memory stores computer programs executable by the at least one processor. The processor 41 can perform various appropriate actions and processes based on the computer program stored in the ROM 42 or loaded into the RAM 43 from storage unit 48. The RAM 43 may also store various programs and data required for the operation of the electronic device 40. The processor 41, ROM 42, and RAM 43 are interconnected via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0230] Multiple components in electronic device 40 are connected to I / O interface 45, including: input unit 46, such as keyboard, mouse, etc.; output unit 47, such as various types of monitors, speakers, etc.; storage unit 48, such as disk, optical disk, etc.; and communication unit 49, such as network card, modem, wireless transceiver, etc. Communication unit 49 allows electronic device 40 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0231] Processor 41 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 41 performs the various methods and processes described above, such as particle sieving methods.
[0232] In some embodiments, the particle screening method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the particle screening method described above may be performed. Alternatively, in other embodiments, processor 41 may be configured to perform the particle screening method by any other suitable means (e.g., by means of firmware).
[0233] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0234] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0235] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0236] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0237] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0238] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0239] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0240] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A particle screening method, characterized by, include: Receive a particle screening signal, obtain the particle data to be screened for at least one particle according to the particle screening signal, and obtain the reference particle parameters corresponding to the current reference particle set. When the conditions for obtaining the reference particle are met, the reference particle data of the reference particle in the current reference particle set is obtained according to the reference particle parameters. The distance between the particle to be screened and the reference particle is calculated based on the reference particle parameters, the particle data to be screened, and the reference particle data. Valid particles are screened based on the distance, and the valid particle data of the valid particles are stored based on the reference particle parameters. If the interruption condition is met, an interrupt signal is generated and sent to the particle processing device so that the particle processing device can read the valid particle data; The step of calculating the distance between the particle to be screened and the reference particle based on the reference particle parameters, the particle data to be screened, and the reference particle data includes: Determine the particle data type in the reference particle parameters; For each particle data to be screened, the distance between the particle data to be screened and the reference particle data is calculated according to the particle data type to determine the distance between the particle to be screened and the reference particle. When the particle data type is a fixed number, the step of calculating the distance between the particle data to be screened and the reference particle data based on the particle data type to determine the distance between the particle to be screened and the reference particle includes: The coordinate data of the high bits in the particle data to be screened is obtained according to a first preset number to obtain the first coordinate data; the coordinate data of the high bits in the reference particle data is obtained according to the first preset number to obtain the second coordinate data. The first difference result is determined based on the first coordinate data and the second coordinate data; If the first difference result is within the bit representation range and the right shift of the comparison position in the reference particle parameters is 0, the data of the high bits in the first difference result is obtained according to the second preset quantity to obtain the first coordinate difference data; If the first difference result is within the bit representation range and the right shift of the comparison position in the reference particle parameters is not 0, the offset is determined according to the right shift of the comparison position, and the data of the high bits in the first difference result is obtained according to the second preset quantity and the offset to obtain the first coordinate difference data. The distance between the particle to be screened and the reference particle is calculated based on the first coordinate difference data; When the particle data type is a floating-point number, the step of calculating the distance between the particle data to be screened and the reference particle data based on the particle data type to determine the distance between the particle to be screened and the reference particle includes: The coordinates in the particle data to be screened and the coordinates in the reference particle data are aligned and subtracted to obtain the second difference result. The second difference result is aligned with the distance order in the reference particle parameters; The high-order bits of the second difference result after alignment are obtained according to the third preset quantity to obtain the second coordinate difference data; The distance between the particle to be screened and the reference particle is calculated based on the second coordinate difference data.
2. The method of claim 1, wherein, The step of obtaining the reference particle data of the reference particles in the current reference particle set based on the reference particle parameters includes: Get the index value of the reference particle in the current reference particle set; The reference particle data is obtained by querying the data stored in the register based on the index value and the particle data type and reference particle data storage method in the reference particle parameters.
3. The method of claim 1, wherein, The step of determining the first difference result based on the first coordinate data and the second coordinate data includes: Calculate the difference between the first coordinate data and the second coordinate data, the difference including the difference in different coordinate axis directions; For the difference in each coordinate axis direction, if the difference is greater than 0, the result of subtracting 1 from the difference is taken as the processing result; If the difference is less than 0, the result of adding 1 to the difference is taken as the processing result; If the difference is equal to 0, the difference is taken as the processing result; The first difference result is formed based on the processing results corresponding to the differences in the directions of each coordinate axis.
4. The method of claim 1, wherein, Valid particles are selected based on the distance, and valid particle data of the valid particles are stored according to the reference particle parameters, including: If the distance is not greater than the distance threshold in the reference particle parameters, the particle to be screened is determined to be a valid particle; The first starting address for storing the effective particle data corresponding to the effective particle is determined based on the reference particle parameters. The data storage address is determined based on the index of the reference particle, the first starting address, and the first reference particle offset in the reference particle parameters. The data storage address is used as the starting address to store the effective particle coordinates and charge in each effective particle data in sequence.
5. The method of claim 1, wherein, The interruption condition includes at least one of the following: The number of unread valid particles selected by the reference particle exceeds a first quantity threshold. The number of effective particles selected by the reference particle exceeds the second quantity threshold; All benchmark particles have been screened, but the screening results have not been read.
6. The method of claim 5, wherein, Also includes: When the number of effective particles selected by the reference particle exceeds the second quantity threshold, the selection process is paused until the storage space for the effective particle data is released.
7. The method of claim 4, wherein, In addition to meeting the interruption conditions, the following are also included: Identify the reference particle to be read; The number of currently selected effective particles and the data storage address corresponding to the reference particle to be read are written into the reference particle parameters so that the particle processing device can read the effective particle data according to the number of effective particles and the data storage address.
8. The method of claim 7, wherein, The determination of the reference particle to be read includes: Determine whether all reference particles in the current reference particle set have been filtered. If so, determine the reference particles to be read in sequence according to the remaining address space and order of the unread reference particles. Otherwise, the reference particles to be read are determined sequentially based on the number of valid particles corresponding to the unread reference particles.
9. The method of claim 1, wherein, Also includes: The receiving particle processing device performs a write operation on the interrupt clearing count in the reference particle parameters; The storage space for the valid particle data corresponding to the reference particle is released based on the number of interrupt clearing operations during writing.
10. The method of claim 9, wherein, The step of releasing the storage space of the effective particles corresponding to the reference particle based on the number of interrupt clearing operations includes: At least one target read record is obtained based on the number of interruption clearings. The target read record is formed based on the reading of effective particle data by the particle processing device. The target read record includes the number of reference particles and effective particles read. Release the storage space for the valid particle data corresponding to each target read record.
11. The method according to any one of claims 1-10, characterized in that, Also includes: Upon receiving the switching signal, the current set of reference particles is switched.
12. A particle screening apparatus for performing the particle screening method as described in any one of claims 1-11, characterized in that, include: The filtering signal receiving module is used to receive particle filtering signals, obtain the particle data to be filtered of at least one particle according to the particle filtering signals, and obtain the reference particle parameters corresponding to the current reference particle set. The reference particle data acquisition module is used to acquire the reference particle data of the reference particles in the current reference particle set according to the reference particle parameters when the reference particle acquisition conditions are met. The data storage module is used to calculate the distance between the particle to be screened and the reference particle based on the reference particle parameters, the particle data to be screened, and the reference particle data; to screen out effective particles based on the distance; and to store the effective particle data of the effective particles based on the reference particle parameters. An interrupt signal sending module is used to generate and send an interrupt signal to the particle processing device when an interrupt condition is met, so that the particle processing device can read the valid particle data.
13. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the particle screening method according to any one of claims 1-11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the particle screening method according to any one of claims 1-11.
Citation Information
Patent Citations
Simplified method of time filtering
CN114788182A
Particle behavior analysis device and program
JP2008269443A