Grouping method, device, equipment, medium and product

By reasonably grouping the topology data in numerical calculations, the problem of inefficient parallel processing caused by data interdependence is solved, and the data processing time is significantly reduced and the numerical calculation is accelerated.

CN119046518APending Publication Date: 2024-11-29YOU SAN DI TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411084137.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

During numerical calculations, interdependence between data leads to inefficient parallel processing, and a method is needed to reasonably group to maximize the use of computer processors.

Method used

By obtaining the number of preset groups, the set of primitive topology data to be grouped and the number of preset groups, the primitive topology data is allocated to the group of preset groups during each grouping process, and according to the target value of each grouping Determine the grouping results to achieve reasonable grouping of data.

Benefits of technology

This greatly reduces the data processing time, accelerates the numerical calculation process, and improves the parallelism of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046518A_ABST
    Figure CN119046518A_ABST
Patent Text Reader

Abstract

The invention discloses a grouping method, device and equipment, a medium and a product. The method comprises the steps of obtaining a preset grouping number, a to-be-grouped primitive topological data set and a preset grouping frequency; in each grouping process, the primitive topological data in the primitive topological data set is distributed to the groups with the preset grouping number, and a target value corresponding to each grouping is obtained; and determining a target grouping result according to the target value corresponding to each grouping. By means of the technical scheme, the computer processor can be called to the maximum extent to conduct grouping processing on the graphic element topological data, the data processing time is greatly shortened, and the numerical calculation process is accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a grouping method, apparatus, device, medium and product. Background Art

[0002] In the process of numerical calculation and solution, it is generally necessary to pre-process the data to ensure that there is no mutual dependence between the data, so as to maximize the parallel degree of the numerical solution process. In order to solve the mutual dependence between the data, it is necessary to group the data reasonably, split the non-dependent data into different groups and process them in parallel. Summary of the invention

[0003] The embodiments of the present invention provide a grouping method, apparatus, device, medium and product, so as to realize reasonable grouping of primitive topology data by calling a computer processor to the maximum extent.

[0004] According to one aspect of the present invention, there is provided a grouping method, comprising:

[0005] Obtaining a preset number of groups, a set of topological data of graph elements to be grouped, and a preset number of grouping times;

[0006] In each grouping process, the primitive topological data in the primitive topological data set are allocated to the groups of the preset number of groups to obtain a target value corresponding to each grouping;

[0007] The target grouping result is determined according to the target value corresponding to each grouping.

[0008] According to another aspect of the present invention, there is provided a grouping device, the device comprising:

[0009] An acquisition module, used to acquire a preset number of groups, a set of topological data of graph elements to be grouped, and a preset number of grouping times;

[0010] An allocation module, used for allocating the primitive topological data in the primitive topological data set to the groups of the preset number of groups in each grouping process, to obtain a target value corresponding to each grouping;

[0011] The determination module is used to determine the target grouping result according to the target value corresponding to each grouping.

[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the grouping method described in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the grouping method described in any embodiment of the present invention when executed.

[0017] According to another aspect of the present invention, an embodiment of the present invention further provides a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the grouping method described in any embodiment of the present invention is implemented.

[0018] The embodiment of the present invention obtains a preset number of groups, a set of primitive topological data to be grouped, and a preset number of groupings. In each grouping process, the primitive topological data in the primitive topological data set is assigned to groups of the preset number of groups, a target value corresponding to each grouping is obtained, and a target grouping result is determined according to the target value corresponding to each grouping. Through the technical solution of the present invention, the computer processor can be called to the maximum extent to perform grouping processing on the primitive topological data, which greatly reduces the time of data processing and accelerates the process of numerical calculation.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a grouping method in an embodiment of the present invention;

[0022] Figure 2 is a flowchart of an exemplary grouping method in an embodiment of the present invention;

[0023] Figure 3 is a structural schematic diagram of a grouping device in an embodiment of the present invention;

[0024] Figure 4It is a structural schematic diagram of an electronic device for implementing the grouping method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and their meanings are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0028] Embodiment 1

[0029] Figure 1 is a flow chart of a grouping method in an embodiment of the present invention. This embodiment is applicable to the case of reasonably grouping primitive topological data of any topological relationship. The method can be executed by a grouping device in an embodiment of the present invention, and the device can be implemented in software and / or hardware, such as Figure 1 As shown, the method specifically comprises the following steps:

[0030] S101, obtaining a preset number of groups, a set of topological data of graphic elements to be grouped, and a preset number of grouping times.

[0031] The preset number of groups may be the number of groups pre-set according to actual needs, that is, the number of groups for all primitive topological data. This embodiment does not limit the specific value of the preset number of groups, and the user may set it according to the situation.

[0032] It can be known that primitive topological data usually refers to data describing the structure of a graph or network, where "elements" refer to the basic units that make up a graph, and "topology" refers to the interconnected relationships between these basic units. In different fields, primitive topological data can have different meanings and applications: for example, in computer graphics, primitives can be basic graphic elements such as points, lines, and surfaces, and topological data describes how these elements are connected to form more complex graphic structures. In network science, primitives can be nodes in a network (for example, routers in the Internet, people in social networks), and topological data describes the connection relationship between nodes, that is, the connection pattern of the network. In Geographic Information System (GIS), primitive topological data is used to describe the geometric and topological relationships of geographic spatial data, such as the spatial relationship between roads, rivers, and boundaries. In molecular biology, primitives can be atoms or molecular fragments in a molecular structure, and topological data describes the chemical bond connections between them. In computer science, a graph is a data structure, and primitive topological data can refer to the set of nodes and edges of a graph, as well as the connection relationship between them. In electronic circuit design, primitives can be components in a circuit (such as resistors and capacitors), and topological data describes how these components are connected to form a circuit. In structural engineering, primitive topological data can describe the structural elements of a building or bridge (such as beams and columns) and how they are connected. In software architecture, primitives can be software components, and topological data describes the dependencies and interactions between components. In a database, primitive topological data can describe the relationships between data tables, for example, the primary key and foreign key relationships between tables. Topological data analysis is a mathematical and computational method used to analyze and understand the topological characteristics of data, such as connectivity, holes, and community structure. The management and analysis of primitive topological data is very important in all of the above fields, and it helps to understand the basic structure and function of complex systems. When processing this type of data, specialized software tools and algorithms are usually required to maintain and analyze topological relationships.

[0033] In this embodiment, the specific type and meaning of the primitive topological data are not limited. A primitive topological data set is formed for primitive topological data of any topological relationship, and these data are reasonably grouped.

[0034] It should be noted that the preset number of groupings can be the number of groupings pre-set according to actual needs, and the specific value of the preset number of groupings is not limited in this embodiment. In this embodiment, a more appropriate grouping method is determined through multiple groupings, for example, a grouping method can be selected so that the data processing time of each processor is not much different, so that the computer processor can be called to the maximum extent and the data processing time can be reduced.

[0035] S102 . In each grouping process, the primitive topology data in the primitive topology data set are distributed to groups with a preset number of groups to obtain a target value corresponding to each grouping.

[0036] It should be explained that the target value can be understood as the degree of parallelism of each processor in processing data during the grouping process, which can be represented by cost in this embodiment. Exemplarily, the degree of parallelism of each processor can be, for example, whether the time consumed by each processor in processing data is similar.

[0037] Exemplarily, the preset number of grouping times can be, for example, 5 times, and the preset number of groupings can be, for example, 30. Then, the primitive topological data in the primitive topological data are respectively distributed to 30 groups, and then the grouping process is looped, and the cost value is calculated in each grouping process, and finally a total of 5 cost values ​​are obtained.

[0038] S103. Determine the target grouping result according to the target value corresponding to each grouping.

[0039] The target grouping result may be a grouping result obtained by maximally invoking a computer processor to perform grouping processing on the primitive topology data.

[0040] Specifically, the final grouping method is determined according to the cost value calculated in each grouping process.

[0041] The embodiment of the present invention obtains a preset number of groups, a set of primitive topological data to be grouped, and a preset number of groupings. In each grouping process, the primitive topological data in the primitive topological data set is assigned to groups of the preset number of groups, a target value corresponding to each grouping is obtained, and a grouping result is determined according to the target value corresponding to each grouping. Through the technical solution of the present invention, the computer processor can be called to the maximum extent to perform grouping processing on the primitive topological data, which greatly reduces the time of data processing and accelerates the process of numerical calculation.

[0042] Optionally, in each grouping process, the primitive topology data in the primitive topology data set is allocated to groups of a preset number of groups to obtain a target value corresponding to each grouping, including:

[0043] Get the initial scaling amount and preset step size.

[0044] The initial expansion amount and the preset step length can be set by the user according to actual needs, and this embodiment does not limit this.

[0045] In each grouping process, the preset number of groups needs to be changed to find a more appropriate grouping method, so the scaling amount needs to be set. In this embodiment, the scaling amount can be represented by s, and the initial scaling amount can be set to 1. The step length of the scaling amount can be represented by alpha, and the preset step length can be set to 0.2, that is, in each cycle, the scaling amount s plus the step length alpha is used as the new scaling amount s.

[0046] In each grouping process, the current number of groups corresponding to the grouping process is determined according to the preset number of groups, the initial expansion amount and the preset step size.

[0047] The current number of groups may be the number of all groups in the current grouping process.

[0048] Specifically, in each grouping process, the current number of groups corresponding to the grouping process is calculated according to the preset number of groups, the initial expansion amount and the preset step size.

[0049] The primitive topology data in the primitive topology data set are distributed to the groups of the current grouping number to obtain the target value corresponding to the current grouping.

[0050] Specifically, the primitive topology data in the primitive topology data set are distributed to the groups of the current grouping number, the number of all primitive topology data in each group is obtained, and then the target value corresponding to the current group is calculated.

[0051] Optionally, in each grouping process, the current number of groups corresponding to the grouping process is determined according to the preset number of groups, the initial scaling amount, and the preset step size, including:

[0052] Get the current grouping count.

[0053] Specifically, the current grouping number can be understood as the number of groupings in the cyclic grouping. For example, the preset grouping number is 5, that is, a total of 5 groupings are required. For example, the current grouping number is 2, which means that the current grouping process is the second time.

[0054] The current scaling amount is obtained by subtracting one from the current number of groupings, multiplying the result by the preset step length, and summing the result by the initial scaling amount.

[0055] The current scaling amount may be a scaling amount corresponding to the current grouping process.

[0056] Exemplarily, the amount of expansion can be represented by s, and the step length can be represented by alpha, then the calculation method of the current amount of expansion can be expressed as: current amount of expansion = (current number of grouping times - 1) * preset step length + initial amount of expansion. That is, in the first grouping process, the current amount of expansion s = (1-1) * preset step length alpha + initial amount of expansion s = initial amount of expansion s; in the second grouping process, the current amount of expansion s = (2-1) * preset step length alpha + initial amount of expansion s = preset step length alpha + initial amount of expansion s, and so on, which will not be described in detail in this embodiment.

[0057] The quotient of the preset number of groups and the current expansion amount is determined as the current number of groups corresponding to the current grouping process.

[0058] Specifically, the current number of groups corresponding to the current grouping process = the preset number of groups / the current expansion amount.

[0059] Optionally, the primitive topology data in the primitive topology data set is assigned to groups of the current grouping number, including:

[0060] The primitive topology data in the primitive topology data set is distributed to each processor, so that each processor obtains a corresponding primitive topology data subset.

[0061] The graph primitive topology data subset may be a set consisting of graph primitive topology data allocated to each processor.

[0062] In this embodiment, when the primitive topology data in the primitive topology data set is distributed to each processor, the data can be distributed to each processor in parallel as evenly as possible. For example, if the primitive topology data set includes a total of 10 primitive topology data and there are 5 processors, 2 primitive topology data can be distributed to each processor in parallel evenly, so that the processing speed of each processor is not much different, and finally the operation of grouping the primitive topology data is completed together.

[0063] According to the primitive topological relationship between each primitive topological data in the primitive topological data set, the primitive topological data in the primitive topological data subset corresponding to each processor is allocated to the groups of the current grouping number.

[0064] Among them, the primitive topological relationship can be a description of the topological relationship between the primitive topological data. These relationships define the properties such as connection, adjacency, overlap and inclusion between the primitive topological data, without considering the specific distance and direction between them.

[0065] In this embodiment, different groups can be distinguished in different ways, for example, different colors can be set for each group to distinguish, for example, there are 5 groups, which can be distinguished by red, yellow, blue, green and purple respectively; different numbers can be set to distinguish, for example, there are 3 groups, which can be distinguished by group 1, group 2 and group 3 respectively; different letters can be set to distinguish, for example, there are 4 groups, which can be distinguished by group A, group B, group C and group D respectively. This embodiment does not limit this, and users can set it according to actual conditions.

[0066] Specifically, the primitive topology data in the primitive topology data set are distributed in parallel to each processor, and the conflict is determined based on the topology information. Then, the corresponding strategy is adopted to fall back and re-group the screening or exit, thereby realizing the pre-processing of the data and completing the grouping operation of the primitive topology data.

[0067] Optionally, according to the primitive topology relationship between the primitive topology data in the primitive topology data set, the primitive topology data in the primitive topology data subset corresponding to each processor is allocated to the groups of the current grouping number, including:

[0068] According to the primitive topological relationship between the primitive topological data in the primitive topological data set, it is determined whether there is a conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor.

[0069] In this embodiment, the primitive topology data in the primitive topology data subset corresponding to each processor may be pre-grouped, and in the pre-grouping process, it is determined whether there is a conflict in the grouping according to the primitive topology relationship between the primitive topology data in the primitive topology data set, that is, whether the primitive topology data with primitive topology relationship are mistakenly grouped into the same group. The group to be assigned may be the group to which the primitive topology data is assigned when pre-grouping is performed.

[0070] If there is no conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor, the primitive topological data in the primitive topological data subset corresponding to each processor will be allocated to the to-be-allocated groups corresponding to each primitive topological data, completing the operation of allocating the primitive topological data in the primitive topological data subset corresponding to each processor to the groups with the current number of groups.

[0071] Specifically, if there is no conflict in the to-be-assigned groups of the primitive topological data in the primitive topological data subset corresponding to each processor, that is, the primitive topological data with primitive topological relationships are evenly divided into different groups, then it indicates that the grouping is reasonable, and the result of the pre-grouping can be determined as the final grouping result, that is, the primitive topological data in the primitive topological data subset corresponding to each processor is assigned to the to-be-assigned group corresponding to each primitive topological data, completing the operation of assigning the primitive topological data in the primitive topological data subset corresponding to each processor to the groups with the current number of groups.

[0072] Optionally, judging whether there is a conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor according to the primitive topological relationship between the primitive topological data in the primitive topological data set includes:

[0073] For each primitive topology data in the primitive topology data subset corresponding to each processor, a to-be-allocated group with the current grouping number is set.

[0074] Specifically, for each primitive topological data, a preset number of groups to be allocated are created, that is, each primitive topological data can be allocated to each group to be allocated.

[0075] Control each processor to randomly distribute each primitive topology data in the primitive topology data subset to the to-be-distributed group in parallel.

[0076] Specifically, all processors randomly distribute the primitive topology data they possess in parallel to a preset number of to-be-distributed groups.

[0077] According to the primitive topological relationship between the primitive topological data in the primitive topological data set, it is determined whether the to-be-allocated groups corresponding to the primitive topological data in the same topological relationship in each processor are the same.

[0078] Specifically, it is judged according to the primitive topological relationship between the primitive topological data in the primitive topological data set whether the primitive topological data in the same topological relationship are allocated to the same group to be allocated.

[0079] If the to-be-allocated groups corresponding to the primitive topological data belonging to the same topological relationship in each processor are all different, it is determined that there is no conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor.

[0080] Specifically, if the primitive topological data belonging to the same topological relationship are all allocated to different to-be-allocated groups, it indicates that there is no conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor, and the grouping is reasonable.

[0081] Optionally, the method further includes:

[0082] If there is a situation where the to-be-assigned groups corresponding to the primitive topological data belonging to the same topological relationship are the same, it is determined that there is a conflict in the to-be-assigned groups of the primitive topological data in the primitive topological data subset corresponding to each processor, and the operation of controlling each processor in parallel to randomly assign each primitive topological data in the primitive topological data subset to the to-be-assigned group is returned.

[0083] Specifically, if the primitive topological data belonging to the same topological relationship are assigned to the same group to be assigned, it indicates that there is a conflict in the to-be-assigned groups of the primitive topological data in the primitive topological data subset corresponding to each processor. At this time, it is necessary to re-control each processor to randomly assign each primitive topological data in the primitive topological data subset to the to-be-assigned group in parallel, until there is no conflict in the to-be-assigned groups of the primitive topological data in the primitive topological data subset corresponding to each processor, and complete the operation of assigning the primitive topological data in the primitive topological data subset corresponding to each processor to the groups with a preset number of groups.

[0084] Optionally, the method further includes:

[0085] If it is detected that the primitive topology data in the primitive topology data set are not grouped, the operation of controlling each processor to randomly assign each primitive topology data in the primitive topology data subset to the to-be-assigned group in parallel is returned to be executed.

[0086] Specifically, determine whether all the primitive topological data have been successfully grouped. If all the primitive topological data have been successfully grouped, exit the program; if there are still some remaining primitive topological data that have not been grouped, it is necessary to re-control each processor in parallel to randomly assign each primitive topological data in the primitive topological data subset to the group to be assigned, until the operation of assigning the primitive topological data in the primitive topological data subset corresponding to each processor to the preset number of groups is completed.

[0087] Optionally, the primitive topology data in the primitive topology data set are allocated to groups of the current grouping number to obtain a target value corresponding to the current grouping, including:

[0088] Get the number of primitive topology data in primitive topology data.

[0089] The first value is determined according to the number of primitive topology data in the primitive topology data and the current number of groups.

[0090] It should be noted that the first value may be the ratio of the total number of primitive topology data to the current number of groups.

[0091] Exemplarily, the primitive topology data includes 300 primitive topology data in total, and the current number of groups is 5, then the first value may be 300 / 5=60.

[0092] The primitive topological data in the primitive topological data set are distributed to groups of the current grouping number, and the target value corresponding to the current grouping is determined according to the number of primitive topological data in each group and the first value.

[0093] In actual operation, after allocating the primitive topological data to each group, the number of primitive topological data in each group is obtained, the number of primitive topological data in each group is subtracted from the first value, and all differences are added together to obtain the target value corresponding to this cyclic grouping.

[0094] Optionally, the target grouping result is determined according to the target value corresponding to each grouping, including:

[0095] The grouping result with the smallest target value among all grouping results is determined as the target grouping result.

[0096] Specifically, the target value obtained in each cyclic grouping is selected, the smallest target value is screened out, and the grouping result corresponding to the target value is determined as the final grouping result. This can make the data processing amount of each processor as similar as possible, so that the data processing time of each processor is similar, thereby ensuring the maximum degree of parallelism of the algorithm, reducing the overall data processing time, and accelerating the numerical calculation process.

[0097] Optionally, the primitive topology data includes at least one of vertex primitive data, triangle edge topology data, triangle face topology data and tetrahedron topology data.

[0098] As an exemplary description of an embodiment of the present invention, Figure 2 is a flowchart of an exemplary grouping method in an embodiment of the present invention, in which different groups are distinguished by setting different numbers, such as Figure 2 As shown, the grouping method includes the following operations:

[0099] Step a: set the number of groups, the number of groupings, the amount of expansion s and the step length alpha, read the given primitive topological data and primitive topological relationship, and create a group list with the number of groups / s for each of the primitive topological data.

[0100] Specifically, s=1 can be used by default, and the scaling amount is s+alpha for each cycle. The following algorithm steps will select a suitable scaling amount s according to the overall parallelism of the algorithm, the cost variable, and determine the grouping situation corresponding to the scaling amount s as the final grouping situation.

[0101] Exemplarily, the number of groups can be 5, the number of groupings can be 5, that is, the grouping is cyclically performed 5 times, the initial scaling s defaults to 1, and the step size alpha can be set to 0.2. For all primitive topological data, a group list with the number of groups / s is created. Read the given primitive topological data and the primitive topological relationship. The following operations will update and maintain each primitive topological data list.

[0102] Step b: Determine whether the current number of cycles is less than or equal to the number of groupings. If yes, execute step c; if no, execute step d.

[0103] It can be understood that it is determined whether the current number of cycles does not exceed the preset number of cycles, i.e., the number of groupings. If not, the grouping cycle continues; if it has exceeded, it indicates that the cycle is over, and a more appropriate grouping result can be selected from it.

[0104] Step c: All processors randomly select one of the grouping number / s group lists for their own primitive topology data in parallel as the group to which the primitive topology data belongs.

[0105] Step d: Select the scaling value s corresponding to cost_min to determine the final grouping result.

[0106] Specifically, by selecting each loop comparison, the scaling amount s corresponding to cost_min can be screened out to ensure the maximum parallelism of the algorithm.

[0107] Step e: determine whether the topological data of each graphic element conflict in parallel according to the topological relationship of the graphic element. If not, execute step f; if yes, return to execute step c.

[0108] Specifically, determine whether the group selected from step c of the primitive topological data is the same as the group selected from step c of other primitive topological data in the primitive topological relationship according to the primitive topological relationship? If the groups of primitive topological data in the same topological relationship are the same, it means there is a conflict, and you need to go back to step c; otherwise, continue to execute step f.

[0109] Step f: Delete the group selected by the current primitive topology data from the maintained list of other primitive topology data.

[0110] Among them, other primitive topological data are defined as primitive topological data that are connected with the current primitive topological data in a topological relationship.

[0111] Specifically, based on the primitive topological relationship, if the group selected by the primitive topological data does not conflict with the group randomly selected by other primitive topological data in the primitive topological relationship, the group selected by the current primitive topological data will be deleted from the maintained list of other primitive topological data in the primitive topological relationship, indicating that the group has been occupied and cannot be selected again.

[0112] Step g: determine whether there are any remaining optional groups in the current primitive topology data maintenance list. If not, execute step i; if yes, execute step h.

[0113] Specifically, if there are no remaining optional groups in the maintenance list, step i is executed to expand the number of groups; if there are remaining optional groups, step h is executed.

[0114] Step i: Expand the number of groups.

[0115] Exemplarily, expanding the number of groups may be to expand the maximum number of groups to the maximum number of groups+1. For example, if the original number of groups is 5, the number of groups after expansion may be 6.

[0116] Step h: Determine whether all the topological data of the graphic elements have been grouped. If yes, execute step j; if no, return to execute step c.

[0117] Specifically, it is determined whether all the primitive topological data have been successfully grouped. If all the primitive topological data have been successfully grouped, step j is executed; if there are some remaining primitive topological data that have not been grouped, the process returns to step c.

[0118] Step j: define cost as the degree of parallelism of the system, calculate the difference between the number of data contained in each group after grouping and AvgColorNum, and calculate the corresponding cost.

[0119] Among them, AvgColorNum is the first value, AvgColorNum=total number of data in the data set / initial number of groups, that is, cost+=|(number of data in each group after the above grouping-AvgColorNum)|.

[0120] Step k, the expansion amount s+step length alpha is used as the new expansion amount s; at the same time, the number of loops is increased by 1.

[0121] Specifically, after calculating the corresponding cost in each loop, add the step length alpha to the scaling amount s, and increase the number of loops by 1, and return to step b to determine whether the number of loops is less than or equal to the number of groupings. If it is less than or equal to, continue to execute the grouping loop; if it is greater, end the loop and obtain the final grouping result.

[0122] The technical solution of the embodiment of the present invention provides a parallel data pre-processing method, which can call the computer processor to group and process the data to the maximum extent, greatly reducing the data processing time and accelerating the numerical calculation process. In view of the scenario where the serial data grouping method slows down the entire numerical calculation process, a method is provided to solve the problem that the numerical solution time bottleneck is stuck in the grouping process. This method can reasonably group any topological relationship, not only vertex primitive data, but also triangle edge topology data, triangle face topology data, tetrahedron topology data and other primitive topology data, all of which can be correctly grouped.

[0123] Embodiment 2

[0124] Figure 3 Schematic diagram of a grouping device in an embodiment of the present invention. This embodiment is applicable to the case of reasonable grouping of primitive topological data of any topological relationship. The device can be implemented in software and / or hardware. The device can be integrated in any device that provides grouping functions, such as Figure 3 As shown, the grouping device specifically includes: an acquisition module 201, an allocation module 202 and a determination module 203.

[0125] The acquisition module 201 is used to acquire the preset number of groups, the topological data set of the graph elements to be grouped, and the preset number of grouping times;

[0126] The allocation module 202 is used to allocate the primitive topology data in the primitive topology data set to the groups of the preset number of groups in each grouping process to obtain the target value corresponding to each grouping;

[0127] The determination module 203 is used to determine the target grouping result according to the target value corresponding to each grouping.

[0128] Optionally, the allocation module 202 includes:

[0129] The acquisition submodule is used to obtain the initial expansion amount and the preset step size;

[0130] A determination submodule, used for determining the current number of groups corresponding to the grouping process in each grouping process according to the preset number of groups, the initial scaling amount and the preset step size;

[0131] The allocation submodule is used to allocate the primitive topology data in the primitive topology data set to the groups of the current grouping number to obtain the target value corresponding to the current grouping.

[0132] Optionally, the determining submodule is specifically used for:

[0133] Get the current grouping count;

[0134] The current scaling amount is obtained by subtracting one from the current number of groupings, multiplying the current number of groupings by the preset step length, and summing the current number of groupings by the initial scaling amount.

[0135] The quotient of the preset number of groups and the current scaling amount is determined as the current number of groups corresponding to the current grouping process.

[0136] Optionally, the allocation submodule includes:

[0137] A distribution unit, used for distributing the primitive topology data in the primitive topology data set to each processor, so that each processor obtains a corresponding primitive topology data subset;

[0138] The grouping unit is used to distribute the primitive topology data in the primitive topology data subset corresponding to each processor to the groups of the current grouping number according to the primitive topology relationship between the primitive topology data in the primitive topology data set.

[0139] Optionally, the grouping unit includes:

[0140] A judgment subunit, used for judging whether there is a conflict between the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor according to the primitive topological relationship between the primitive topological data in the primitive topological data set;

[0141] A grouping subunit is used to allocate the primitive topological data in the primitive topological data subset corresponding to each processor to the group to be allocated corresponding to each primitive topological data if there is no conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor, thereby completing the operation of allocating the primitive topological data in the primitive topological data subset corresponding to each processor to the groups with the current number of groupings.

[0142] Optionally, the grouping subunit is specifically used for:

[0143] For each primitive topology data in the primitive topology data subset corresponding to each processor, a to-be-allocated group of the current grouping number is set;

[0144] Control each processor to randomly distribute each of the graph element topology data in the graph element topology data subset to the to-be-distributed group in parallel;

[0145] According to the primitive topological relationship between the primitive topological data in the primitive topological data set, determining whether the to-be-allocated groups corresponding to the primitive topological data in the same topological relationship in each processor are the same;

[0146] If the to-be-allocated groups corresponding to the primitive topological data belonging to the same topological relationship in each processor are all different, it is determined that there is no conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor.

[0147] Optionally, the device is also used for:

[0148] If there is a situation where the groups to be assigned corresponding to the primitive topological data belonging to the same topological relationship are the same, it is determined that there is a conflict in the groups to be assigned of the primitive topological data in the primitive topological data subset corresponding to each processor, and the operation of controlling each processor in parallel to randomly assign each primitive topological data in the primitive topological data subset to the said groups to be assigned is returned.

[0149] Optionally, the device is also used for:

[0150] If it is detected that the primitive topology data in the primitive topology data set are not grouped, the operation of controlling each processor in parallel to randomly assign each primitive topology data in the primitive topology data subset to the to-be-assigned group is returned to be executed.

[0151] Optionally, the allocation submodule is specifically used for:

[0152] Obtaining the number of primitive topological data in the primitive topological data;

[0153] Determine a first value according to the number of primitive topological data in the primitive topological data and the current number of groups;

[0154] The primitive topological data in the primitive topological data set are allocated to the groups of the current grouping number, and the target value corresponding to the current grouping is determined according to the number of primitive topological data in each group and the first value.

[0155] Optionally, the determining module 203 is specifically configured to:

[0156] The grouping result with the smallest target value among all grouping results is determined as the target grouping result.

[0157] Optionally, the primitive topology data includes at least one of vertex primitive data, triangle edge topology data, triangle face topology data and tetrahedron topology data.

[0158] The above-mentioned product can execute the grouping method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0159] Embodiment 3

[0160] Figure 4A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment 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 processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0161] like Figure 4 As shown, the electronic device 30 includes at least one processor 31, and a memory connected to the at least one processor 31, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 32 or the computer program loaded from the storage unit 38 to the random access memory (RAM) 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, the ROM 32, and the RAM 33 are connected to each other through a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.

[0162] A number of components in the electronic device 30 are connected to the I / O interface 35, including: an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0163] The processor 31 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 31 performs the various methods and processes described above, such as the grouping method:

[0164] Obtaining a preset number of groups, a set of topological data of graph elements to be grouped, and a preset number of grouping times;

[0165] In each grouping process, the primitive topological data in the primitive topological data set are allocated to the groups of the preset number of groups to obtain a target value corresponding to each grouping;

[0166] The target grouping result is determined according to the target value corresponding to each grouping.

[0167] In some embodiments, the grouping method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the grouping method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to perform the grouping method in any other appropriate manner (e.g., by means of firmware).

[0168] Various implementations 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 chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0169] Computer programs for implementing 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, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0170] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0171] To provide interaction with a user, the systems and techniques described herein may 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0172] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0173] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0174] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the grouping method of any embodiment of the present invention when executed by a processor.

[0175] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0176] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0177] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A grouping method, It is characterized in that include: Obtaining a preset number of groups, a set of topological data of graph elements to be grouped, and a preset number of grouping times; In each grouping process, the primitive topological data in the primitive topological data set are allocated to the groups of the preset number of groups to obtain a target value corresponding to each grouping; The target grouping result is determined according to the target value corresponding to each grouping.

2. The method according to claim 1, It is characterized in that In each grouping process, the primitive topology data in the primitive topology data set is allocated to the groups of the preset number of groups to obtain the target value corresponding to each grouping, including: Get the initial expansion amount and preset step length; In each grouping process, the current number of groups corresponding to the grouping process is determined according to the preset number of groups, the initial scaling amount and the preset step size; The primitive topology data in the primitive topology data set are distributed to the groups of the current grouping number to obtain the target value corresponding to the current grouping.

3. The method according to claim 2, It is characterized in that In each grouping process, determining the current number of groups corresponding to the grouping process according to the preset number of groups, the initial scaling amount, and the preset step size includes: Get the current grouping count; The current scaling amount is obtained by subtracting one from the current number of groupings, multiplying the current number of groupings by the preset step length, and summing the current number of groupings by the initial scaling amount. The quotient of the preset number of groups and the current scaling amount is determined as the current number of groups corresponding to the current grouping process.

4. The method according to claim 2, It is characterized in that Allocating the primitive topology data in the primitive topology data set to the groups of the current grouping number includes: Distributing the primitive topology data in the primitive topology data set to each processor so that each processor obtains a corresponding subset of the primitive topology data; According to the primitive topological relationship between each primitive topological data in the primitive topological data set, the primitive topological data in the primitive topological data subset corresponding to each processor is allocated to the groups of the current grouping number.

5. The method according to claim 4, It is characterized in that According to the primitive topological relationship between each primitive topological data in the primitive topological data set, the primitive topological data in the primitive topological data subset corresponding to each processor is allocated to the groups of the current grouping number, including: According to the primitive topological relationship between the primitive topological data in the primitive topological data set, determining whether there is a conflict between the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor; If there is no conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor, the primitive topological data in the primitive topological data subset corresponding to each processor is allocated to the to-be-allocated groups corresponding to each primitive topological data, completing the operation of allocating the primitive topological data in the primitive topological data subset corresponding to each processor to the groups with the current number of groups.

6. The method according to claim 5, It is characterized in that According to the primitive topological relationship between the primitive topological data in the primitive topological data set, determining whether there is a conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor includes: For each primitive topology data in the primitive topology data subset corresponding to each processor, a to-be-allocated group of the current grouping number is set; Control each processor to randomly distribute each of the graph element topology data in the graph element topology data subset to the to-be-distributed group in parallel; According to the primitive topological relationship between the primitive topological data in the primitive topological data set, determining whether the to-be-allocated groups corresponding to the primitive topological data in the same topological relationship in each processor are the same; If the to-be-allocated groups corresponding to the primitive topological data belonging to the same topological relationship in each processor are all different, it is determined that there is no conflict in the to-be-allocated groups of the primitive topological data in the primitive topological data subset corresponding to each processor.

7. The method according to claim 1, It is characterized in that Also includes: If there is a situation where the groups to be assigned corresponding to the primitive topological data belonging to the same topological relationship are the same, it is determined that there is a conflict in the groups to be assigned of the primitive topological data in the primitive topological data subset corresponding to each processor, and the operation of controlling each processor in parallel to randomly assign each primitive topological data in the primitive topological data subset to the said groups to be assigned is returned.

8. The method according to claim 1, It is characterized in that Also includes: If it is detected that the primitive topology data in the primitive topology data set are not grouped, the operation of controlling each processor in parallel to randomly assign each primitive topology data in the primitive topology data subset to the to-be-assigned group is returned to be executed.

9. The method according to claim 2, It is characterized in that Allocating the primitive topology data in the primitive topology data set to the groups of the current grouping number to obtain a target value corresponding to the current grouping includes: Obtaining the number of primitive topological data in the primitive topological data; Determine a first value according to the number of primitive topological data in the primitive topological data and the current number of groups; The primitive topological data in the primitive topological data set are allocated to the groups of the current grouping number, and the target value corresponding to the current grouping is determined according to the number of primitive topological data in each group and the first value.

10. The method according to claim 1, It is characterized in that The target grouping result is determined according to the target value corresponding to each grouping, including: The grouping result with the smallest target value among all grouping results is determined as the target grouping result.

11. The method according to claim 1, It is characterized in that The primitive topology data includes at least one of vertex primitive data, triangle edge topology data, triangle face topology data and tetrahedron topology data.

12. A grouping device, It is characterized in that include: An acquisition module, used to acquire a preset number of groups, a set of topological data of graph elements to be grouped, and a preset number of grouping times; An allocation module, used for allocating the primitive topological data in the primitive topological data set to the groups of the preset number of groups in each grouping process, to obtain a target value corresponding to each grouping; The determination module is used to determine the target grouping result according to the target value corresponding to each grouping.

13. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the grouping method according to any one of claims 1 to 11.

14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the grouping method according to any one of claims 1 to 11 when executed.

15. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the grouping method according to any one of claims 1 to 11.