Data processing method, device, equipment and medium
By iteratively adjusting the clustering center and introducing the stallion mutation strategy in the krill swarm algorithm, the local premature problem of the algorithm is improved, the clustering effect is improved, the problems of rapid convergence and local optimal solutions are solved, and a more efficient algorithm is achieved Data clustering.
Patent Information
- Application Number
- CN202110281332.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-16
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-03-16
AI Technical Summary
The krill swarm algorithm is prone to rapid convergence and local optimal solutions during the data clustering process, leading to premature phenomena and making it difficult to find the global optimal solution.
By initializing the position information of multiple clustering centers and adjusting iteratively until the preset stopping conditions are met, the krill swarm algorithm is used to adjust the position of the clustering centers, and the center with the best clustering effect is selected as the 'stallion', and other The center performs cross mutation to generate a second center with mutated position information, which is used to replace the first center and improve the shortcomings of local premature maturation.
It effectively improves the local premature problem of the krill swarm algorithm, improves the clustering effect, increases the probability of finding the global optimal solution, and significantly optimizes the clustering accuracy.
Smart Images

Figure CN112949811B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and more specifically, to a data processing method, apparatus, device and medium. Background Art
[0002] During the foraging process, krill swarms continuously gather to increase population density and reduce the chance of being preyed upon. At the same time, they explore the living area and shorten the distance between them and food as much as possible, so that the population can obtain food. Based on the foraging characteristics of krill swarms, a krill herd algorithm (KHA) is proposed.
[0003] The inventors found that the krill swarm algorithm has the characteristic of rapid convergence, which makes it easy for local optimal solutions to appear, leading to the premature maturity of the algorithm. Summary of the invention
[0004] In order to overcome at least one shortcoming in the prior art, in a first aspect, an embodiment of the present application further provides a data processing method, which is applied to an electronic device, and the method includes:
[0005] Initializing location information of multiple cluster centers, wherein the multiple cluster centers correspond to cluster data of the same category;
[0006] Iteratively adjusting the position information of each cluster center until a preset stop condition is met, wherein the adjusting the position information of each cluster center includes:
[0007] Adjusting the position information of each cluster center by using a krill swarm algorithm;
[0008] Determining a first center from the plurality of cluster centers according to the adjusted position information of each cluster center;
[0009] Generate a second center with a sudden change in position information based on the position information of the first center;
[0010] Determine a target center with the best clustering effect from the first center and the second center;
[0011] The first center is replaced by the target center.
[0012] In a second aspect, an embodiment of the present application further provides a data processing device, applied to an electronic device, the data processing device comprising:
[0013] A position initialization module, used to initialize the position information of multiple cluster centers, wherein the multiple cluster centers correspond to cluster data of the same category;
[0014] A position iteration module is used to iteratively adjust the position information of each cluster center until a preset stop condition is met, wherein the adjusting the position information of each cluster center includes:
[0015] Adjusting the position information of each cluster center by using a krill swarm algorithm;
[0016] Determining a first center from the plurality of cluster center points according to the adjusted position information of each cluster center;
[0017] Generate a second center with a sudden change in position information based on the position information of the first center;
[0018] Determine a target center point with the best clustering effect from the first center and the second center;
[0019] The first center is replaced by the target center.
[0020] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the data processing method is implemented.
[0021] In a fourth aspect, an embodiment of the present application further provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the data processing method is implemented.
[0022] Compared with the prior art, this application has the following beneficial effects:
[0023] In a data processing method, apparatus, device and medium provided by an embodiment of the present application, the electronic device iteratively adjusts the position information of the cluster centers based on the initialized multiple cluster centers until a preset stop condition is met. In each iteration process, a first center is determined from multiple cluster centers according to the adjusted position information of each cluster center; a second center with a sudden change in position information is generated through the position information of the first center; a target center with the best clustering effect is determined from the first center and the second center; and is used to replace the first center. Since the second center is generated based on the sudden change of the first center, the disadvantage of local premature maturation of the krill swarm algorithm is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application 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 paying creative work.
[0025] Figure 1 A schematic diagram of the optimal solution provided for the embodiment of the present application;
[0026] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0027] Figure 3 A flowchart of the steps of the data processing method provided in the embodiment of the present application;
[0028] Figure 4 A schematic diagram of the mutation effect provided in the embodiments of the present application;
[0029] Figure 5 Iterative block diagram of the data processing method provided in the embodiment of the present application;
[0030] Figure 6 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application.
[0031] Icon: 120 - memory; 130 - processor; 201 - position initialization module; 202 - position iteration module. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0033] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0034] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0035] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0036] According to the characteristics of krill swarm foraging, the Krill Herd Algorithm (KHA) is proposed. The Krill Herd Algorithm can be applied in many fields to find the optimal solution.
[0037] For example, with the development of the Internet, online social interaction has become more and more frequent (for example, viewers watching live broadcasts can send bullet comments to communicate). Online data contains huge value. When analyzing online data, data of the same category needs to be classified into one category to reduce semantic differences.
[0038] The inventors have found that the krill swarm algorithm has the characteristic of rapid convergence, which makes it easy to produce local optimal solutions when clustering online data, leading to the premature maturity of the algorithm.
[0039] Since it involves concepts such as fast convergence and local optimal solution, in order to facilitate understanding of the technical solution provided in the embodiment of the present application. Figure 1 The above concepts such as fast convergence and local optimal solution are explained.
[0040] like Figure 1 In the curve shown, there are two optimal points, namely the local optimal point A and the global optimal point B. Assume that there is a small ball starting from point C, and iteratively adjusts its position on the curve through the krill swarm algorithm ( Figure 1 The ball is represented by the dotted line in the middle) to find the minimum value in the curve. Due to the fast convergence of the krill swarm algorithm, the ball adjusts its position in a small range, making it difficult for the ball to cross Figure 1 Point D in the curve, and then the minimum value found by the ball with high probability is at point A. However, point A is the local optimal point in the curve.
[0041] In view of this, an embodiment of the present application provides a data processing method applied to an electronic device, which is used to improve the disadvantages of local premature maturity of the krill swarm algorithm. In order to improve the disadvantages of local premature maturity of the krill swarm algorithm, in this method, the electronic device selects a cluster center with better clustering effect as a "stud", performs crossover mutation with other cluster center points, and compares the mutation result of the crossover mutation with the cluster center corresponding to the "stud", and selects the cluster center with the best clustering effect. Therefore, the mutation result of the crossover mutation can improve the disadvantages of local premature maturity of the krill swarm algorithm to a certain extent.
[0042] The electronic device may be, but is not limited to, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), a server, etc.
[0043] For the electronic device, the embodiment of the present application also provides a structural schematic diagram of the electronic device. Figure 2 As shown, the electronic device includes a memory 120 and a processor 130 .
[0044] The memory 120 and the processor 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines.
[0045] Among them, the memory 120 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.
[0046] The memory 120 is used to store computer programs, and the processor 130 executes the computer program after receiving an execution instruction, thereby implementing the data processing method provided in the embodiment of the present application.
[0047] The processor 130 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0048] Based on the structure of the above electronic equipment, such as Figure 3 As shown, the embodiment of the present application also provides a step flow chart of the data processing method. Figure 3 Each step of the method is described in detail, such as Figure 3 As shown, the data processing method includes:
[0049] Step S101, initializing location information of multiple cluster centers.
[0050] Among them, multiple cluster centers correspond to cluster data of the same category. It should be understood that for data to be classified containing multiple categories, it can be split into multiple groups of cluster data corresponding to the number of categories. Among them, each group of cluster data has the most reasonable cluster center, and the purpose of clustering is to try to find a center point close to the most reasonable cluster center.
[0051] Step S102, iteratively adjusting the position information of each cluster center until a preset stop condition is met, wherein adjusting the position information of each cluster center includes:
[0052] The location information of each cluster center is adjusted through the krill swarm algorithm;
[0053] Determining a first center from the plurality of cluster centers according to the adjusted position information of each cluster center;
[0054] Generate a second center with a sudden change in position information through the position information of the first center;
[0055] Determine the target center with the best clustering effect from the first center and the second center;
[0056] Replace the first center by the target center.
[0057] In the embodiment of the present application, in order to improve the disadvantage of local premature maturity of the krill swarm algorithm, a stallion mutation strategy is introduced on the basis of the krill swarm algorithm. Based on the stallion mutation strategy, the electronic device selects the cluster center with the best clustering effect as the "stallion" and performs cross mutation with the remaining cluster centers.
[0058] In order to facilitate understanding of this solution, the krill swarm algorithm is first introduced below. It should be understood that the krill swarm algorithm is a heuristic algorithm that simulates the foraging activities of krill swarms in nature.
[0059] In the foraging activities of krill swarms in nature, each krill in the krill swarm will be affected by the combined influence of food and surrounding krill during foraging, and the krill individuals move towards the food under this combined influence. In the krill swarm algorithm, each krill individual represents a potential solution in the solution space.
[0060] For example, assume that there are 100 krill in the solution space, each of which is a potential optimal solution, and krill food is the global optimal solution that the algorithm needs to find.
[0061] Under the comprehensive guidance of food information and surrounding krill information, the algorithm iterates the krill position in the solution space until the optimal solution is finally output. The mathematical model of the krill swarm algorithm can be expressed as:
[0062] X i (k) = N i (k)+F i (k)+D i (k);
[0063] Where N i (k) represents the induced movement of the i-th krill under the influence of other krill individuals when it moves for the kth time; F i (k) represents the foraging movement of the i-th krill under the influence of food during its k-th movement, D i (k) represents the physical diffusion caused by the random disturbance when the i-th krill moves for the k-th time.
[0064] It is worth noting that the krill individuals in the above krill swarm algorithm represent the clustering centers in the embodiments of the present application.
[0065] Based on the above-mentioned krill swarm algorithm, after the electronic device adjusts the position information of each cluster center through the krill swarm algorithm, the first center is selected from the adjusted position information of each cluster center. It should be understood that in the krill swarm algorithm, the cluster center with the best clustering effect will affect the movement trend of all cluster centers. Therefore, the first center meets the need to be selected based on the preset screening conditions.
[0066] Exemplarily, the first center may be the clustering center with the best clustering effect; of course, those skilled in the art may also select any one of the top 10 clustering centers in terms of clustering effect as the first center.
[0067] Since the clustering effect of the first center is relatively good, the electronic device uses the first center as a "stud" and selects mutation centers from the remaining clustering centers for cross-mutation to obtain the second center after the position information is mutated.
[0068] Exemplarily, assuming that the position information of the first center is represented as P1, and the position information of the mutation center is represented as P2, the position information of the second center P3 can be represented as:
[0069] P3 = δP1 + (1-δ)P2;
[0070] In the formula, δ∈[0,1], and those skilled in the art can select an appropriate value according to actual needs. The second center thus generated has two situations in terms of clustering effect:
[0071] Case 1: The clustering effect of the second center is better than that of the first center.
[0072] Case 2: The clustering effect of the second center is inferior to that of the first center.
[0073] The electronic device selects a target center with the best clustering effect from the first center and the second center to replace the first center.
[0074] After at least one round of the above iterations, when the preset stop condition is met, a cluster center with the best clustering effect is selected from multiple cluster centers as the final cluster center of the clustered data.
[0075] Exemplarily, if the differences in clustering effects between the optimal clustering centers after multiple consecutive iterations are within a preset range, the iteration is stopped.
[0076] Combine the following Figure 4 , explaining why the second center after the position information mutation can improve the shortcomings of the krill swarm algorithm in local premature maturation. Figure 4 As shown, suppose there is a small ball that also starts from point C and iteratively adjusts its position on the curve through the krill swarm algorithm ( Figure 4 The dotted line in the figure shows the ball) to find the minimum value in the curve. Due to the fast convergence characteristics of the krill swarm algorithm, the ball adjusts its position within a smaller range.
[0077] In the embodiment of the present application, since the second center is generated by mutation, there is a certain probability that the second center will cross Figure 4 In addition, the second center is generated based on the first center with relatively better clustering effect, which further increases the cross Figure 4 The probability of point D in the solution, and then find the global optimal point B.
[0078] Thus, the electronic device iteratively adjusts the position information of the cluster centers based on the initialized multiple cluster centers until the preset stop condition is met. In each iteration, the first center is determined from the multiple cluster centers according to the adjusted position information of each cluster center; the second center after the position information mutation is generated through the position information of the first center; the target center with the best clustering effect is determined from the first center and the second center; and is used to replace the first center. Since the second center is generated based on the mutation of the first center, the disadvantage of local premature maturity of the krill swarm algorithm is improved.
[0079] In addition, as a way to measure the clustering effect, in an embodiment of the present application, for each cluster center, the distance between the cluster center and each cluster data is obtained based on the adjusted position information of the cluster center; and the first center is determined based on the distance between each cluster center and each cluster data.
[0080] Specifically, the electronic device obtains multiple groups of distance averages corresponding to multiple cluster centers based on the distance between each cluster center and each cluster data; selects the distance average with the smallest value from the multiple groups of distance averages, and determines the cluster center corresponding to the distance average with the smallest value as the first center.
[0081] Of course, those skilled in the art may also select the total distance between each cluster center and each cluster data as a standard for measuring the clustering effect, and the embodiments of the present application do not make specific limitations on this.
[0082] The above data processing method can be applied to clustering needs in various scenarios, such as text clustering, image clustering, information search, etc.
[0083] Taking text clustering as an example, since electronic devices are not good at performing mathematical operations directly on text data, the text data to be classified needs to be converted accordingly.
[0084] In view of this, before clustering the text data, the electronic device obtains the text data to be classified, and converts the text data to be classified into text vectors to be classified by a word vector conversion tool. The word vector conversion tool may be, but is not limited to, word2vec, TF-IDF, etc.
[0085] Based on the above data processing method, the following Figure 5 The iterative process of the above data processing method is exemplified. Figure 5 As shown, after the electronic device starts to enter the cluster analysis, the data set is initialized, wherein the object of the initialized data set is the location information of multiple cluster centers.
[0086] Then, based on the location information of multiple cluster centers after initialization, the fitness is evaluated in combination with the krill swarm algorithm, that is, the first center with the best clustering effect is selected from multiple cluster centers.
[0087] Furthermore, the electronic device adjusts the position information of each cluster center through induced motion, foraging motion and physical diffusion to achieve the purpose of updating the group, wherein the group is composed of multiple cluster centers.
[0088] Based on the updated population, the electronic device selects the first center with the best clustering effect as the "stud" to perform crossover mutation with the remaining clustering centers to obtain the second center.
[0089] A dynamic mutation is performed based on the first center and the second center, that is, a target center with the best clustering effect is selected from the first center and the second center to replace the first center.
[0090] If a stop signal indicating that the stop condition is met is not received, the process returns to the fitness evaluation step and iterates again. If a stop signal indicating that the stop condition is met is received, the corresponding optimal solution is obtained.
[0091] Six data sets from the Machine Learning Repository of UCI (University of California, Irvine) were used for verification. The experimental results showed that compared with traditional data clustering algorithms (for example, including three clustering algorithms: K-mean, K-mean++ and DBSCAN), in terms of the performance of incorrect clustering values, the mean result of K-mean was 33.90, the mean result of K-mean++ was 30.69, the mean result of DBSCAN was 36.23, and the mean value of the data processing method in the embodiment of the present application was 25.68.
[0092] Among them, the smaller the error clustering value is, the better the clustering effect is. It can be seen that the data processing method provided in the embodiment of the present application can significantly optimize the clustering accuracy.
[0093] Based on the same inventive concept, the embodiment of the present application also provides a data processing device, which is applied to an electronic device. The data processing device includes at least one functional module that can be stored in a memory in the form of software. Figure 6 As shown, from the functional point of view, the data processing device may include:
[0094] The position initialization module 201 is used to initialize the position information of multiple cluster centers, wherein the multiple cluster centers correspond to cluster data of the same category.
[0095] In the embodiment of the present application, when the computer executable instructions corresponding to the position initialization module 201 are executed by the processor, Figure 3 For the detailed description of the position initialization module 201, please refer to the detailed description of step S101.
[0096] The position iteration module 202 is used to iteratively adjust the position information of each cluster center until a preset stop condition is met, wherein adjusting the position information of each cluster center includes:
[0097] The location information of each cluster center is adjusted through the krill swarm algorithm;
[0098] Determining a first center from a plurality of cluster center points according to the adjusted position information of each cluster center;
[0099] Generate a second center with a sudden change in position information through the position information of the first center;
[0100] Determine the target center point with the best clustering effect from the first center and the second center;
[0101] Replace the first center by the target center.
[0102] In the embodiment of the present application, when the computer executable instructions corresponding to the position iteration module 202 are executed by the processor, Figure 3 For the detailed description of the position iteration module 202, please refer to the detailed description of step S102.
[0103] In a possible implementation, the position iteration module 202 is further configured to:
[0104] According to the distance between each cluster center and each cluster data, multiple groups of distance average values corresponding to multiple cluster centers are obtained;
[0105] The distance average with the smallest value is selected from multiple groups of distance averages, and the cluster center corresponding to the distance average with the smallest value is determined as the first center.
[0106] In a possible implementation, the iteration module is also used to:
[0107] Based on the first center, select the mutation center from the remaining cluster centers;
[0108] According to the position information of the first center and the position information of the mutation center, a second center after the position information mutation is generated.
[0109] Of course, the above-mentioned data processing device may also include other modules according to the functions implemented. The above-mentioned position iteration module 202 and the position initialization module 201 may also be used to implement other steps or sub-steps of the above-mentioned data processing method. The embodiment of the present application does not make specific limitations on this.
[0110] An embodiment of the present application further provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned data processing method is implemented.
[0111] In summary, in a data processing method, apparatus, device and medium provided by an embodiment of the present application, the electronic device iteratively adjusts the position information of the cluster centers based on the initialized multiple cluster centers until the preset stop condition is met. In each iteration process, the first center is determined from the multiple cluster centers according to the adjusted position information of each cluster center; the second center after the position information mutation is generated through the position information of the first center; the target center with the best clustering effect is determined from the first center and the second center; and is used to replace the first center. Since the second center is generated based on the mutation of the first center, the disadvantage of local premature maturity of the krill swarm algorithm is improved.
[0112] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0113] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0114] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0115] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0116] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: Applied to electronic equipment, the method comprises: Initializing location information of a plurality of cluster centers, wherein the plurality of cluster centers correspond to a plurality of categories of cluster data, and the cluster data belongs to a text vector to be classified; Iteratively adjusting the position information of each cluster center until a preset stop condition is met to obtain a center point close to the most reasonable cluster center, wherein adjusting the position information of each cluster center includes: Adjusting the position information of each cluster center by using a krill swarm algorithm; For each of the cluster centers, according to the adjusted position information of the cluster center, obtain the distance between the cluster center and each of the cluster data; Determine a first center according to the distance between each cluster center and each cluster data; According to the first center, selecting a mutation center from the remaining cluster centers; According to the position information of the first center and the position information of the mutation center, generating a second center after the position information is mutated; Determine a target center with the best clustering effect from the first center and the second center; The first center is replaced by the target center.
2. The data processing method according to claim 1, characterized in that: The determining the first center according to the distance between each cluster center and each cluster data includes: According to the distance between each cluster center and each of the cluster data, a plurality of groups of distance average values corresponding to the plurality of cluster centers are obtained; A distance average value with the smallest value is selected from the multiple groups of distance average values, and a cluster center corresponding to the distance average value with the smallest value is determined as the first center.
3. The data processing method according to claim 1, characterized in that: Before initializing the positions of the multiple cluster centers, the method further includes: Get the text data to be classified; The text data to be classified is converted into the text vector to be classified by a word vector conversion tool.
4. A data processing device, characterized in that: Applied to electronic equipment, the data processing device comprises: A position initialization module, used to initialize position information of a plurality of cluster centers, wherein the plurality of cluster centers correspond to a plurality of categories of cluster data, and the cluster data belongs to a text vector to be classified; A position iteration module is used to iteratively adjust the position information of each cluster center until a preset stop condition is met to obtain a center point close to the most reasonable cluster center, wherein the adjustment of the position information of each cluster center includes: Adjusting the position information of each cluster center by using a krill swarm algorithm; For each of the cluster centers, according to the adjusted position information of the cluster center, obtain the distance between the cluster center and each of the cluster data; Determine a first center according to the distance between each cluster center and each cluster data; According to the first center, selecting a mutation center from the remaining cluster centers; According to the position information of the first center and the position information of the mutation center, generating a second center after the position information is mutated; Determine a target center point with the best clustering effect from the first center and the second center; The first center is replaced by the target center.
5. The data processing device according to claim 4, characterized in that: The position iteration module is also used for: According to the distance between each cluster center and each of the cluster data, a plurality of groups of distance average values corresponding to the plurality of cluster centers are obtained; A distance average value with the smallest value is selected from the multiple groups of distance average values, and a cluster center corresponding to the distance average value with the smallest value is determined as the first center.
6. An electronic device, characterized in that: The electronic device includes a processor and a memory, the memory stores a computer program, and when the computer program is executed by the processor, the data processing method according to any one of claims 1 to 3 is implemented.
7. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the data processing method according to any one of claims 1 to 3 is implemented.
