Multi-way tree adaptive anti-collision method and system based on clustering algorithm

Through the multi-forktree adaptive anti-collision method based on clustering algorithm, the low recognition efficiency and accuracy problems caused by uneven label distribution are solved, and efficient and accurate label recognition and system stability are achieved.

CN119884802APending Publication Date: 2025-04-25SHANXI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510057660.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art cannot adapt to the unevenness of label distribution, resulting in slow identification process and low identification efficiency, affecting the accuracy and efficiency of identification.

Method used

The multi-fork tree adaptive anti-collision method based on the clustering algorithm is adopted. By initializing the query stack, receiving response information for collision judgment, clustering analysis of the response tags based on the K-Means algorithm, calculating the differences between clusters and adaptively selecting the multi-fork collision tree, and finally generating a new query prefix and repeating searches are performed.

Benefits of technology

It effectively reduces collision interference, improves the efficiency and accuracy of label identification, enhances the operating stability of the system, and provides more accurate and reliable technical support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884802A_ABST
    Figure CN119884802A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-way tree self-adaptive anti-collision method and system based on a clustering algorithm, and belongs to the technical field of computers and communication. Aiming at the problems of slow identification process, low identification efficiency and the like caused by the fact that the existing method cannot adapt to the non-uniformity of label distribution, a search instruction is sent to an animal label by initializing a query stack; receiving response information of the animal tag, and performing collision judgment on the response information according to a preset condition to obtain a judgment result; when the judgment result is that the collision occurs, performing clustering analysis on the response label to obtain a clustering result; calculating to obtain inter-cluster difference according to the result, and adaptively selecting a multi-fork collision tree in combination with the number of labels; generating a new query prefix according to the response label based on the selected multi-fork collision tree, and pressing the new query prefix into a query stack; and through the query stack, sending a search instruction based on the new query prefix to the response label to perform repeated search until the query stack is empty. According to the method, the identification efficiency is improved, and collision interference is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer and communication technology, and in particular relates to a multi-tree adaptive anti-collision method and system based on a clustering algorithm. Background Art

[0002] With the rapid development of Internet of Things technology, radio frequency identification technology has been widely used in animal tracking, warehouse management, logistics tracking and other fields. This technology has the characteristics of non-contact and fast identification, which greatly improves the efficiency and accuracy of animal management. However, in actual application, when the reader sends a query instruction, multiple tags may respond at the same time, resulting in signal collision, thus affecting the accuracy and efficiency of identification.

[0003] To solve the anti-collision problem, traditional anti-collision technologies usually rely on fixed collision handling strategies. For example, the Aloha protocol and the tree protocol both use preset fixed time slots to avoid collisions when the tag responds. However, this method cannot adapt to the uneven distribution of tags. When there are many tags and their distribution is complex, it may lead to a decrease in system performance, slow down the recognition process, and affect the efficiency of recognition. Summary of the invention

[0004] In view of the problem that existing methods cannot adapt to the uneven distribution of tags, resulting in slow recognition process and low recognition efficiency, the present invention provides a multi-tree adaptive anti-collision method and system based on a clustering algorithm to improve the efficiency and accuracy of animal tag recognition, reduce collision interference, and thereby improve the operating stability of the overall system, providing more accurate and reliable technical support for related fields.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A multi-tree adaptive anti-collision method based on a clustering algorithm, the method comprising the following steps:

[0007] Step 1: Initialize the query stack and send a search instruction to the animal tag, wherein the search instruction includes a query prefix;

[0008] Step 2: receiving the response information of the animal tag, performing collision judgment on the response information according to preset conditions, and obtaining a judgment result, wherein the judgment result is used to indicate whether a collision occurs in the current time slot, and the response information includes a sequence number and a response time;

[0009] Furthermore, the preset conditions in step 2 include:

[0010] When the response information is information returned after an animal tag responds, it is determined that the current time slot does not have a collision;

[0011] When the response information is information returned after multiple animal tags respond, it is determined that a collision occurs in the current time slot;

[0012] Step 3: When the judgment result is that a collision occurs, cluster analysis is performed on the response tag based on the K-Means algorithm to obtain a clustering result, wherein the clustering result includes the number of tag clusters and the number of tags in each tag cluster, and the response tag is the animal tag that sends the response information;

[0013] Furthermore, in step 3, cluster analysis is performed on the response labels based on the K-Means algorithm to obtain the clustering results, including:

[0014] Step 3.1: Determine the number of clusters based on the response information;

[0015] Step 3.2: construct a feature space based on the response information, and randomly select multiple initial clustering centers based on the feature space;

[0016] Step 3.3: Calculate the distance between the response label and the initial cluster center, and assign the response label to the label cluster closest to the initial cluster center according to the distance;

[0017] The distance between the response label and the initial cluster center is calculated as:

[0018]

[0019] Among them, x i represents the i-th label, C j represents the jth cluster center, represents the response time of the i-th tag, represents the serial number of the i-th tag, t j represents the response time of the jth cluster center, s j Represents the serial number of the jth cluster center;

[0020] Step 3.4: After assigning the response labels to the corresponding label clusters, recalculate the feature mean of the response labels in each label cluster as the new cluster center based on the response information;

[0021] Step 3.5: Repeat the calculation of the distance and redistribute the response labels according to the distance until the target condition is met to obtain a clustering result;

[0022] Furthermore, the target conditions include:

[0023] The number of iterations of cluster center reaches the preset maximum number of iterations;

[0024] The distance between the new cluster center and the cluster center of the previous iteration is less than the preset threshold.

[0025] Step 4: Calculate the inter-cluster differences according to the clustering results, and adaptively select a multi-branch collision tree according to the inter-cluster differences and the number of labels, wherein the multi-branch collision tree includes a binary tree and / or an octree;

[0026] Furthermore, the calculation formula of the inter-cluster difference is:

[0027]

[0028] Where D represents the difference between clusters, m represents the number of label clusters, d(C a ,C b ) represents the cluster center C of label cluster a a To the cluster center C of label cluster b b Euclidean distance; i represents an index from 1 to m-1, which is used to traverse the label cluster; j represents an index from i+1 to m, which is used to cooperate with i to traverse the label cluster.

[0029] Furthermore, the multi-branch collision tree is adaptively selected according to the difference between clusters and the number of labels, and the specific steps are:

[0030] Step 4.1: Construct a decision function based on the difference between clusters and the number of labels;

[0031] Step 4.2: Get the decision value by inputting the inter-cluster difference and the number of labels into the decision function;

[0032] Step 4.3: Compare the decision value with the value ranges corresponding to different multi-branch collision trees to obtain the corresponding multi-branch collision tree.

[0033] Step 5: Based on the selected multi-branch collision tree, generate a new query prefix according to the response label, and push the new query prefix into the query stack;

[0034] Step 6: Send a search instruction based on the new query prefix to the response tag through the query stack to perform repeated searches until the query stack is empty. The query stack is empty, indicating that all animal tags and corresponding animals have been identified.

[0035] Furthermore, the method further comprises: obtaining the location coordinate information of the animal according to the identified animal tag;

[0036] The animal's activity trajectory is generated based on multiple position coordinate information of the animal.

[0037] A multi-tree adaptive anti-collision system based on a clustering algorithm, the system comprising:

[0038] An initialization module, used for initializing a query stack and sending a search instruction to an animal tag, wherein the search instruction includes a query prefix;

[0039] A collision judgment module is used to receive the response information of the animal tag, perform collision judgment on the response information according to preset conditions, and obtain a judgment result, wherein the judgment result is used to indicate whether a collision occurs in the current time slot, and the response information includes a sequence number and a response time;

[0040] A clustering analysis module, for performing clustering analysis on the response labels based on the K-Means algorithm to obtain clustering results when the result of the judgment is that a collision occurs, wherein the clustering results include the number of label clusters and the number of labels in each label cluster;

[0041] An adaptive selection module, used to calculate the inter-cluster difference according to the clustering result, and adaptively select a multi-branch collision tree according to the inter-cluster difference and the number of labels, wherein the multi-branch collision tree includes a binary tree and / or an octree;

[0042] A prefix generation module, used for generating a new query prefix according to the response label based on the selected multi-branch collision tree, and pushing the new query prefix into the query stack;

[0043] The repeated search module is used to send a search instruction based on a new query prefix to the response tag through the query stack to perform repeated search until the query stack is empty. The query stack is empty, indicating that all animal tags and corresponding animals have been identified.

[0044] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a multi-tree adaptive anti-collision method based on a clustering algorithm are implemented.

[0045] Compared with the prior art, the present invention has the following advantages:

[0046] The present invention provides a multi-tree adaptive anti-collision method and system based on clustering algorithm, which is applied to a reader / writer. First, by initializing the query stack and sending a search instruction based on the query prefix to the animal tag, the search process can be effectively ensured to proceed in an orderly manner. By receiving the response information returned by the tag and judging whether a collision occurs in the current time slot according to the sequence number and response time of the response information, the signal conflict problem can be identified and processed in time, interference in the tag identification process can be avoided, and the accuracy of identification can be improved.

[0047] Secondly, in the event of a collision, this method performs cluster analysis on the response tags based on the K-Means clustering algorithm. It can group multiple tags according to information such as tag response time and signal strength, thereby reducing collision conflicts and improving tag recognition efficiency to obtain corresponding clustering results. In addition, the difference between clusters is calculated based on the result, and the most appropriate multi-branch collision tree structure is adaptively selected based on the difference and the number of tags, which can effectively manage the collision problem and improve query and recognition efficiency. Based on the selected multi-branch tree structure, corresponding new query prefixes are continuously generated according to different response tags and pushed into the query stack, which can refine the search for tags and ensure that each query can locate the tag position more accurately, thereby reducing collisions and improving recognition speed.

[0048] By continuously using new query prefixes to perform repeated searches until the query stack is empty, all animal tags and corresponding animals are identified. This method uses clustering algorithms and multi-branch tree structures, combined with an adaptive selection mechanism, which not only solves the tag collision problem, but also effectively improves the recognition efficiency and accuracy of the system. Compared with traditional anti-collision methods, this method is more flexible and efficient in dealing with collisions, and can adaptively select the optimal query strategy, effectively reducing collisions and query delays, thereby optimizing the recognition process of animal tags. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A flow chart of a multi-tree adaptive anti-collision method based on a clustering algorithm provided by the present invention;

[0050] Figure 2 A flow chart of a method for clustering analysis of response labels based on the K-Means algorithm provided by the present invention;

[0051] Figure 3 A schematic diagram of the structure of a multi-tree adaptive anti-collision system based on a clustering algorithm provided by the present invention. DETAILED DESCRIPTION

[0052] In order to gain a deeper understanding of the present invention, we will provide a comprehensive and detailed description of the present invention. However, the present invention has multiple implementations and is not limited to the specific examples listed herein. The presentation of these examples is intended to deepen the comprehensive understanding of the disclosure of the present invention.

[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0054] First, the application scenario of the embodiment of the present application is described. In the embodiment of the present application, a multi-tree adaptive anti-collision method based on a clustering algorithm is provided, which is applicable to but not limited to such a scenario. For example, in application scenarios such as wildlife protection, livestock management, and animal behavior monitoring, a large number of animals usually need to be identified and tracked in real time. For example, in a large ranch, each livestock can communicate with a reader by wearing a radio frequency identification tag (RFID tag) to identify each livestock, thereby realizing the refined management of individual livestock. However, due to signal interference or too many tags, multiple tags or devices may respond to signals in the same time slot, resulting in signal collision, resulting in tag recognition failure, thereby affecting the efficiency of data collection and processing. In addition, in ecological protection areas or wildlife habitats, long-term monitoring can be performed by installing RFID tags on animals. These tags can send animal location information and activity data in real time, helping researchers to analyze animal behavior and habitat changes, but due to the wide range of wildlife activities, large numbers, and frequent data transmission, the problem of signal collision is particularly prominent. To address this problem, the multi-tree adaptive anti-collision method based on clustering algorithm proposed in the embodiment of the present application can effectively avoid or reduce the occurrence of collisions by optimizing the processing process of tag responses, thereby improving the recognition efficiency of tags and ensuring the continuity and accuracy of data transmission.

[0055] The multi-tree adaptive anti-collision method based on a clustering algorithm provided in the embodiment of the present application can also be applied to other application scenarios. It is only used as an example here and is not limited to the specific application scenario.

[0056] like Figure 1 As shown, a multi-tree adaptive anti-collision method based on a clustering algorithm is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method is applied to a reader / writer, and the reader / writer is connected to an animal tag through a radio frequency signal. The method includes the following steps:

[0057] Step 1: Initialize the query stack and send a search instruction to the animal tag, wherein the search instruction includes a query prefix;

[0058] Specifically, the query stack is a data structure used to store query prefixes. The query prefix refers to a part of information used by the reader to distinguish different tags when sending a query request. This prefix can effectively filter out the target tag. The query stack is initialized to the initial state, and any remaining data is cleared to prepare for the subsequent storage of new query-related content.

[0059] Step 2: receiving the response information of the animal tag, performing collision judgment on the response information according to preset conditions, and obtaining a judgment result, wherein the judgment result is used to indicate whether a collision occurs in the current time slot, and the response information includes a sequence number and a response time;

[0060] The animal tag that receives the search command will match the query prefix in the command, and respond if it matches, otherwise it remains silent. Indicatively, if the query prefix is ​​an empty string, all animal tags respond; if the query prefix is ​​not empty, only animal tags that meet the conditions respond. The responding tag will send a response message to the reader, which may include a serial number, response time, and response signal strength. This information is used to perform real-time collision judgment based on preset conditions such as whether the response time overlaps or the similarity of the response signal strength, providing a basis for subsequent processing.

[0061] Step 3: When the judgment result is that a collision occurs, cluster analysis is performed on the response tag based on the K-Means algorithm to obtain a clustering result, wherein the clustering result includes the number of tag clusters and the number of tags in each tag cluster, and the response tag is the animal tag that sends the response information;

[0062] K-Means algorithm is a clustering algorithm that divides data objects into different clusters so that the similarity of data objects in the same cluster is high, while the similarity between different clusters is low. This algorithm can divide multiple tags into several different tag clusters according to certain characteristics such as signal strength, response time, etc., effectively reducing the complexity caused by collisions, and the tags in each cluster can be more easily distinguished and identified.

[0063] Step 4: Calculate the inter-cluster differences according to the clustering results, and adaptively select a multi-branch collision tree according to the inter-cluster differences and the number of labels, wherein the multi-branch collision tree includes a binary tree and / or an octree;

[0064] The difference between clusters can reflect the degree of distinction or distance between different label clusters, which can be quantified by performing relevant calculations on the clustering results, such as calculating the distance between the centers of different clusters. A multi-branch collision tree refers to a method of organizing query instructions through a tree structure, which can effectively solve the problem of signal collision. By comprehensively considering the size of the difference between clusters and the number of labels in different label clusters, the multi-branch collision tree that best suits the current situation is adaptively selected. Schematically, for label clusters with large differences between clusters and a large number of labels, an octree is selected for query, which is conducive to quickly distinguishing and identifying labels; if the difference between clusters is small and the number of labels is small, a binary tree is selected for query to avoid complex calculations.

[0065] Step 5: Based on the selected multi-branch collision tree, generate a new query prefix according to the response label, and push the new query prefix into the query stack;

[0066] According to the characteristics of the selected multi-branch collision tree structure and the current response tag situation, a more targeted new query prefix can be reconstructed. This new query prefix can more accurately point to the specific tag or tag group to be identified than the one originally sent, which helps to further narrow the search scope. For example, if an octree is selected, a new query prefix can be generated based on the first 3 bits of the response tag. If a binary tree is selected, a new query prefix can be generated based on the first bit of the response tag. The new query prefix is ​​stored in the query stack, and then the query prefix stored in the stack can be searched in sequence to achieve a process of gradually and accurately identifying tags.

[0067] Step 6: Send a search instruction based on the new query prefix to the response tag through the query stack to perform repeated searches until the query stack is empty. The query stack is empty, indicating that all animal tags and corresponding animals have been identified.

[0068] Specifically, the query prefixes stored in the query stack can be retrieved one by one and the corresponding search instructions can be sent to the animal tags. This process can be repeated continuously to continuously narrow the search scope and identify the animal tags more carefully and accurately. By checking the query stack, if the stack is not empty, the search is repeated; if the stack is empty, the anti-collision process ends, which means that the search and identification of all possible animal tags has been completed.

[0069] Furthermore, the preset conditions in step 2 include:

[0070] When the response information is information returned after an animal tag responds, it is determined that the current time slot does not have a collision;

[0071] When the response information is information returned after multiple animal tags respond, it is determined that a collision occurs in the current time slot.

[0072] Specifically, if the reader receives only a reply from a specific animal tag after sending a search command, this indicates that only one tag is responding in the current communication time slot, and no other tags are interfering. Therefore, it is judged that there is no signal collision in the current time slot. If the reader receives replies from multiple different animal tags after sending a search command, this means that there are multiple tags responding at the same time in the current communication time slot. These signals will interfere with each other, resulting in a signal collision, thereby affecting the reader's correct recognition of the tag, and the current time slot is judged to have a signal collision.

[0073] Furthermore, in step 3, cluster analysis is performed on the response labels based on the K-Means algorithm to obtain the specific steps of the clustering results as follows: Figure 2 As shown, the following steps are included:

[0074] Step 3.1: Determine the number of clusters based on the response information;

[0075] Step 3.2: construct a feature space based on the response information, and randomly select multiple initial clustering centers based on the feature space;

[0076] Step 3.3: Calculate the distance between the response label and the initial cluster center, and assign the response label to the label cluster closest to the initial cluster center according to the distance;

[0077] Step 3.4: After assigning the response labels to the corresponding label clusters, recalculate the feature mean of the response labels in each label cluster as the new cluster center based on the response information;

[0078] Step 3.5: Repeat the calculation of the distance and redistribute the response labels according to the distance until the target condition is met to obtain a clustering result;

[0079] After receiving the response information of the response tag, the two key information, the serial number and the response time, can be extracted to determine the number of clusters. Specifically, the serial number can uniquely identify each animal tag, and the tags corresponding to different serial numbers may show different regularities or grouping characteristics in terms of response time and other aspects. By analyzing the distribution of serial numbers and corresponding response times in the response information of many tags, for example, observing the tag groups with similar response times and possible correlation in the serial numbers, it can be roughly judged that these tags should be divided into several categories, thereby determining the number of clusters. Using the serial number and response time as dimensions, a feature space can be constructed, and the response information of each response tag corresponds to a point in the feature space, and multiple response tags constitute a set of data points, and then several points can be randomly selected from the set of data points as the initial clustering centers.

[0080] According to the feature space, the distance between each response tag and each initial cluster center is calculated. This distance can be Euclidean distance or Manhattan distance, etc., which is not limited here. For each response tag, find the initial cluster center closest to it, and divide this response tag into the tag cluster represented by the initial cluster center, so that the response tags with similar distances in the feature space can be classified into the same category, that is, tags with similar response time and serial number features are clustered together to form a preliminary cluster division. For each tag cluster that has been formed, the mean of the feature values ​​(coordinate values ​​of the processed serial number and response time) corresponding to all response tags in the tag cluster in the feature space can be taken as the new cluster center. This new cluster center can better represent the average feature of the tags in the current tag cluster and prepare for re-clustering adjustment. It will not stop until the cluster adjustment meets certain target conditions, and the clustering result is obtained. Through this process, the response tags that collide can be reasonably classified, which helps to improve the effect of multi-tree adaptive anti-collision and ensure that the system can formulate appropriate anti-collision strategies according to different tag clusters.

[0081] Furthermore, the calculation formula for the distance between the response label and the initial cluster center in step 3.3 is:

[0082]

[0083] Among them, x i represents the i-th label, C j represents the jth cluster center, represents the response time of the i-th tag, represents the serial number of the i-th tag, t j represents the response time of the jth cluster center, s j Represents the sequence number of the j-th cluster center.

[0084] Furthermore, the target conditions in step 3.5 include:

[0085] The number of iterations of cluster center reaches the preset maximum number of iterations;

[0086] The distance between the new cluster center and the cluster center of the previous iteration is less than the preset threshold.

[0087] In the above clustering analysis process, in some special data distributions or improper selection of the initial cluster center, if there is no limit on the number of iterations, the algorithm may fall into endless iterations and fail to obtain stable results. Then, the maximum number of iterations can be set to ensure that the algorithm ends within limited time and computing resources. Alternatively, a preset threshold can be set to reflect whether the clustering process has converged. When the distance between the new cluster center and the cluster center of the previous round is less than the preset threshold, it means that the cluster center no longer has significant changes, and accordingly, the distribution of response labels in each cluster tends to be stable. Unlike a fixed number of iterations, the convergence condition based on the cluster center distance is an adaptive stopping mechanism. For example, for simple data distribution, clustering may meet the convergence condition within a fewer number of iterations, and the algorithm can end early to save computing resources; for complex data distribution, the algorithm will continue to iterate until the cluster center is stable. This method can flexibly determine the stop time of the algorithm according to the specific situation of the data, while ensuring the accuracy of the clustering results, while reducing unnecessary calculations as much as possible.

[0088] Furthermore, in step 4, the inter-cluster differences are calculated based on the clustering results, and the calculation formula of the inter-cluster differences is:

[0089]

[0090] Where D represents the difference between clusters, m represents the number of label clusters, d(C a ,C b ) represents the cluster center C of label cluster a a To the cluster center C of label cluster b b Euclidean distance; i represents an index from 1 to m-1, which is used to traverse the label cluster; j represents an index from i+1 to m, which is used to cooperate with i to traverse the label cluster.

[0091] In step 4, a multi-branch collision tree is adaptively selected according to the difference between clusters and the number of labels. The specific steps are:

[0092] Step 4.1: Construct a decision function based on the difference between clusters and the number of labels;

[0093] Step 4.2: Get the decision value by inputting the inter-cluster difference and the number of labels into the decision function;

[0094] Step 4.3: Compare the decision value with the value ranges corresponding to different multi-branch collision trees to obtain the corresponding multi-branch collision tree.

[0095] The decision function can be constructed by comprehensively considering the inter-cluster differences and the number of labels in a weighted summation manner. This function provides a unified framework to evaluate the current label distribution, avoiding the unreasonable choices that may be caused by considering only a single factor. The decision value is obtained by substituting the actual calculated inter-cluster differences and the number of labels into the decision function for calculation. By comparing the decision value with the value range corresponding to different multi-branch collision trees, the most suitable multi-branch collision tree can be selected for label recognition under different label distributions, thereby improving recognition efficiency and accuracy.

[0096] Furthermore, the method further comprises: obtaining the location coordinate information of the animal according to the identified animal tag;

[0097] The animal's activity trajectory is generated based on multiple position coordinate information of the animal.

[0098] Specifically, multiple readers can be arranged in a certain area, and the location coordinates of the animals can be determined by positioning methods such as signal strength and arrival time difference, combined with the identification information of the identified animal tags. And as time goes by, the location coordinates of the animals are continuously obtained, and by connecting these coordinate points in chronological order, the activity trajectory of the animals in a certain period of time can be depicted. This activity trajectory is of great significance for studying animal behavior habits such as foraging routes, migration paths, etc., animal management such as monitoring livestock activity range in pastures, and wildlife protection. It can not only deeply understand the behavior patterns and ecological needs of animals, but also provide strong data support for animal protection, ecological monitoring and scientific research.

[0099] Specifically, multiple readers can be deployed in a specific area, and the real-time coordinates of the animals can be accurately determined by positioning technologies such as signal strength and arrival time difference, combined with the identification information of the identified animal tags. As time goes by, the location coordinates of the animals are continuously obtained, and these data points are connected in chronological order to depict the activity trajectory of the animals over a period of time. In this way, not only can the behavior patterns of animals, such as foraging paths and migration routes, be deeply studied, but it also has important application value in animal management, such as monitoring the range of livestock activities in pastures, and the protection and ecological monitoring of wild animals.

[0100] In the above multi-branch tree adaptive anti-collision method based on clustering algorithm, the reader is first connected to the animal tag through a radio frequency signal, and after initializing the query stack, a search instruction containing a query prefix is ​​sent to the animal tag. This step provides a starting operation for subsequent tag identification, thereby ensuring the orderly development of the entire identification process. The reader receives the response information of the animal tag and makes a collision judgment based on preset conditions, ensuring accurate judgment of whether a collision occurs in the current time slot, avoiding signal interference, and improving communication reliability. When the judgment result is a collision, the response tag is clustered based on the K-Means algorithm, and the response tags are effectively grouped according to similarity, reducing conflicts and redundant communications between tags, and obtaining clustering results such as the number of tag clusters and the number of tags in each tag cluster. This clustering process can effectively group the colliding tags and provide data support for the subsequent selection of a suitable multi-branch collision tree.

[0101] By calculating the difference between clusters based on the clustering results and adaptively selecting a multi-branch collision tree based on the number of tags, this adaptive selection method can optimize the search path according to the actual situation and improve the recognition efficiency. Finally, based on the selected multi-branch collision tree, a new query prefix is ​​generated according to the response tag and pushed into the query stack. The query stack sends a search instruction based on the new query prefix to the response tag for repeated search until the query stack is empty, completing the recognition of all animal tags and corresponding animals. This recognition process can accurately identify each animal tag and ensure the accuracy of tag recognition in animal management. Compared with the traditional anti-collision method, this method makes the animal tag recognition process more efficient and accurate by adaptively selecting multi-branch collision trees and clustering analysis, thereby improving the efficiency and reliability of tag recognition.

[0102] like Figure 3 As shown, the present invention also provides a multi-tree adaptive anti-collision system based on a clustering algorithm, the system comprising:

[0103] An initialization module, used for initializing a query stack and sending a search instruction to an animal tag, wherein the search instruction includes a query prefix;

[0104] A collision judgment module is used to receive the response information of the animal tag, perform collision judgment on the response information according to preset conditions, and obtain a judgment result, wherein the judgment result is used to indicate whether a collision occurs in the current time slot, and the response information includes a sequence number and a response time;

[0105] A clustering analysis module, for performing clustering analysis on the response labels based on the K-Means algorithm to obtain clustering results when the result of the judgment is that a collision occurs, wherein the clustering results include the number of label clusters and the number of labels in each label cluster;

[0106] An adaptive selection module, used to calculate the inter-cluster difference according to the clustering result, and adaptively select a multi-branch collision tree according to the inter-cluster difference and the number of labels, wherein the multi-branch collision tree includes a binary tree and / or an octree;

[0107] A prefix generation module, used for generating a new query prefix according to the response label based on the selected multi-branch collision tree, and pushing the new query prefix into the query stack;

[0108] The repeated search module is used to send a search instruction based on a new query prefix to the response tag through the query stack to perform repeated search until the query stack is empty. The query stack is empty, indicating that all animal tags and corresponding animals have been identified.

[0109] The system is divided into six main modules. The query stack is initialized through the initialization module, and a search instruction containing a query prefix is ​​sent to the animal tag, ensuring the smooth progress of the subsequent identification process. At the same time, the design of the query prefix lays the foundation for interaction with different animal tags. The collision judgment module receives the response information of the animal tag, and according to the preset conditions, performs collision judgment on the response information containing the serial number, response time and response signal strength, and obtains the judgment result used to characterize whether a collision occurs in the current time slot, which provides a basis for subsequent targeted processing and ensures that the system can make appropriate decisions based on actual conditions.

[0110] When the collision judgment module determines that a collision has occurred, the clustering analysis module performs clustering analysis on the response labels based on the K-Means algorithm, and then obtains clustering results covering the number of label clusters and the number of labels in each label cluster. The clustering operation of this module can reasonably group the colliding labels, provide important data support for further processing of subsequent modules, and help improve the overall recognition efficiency and accuracy. The adaptive selection module calculates the differences between clusters based on the clustering results, and through adaptive selection based on the number of labels, it can select the most suitable multi-branch collision tree based on the actual label distribution and differences, optimize the search path, and effectively improve the efficiency of the entire system in identifying animal labels.

[0111] The prefix generation module generates a new query prefix according to the response tag based on the multi-branch collision tree selected by the adaptive selection module, and pushes it into the query stack, ensuring the dynamic update of the query prefix to make it fit the current recognition situation, providing accurate guidance for subsequent repeated searches, and continuously advancing the recognition of animal tags. Finally, the repeated search module can send a search instruction based on the new query prefix to the response tag for repeated searches by checking the query stack, ensuring that the system can accurately identify each animal tag until the query stack is empty, achieving comprehensive and accurate recognition of animal tags, and improving the reliability of tag recognition in animal management.

[0112] This system not only effectively solves the anti-collision problem and realizes efficient and accurate identification of animal tags, but also helps managers to obtain animal-related information in a timely manner, avoids management inconveniences caused by tag identification problems, improves the overall efficiency and accuracy of animal management work, and ensures the smooth implementation of animal management activities.

[0113] Furthermore, the cluster analysis module performs cluster analysis on the response labels based on the K-Means algorithm to obtain clustering results, including:

[0114] Step 3.1: Determine the number of clusters based on the response information;

[0115] Step 3.2: construct a feature space based on the response information, and randomly select multiple initial clustering centers based on the feature space;

[0116] Step 3.3: Calculate the distance between the response label and the initial cluster center, and assign the response label to the label cluster closest to the initial cluster center according to the distance;

[0117] Step 3.4: After assigning the response labels to the corresponding label clusters, recalculate the feature mean of the response labels in each label cluster as the new cluster center based on the response information;

[0118] Step 3.5: Repeat the calculation of the distance and redistribute the response labels according to the distance until the target condition is met to obtain a clustering result.

[0119] Furthermore, the distance calculation formula is:

[0120]

[0121] Among them, x i represents the i-th label, C j represents the jth cluster center, represents the response time of the i-th tag, represents the serial number of the i-th tag, t j represents the response time of the jth cluster center, s j Represents the sequence number of the j-th cluster center.

[0122] Furthermore, the target conditions in step 3.5 include:

[0123] The number of iterations of cluster centers reaches the preset maximum number of iterations; or,

[0124] The distance between the new cluster center and the cluster center of the previous iteration is less than the preset threshold.

[0125] Furthermore, the inter-cluster differences in the adaptive selection module are obtained by the following method:

[0126]

[0127] Where D represents the difference between clusters, m represents the number of label clusters, d(C a ,C b ) represents the cluster center C of label cluster a a To the cluster center C of label cluster b b Euclidean distance; i represents an index from 1 to m-1, which is used to traverse the label cluster; j represents an index from i+1 to m, which is used to cooperate with i to traverse the label cluster.

[0128] Furthermore, the preset conditions in the collision judgment module include:

[0129] When the response information is information returned after an animal tag responds, it is determined that the current time slot does not have a collision;

[0130] When the response information is information returned after multiple animal tags respond, it is determined that a collision occurs in the current time slot.

[0131] Furthermore, the adaptive selection module adaptively selects a multi-branch collision tree according to the difference between clusters and the number of labels, including:

[0132] Step 4.1: Construct a decision function based on the difference between clusters and the number of labels;

[0133] Step 4.2: Get the decision value by inputting the inter-cluster difference and the number of labels into the decision function;

[0134] Step 4.3: Compare the decision value with the value ranges corresponding to different multi-branch collision trees to obtain the corresponding multi-branch collision tree.

[0135] Furthermore, the system may also include a motion trajectory module, which is used to:

[0136] According to the identified animal tags, obtain the location coordinate information of the animal;

[0137] The animal's activity trajectory is generated based on multiple position coordinate information of the animal.

[0138] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a multi-tree adaptive anti-collision method based on a clustering algorithm of the present application are implemented. A multi-core processor is preferably used to improve the parallel processing capability of the system. Memory: Provides sufficient temporary storage space to support the operation of the program and the processing of data. The memory capacity should be large enough to accommodate a large amount of supply information and computing tasks.

[0139] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of a multi-tree adaptive anti-collision method based on a clustering algorithm of the present application are implemented. The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid-state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM).

[0140] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in the field. Although the illustrative specific embodiments of the present invention are described above to facilitate the understanding of the present invention by the technical personnel in the field, it should be clear that the present invention is not limited to the scope of the specific embodiments. For the ordinary technical personnel in the field, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A multi-tree adaptive anti-collision method based on clustering algorithm, characterized in that: The method comprises the following steps: Step 1: Initialize the query stack and send a search instruction to the animal tag, wherein the search instruction includes a query prefix; Step 2: receiving the response information of the animal tag, performing collision judgment on the response information according to preset conditions, and obtaining a judgment result, wherein the judgment result is used to indicate whether a collision occurs in the current time slot, and the response information includes a sequence number and a response time; Step 3: When the judgment result is that a collision occurs, cluster analysis is performed on the response tag based on the K-Means algorithm to obtain a clustering result, wherein the clustering result includes the number of tag clusters and the number of tags in each tag cluster, and the response tag is the animal tag that sends the response information; Step 4: Calculate the inter-cluster differences according to the clustering results, and adaptively select a multi-branch collision tree according to the inter-cluster differences and the number of labels, wherein the multi-branch collision tree includes a binary tree and / or an octree; Step 5: Based on the selected multi-branch collision tree, generate a new query prefix according to the response label, and push the new query prefix into the query stack; Step 6: Send a search instruction based on the new query prefix to the response tag through the query stack to perform repeated searches until the query stack is empty. The query stack is empty, indicating that all animal tags and corresponding animals have been identified.

2. The multi-tree adaptive anti-collision method based on clustering algorithm according to claim 1, characterized in that: The preset conditions in step 2 include: When the response information is information returned after an animal tag responds, it is determined that the current time slot does not have a collision; When the response information is information returned after multiple animal tags respond, it is determined that a collision occurs in the current time slot.

3. The multi-tree adaptive anti-collision method based on clustering algorithm according to claim 2, characterized in that: In step 3, cluster analysis is performed on the response labels based on the K-Means algorithm to obtain the clustering results, including: Step 3.1: Determine the number of clusters based on the response information; Step 3.2: construct a feature space based on the response information, and randomly select multiple initial clustering centers based on the feature space; Step 3.3: Calculate the distance between the response label and the initial cluster center, and assign the response label to the label cluster closest to the initial cluster center according to the distance; Step 3.4: After assigning the response labels to the corresponding label clusters, recalculate the feature mean of the response labels in each label cluster as the new cluster center based on the response information; Step 3.5: Repeat the calculation of the distance and redistribute the response labels according to the distance until the target condition is met to obtain a clustering result.

4. The multi-tree adaptive anti-collision method based on clustering algorithm according to claim 3 is characterized in that: The calculation formula for the distance between the response label and the initial cluster center in step 3.3 is: Among them, x i represents the i-th label, C j represents the jth cluster center, represents the response time of the i-th tag, represents the serial number of the i-th tag, t j represents the response time of the jth cluster center, s j Represents the sequence number of the j-th cluster center.

5. The multi-tree adaptive anti-collision method based on clustering algorithm according to claim 4 is characterized in that: The target conditions in step 3.5 include: The number of iterations of cluster centers reaches the preset maximum number of iterations; or, The distance between the new cluster center and the cluster center of the previous iteration is less than the preset threshold.

6. The multi-tree adaptive anti-collision method based on clustering algorithm according to claim 5, characterized in that: In step 4, the inter-cluster differences are calculated based on the clustering results. The calculation formula for the inter-cluster differences is: Where D represents the difference between clusters, m represents the number of label clusters, d(C a ,C b ) represents the cluster center C of label cluster a a To the cluster center C of label cluster b b Euclidean distance; i represents an index from 1 to m-1, which is used to traverse the label cluster; j represents an index from i+1 to m, which is used to cooperate with i to traverse the label cluster.

7. The multi-tree adaptive anti-collision method based on clustering algorithm according to claim 6, characterized in that: In step 4, a multi-branch collision tree is adaptively selected according to the difference between clusters and the number of labels. The specific steps are: Step 4.1: Construct a decision function based on the difference between clusters and the number of labels; Step 4.2: Get the decision value by inputting the inter-cluster difference and the number of labels into the decision function; Step 4.3: Compare the decision value with the value ranges corresponding to different multi-branch collision trees to obtain the corresponding multi-branch collision tree.

8. The multi-tree adaptive anti-collision method based on clustering algorithm according to claim 7, characterized in that: The method further comprises: According to the identified animal tags, obtain the location coordinate information of the animal; The animal's activity trajectory is generated based on multiple position coordinate information of the animal.

9. A multi-tree adaptive anti-collision system based on clustering algorithm, characterized in that: The system comprises: An initialization module, used for initializing a query stack and sending a search instruction to an animal tag, wherein the search instruction includes a query prefix; A collision judgment module is used to receive the response information of the animal tag, perform collision judgment on the response information according to preset conditions, and obtain a judgment result, wherein the judgment result is used to indicate whether a collision occurs in the current time slot, and the response information includes a sequence number and a response time; A clustering analysis module, for performing clustering analysis on the response labels based on the K-Means algorithm to obtain clustering results when the result of the judgment is that a collision occurs, wherein the clustering results include the number of label clusters and the number of labels in each label cluster; An adaptive selection module, used to calculate the inter-cluster difference according to the clustering result, and adaptively select a multi-branch collision tree according to the inter-cluster difference and the number of labels, wherein the multi-branch collision tree includes a binary tree and / or an octree; A prefix generation module, used for generating a new query prefix according to the response label based on the selected multi-branch collision tree, and pushing the new query prefix into the query stack; The repeated search module is used to send a search instruction based on a new query prefix to the response tag through the query stack to perform repeated search until the query stack is empty. The query stack is empty, indicating that all animal tags and corresponding animals have been identified.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.