CN116127792A - Interpolation method and device for scattered data - Google Patents

Interpolation method and device for scattered data Download PDF

Info

Publication number
CN116127792A
CN116127792A CN202310406499.5A CN202310406499A CN116127792A CN 116127792 A CN116127792 A CN 116127792A CN 202310406499 A CN202310406499 A CN 202310406499A CN 116127792 A CN116127792 A CN 116127792A
Authority
CN
China
Prior art keywords
triangle
node
data
interpolated
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310406499.5A
Other languages
Chinese (zh)
Other versions
CN116127792B (en
Inventor
贝晓狮
王范凤
李光祖
张桥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Shi Guan Jin Yang Technology Development Co ltd
Original Assignee
Beijing Shi Guan Jin Yang Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Shi Guan Jin Yang Technology Development Co ltd filed Critical Beijing Shi Guan Jin Yang Technology Development Co ltd
Priority to CN202310406499.5A priority Critical patent/CN116127792B/en
Publication of CN116127792A publication Critical patent/CN116127792A/en
Application granted granted Critical
Publication of CN116127792B publication Critical patent/CN116127792B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Abstract

The application discloses a method and a device for interpolating scattered data, which relate to the field of simulation, and the method comprises the following steps: determining a triangle node information network according to the data information of the CSV data file, wherein the data information of the CSV data file comprises scattered data coordinates and triangle node data corresponding to the scattered data coordinates; searching a first target triangle in a triangle node information network according to data information of a CSV data file, a first coordinate to be interpolated, which is input in advance, and association information between triangle nodes, wherein the first coordinate to be interpolated is positioned in the first target triangle; and determining a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle. Because the distance between triangles to be searched is relatively short in simulation operation aiming at interpolation of scattered data, adjacent triangles can be conveniently searched by utilizing the association information between triangle nodes in the triangle node information network, and therefore the simulation interpolation efficiency is improved.

Description

Interpolation method and device for scattered data
Technical Field
The application relates to the field of simulation, in particular to a method and a device for interpolating scattered data.
Background
Most of the simulation software today includes an interpolation table model, and the function value of the specified coordinate can be calculated by importing a table. Such as one-dimensional interpolation table models, two-dimensional interpolation table models, N-dimensional interpolation table models, and irregular interpolation table models, which mostly interpolate regular data, such as temperature data of interpolation over time t.
In the process of calculating interpolation of scattered data, a series of triangles are needed to be obtained according to Delaunay triangulation (Delaunay triangulation) of a point set, and then interpolation operation is carried out according to the position of the triangle where the input interpolation point is located. In the prior art, a triangle to which an interpolation point belongs is found by traversing each triangle. However, for the case of large triangle data volume, each triangle is traversed to determine whether the interpolation point falls in the triangle, and the efficiency of simulation interpolation is low.
Disclosure of Invention
In view of this, the present application provides a method and apparatus for interpolating scattered data, so as to achieve the purpose of improving the simulation interpolation efficiency of the scattered data.
The interpolation method of scattered data provided by the application is realized by the following steps:
determining a triangle node information network according to the data information of the CSV data file with the character separation value, wherein the data information of the CSV data file comprises scattered data coordinates and triangle node data corresponding to the scattered data coordinates, and the triangle node information network comprises: association information between triangle nodes;
searching a first target triangle in a triangle node information network according to data information of a CSV data file, a first coordinate to be interpolated, which is input in advance, and association information between triangle nodes, wherein the first coordinate to be interpolated is positioned in the first target triangle;
and determining a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle.
Optionally, according to the data information of the CSV data file, the first coordinate to be interpolated input in advance, and the association information between triangle nodes, searching the triangle node information network for the first target triangle, including:
if the first coordinate to be interpolated is determined to be positioned in the first triangle according to the data information of the CSV data file, determining the first triangle as a first target triangle, wherein the first triangle is a triangle taking a first node as a starting node in a triangle node information network;
if the first coordinate to be interpolated is not located in the first triangle, determining a second node and a second triangle, wherein the second node is a child node of the first node, the first node and the second node both belong to the vertex of the same triangle, and the second triangle is a triangle taking the second node as a starting node in the triangle node information network;
and if the first coordinate to be interpolated is determined to be positioned in the second triangle according to the data information of the CSV data file, determining the second triangle as the first target triangle.
Because triangles to be searched in the simulation operation are often closer, the second node is used as a child node of the first node, and by judging whether the first coordinate to be interpolated is in the triangle taking the second node as the vertex, the triangle adjacent to the first triangle can be searched when the first coordinate to be interpolated is not in the first triangle, so that the efficiency of the simulation interpolation can be improved.
Optionally, after determining the first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle, the method further includes:
searching a second target triangle in a triangle node information network according to data information of the CSV data file, a second coordinate to be interpolated, a first target triangle and association information between triangle nodes, wherein the second coordinate to be interpolated is positioned in the second target triangle;
and determining a second interpolation result corresponding to the second coordinate to be interpolated according to the second target triangle.
Optionally, searching the second target triangle in the triangle node information network according to the data information of the CSV data file, the second coordinate to be interpolated, the first target triangle and the association information between triangle nodes, including:
determining a third node according to the first target triangle, wherein the third node is a child node of the starting node corresponding to the first target triangle, and the third node and the starting node corresponding to the first target triangle belong to the vertex of the same triangle;
if the second coordinate to be interpolated is determined to be located in the third triangle according to the data information of the CSV data file, determining that the third triangle is the second target triangle, wherein the third triangle is a triangle taking the third node as a starting node in the triangle node information network.
In the continuous simulation operation, under the condition that the first target triangle where the first coordinate to be interpolated is located is known, the triangle adjacent to the first target triangle can be searched, and the second target triangle where the second coordinate to be interpolated is located is often closer to the first target triangle, so that the efficiency of simulation interpolation can be further improved.
Optionally, before determining the triangle node information network according to the data information of the CSV data file, the method further includes:
determining triangle data based on Delaunay triangulation according to the data information of the CSV data file;
establishing a starting node of the triangle according to the triangle data;
according to the starting node and triangle data, sub-nodes of the starting node are established, and the starting node and the sub-nodes of the starting node belong to the vertexes of the same triangle;
and establishing a triangle node information network according to the starting node and the child nodes of the starting node.
Through the triangle data based on Delaunay triangulation, each node of the triangle can be determined, so that a triangle node information network is established, the association information between the triangle nodes is linked, and a foundation is laid for searching the target triangle according to the coordinate to be interpolated.
Optionally, the start node and the child node of the start node are both stored in a node list.
Optionally, the method further comprises:
and if the second coordinate to be interpolated is the same as the first coordinate to be interpolated, outputting a first interpolation result.
Because there may be the same condition of two input coordinates to be interpolated, by comparing the two coordinates to be interpolated before searching the target triangle, if the two coordinates to be interpolated are the same, the previous interpolation result can be directly output, so that the step of searching the target triangle is omitted, and the efficiency of simulating interpolation is further improved.
The application also provides an interpolation device of scattered data, comprising: the device comprises a determining unit, a searching unit and an output unit;
the determining unit is configured to determine a triangle node information network according to data information of the CSV data file, where the data information of the CSV data file includes scattered data coordinates and triangle node data corresponding to the scattered data coordinates, and the triangle node information network includes: association information between triangle nodes;
the searching unit is used for searching a first target triangle in the triangle node information network according to the data information of the CSV data file, the first coordinate to be interpolated which is input in advance and the association information between the triangle nodes, wherein the first coordinate to be interpolated is positioned in the first target triangle;
and the output unit is used for determining a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle.
Optionally, the searching unit is further configured to search for a second target triangle in the triangle node information network according to the data information of the CSV data file, the second coordinate to be interpolated, the first target triangle, and the association information between triangle nodes, where the second coordinate to be interpolated is located in the second target triangle;
and the output unit is also used for determining a second interpolation result corresponding to the second coordinate to be interpolated according to the second target triangle.
The present application also provides a computer device comprising: and the processor is coupled with the memory, and at least one computer program instruction is stored in the memory, and is loaded and executed by the processor, so that the computer equipment realizes the interpolation method of the scattered data.
Therefore, the beneficial effects of this application are: the method and the device for interpolating scattered data are provided, and the method comprises the following steps: determining a triangle node information network according to the data information of the CSV data file, wherein the data information of the CSV data file comprises scattered data coordinates and triangle node data corresponding to the scattered data coordinates, and the triangle node information network comprises: association information between triangle nodes; searching a first target triangle in a triangle node information network according to data information of a CSV data file, a first coordinate to be interpolated, which is input in advance, and association information between triangle nodes, wherein the first coordinate to be interpolated is positioned in the first target triangle; and determining a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle. Because the distance between triangles to be searched is relatively short in simulation operation aiming at interpolation of scattered data, adjacent triangles can be conveniently searched by utilizing the association information between triangle nodes in the triangle node information network, and therefore the simulation interpolation efficiency is improved.
In addition, the method and the device can conduct repeated interpolation aiming at different data to be interpolated according to the same CSV data file, and under the condition that the number of the data to be interpolated is large, the solving speed of simulation interpolation can be further improved, and the efficiency of simulation interpolation is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings for a person skilled in the art.
FIG. 1 is a flow chart of a first embodiment of the present application;
FIG. 2 is a flow chart of a second embodiment of the present application;
FIG. 3 is a schematic diagram of a triangle based on Delaunay triangulation in accordance with a second embodiment of the present application;
FIG. 4 is a flow chart of a third embodiment of the present application;
FIG. 5 is a flow chart of a fourth embodiment of the present application;
FIG. 6 is a schematic view of an apparatus of the present application;
fig. 7 is a schematic diagram of a computer device of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In embodiments of the present application, the interpolation device that shuffles the data may include, but is not limited to, a computer device.
The computer device may include: and the processor is coupled with the memory, and at least one computer program instruction is stored in the memory, and is loaded and executed by the processor, so that the computer equipment realizes the interpolation method of the scattered data. The computer device is simply referred to as a computer in the following embodiments.
Specifically, the computer device may download GCKontrol simulation software, and introduce a Character Separation Value (CSV) data file and coordinates to be interpolated in the discrete interpolation table module through a discrete interpolation table module of a model library in the GCKontrol simulation software, so as to implement an interpolation method of discrete data, where the CSV data file includes discrete data coordinates and triangle node data corresponding to the discrete data coordinates.
Referring to fig. 1, the specific steps of the first embodiment of the present application are as follows:
s101: and the computer determines a triangle node information network according to the data information of the CSV data file.
The data information of the CSV data file comprises scattered data coordinates and triangle node data corresponding to the scattered data coordinates. The scattered data may include, but is not limited to: physical quantity measurement data, data obtained by scientific experiments, and scattered data existing in data obtained by scientific calculation or engineering calculation. The triangle node data corresponding to the scattered data coordinates is used for indicating nodes of the scattered data coordinates in the triangle, for example, the scattered data coordinates (-1, -1), (-1, 1), (0, -0.5) and (0, 0.5), wherein (-1, -1) can correspond to a first triangle node, the triangle node data is 1, (-1, 1) can correspond to a second triangle node, the triangle node data is 2, (0, -0.5) can correspond to a third triangle node, the triangle node data is 3, (0, 0.5) can correspond to a fourth triangle node, and the triangle node data is 4.
The triangle node information network comprises: association information between triangle nodes.
In some implementations, before determining the triangle node information network according to the data information of the CSV data file, the computer determines triangle data based on Delaunay triangulation according to the data information of the CSV data file; establishing a starting node of the triangle according to the triangle data; according to the starting node and triangle data, sub-nodes of the starting node are established, and the starting node and the sub-nodes of the starting node belong to the vertexes of the same triangle; and establishing a triangle node information network according to the starting node and the child nodes of the starting node.
In some implementations, the computer determines whether a triangle node information network is established according to the data information of the CSV data file, and if so, performs subsequent steps S102 to S103 according to the established triangle node information network.
In other implementations, the computer receives the CSV data file from the user input prior to determining the triangle node information network based on the data information of the CSV data file.
S102: and the computer searches the first target triangle in the triangle node information network according to the data information of the CSV data file, the first coordinate to be interpolated which is input in advance and the association information between the triangle nodes.
The first coordinate to be interpolated is located in the first target triangle.
In some implementations, if the computer determines that the first coordinate to be interpolated is located in the first triangle according to the data information of the CSV data file, determining that the first triangle is a first target triangle, where the first triangle is a triangle in the triangle node information network that uses the first node as a start node; if the first coordinate to be interpolated is not located in the first triangle, determining a second node and a second triangle, wherein the second node is a child node of the first node, the first node and the second node both belong to the vertex of the same triangle, and the second triangle is a triangle taking the second node as a starting node in the triangle node information network; and if the first coordinate to be interpolated is determined to be positioned in the second triangle according to the data information of the CSV data file, determining the second triangle as the first target triangle.
S103: and the computer determines a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle.
In some implementations, after determining a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle, the computer searches for a second target triangle in the triangle node information network according to the data information of the CSV data file, the second coordinate to be interpolated input in advance, the first target triangle and the association information between triangle nodes, and the second coordinate to be interpolated is located in the second target triangle; and determining a second interpolation result corresponding to the second coordinate to be interpolated according to the second target triangle.
In other implementations, the computer outputs the first interpolation result if the second coordinate to be interpolated is the same as the first coordinate to be interpolated.
In the first embodiment of the application, because of interpolation of scattered data, in simulation operation, the distance of triangles to be searched is relatively close, and adjacent triangles are conveniently searched by utilizing the association information among triangle nodes in the triangle node information network, so that the efficiency of simulation interpolation is improved.
The specific implementation of the present application will be described below in connection with the process of establishing a triangular node information network.
Referring to fig. 2, the steps of the second embodiment of the present application are as follows:
s201: the computer receives a CSV data file from a user input.
In some implementations, after the computer receives the CSV data file from the user input, a structure is established and the CSV data file is stored in the structure. The construct may be named ParseTableInfo.
In other implementations, the computer receives a CSV data file from a user input and a first coordinate to be interpolated.
S202: the computer determines triangle data based on Delaunay triangulation according to the data information of the CSV data file.
The triangle data includes information of three vertices corresponding to the triangle. If three vertexes corresponding to a triangle are (0, 0.5), (-1, 1) and (-1, -1) respectively, and triangle node data corresponding to the three vertexes are 4,2 and 1 respectively, triangle data corresponding to the triangle can be {3,1,0}; if the three vertices corresponding to the other triangle are (0, -0.5), (0, 0.5) and (-1, -1), respectively, the triangle node data corresponding to the three vertices are 3,4 and 1, respectively, the triangle data corresponding to the triangle may be {2,3,0}.
Specifically, the data information of the CSV data file may be shown in table 1, where input 1 may be an x-axis coordinate of the scattered data, input 2 may be a y-axis coordinate of the scattered data, and output 1 may be triangle node data corresponding to the scattered data coordinate.
Then the triangle based on Delaunay triangulation may be as shown in fig. 3 and the triangle data based on Delaunay triangulation may be {4,2,0}, {3,5,1}, {3,1,0}, {2,3,0}, {5,3,4}, and {3,2,4}.
Figure SMS_1
In some implementations, the computer invokes triangle data generated by the external library based on Delaunay triangulation based on the data information of the CSV data file.
In other implementations, the external library generates delta data based on Delaunay triangulation and stores the delta data in the file before determining the delta data based on Delaunay triangulation based on the data information of the CSV data file.
S203: the computer establishes a starting node of the triangle according to the triangle data.
The starting node of the triangle may be the first vertex in the triangle data. For example, if the triangle data corresponding to a triangle is {3,1,0}, the start node of the triangle may be 3; the triangle data corresponding to another triangle is 2,3,0, then the starting node of this triangle may be 2.
In some implementations, the computer also stores the start node in the fabric and joins the list of nodes. The structure may be named triangularenode.
S204: the computer establishes child nodes of the starting node according to the starting node and the triangle data.
The start node and the child nodes of the start node all belong to the same triangle vertex. For example, if triangle data corresponding to one triangle is {3,1,0}, and the start node is 3, child nodes of the start node are 1 and 0; the triangle data corresponding to the other triangle is {2,3,0}, the start node is 2, and the child nodes of the start node are 3 and 0.
In some implementations, the computer also stores the child nodes of the start node in the triangularenode structure in child nodes and stores the child nodes of the start node in a node list.
S205: and the computer establishes a triangle node information network according to the starting node and the child nodes of the starting node.
S206: and the computer determines a triangle node information network according to the data information of the CSV data file.
S207: and the computer searches the first target triangle in the triangle node information network according to the data information of the CSV data file, the first coordinate to be interpolated which is input in advance and the association information between the triangle nodes.
S208: and the computer determines a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle.
In the second embodiment of the application, the triangle node information network is established to link the association information between the triangle nodes, so as to lay a foundation for the subsequent searching of the target triangle; meanwhile, when the data to be interpolated with high latitude and large data volume is imported, the solving speed of the model can be further improved.
Specific implementations of the present application are described below in connection with determining a first target triangle.
Referring to fig. 4, the specific steps of the third embodiment of the present application are as follows:
s401: and the computer determines a triangle node information network according to the data information of the CSV data file.
S402: and if the computer determines that the first coordinate to be interpolated is positioned in the first triangle according to the data information of the CSV data file, determining that the first triangle is the first target triangle.
The first triangle is a triangle in the triangle node information network with the first node as a starting node.
Because the data information of the CSV data file contains scattered data coordinates and triangle node data corresponding to the scattered data coordinates, coordinates of three vertexes of the first triangle can be determined according to the triangle data corresponding to the first triangle, so that whether the first coordinate to be interpolated is located in the first triangle or not is determined.
In some implementations, the computer creates a search queue, adds a start node to the search queue, determines whether the first coordinate to be interpolated is located in a triangle with the start node as a vertex according to data information of the CSV data file, returns the triangle if so, and determines the triangle as a first target triangle.
S403: and if the first coordinate to be interpolated is not located in the first triangle, the computer determines a second node and a second triangle.
The second node is a child node of the first node, and the first node and the second node both belong to the vertex of the same triangle. The second triangle is a triangle in the triangle node information network with the second node as a starting node.
Specifically, if the triangle data based on Delaunay triangulation is {4,2,0}, {3,5,1}, {3,1,0}, {2,3,0}, {5,3,4}, {3,2,4}, the triangle data corresponding to the first triangle is {4,2,0}, the first node is 4, the second node may be 2, and the second triangle may be a triangle corresponding to the triangle data of {2,3,0}.
In some implementations, the computer creates a search queue, adds the start node to the search queue, determines whether the first coordinate to be interpolated is located in a triangle with the start node as a vertex according to the data information of the CSV data file, if not, replaces the start node with a child node of the start node, and determines whether the first coordinate to be interpolated is located in a triangle with the child node of the start node as a vertex according to the data information of the CSV data file.
In other implementations, the computer outputs a hint message indicating that the first target triangle does not exist in the triangle node information network if it is determined that the first target triangle does not exist in the triangle node information network.
S404: and if the computer determines that the first coordinate to be interpolated is positioned in the second triangle according to the data information of the CSV data file, determining that the second triangle is the first target triangle.
Because the data information of the CSV data file contains scattered data coordinates and triangle node data corresponding to the scattered data coordinates, coordinates of three vertexes of the second triangle can be determined according to the triangle data corresponding to the second triangle, so that whether the first coordinate to be interpolated is located in the second triangle is determined.
S405: and the computer determines a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle.
In some implementations, after determining the first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle, the computer further stores the first coordinate to be interpolated and the first interpolation result in a static array manner.
In the third embodiment of the present application, since the second node is a child node of the first node, by determining whether the first coordinate to be interpolated is in a triangle using the second node as a vertex, a triangle adjacent to the first triangle may be found when the first coordinate to be interpolated is not in the first triangle, thereby improving efficiency of simulation interpolation.
Because during simulation interpolation, multiple groups of coordinate data to be interpolated are generally simulated according to the same CSV data file, the specific implementation of the application is described below in connection with the situation.
Referring to fig. 5, the steps of the fourth embodiment of the present application are as follows:
s501: and the computer determines a triangle node information network according to the data information of the CSV data file.
S502: and the computer searches the first target triangle in the triangle node information network according to the data information of the CSV data file, the first coordinate to be interpolated which is input in advance and the association information between the triangle nodes.
S503: and the computer determines a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle.
It should be noted that, steps S501 to S503 may be referred to the detailed description in the above embodiment, and will not be repeated in this embodiment.
S504: and the computer searches the second target triangle in the triangle node information network according to the data information of the CSV data file, the second coordinate to be interpolated, the first target triangle and the association information between the triangle nodes, which are input in advance.
The second coordinate to be interpolated is located in the second target triangle.
In some implementations, the computer determines a third node according to the first target triangle, the third node being a child node of the start node corresponding to the first target triangle, the third node and the start node corresponding to the first target triangle both belonging to a vertex of the same triangle; if the second coordinate to be interpolated is determined to be located in the third triangle according to the data information of the CSV data file, determining that the third triangle is the second target triangle, wherein the third triangle is a triangle taking the third node as a starting node in the triangle node information network.
In other implementations, the computer judges whether the second coordinate to be interpolated is the same as the first coordinate to be interpolated or not before searching the second target triangle in the triangle node information network according to the data information of the CSV data file, the second coordinate to be interpolated, the first target triangle and the association information between triangle nodes, and if the second coordinate to be interpolated is the same as the first coordinate to be interpolated, the computer outputs the first interpolation result.
S505: and the computer determines a second interpolation result corresponding to the second coordinate to be interpolated according to the second target triangle.
In the fourth embodiment of the present application, since in the continuous simulation operation, triangles to be searched are often closer, according to the first target triangle where the first coordinate to be interpolated is located, triangles adjacent to the first target triangle can be searched, thereby improving the efficiency of simulation interpolation.
Referring to fig. 6, the present application provides an interpolation device 600 for scattered data, including: a determining unit 601, a finding unit 602, and an output unit 603.
Determination unit 601: the triangle node information network is used for determining a triangle node information network according to the data information of the CSV data file, wherein the data information of the CSV data file comprises scattered data coordinates and triangle node data corresponding to the scattered data coordinates, and the triangle node information network comprises: association information between triangle nodes.
The search unit 602: the method is used for searching a first target triangle in the triangle node information network according to the data information of the CSV data file, the first coordinate to be interpolated, which is input in advance, and the association information between triangle nodes, wherein the first coordinate to be interpolated is located in the first target triangle.
An output unit 603: and the first interpolation result corresponding to the first coordinate to be interpolated is determined according to the first target triangle.
Optionally, the search unit 602: if the first coordinate to be interpolated is determined to be located in the first triangle according to the data information of the CSV data file, determining that the first triangle is a first target triangle, wherein the first triangle is a triangle taking the first node as a starting node in the triangle node information network; if the first coordinate to be interpolated is not located in the first triangle, determining a second node and a second triangle, wherein the second node is a child node of the first node, the first node and the second node both belong to the vertex of the same triangle, and the second triangle is a triangle taking the second node as a starting node in the triangle node information network; and if the first coordinate to be interpolated is determined to be positioned in the second triangle according to the data information of the CSV data file, determining the second triangle as the first target triangle.
Optionally, the search unit 602: and the method is also used for searching a second target triangle in the triangle node information network according to the data information of the CSV data file, the second coordinate to be interpolated, the first target triangle and the association information between triangle nodes, wherein the second coordinate to be interpolated is positioned in the second target triangle.
Alternatively, the output unit 603: and the method is also used for determining a second interpolation result corresponding to the second coordinate to be interpolated according to the second target triangle.
Optionally, the search unit 602: the method comprises the steps of determining a first node according to a first target triangle, wherein the first node is a child node of a starting node corresponding to the first target triangle, and the first node and the starting node corresponding to the first target triangle belong to the same vertex of the triangle; if the second coordinate to be interpolated is determined to be located in the third triangle according to the data information of the CSV data file, determining that the third triangle is the second target triangle, wherein the third triangle is a triangle taking the third node as a starting node in the triangle node information network.
Alternatively, the output unit 603: and the first interpolation result is output if the second coordinate to be interpolated is the same as the first coordinate to be interpolated.
Optionally, the interpolation device 600 for scattering data further includes: a unit 604 is established.
The establishing unit 604: the triangle data based on Delaunay triangulation is determined according to the data information of the CSV data file; establishing a starting node of the triangle according to the triangle data; according to the starting node and triangle data, sub-nodes of the starting node are established, and the starting node and the sub-nodes of the starting node belong to the vertexes of the same triangle; and establishing a triangle node information network according to the starting node and the child nodes of the starting node.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
It should be noted that: in the interpolation device for scattered data provided in the above embodiment, when implementing the function of interpolating scattered data, only the division of the above functional modules is used for illustration, in practical application, the above functional allocation may be implemented by different functional modules according to needs, that is, the internal structure of the interpolation device for scattered data is divided into different functional modules, so as to implement all or part of the functions described above. In addition, the interpolation device of the scattered data provided in the above embodiment and the interpolation method embodiment of the scattered data belong to the same concept, and detailed implementation processes of the interpolation device and the interpolation method embodiment of the scattered data are detailed in the method embodiment, and are not repeated here.
Referring to fig. 7, the present application further provides a computer device 700, including: a processor 701 and a memory 702.
The processor 701 is coupled to a memory 702, and at least one computer program instruction is stored in the memory 702, which is loaded and executed by the processor 701 to cause the computer apparatus to implement a method of interpolation of scattered data.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of interpolating scattered data, the method comprising:
determining a triangle node information network according to data information of a character separation value CSV data file, wherein the data information of the CSV data file comprises scattered data coordinates and triangle node data corresponding to the scattered data coordinates, and the triangle node information network comprises: association information between triangle nodes;
searching a first target triangle in the triangle node information network according to the data information of the CSV data file, a first coordinate to be interpolated, which is input in advance, and the association information between the triangle nodes, wherein the first coordinate to be interpolated is positioned in the first target triangle;
and determining a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle.
2. The method according to claim 1, wherein searching the triangle node information network for the first target triangle based on the data information of the CSV data file, the first coordinate to be interpolated inputted in advance, and the association information between the triangle nodes, comprises:
if the first coordinate to be interpolated is determined to be located in a first triangle according to the data information of the CSV data file, determining that the first triangle is the first target triangle, wherein the first triangle is a triangle taking a first node as a starting node in the triangle node information network;
if the first coordinate to be interpolated is not located in the first triangle, determining a second node and a second triangle, wherein the second node is a child node of the first node, the first node and the second node both belong to the same vertex of the triangle, and the second triangle is a triangle taking the second node as a starting node in the triangle node information network;
and if the first coordinate to be interpolated is determined to be positioned in the second triangle according to the data information of the CSV data file, determining that the second triangle is the first target triangle.
3. The method of claim 1, further comprising, after determining a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle:
searching a second target triangle in the triangle node information network according to the data information of the CSV data file, a second coordinate to be interpolated, the first target triangle and the association information between triangle nodes, wherein the second coordinate to be interpolated is positioned in the second target triangle;
and determining a second interpolation result corresponding to the second coordinate to be interpolated according to the second target triangle.
4. A method according to claim 3, wherein searching for a second target triangle in the triangle node information network based on the data information of the CSV data file, the second coordinates to be interpolated entered in advance, the first target triangle and the association information between the triangle nodes, comprises:
determining a third node according to the first target triangle, wherein the third node is a child node of a starting node corresponding to the first target triangle, and the third node and the starting node corresponding to the first target triangle belong to the vertex of the same triangle;
and if the second coordinate to be interpolated is determined to be located in a third triangle according to the data information of the CSV data file, determining that the third triangle is the second target triangle, wherein the third triangle is a triangle taking the third node as a starting node in the triangle node information network.
5. The method of claim 1, further comprising, prior to determining the triangle node information network based on the data information of the CSV data file:
determining triangle data based on Delaunay triangulation according to the data information of the CSV data file;
establishing a starting node of the triangle according to the triangle data;
establishing a child node of the starting node according to the starting node and the triangle data, wherein the starting node and the child node of the starting node belong to the same vertex of the triangle;
and establishing the triangle node information network according to the starting node and the child nodes of the starting node.
6. The method of claim 5, wherein the start node and child nodes of the start node are each stored in a node list.
7. A method according to claim 3, characterized in that the method further comprises:
and if the second coordinate to be interpolated is the same as the first coordinate to be interpolated, outputting the first interpolation result.
8. An interpolation device for scattered data, the device comprising: the device comprises a determining unit, a searching unit and an output unit;
the determining unit is configured to determine a triangle node information network according to data information of a CSV data file, where the data information of the CSV data file includes scattered data coordinates and triangle node data corresponding to the scattered data coordinates, and the triangle node information network includes: association information between triangle nodes;
the searching unit is used for searching a first target triangle in the triangle node information network according to the data information of the CSV data file, a first coordinate to be interpolated which is input in advance and the association information between the triangle nodes, wherein the first coordinate to be interpolated is positioned in the first target triangle;
and the output unit is used for determining a first interpolation result corresponding to the first coordinate to be interpolated according to the first target triangle.
9. The apparatus of claim 8, wherein the searching unit is further configured to search for a second target triangle in the triangle node information network according to the data information of the CSV data file, the second coordinate to be interpolated inputted in advance, the first target triangle, and the association information between the triangle nodes, the second coordinate to be interpolated being located in the second target triangle;
the output unit is further configured to determine a second interpolation result corresponding to the second coordinate to be interpolated according to the second target triangle.
10. A computer device, the computer device comprising: a processor coupled to a memory having stored therein at least one computer program instruction that is loaded and executed by the processor to cause the computer arrangement to implement the method of any of claims 1-7.
CN202310406499.5A 2023-04-17 2023-04-17 Interpolation method and device for scattered data Active CN116127792B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310406499.5A CN116127792B (en) 2023-04-17 2023-04-17 Interpolation method and device for scattered data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310406499.5A CN116127792B (en) 2023-04-17 2023-04-17 Interpolation method and device for scattered data

Publications (2)

Publication Number Publication Date
CN116127792A true CN116127792A (en) 2023-05-16
CN116127792B CN116127792B (en) 2023-07-04

Family

ID=86303135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310406499.5A Active CN116127792B (en) 2023-04-17 2023-04-17 Interpolation method and device for scattered data

Country Status (1)

Country Link
CN (1) CN116127792B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831645A (en) * 2012-07-18 2012-12-19 哈尔滨工程大学 Method for establishing digital elevation model applied to submarine topography
JP2016157174A (en) * 2015-02-23 2016-09-01 浅野 隆 Three-dimensional space data interpolation program and shape generation program achieved by combining the same
KR102014389B1 (en) * 2019-06-14 2019-08-26 국방과학연구소 Method and apparatus for estimating scatterng center
CN111127610A (en) * 2019-12-23 2020-05-08 武汉真蓝三维科技有限公司 Point cloud data three-dimensional visualization rendering method and calculation method
CN114398460A (en) * 2022-01-20 2022-04-26 山西华瑞鑫环保科技有限公司 Environment-friendly field prediction model plotting system
CN114612632A (en) * 2022-03-03 2022-06-10 武汉科技大学 Sorting and interpolation processing method based on three-dimensional laser point cloud data
CN114818309A (en) * 2022-04-21 2022-07-29 哈尔滨工程大学 Two-dimensional scalar field interpolation method and device based on discrete point representation and computer equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831645A (en) * 2012-07-18 2012-12-19 哈尔滨工程大学 Method for establishing digital elevation model applied to submarine topography
JP2016157174A (en) * 2015-02-23 2016-09-01 浅野 隆 Three-dimensional space data interpolation program and shape generation program achieved by combining the same
KR102014389B1 (en) * 2019-06-14 2019-08-26 국방과학연구소 Method and apparatus for estimating scatterng center
CN111127610A (en) * 2019-12-23 2020-05-08 武汉真蓝三维科技有限公司 Point cloud data three-dimensional visualization rendering method and calculation method
CN114398460A (en) * 2022-01-20 2022-04-26 山西华瑞鑫环保科技有限公司 Environment-friendly field prediction model plotting system
CN114612632A (en) * 2022-03-03 2022-06-10 武汉科技大学 Sorting and interpolation processing method based on three-dimensional laser point cloud data
CN114818309A (en) * 2022-04-21 2022-07-29 哈尔滨工程大学 Two-dimensional scalar field interpolation method and device based on discrete point representation and computer equipment

Also Published As

Publication number Publication date
CN116127792B (en) 2023-07-04

Similar Documents

Publication Publication Date Title
CN111966912B (en) Recommendation method and device based on knowledge graph, computer equipment and storage medium
CN104462668A (en) Computer-implemented method for designing an industrial product modeled with a binary tree
CN112434188A (en) Data integration method and device for heterogeneous database and storage medium
WO2022242259A1 (en) Data processing method and apparatus, device, and medium
CN115952752A (en) Data processing method based on flow field simulation robustness calculation under enhanced inclined grid
CN116127792B (en) Interpolation method and device for scattered data
Hüls et al. Analyzing Hybrid Petri nets with multiple stochastic firings using HyPro
CN111858613B (en) Service data retrieval method
CN108989105B (en) Propagation path diagram generation method and device and server
KR101001844B1 (en) System and method for genrating cloaking area to cloak position inforamtion of user in location based service
CN112100307B (en) Data processing method, path-finding processing device and electronic equipment
CN110378037B (en) CFD simulation data storage method and device based on Ceph and server
CN111767522A (en) Recursive algorithm implementation method and device and electronic equipment
Khamayseh et al. Use of the spatial kD-tree in computational physics applications
CN113313419A (en) Information system window change risk obtaining method and device
CN112579709A (en) Data table identification method and device, storage medium and electronic equipment
JP5776403B2 (en) Region search method, region search program, and information processing apparatus
CN113313829B (en) Rapid construction processing method and device for display model
JP6167531B2 (en) Region search method, region index construction method, and region search device
CN117094268B (en) Inter-grid data transmission method and device, storage medium and electronic equipment
CN109324797B (en) Desktop icon generation method, computer readable storage medium and terminal equipment
CN110750847B (en) Method, device, equipment and medium for determining grid segmentation relation
CN117709129B (en) Multi-scale simulation method, device, equipment and storage medium
CN117357894B (en) Three-dimensional scene generation method, device, equipment and medium
CN111949839B (en) Data association method, electronic device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant