Cost detection method, device and equipment, readable storage medium and product

By performing dimensionality reduction and clustering on the cost data, and combining it with a multi-decision tree model, the problem of inaccurate detection results caused by poor data quality was solved, thereby improving the comprehensiveness and reliability of cost detection.

CN121350601APending Publication Date: 2026-01-16AKSU PREFECTURE BRANCH OF CHINA MOBILE GRP XINJIANG +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511241860.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-01
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

Existing supervised learning-based cost anomaly detection models suffer from severely compromised accuracy when data quality is poor, especially when there are human error issues or equipment malfunctions during cost data collection.

Method used

Principal component feature sets are extracted by dimensionality reduction of cost data. Clustering is used to group principal component feature sets with high similarity into one class. Multiple decision tree models are used for screening, and different decision trees are assigned different weights. Finally, the screening result with the highest weight is determined as the final anomaly detection result.

Benefits of technology

It effectively eliminates redundant information caused by the correlation between features, reduces cross-category detection interference, improves the comprehensiveness and reliability of cost detection, and enhances the accuracy of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121350601A_ABST
    Figure CN121350601A_ABST
Patent Text Reader

Abstract

The invention discloses a cost detection method, device and equipment, a readable storage medium and a product. The method comprises the following steps: acquiring cost data of a plurality of objects; performing dimension reduction processing on related cost features in the cost data of the plurality of objects to obtain a principal component feature set of each object; clustering the principal component feature sets of the plurality of objects based on the similarity between the principal component feature sets of the objects to obtain a plurality of feature clusters, each feature cluster being associated with a category label; inputting the principal component feature set and the corresponding category label into a detection model; through a plurality of decision trees in the detection model, according to a screening rule of each decision tree node, screening the principal component feature set and the corresponding cost category label, and outputting a screening result; and based on the preset weight of each decision tree, determining the screening result with the highest weight as a final anomaly detection result. According to the embodiment of the invention, the cost detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of data processing technology, and in particular relates to a method, apparatus, equipment, readable storage medium and product for detecting cost anomalies. Background Technology

[0002] Expense anomaly detection is a crucial step in ensuring the standardized operation of various economic activities. By analyzing various expense data, it identifies expense records that deviate from standard patterns, providing key support for enterprise cost control and risk prevention. For example, data related to tower service fees, logistics and transportation costs, engineering supervision fees, and advertising placement fees all rely heavily on this technology.

[0003] Among existing anomaly detection methods, supervised learning-based anomaly detection models are widely used. However, these models are highly dependent on the quality of the data during the learning process, and the quality of the data directly affects the model's learning ability.

[0004] In real-world applications, the collection of cost data can be flawed due to human error or equipment malfunctions. If this type of model is directly applied to detect anomalies in cost calculations from such statistical data, the accuracy of the detection results will be severely compromised. Summary of the Invention

[0005] This application provides a method, apparatus, device, computer storage medium, and program product for cost detection, which can improve the accuracy of detection results.

[0006] On one hand, embodiments of this application provide a cost detection method, the method comprising: acquiring cost data of multiple objects; performing dimensionality reduction processing on relevant cost features in the cost data of the multiple objects to obtain principal component feature sets for each object; clustering the principal component feature sets of the multiple objects based on the similarity between the principal component feature sets of each object to obtain multiple feature clusters, each feature cluster being associated with a category label; inputting the principal component feature sets and their corresponding category labels into a detection model; filtering the principal component feature sets and their corresponding cost category labels through multiple decision trees in the detection model according to the filtering rules of each decision tree node, and outputting the filtering results; and determining the filtering result with the highest weight as the final anomaly detection result based on the preset weights of each decision tree.

[0007] According to an embodiment of the first aspect of this application, the method further includes: obtaining a training sample set of objects, the training sample set including multiple training samples, each training sample including multiple cost features and cost category labels of objects; randomly extracting cost features and / or cost category labels of objects from the training sample set to obtain multiple sample subsets; training decision trees based on the multiple sample subsets to obtain multiple decision trees; and combining the multiple decision trees to obtain the detection model.

[0008] According to an embodiment of the first aspect of this application, the step of randomly extracting cost features from the training sample set to obtain multiple sample subsets includes: obtaining a number threshold for the decision tree; and, based on the number threshold of the decision tree, randomly extracting cost features from the training sample set to obtain a sample subset of the number threshold.

[0009] According to an embodiment of the first aspect of this application, before randomly extracting cost features from the training sample set to obtain multiple sample subsets, the method further includes: performing dimensionality reduction processing on the relevant cost features in the training sample set to obtain a dimensionality-reduced training sample set.

[0010] According to an embodiment of the first aspect of this application, training decision trees based on multiple sample subsets to obtain multiple decision trees includes: determining the filtering rules for each decision tree node in each decision tree based on the multiple sample subsets; wherein the depth of each decision tree satisfies a depth threshold for decision trees; and classifying the values ​​of cost features and / or cost category labels of objects in the sample subsets using the filtering rules of the decision tree nodes to obtain decision trees.

[0011] According to an embodiment of the first aspect of this application, each of the cost features and / or object cost category labels includes multiple candidate values, which are determined based on the value of each cost feature and / or object cost category label. Determining the screening rules for each decision tree node in each decision tree includes: calculating the Gini index of each candidate value of the multiple cost features and / or object cost category labels in each sample subset; determining the cost feature or object cost category label corresponding to the minimum Gini index as a candidate cost feature or candidate category label; calculating the information gain ratio of each candidate value among the candidate cost features or candidate cost category labels; and generating screening rules based on the candidate cost feature or candidate cost category label and the candidate value of the maximum information gain ratio when the candidate value of the maximum information gain ratio is equal to the candidate value corresponding to the minimum Gini index.

[0012] According to an embodiment of the first aspect of this application, before obtaining the number threshold of the decision tree, the method further includes: obtaining multiple combinations of the depth potential value and the number potential value of the decision tree for a first test sample, wherein the first test sample includes a real label; mapping each combination to a position vector in a particle swarm, initializing the velocity vector corresponding to the position vector, and constructing an initial particle swarm; constructing a decision tree based on the depth potential value and the number potential value of each combination to obtain an initial detection model; inputting the test sample into the initial detection model and outputting a prediction result; calculating a fitness value based on the degree of matching between the prediction result and the real label; recording the position of the particle with the highest fitness value as the global optimal position, and recording the position corresponding to the historical optimal fitness of each particle as the individual optimal position; calculating a particle velocity update amount based on the global optimal position and the individual optimal position; adjusting the particle position according to the particle velocity update amount, and if the updated particle position meets a preset condition, outputting the depth potential value corresponding to the updated particle position as the depth threshold, and the number potential value corresponding to the updated particle position as the number threshold.

[0013] According to an embodiment of the first aspect of this application, after training decision trees based on multiple sample subsets to obtain multiple decision trees, the method further includes: obtaining a second test sample set; inputting the second test sample set into the multiple decision trees and outputting test results respectively; comparing the test results with the true labels to obtain the number of correctly classified abnormal samples, the number of abnormal samples misclassified, and the number of normal samples misclassified for each decision tree; calculating the precision and recall of each decision tree based on the number of correctly classified abnormal samples, the number of abnormal samples misclassified, and the number of normal samples misclassified for each decision tree; and weighting and harmonicizing the precision and recall of each tree using weight coefficients to obtain the preset weights for each tree.

[0014] On the other hand, embodiments of this application provide a cost detection device, comprising: a dimensionality reduction module for performing dimensionality reduction processing on relevant cost features in the cost data of the plurality of objects to obtain a principal component feature set for each object; a clustering module for clustering the principal component feature sets of the plurality of objects based on the similarity between the principal component feature sets of each object to obtain multiple feature clusters, each feature cluster being associated with a category label; an input module for inputting the principal component feature sets and their corresponding category labels into a detection model; a filtering module for filtering the principal component feature sets and their corresponding cost category labels through multiple decision trees in the detection model according to the filtering rules of each decision tree node, and outputting the filtering results; and a weighting module for determining the filtering result with the highest weight as the final anomaly detection result based on the preset weights of each decision tree.

[0015] In another aspect, embodiments of this application provide a cost detection device, the device including: a processor and a memory storing computer program instructions; the processor implements the cost detection method when executing the computer program instructions.

[0016] In another aspect, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the aforementioned cost detection method.

[0017] In another aspect, embodiments of this application provide a computer program product, wherein the instructions in the computer program product, when executed by the processor of an electronic device, cause the electronic device to perform the aforementioned fee detection method.

[0018] The cost detection method, apparatus, device, readable storage medium, and product of this application extract principal component feature sets through dimensionality reduction processing, effectively eliminating redundant information caused by the correlation between features. Simultaneously, clustering groups principal component feature sets with high similarity into one class, further subdividing objects according to category labels, thereby reducing interference from cross-category detection. Based on this, the cost after dimensionality reduction and clustering is input into a multi-decision-tree detection model. Different decision trees set filtering rules for different feature dimensions in the principal component feature sets, enabling multiple decision trees to cover multiple dimensions of detection, improving the comprehensiveness of cost detection. Furthermore, since the filtering rules for different feature dimensions differ, the ability of different decision trees to identify different types of abnormal costs also varies. Therefore, the filtering result with the highest weight is used as the final abnormal result, highlighting the identification result corresponding to the decision tree with stronger identification ability, ensuring the reliability of the result, and reducing the risk of misjudgment by a single model. Thus, the collaborative processing of dimensionality reduction and clustering, on the one hand, eliminates redundant information, and on the other hand, reduces interference from cross-category detection, optimizing data quality through a dual effect and providing high-quality input data for the detection model. Meanwhile, multiple decision trees, through weighted balancing of the comprehensiveness and reliability of the detection, ultimately improved the accuracy of cost detection. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a schematic flowchart of a cost detection method provided in one embodiment of this application;

[0021] Figure 2 This is a flowchart illustrating a cost detection method provided in another embodiment of this application;

[0022] Figure 3 This is a flowchart illustrating a cost detection method provided in yet another embodiment of this application;

[0023] Figure 4 This is a flowchart illustrating a cost detection method provided in yet another embodiment of this application;

[0024] Figure 5 This is a flowchart illustrating a cost detection method provided in yet another embodiment of this application;

[0025] Figure 6 This is a flowchart illustrating a cost detection method provided in yet another embodiment of this application;

[0026] Figure 7 This is a schematic diagram of the structure of a cost detection device provided in another embodiment of this application;

[0027] Figure 8 This is a schematic diagram of the structure of a cost detection device provided in another embodiment of this application. Detailed Implementation

[0028] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0029] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0030] Cost monitoring is a crucial step in ensuring the standardized operation of various economic activities. By analyzing various cost data, it identifies expense records that deviate from standard patterns, providing key support for enterprise cost control and risk prevention. For example, data related to tower service fees, logistics and transportation costs, engineering supervision fees, and advertising placement fees all rely heavily on this technology.

[0031] Among existing cost detection methods, supervised learning-based detection models are widely used. However, these models are highly dependent on data quality during the learning process, and the quality of the data directly affects the model's learning ability. In real-world applications, cost data collection can be flawed due to human error or equipment malfunctions. If these models are directly used to calculate and detect costs based on such statistical data, the accuracy of the results will be severely compromised.

[0032] To address the problems of the prior art, embodiments of this application provide a cost detection method, apparatus, device, computer-readable storage medium, and computer program product. The cost detection method provided in this application embodiment is described below first.

[0033] Figure 1 A flowchart illustrating a cost detection method according to an embodiment of this application is shown. Figure 1 As shown, the cost detection method provided in this application embodiment includes steps S101-S106.

[0034] S101: Retrieve cost data for multiple objects.

[0035] As an example, objects may include at least one of the following: different users, departments, projects, etc.; expense data may include at least one of the following: object configuration data, expense composition details, etc.

[0036] In one embodiment, the object is illustrated using a tower site as an example. The cost data may include tower site configuration data and tower cost breakdown details. Obtaining cost data for multiple objects can be done by obtaining configuration data and cost breakdown details for N tower sites.

[0037] As an example, tower site configuration data may include at least one of the following: tower type, antenna height, tower ownership, number of shared operators, equipment room type, and product configuration. Product configuration may include at least one of equipment room configuration data and environmental configuration data. Equipment room configuration data may include at least one of the following: AC distribution box, DC distribution box, combined switching power supply, and backup battery. Environmental configuration data may include at least one of the following: air conditioning, environmental monitoring, lighting, and fire protection data.

[0038] In addition, as an example, detailed data on the cost breakdown of towers can be obtained from the billing system, and may include at least one of the following: construction costs, maintenance costs, site fees, power supply fees, and power generation service fees.

[0039] S102: Perform dimensionality reduction on the relevant cost features in the cost data of multiple objects to obtain the principal component feature set for each object.

[0040] As an example, cost data can typically include many dimensions, but too many dimensions increase computational complexity and may contain redundant information, affecting the accuracy of detection results. Therefore, as an example, dimensionality reduction can compress multiple related cost features into a few principal component features. These principal component features can retain most of the information in the cost data while removing redundancy.

[0041] As an example, let's take the cost data from the aforementioned multiple tower sites as an illustration. Because there is a certain correlation between the various features, information redundancy occurs. Therefore, multiple related influencing factors can be simplified into as few irrelevant composite features as possible, reducing the computational load of data analysis and making the cost detection results more scientific and reasonable.

[0042] As one implementation of S102, Principal Component Analysis (PCA) algorithm can be used to reduce the dimensionality of relevant cost features in the cost data of multiple tower sites. Specifically, it can include the following steps:

[0043] It should be noted that this embodiment includes n tower sampling points, and each sampling point includes l features, namely tower site configuration data and cost composition details. The k-th sample is represented as x. k ∈R l (k = 1, 2, ..., n, x k (It is an l-dimensional column vector), and the sample matrix is ​​X = [x1, x2, ..., x... k ,…,x n ]∈R l×n .

[0044] Step A: Calculate the average value of all samples in each feature dimension using the following formula, and denote it as the sample mean.

[0045]

[0046] Step B: Calculate the covariance matrix S of the sample matrix according to the following formula, which is used to reflect the correlation between feature dimensions.

[0047]

[0048] Step C: Through the l×l identity matrix I lSolving the characteristic equation, we obtain the eigenvalues ​​λ1≥λ2≥…≥λ l and eigenvectors a1, a2, ..., a l The larger the eigenvalue, the more original data information the principal component represented by the eigenvector contains.

[0049] |λI l -S|=0 (3)

[0050] Step D: Extract the eigenvectors a1, a2, ..., a from the covariance matrix S. l According to the eigenvalues ​​λ1≥λ2≥…≥λ l Arrange the vectors in descending order, and take the first k vectors as the projection matrix A = [a1, a2, ..., a2] onto the k-dimensional space. k ]∈R l×k The projection matrix A and the tower service fee sample matrix X are multiplied to form the final principal component matrix U = A. T X.

[0051] Because there is correlation between the original feature dimensions—that is, between the cost features of the original cost data in this embodiment—information redundancy occurs. Therefore, by sorting the feature vectors according to their corresponding feature values ​​from largest to smallest, we can filter out the principal component directions that carry the most information and have the strongest interpretive power for the original data. The feature vectors in these directions can effectively remove redundant correlations between features. The first k sorted feature vectors are selected to form a projection matrix, and the original sample matrix is ​​projected onto the k-dimensional space of this matrix to generate the principal component matrix U. Due to the characteristics of principal component analysis, the principal components obtained after projection are mutually orthogonal (i.e., the correlation is 0), thereby completely eliminating the correlation between the original feature dimensions, while retaining the main information of the data, reducing the computational load of subsequent analysis, and improving the scientific nature of anomaly detection.

[0052] In this embodiment, after the calculation in step AD, the principal component feature dataset U consists of tower type, cable height, number of tower sharing operators, equipment room type, construction cost, maintenance cost, site cost, and power supply cost.

[0053] S103: Based on the similarity between the principal component feature sets of each object, the principal component feature sets of the multiple objects are clustered to obtain multiple feature clusters, and each feature cluster is associated with a category label.

[0054] As an example, similarity calculation can compare the principal component feature sets of different objects to determine whether their cost calculation methods are similar. Clustering can group objects with high similarity into one category, forming feature clusters. Category labels can assign a label to each feature cluster to distinguish different categories of cost calculation methods.

[0055] As an example, the data after PCA dimensionality reduction has extracted important features that affect the calculation of tower service fees. Based on this, clustering can more accurately grasp the payment characteristics of different sites. By classifying sites with different fee details and tower configurations, more targeted classification basis can be provided for subsequent anomaly detection.

[0056] As one implementation of S103, nearest neighbor propagation clustering (AP clustering) can be used to obtain the category labels of each object, which may include the following steps:

[0057] Step A: Construct the similarity matrix K(a) of tower service fee payment according to the following formula. s ,b s ), quantifying different tower sites (a s With b s The degree of similarity in cost characteristics.

[0058]

[0059] Among them, L as L bs These are the iron tower sites a s With Tower Site b s The Euclidean distance from the discrete features of service fees to the cluster point z of the index center is used to measure the distance from the tower site features to the cluster center. These are discrete feature value weights, used to adjust the influence of different features in similarity calculation, thereby more accurately reflecting the payment association between sites.

[0060] Step B: Use the F-index, obtained through multiple iterations, as the bias function and convergence criterion for nearest neighbor propagation clustering to update the similarity matrix. The formula for the updated similarity matrix is:

[0061] K(a s ,b s ) = C a +Δf×F min (5)

[0062] Where C a The median of the diagonal of the similarity matrix for tower service fee payments, Δf is the iterative retrieval threshold, and F min This represents the minimum value after multiple iterations.

[0063] The similarity matrix is ​​updated using the F-index obtained through multiple iterations as a bias function and convergence criterion. This aims to optimize the similarity calculation through iteration, making the matrix more closely reflect the actual data distribution. The median C on the diagonal is used as a criterion. a Iterative retrieval threshold Δf and iterative minimum value F minThe introduction of this method helps improve the stability and convergence speed of clustering, ensuring the reliability of the clustering results.

[0064] By continuously updating and iterating the similarity matrix, the service fee classification categories of tower sites are obtained. Tower sites with similar payment characteristics are grouped into one category, providing classified feature data for subsequent model building, so as to more accurately detect tower service fee data.

[0065] S104: Input the principal component feature set and its corresponding category label into the detection model.

[0066] As an example, the detection model can be an ensemble model consisting of multiple decision trees, such as at least one of a random forest model or a gradient boosting tree. Each decision tree can be a rule-based classification tool.

[0067] S105: By detecting multiple decision trees in the model, the principal component feature set and the corresponding cost category label are filtered according to the filtering rules of each decision tree node, and the filtering results are output.

[0068] As an example, the detection model can consist of multiple decision trees, each of which can independently process the input data. Each decision tree can contain multiple nodes, and each node can have preset filtering rules. For example, the preset filtering rules can be at least one of the following: a threshold range of a principal component feature or a matching relationship with a category label.

[0069] As an example, each decision tree filters the principal component feature set and category labels according to its own filtering logic, and outputs a judgment result on whether the cost of the object is abnormal.

[0070] S106: Based on the preset weights of each decision tree, the screening result with the highest weight is determined as the final anomaly detection result.

[0071] As an example, each decision tree can be assigned a preset weight value, which reflects the reliability or importance of the decision tree in anomaly detection. The higher the weight, the more trustworthy the decision tree's judgment. When multiple decision trees output their respective filtering results, a comprehensive judgment can be made based on the weight of each decision tree. After statistically analyzing the filtering results of all decision trees, the result supported by the decision tree with the highest weight can be taken as the final anomaly detection conclusion.

[0072] This approach, by assigning different weights to different decision trees and taking the result with the highest weight, can both integrate the judgments of multiple decision trees and highlight the influence of the better-performing decision tree, thereby improving the reliability of the final detection result.

[0073] The cost detection method in this application extracts principal component feature sets through dimensionality reduction, effectively eliminating redundant information caused by correlations between features. Simultaneously, clustering groups principal component feature sets with high similarity into one class, further subdividing objects by category label, thereby reducing interference from cross-category detection. Based on this, the cost after dimensionality reduction and clustering is input into a multi-decision-tree detection model. Different decision trees set filtering rules for different feature dimensions in the principal component feature sets, enabling multiple decision trees to cover multiple dimensions of detection, improving the comprehensiveness of cost detection. Furthermore, since the filtering rules for different feature dimensions differ, different decision trees have different focuses in identifying different types of abnormal costs. Therefore, the filtering result with the highest weight is used as the final abnormal result, highlighting the identification result corresponding to the decision tree with stronger identification ability, ensuring the reliability of the result and reducing the risk of misjudgment by a single model. Thus, the collaborative processing of dimensionality reduction and clustering, on the one hand, eliminates redundant information, and on the other hand, reduces interference from cross-category detection, optimizing data quality through a dual effect and providing high-quality input data for the detection model. Meanwhile, multiple decision trees, through weighted balancing of the comprehensiveness and reliability of the detection, ultimately improved the accuracy of cost detection.

[0074] As another implementation of this application, in order to further improve the accuracy of the detection method, before S102, the method may further include step S201, such as... Figure 2 As shown.

[0075] S201: Preprocess the cost data.

[0076] Typically, data collection can suffer from quality defects due to human error or equipment malfunction. Therefore, as an example, preprocessing the collected cost data can be performed to improve its quality.

[0077] As one implementation of S201, at least one of the missing value imputation or outlier detection methods can be used to preprocess the cost data to avoid missing and outlier values ​​caused by human error, abnormal reporting by the tower service fee calculation unit, etc., which could interfere with data detection. As an example, the cubic spline method can be used to impute missing values ​​in the cost data. The specific operation is as follows:

[0078] For the cost data X=[x1,x2, … ,x p ,…,x n Missing value x in ] p In its subinterval [x i ,x j ] within (x i , and x j(The known data points on both sides of the missing value) are processed by the cubic spline function S(x p The cubic spline function S(x) calculates smooth and continuous interpolation results to fill in missing values. p )as follows:

[0079]

[0080] Among them, e i+1 =x j -x i , represents the length of the subinterval; g i =S(x i ), g i+1 =S(x i+1 ), representing the spline function at known data points x. i x i+1 The function value at x; α and β represent the second derivative of the spline function at the endpoints x of the interval. i ,、x j The parameters at this point are used to ensure the smoothness and continuity of the curve throughout the entire data range.

[0081] Preprocessing fills in missing values ​​using cubic spline values ​​and handles outliers, making the dataset for subsequent detection more complete and accurate. This reduces the adverse impact of data quality issues on the detection results and helps improve the effectiveness and accuracy of the entire detection method.

[0082] As another implementation of this application, in order to improve the accuracy and stability of the detection, the method may further include steps S301-S304 before S104, such as... Figure 3 As shown.

[0083] S301: Obtain the training sample set of the object. The training sample set includes multiple training samples, and each training sample includes multiple cost features and the cost category label of the object.

[0084] As an example, the training sample set for an object can refer to the dataset used to train the detection model. The object can be at least one of the following entities that needs to be detected in terms of cost: a company, an individual, or a project. This dataset contains multiple samples used for the detection model to learn. As an example, cost features can be specific information representing the zero-cost attribute, such as at least one of the aforementioned tower site configuration data and tower cost composition details. Cost category labels can be explicit labels that indicate the cost nature of the sample, such as the aforementioned category labels.

[0085] As an example, the cost category label of an object can be viewed as a cost feature used to train the detection model. Since the cost category label can distinguish objects with different cost attributes, the detection model can learn cost feature patterns under different cost categories during training, thereby more accurately identifying various anomalies. This provides a more effective training foundation for subsequent detection models, ultimately improving the accuracy of cost detection.

[0086] S302: Randomly extract cost features and / or cost category labels of objects from the training sample set to obtain multiple sample subsets.

[0087] As an example, if we consider the cost category label of an object as a cost feature of that object, we can randomly select multiple cost features and a cost category label of the object from the training sample set; or we can randomly select only multiple cost features from the training sample set.

[0088] This randomness results in different data distributions for each subset, and the decision trees trained on them will learn different judgment rules. Ultimately, combining these rules can improve the generalization ability of the model.

[0089] As one implementation of this application, S302 may include the following steps A-B.

[0090] Step A: Obtain the threshold for the number of decision trees.

[0091] As an example, the specific number of decision trees that need to be built can be determined. This number can be preset, determining the total number of sample subsets to be generated subsequently.

[0092] Step B: Based on the number threshold of the decision tree, randomly extract the cost features and / or the cost category labels of the objects from the training sample set to obtain a sample subset of the number threshold.

[0093] As an example, a subset of samples can be randomly drawn from the original training sample set according to a predetermined threshold number, resulting in a subset of samples that is the same as or greater than the threshold number.

[0094] The cost detection method in this application controls the sample subset size based on a decision tree number threshold, which can balance model complexity and computational resource consumption according to actual scenario requirements. This avoids both insufficient detection model performance due to too few decision trees and redundant computation caused by too many decision trees, achieving a balance between efficiency and performance.

[0095] S303: Train decision trees based on multiple sample subsets to obtain multiple decision trees.

[0096] As an example, a separate decision tree can be trained for each of the previously obtained sample subsets. Since each sample subset is obtained through random sampling and the data distribution differs, the trained decision trees will learn different feature patterns and judgment rules.

[0097] S304: Combine multiple decision trees to obtain a detection model.

[0098] As an example, multiple trained decision trees can be integrated to form a complete detection model. In actual cost detection, this model combines the judgments of multiple decision trees, rather than relying on a single decision tree, thereby improving the accuracy and stability of the detection.

[0099] The cost detection method of this application combines the diversity brought by random sampling with the stability brought by multi-decision tree ensemble, so that the detection model can rely on specific data details while adapting to a wider range of scenarios, ultimately improving the generalization ability.

[0100] As another implementation of this application, in order to further improve the training efficiency of the detection model, the following steps may be included before S302:

[0101] Step A: Perform dimensionality reduction on the relevant cost features in the training sample set to obtain the dimensionality-reduced training sample set.

[0102] As an example, a large number of cost features increases the difficulty of training the detection model and may also affect the model's performance due to feature redundancy or noise. Dimensionality reduction of relevant cost features in the training sample set can transform multiple original cost features into a smaller number of new features, which can retain as much key information as possible from the original features. One way to implement this step is through the aforementioned PCA algorithm. This can further improve the training efficiency of the detection model, reduce the risk of overfitting, and make subsequent decision tree training more efficient and stable.

[0103] It should be noted that, as an example, after randomly selecting multiple sample subsets, the relevant cost features of each sample subset can be reduced in dimensionality to obtain multiple dimensionality-reduced sample subsets.

[0104] The cost detection method in this application first performs dimensionality reduction on the training samples, which can reduce redundant features in the training data and reduce the computational and time costs of model training; at the same time, it removes noisy features, allowing training to focus on key information and improving the efficiency and accuracy of decision tree training.

[0105] As another implementation of this application, in order to improve the reliability of the detection model classification, the method may further include steps S401-S402 before S303, such as... Figure 4 As shown.

[0106] S401: Determine the selection rules for each decision tree node in each decision tree based on multiple sample subsets; wherein the depth of each decision tree satisfies the depth threshold of the decision tree.

[0107] As an example, for each subset of samples, filtering rules can be determined for each node of the corresponding decision tree. The node filtering rules of the decision tree can be based on which cost feature and what conditions are used to partition the samples at each node. These filtering rules can be learned based on the cost features and class labels in the sample subset, with the aim of ensuring that samples within each branch belong to the same category as much as possible, such as all being normal costs or all being abnormal costs.

[0108] As an example, during training, the depth of each decision tree can meet a preset depth threshold. The depth of a decision tree refers to the path length from the root node to the deepest leaf node, which determines the complexity of the tree. Setting a depth threshold is to prevent the decision tree from becoming overly complex (too deep), avoiding overfitting to the training data, and also controlling the computational complexity of the detection model.

[0109] As one implementation of this application, each cost feature and / or object's cost category label includes multiple candidate values, which are determined based on the value of each cost feature and / or object's cost category label. S401 may include the following steps A-D:

[0110] As an example, candidate values ​​can be determined based on the actual values ​​of multiple cost features or lock-up cost features and a category label itself in each sample subset. For example, for the feature "cost amount", assuming its actual values ​​are 100 yuan, 200 yuan, 500 yuan, 1000 yuan, etc., then these specific values ​​or the intervals divided based on them (such as 0-300 yuan, 300-800 yuan, etc.) may become candidate values ​​for this feature, used for the filtering rules of decision tree nodes (e.g., "whether the cost amount is greater than 300 yuan").

[0111] Step A: Calculate the Gini index for each candidate value of the cost category label for multiple cost features and / or objects in each sample subset.

[0112] As an example, the Gini index can be a measure of data purity. The smaller the Gini index value, the purer the data, meaning the samples are more likely to belong to the same category. As another example, considering an object's cost category label as a cost feature, calculating the Gini index for each cost feature or cost category label in each sample subset, and for each candidate value of that cost feature or cost category label, can specifically include the following steps I-II:

[0113] Treating the cost category label of an object as a cost feature of that object, the dataset is divided into two split subsets, d1 and d2, for a certain value λ of feature K in the sample subset d.

[0114] Step I: Calculate the Gini index of the split subsets d1 and d2 using the following formula.

[0115]

[0116] Where H represents the number of abnormal expense categories, and C h This represents the number of abnormal cost categories for the hth type.

[0117] In this application example, the abnormal cost category can be preset as follows: tower type category 1, antenna height category 2, number of tower sharing operators category 3, equipment room type category 4, construction cost category 5, maintenance cost category 6, site fee category 7, and power supply fee category 8. When there is no abnormality, the abnormal cost category is 0.

[0118] Step II: Calculate the Gini index corresponding to the feature value λ using the following formula:

[0119]

[0120] Step B: Determine the cost feature or cost category label corresponding to the minimum Gini index as the candidate cost feature or candidate category label.

[0121] As an example, one can identify the cost feature or cost category label with the smallest Gini index from all cost features or cost category labels and designate it as a candidate cost feature or candidate cost category label. Since the smallest Gini index means that a candidate value of that cost feature or cost category label will result in the highest purity after data partitioning, this step can initially screen out the cost features or cost category labels that are most able to distinguish the sample categories.

[0122] Step C: Calculate the information gain ratio for each candidate value in the candidate cost feature or candidate category label.

[0123] As an example, information gain ratio can be used to measure the contribution of a candidate cost feature or candidate class label to sample classification. The higher the information gain ratio, the more effectively the candidate cost feature or candidate class label can distinguish samples. As an example, for the candidate cost feature or candidate class label selected in step B, the information gain ratio for each candidate value can be calculated, which may include the following steps I-III:

[0124] Step I: Calculate the splitting information using the following formula to measure the uniformity of the distribution of split subsets.

[0125]

[0126] Where L is the number of subsets after feature splitting; N dl N is the number of samples in the l-th subset; d This is the total number of samples. The larger this value is, the more uniform the distribution of the split subsets and the higher the dispersion of the feature splits.

[0127] Step II: Calculate the information gain using the following formula, which represents the degree of disorder in the split subsets after splitting.

[0128] Gai(d)=EntropyB(d)-EntroyA(d) (11)

[0129] Where EntropyB(d) is the information entropy of the sample subset d before splitting, used to measure the disorder of the sample subset d before splitting, and EntropyA(d) is the weighted sum of the information entropies of each split subset after splitting. The larger the information gain, the more significant the effect of splitting the cost feature or cost classification label on reducing disorder.

[0130] Step III: Calculate the information gain ratio using the following formula to balance the splitting effect and dispersion.

[0131]

[0132] When a sample subset is split into too many split subsets, the actual classification effect is generally poor due to excessive dispersion. To avoid this situation, it is preferable to balance the splitting effect and dispersion through information gain ratio.

[0133] Steps I-III show that the cost feature or cost category label that splits the cost evenly, significantly reduces confusion, and avoids excessive dispersion is the one with the highest contribution.

[0134] Step D: If the candidate value of the maximum information gain ratio is equal to the candidate value of the minimum Gini index, generate a screening rule based on the candidate cost feature or candidate category label and the candidate value of the maximum information gain ratio.

[0135] As an example, when the candidate value with the largest information gain ratio in the candidate cost feature or candidate category label is the same as the candidate value corresponding to the smallest Gini index in step B, it means that the candidate value can both ensure data purity and effectively distinguish samples. Therefore, the filtering rules for generating nodes are based on the candidate cost feature or candidate category label and this candidate value.

[0136] This process verifies the decision tree node partitioning rules through the dual indicators of the Gini index and information gain ratio, ensuring that the rules are more reliable and reducing the bias that a single indicator may cause.

[0137] It should be noted that if there is no candidate value with the maximum information gain ratio that is equal to the candidate value with the minimum Gini index in a certain sample subset, the sample subset can be discarded, and a new decision tree can be reconstructed using the new sample subset to generate new screening rules. In this case, in S302, random sampling is performed from the original training sample set according to the predetermined number threshold, and finally a sample subset with a number threshold is obtained.

[0138] The cost detection method in this application combines the Gini index to select the optimal feature and the information gain ratio to select the optimal segmentation threshold to determine the screening rules. This approach balances feature discriminative power and segmentation purity, ensuring the scientific rigor of decision tree node splitting. This method improves the classification accuracy of individual decision trees and provides high-quality screening rules for subsequent detection models.

[0139] S402: Use the selection rules of the decision tree nodes to classify the values ​​of the cost features in the sample subset to obtain the decision tree.

[0140] As an example, for each sample subset, the sample can be progressively divided according to the screening rules of each node of the decision tree.

[0141] For example, starting from the root node of the decision tree, the feature value of the sample is determined according to the screening rules of the root node, and it is assigned to the left branch or the right branch; after entering the next level node, the screening rules of that node are used to continue the division, and so on, until the sample reaches the leaf node.

[0142] As an example, by repeatedly classifying all samples in a subset, each branch gradually gathers samples with similar characteristics, eventually forming a complete decision tree. Each path from the root node to a leaf node in this decision tree corresponds to a set of classification logic based on cost features or cost category labels, enabling the judgment of new cost data.

[0143] The cost detection method in this application clarifies the selection rules for decision tree nodes and controls the depth of the tree, which can avoid overfitting caused by an excessively deep decision tree. Through the rule-based node selection logic, the decision-making process is made more interpretable, and the stability and reliability of the detection model classification are improved.

[0144] As another implementation of this application, in order to improve the efficiency and scientific nature of parameter selection, the method may further include steps S501-S508 before S302, such as... Figure 5 As shown.

[0145] S501: Obtain multiple combinations of depth latent values ​​and quantity latent values ​​of a first test sample and multiple decision trees, wherein the first test sample includes the true label.

[0146] As an example, the first test sample may contain a real label, specifically whether the sample data is abnormal or belongs to which category of abnormal fees, at least one of these.

[0147] As an example, the depth potential value of a decision tree can be at least one of the possible depth parameters of the decision tree, such as 3, 5, 7, etc.; the quantity potential value of a decision tree can be at least one of the possible quantity parameters of the decision tree, such as 10, 20, 30, etc.

[0148] As an example, the performance of the detection model can be maximized by combining and co-optimizing the potential values ​​of depth and number of decision trees, such as depth = 5, number = 20; depth = 7, number = 30, etc.

[0149] It should be noted that, as an example, optimization can also be performed on either the depth of the decision tree or the number of decision trees.

[0150] As one implementation of S501, preferably, the number of decision trees can be set to [1,500]; the depth of the decision trees can be set to [2,10].

[0151] S502: Map each combination to a position vector in the particle swarm, initialize the velocity vector corresponding to the position vector, and construct the initial particle swarm.

[0152] As an example, each parameter combination, such as depth potential value + quantity potential value, can be transformed into a position vector in the particle swarm optimization algorithm. Each particle's position can correspond to a set of parameters, and the velocity vector of each particle is initialized for subsequent position updates, forming the initial particle swarm. The particle swarm optimization algorithm finds the optimal solution by simulating the cooperation and competition of particles in the swarm. In this embodiment, the solution can be the optimal decision tree depth and quantity parameters.

[0153] S503: Assign the deep potential value and quantity potential value based on each combination to construct decision trees to obtain all decision trees in the initial detection model, and obtain the anomaly prediction result for each object.

[0154] S504: Input the test sample into the initial detection model and output the prediction result.

[0155] As an example, for each parameter combination, i.e., the position of each particle, a decision tree with a corresponding structure can be constructed according to its depth potential value and quantity potential value. For example, a model with depth = 5 and quantity = 20 contains 20 decision trees with a depth of 5, forming an initial detection model. Then, the first test sample is input into this model to obtain the model's output prediction results, such as which samples are judged as abnormal or the abnormal cost category of the sample.

[0156] S505: Calculate the fitness value based on the degree of matching between the abnormal prediction results of multiple objects and the true labels.

[0157] As an example, the fitness value can be a metric for measuring the quality of a parameter combination. It can be calculated by comparing the predictions of the initial detection model with the true labels of the test samples, such as whether a sample predicted as an anomaly is indeed an anomaly. The higher the degree of matching, the higher the fitness value, indicating that the parameter combination is better.

[0158] For example, the fitness of each particle can be calculated using the following formula as the fitness function of the particle swarm.

[0159]

[0160] Where J represents the fitness function value of the particle swarm; n represents the number of samples; y i This represents the actual value of the i-th sample; This represents the predicted value of the i-th sample.

[0161] S506: Record the position of the particle with the highest fitness value as the global optimal position, and record the position corresponding to the historical optimal fitness of each particle as the individual optimal position.

[0162] As an example, in a particle swarm, the global optimal position can be the position with the highest fitness value among all particles, i.e., the currently discovered optimal combination of parameters; the individual optimal position can be the position with the highest fitness value in the history of each particle. These two positions can provide a reference for the direction of subsequent particle updates.

[0163] S507: Calculate particle velocity update based on global optimal position and individual optimal position.

[0164] S508: Adjust the particle position according to the particle velocity update amount. If the updated particle position meets the preset conditions, output the depth potential value corresponding to the updated particle position as the depth threshold, and the quantity potential value corresponding to the updated particle position as the quantity threshold.

[0165] As an example, the velocity update of each particle can be calculated based on the global optimal position and the individual optimal position to determine the direction and distance of the particle's next movement, and the particle position is adjusted accordingly, i.e., the parameter combination is updated. This process is repeated until the particle position meets preset conditions, such as reaching the maximum number of iterations, or the optimal fitness value no longer increases by at least one of them. At this point, the depth potential value and the number potential value corresponding to the optimal position are output as the final decision tree depth threshold and number threshold.

[0166] For example, the position and velocity of a particle can be updated according to the following formula.

[0167] v id (k+1)=v id (k)+c1r1(Pbest id (k)-x id (k))+c2r2(Gbest id (k)-x id (k)) (14)

[0168] x id (k+1)=x id (k)+v id (k+1) (15)

[0169] Among them, v id Let c1 and c2 be the velocity of the i-th particle in the d-th dimension after k iterations; c1 and c2 are learning factors; r1 and r2 are random numbers in the range [0,1]; Pbest id Gbest represents the individual extreme value of the i-th particle in the d-th dimension. id x is the global optimal solution of the particle swarm in the d-th dimension; id Let i be the current position of the i-th particle in dimension d after k iterations; the particle velocity is limited to [-v]. max ,v max Within the range.

[0170] As an example, based on the optimized parameters, the final output of the detection model can be:

[0171]

[0172] Among them, R RF(A) represents the output of the detection model, which in this embodiment can be the final judgment result of the tower service fee detection. h represents the classification result of the decision tree, which in this embodiment can be the anomaly detection result of the tower service fee, where h = 0 indicates that the tower service fee is normal, and other values ​​correspond to different abnormal fee categories. N tree Indicates the number of decision trees. F represents the number of decision trees after optimization. β A metric used to evaluate the performance of a decision tree; a higher value indicates better classification performance for outlier samples. I[R] t (A) = h] is the indicator function, when the classification result R of the decision tree t on sample A is... t (A) The function value is 1 when it equals h, otherwise it is 0. t (A) represents the classification result of the t-th decision tree model for sample A. m(R) t ) represents the depth of the t-th decision tree. m try The termination condition for splitting a decision tree node can be, for example, set as the depth threshold of the optimized decision tree. When the depth of the decision tree exceeds this threshold, the node stops splitting.

[0173] The entire process uses the particle swarm optimization algorithm to iteratively optimize and automatically select the parameters that enable the detection model to perform best, avoiding the blindness of manual trial and error and improving the scientific nature of model parameter selection.

[0174] The cost detection method in this application utilizes a particle swarm optimization algorithm to automatically search for the optimal depth and number thresholds of the decision tree, replacing manual parameter tuning and improving the efficiency and scientific rigor of parameter selection. By optimizing parameter combinations, the performance of the detection model can be maximized, reducing biases introduced by human experience.

[0175] As another implementation of this application, in order to improve the reliability of the detection results, steps S601-S605 may be included after S303, such as... Figure 6 As shown.

[0176] S601: Obtain the second test sample set.

[0177] As an example, a second test sample set can be used to evaluate the performance of the decision tree. The second test sample set can be different from the first test sample set. Preferably, the ratio of the sample size of the first test sample set to the sample size of the second test sample set can be 9:1.

[0178] S602: Input the second test sample set into multiple decision trees and output the test results respectively.

[0179] As an example, the second test sample set can be input into multiple previously trained decision trees, and each decision tree will output its own test results independently.

[0180] S603: Compare the test results with the true labels to obtain the number of correctly classified abnormal samples, the number of abnormal samples misclassified, and the number of normal samples misclassified for each decision tree.

[0181] As an example, the test results of each decision tree can be compared with the true labels in the sample set to obtain three key indicators: the number of correctly classified anomalous samples (true examples, i.e., the number of samples that are actually anomalous and correctly judged as anomalous); the number of anomalous samples that are misclassified (false negative examples, i.e., the number of samples that are actually anomalous but are mistakenly judged as normal); and the number of normal samples that are misclassified (false positive examples, i.e., the number of samples that are actually normal but are mistakenly judged as anomalous).

[0182] S604: Calculate the precision and recall of each decision tree based on the number of correctly classified outlier samples, the number of outlier samples misclassified, and the number of normal samples misclassified.

[0183] As one implementation of S604, the precision and recall of each decision tree can be calculated using the following formula.

[0184]

[0185] Where P is precision; R is recall; N TP The number of correctly classified outlier samples; N FP N represents the number of outlier samples that were misclassified. FN This represents the number of normal samples that were misclassified.

[0186] S605: The preset weights for each tree are obtained by weighting and harmonicizing the precision and recall of each tree using weighting coefficients.

[0187] As an example, a comprehensive performance score can be obtained by weighting and harmonicizing the precision and recall of each decision tree using preset weighting coefficients. The higher the score, the better the overall performance of the decision tree, and the larger the corresponding preset weight.

[0188] As one implementation of S605, weighted harmonics can be performed using the following formula.

[0189]

[0190] Where β is a parameter balancing the importance of precision and recall, F β The larger the value, the better the decision tree's classification performance for outlier samples.

[0191] The cost detection method in this application determines the decision tree weights based on a weighted harmonic sum of precision and recall, allowing the higher-performing decision tree to have a greater impact on the final result. This effectively integrates the advantages of each decision tree, reduces interference from low-performing decision trees, and further improves the reliability of the detection results.

[0192] Based on the cost detection method provided in the above embodiments, this application also provides specific implementations of the cost detection device. Please refer to the following embodiments.

[0193] First see Figure 7 The cost detection device 70 provided in this application embodiment includes the following modules:

[0194] Data acquisition module 701: Used to acquire cost data for multiple objects;

[0195] Dimensionality reduction module 702: Used to perform dimensionality reduction processing on the relevant cost features in the cost data of multiple objects to obtain the principal component feature set of each object;

[0196] Clustering module 703: Used to cluster the principal component feature sets of multiple objects based on the similarity between the principal component feature sets of each object, to obtain multiple feature clusters, and each feature cluster is associated with a category label;

[0197] Input module 704: Used to input the principal component feature set and its corresponding category label into the detection model;

[0198] Filtering module 705: Used to filter the principal component feature set and the corresponding cost category label according to the filtering rules of each decision tree node through multiple decision trees in the detection model, and output the filtering results;

[0199] Weighting module 706: Used to determine the screening result with the highest weight as the final anomaly detection result based on the preset weights of each decision tree.

[0200] The cost detection device in this application extracts principal component feature sets through dimensionality reduction, effectively eliminating redundant information caused by the correlation between features. Simultaneously, clustering groups principal component feature sets with high similarity into one class, further subdividing objects by category label, thereby reducing interference from cross-category detection. Based on this, the cost after dimensionality reduction and clustering is input into a multi-decision-tree detection model. Different decision trees set filtering rules for different feature dimensions in the principal component feature sets, enabling multiple decision trees to cover multiple dimensions of detection, improving the comprehensiveness of cost detection. Furthermore, since the filtering rules for different feature dimensions differ, the ability of different decision trees to identify different types of abnormal costs also varies. Therefore, the filtering result with the highest weight is used as the final abnormal result, highlighting the identification result corresponding to the decision tree with stronger identification ability, ensuring the reliability of the result and reducing the risk of misjudgment by a single model. Thus, the collaborative processing of dimensionality reduction and clustering, on the one hand, eliminates redundant information, and on the other hand, reduces interference from cross-category detection, optimizing data quality through a dual effect and providing high-quality input data for the detection model. Meanwhile, multiple decision trees, through weighted balancing of the comprehensiveness and reliability of the detection, ultimately improved the accuracy of cost detection.

[0201] In some embodiments, the cost detection device 70 may further include the following modules:

[0202] Preprocessing module: Used to preprocess cost data.

[0203] In some embodiments, the cost detection device 70 may further include the following modules:

[0204] Training Sample Module: Used to obtain a training sample set for objects. The training sample set includes multiple training samples, and each training sample includes multiple cost features and the cost category label of the object.

[0205] Sample Subset Module: Used to randomly extract cost features and / or cost category labels of objects from the training sample set to obtain multiple sample subsets.

[0206] In some embodiments, the sample subset module may further include the following units:

[0207] Number threshold acquisition unit: used to obtain the number threshold of the decision tree.

[0208] Sample subset unit: A sample subset used to randomly extract cost features and / or cost category labels of objects from the training sample set to obtain a quantity threshold based on the quantity threshold of the decision tree.

[0209] Decision tree module: Used to train decision trees based on multiple sample subsets to obtain multiple decision trees.

[0210] Combination module: Used to combine multiple decision trees to obtain a detection model.

[0211] In some embodiments, the cost detection device 70 may further include the following modules:

[0212] Sample dimensionality reduction module: Used to reduce the dimensionality of relevant cost features in the training sample set to obtain the dimensionality-reduced training sample set.

[0213] In some embodiments, the cost detection device 70 may further include the following modules:

[0214] The filtering rule module is used to determine the filtering rules for each decision tree node in each decision tree based on multiple sample subsets; wherein the depth of each decision tree meets the depth threshold of the decision tree.

[0215] In some embodiments, the filtering rules module may include the following units:

[0216] Gini Index Unit: Used to calculate the Gini index for each candidate value of the cost category label for multiple cost features and / or objects in each sample subset.

[0217] Candidate feature unit: used to determine the cost feature or cost category label corresponding to the minimum Gini index as a candidate cost feature or candidate category label.

[0218] Information gain unit: Used to calculate the information gain ratio of each candidate value in the candidate cost feature or candidate category label.

[0219] Filtering rule unit: Used to generate filtering rules based on candidate cost features or candidate category labels and candidate values ​​of maximum information gain when the candidate value of maximum information gain ratio is equal to the candidate value of minimum Gini index.

[0220] Classification module: Based on the selection rules of decision tree nodes, the values ​​of cost features in the sample subset are classified to obtain a decision tree.

[0221] In some embodiments, the cost detection device 70 may further include the following modules:

[0222] Latent Value Module: Used to obtain multiple combinations of deep latent values ​​and quantity latent values ​​of a first test sample and multiple decision trees, wherein the first test sample includes the true label.

[0223] Initialization module: used to map each combination to a position vector in the particle swarm, initialize the velocity vector corresponding to the position vector, and construct the initial particle swarm.

[0224] Initial model building module: Used to assign the deep potential value and quantity potential value based on each combination to build decision trees to obtain all decision trees in the initial detection model, and obtain the anomaly prediction results for each object.

[0225] Initial detection module: used to input test samples into the initial detection model and output prediction results.

[0226] Fitness module: Used to calculate fitness values ​​based on the degree of matching between the abnormal prediction results of multiple objects and the true labels.

[0227] The optimization module is used to record the position of the particle with the highest fitness value as the global optimal position, and to record the position corresponding to the historical best fitness of each particle as the individual optimal position.

[0228] Update module: Used to calculate particle velocity update based on the global optimal position and the individual optimal position.

[0229] Particle output module: used to adjust particle position according to particle velocity update amount. If the updated particle position meets the preset conditions, the depth potential value corresponding to the updated particle position is output as the depth threshold, and the quantity potential value corresponding to the updated particle position is output as the quantity threshold.

[0230] In some embodiments, the cost detection device 70 may further include the following modules:

[0231] Second Sample Module: Used to obtain the second test sample set.

[0232] The testing module is used to input the second test sample set into multiple decision trees and output the test results respectively.

[0233] The comparison module is used to compare the test results with the true labels to obtain the number of correctly classified abnormal samples, the number of abnormal samples misclassified, and the number of normal samples misclassified for each decision tree.

[0234] Precision calculation module: Used to calculate the precision and recall of each decision tree based on the number of correctly classified outlier samples, the number of outlier samples misclassified, and the number of normal samples misclassified.

[0235] Preset weight module: Used to obtain the preset weight of each tree by weighting and harmonic summing the precision and recall of each tree using weight coefficients.

[0236] Figure 7 Each module in the device shown has the function of implementing each step in the various figures of the above method embodiments, and can achieve the corresponding technical effects. For the sake of brevity, it will not be described in detail here.

[0237] Based on the cost detection method provided in the above embodiments, this application also provides specific implementation methods for electronic devices. Please refer to the following embodiments.

[0238] Figure 8 A schematic diagram of the hardware structure for cost detection provided in an embodiment of this application is shown.

[0239] The cost detection device may include a processor 801 and a memory 802 storing computer program instructions.

[0240] Specifically, the processor 801 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0241] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 802 may include removable or non-removable (or fixed) media. Where appropriate, memory 802 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 802 is non-volatile solid-state memory.

[0242] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0243] The processor 801 implements any of the cost detection methods described in the above embodiments by reading and executing computer program instructions stored in the memory 802.

[0244] In one example, the fee detection device may also include a communication interface 803 and a bus 810. For example, Figure 8 As shown, the processor 801, memory 802, and communication interface 803 are connected through bus 810 and complete communication with each other.

[0245] The communication interface 803 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0246] Bus 810 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 810 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0247] This fee detection device can execute the fee detection method described in this application based on currently blocked spam SMS messages and SMS messages reported by users, thereby achieving a combination of... Figure 1 and Figure 6 The method for cost detection is described.

[0248] Furthermore, in conjunction with the cost detection methods described in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the cost detection methods described in the above embodiments.

[0249] This application also provides a computer program product, including a computer program that, when executed, implements any of the cost detection methods described in the above embodiments.

[0250] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0251] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0252] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0253] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0254] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A charge detecting method characterized by comprising: The method comprises: obtaining cost data of a plurality of objects; dimensionality reduction is performed on relevant cost features in the cost data of the plurality of objects to obtain a principal component feature set of each object; based on the similarity between the principal component feature sets of the objects, the principal component feature sets of the plurality of objects are clustered to obtain a plurality of feature clusters, each feature cluster being associated with a category label; the principal component feature set and the corresponding category label are input into a detection model; the principal component feature set and the corresponding cost category label are filtered by a plurality of decision trees in the detection model according to the filtering rules of the nodes of each decision tree, and a filtering result is output; based on the preset weights of each decision tree, the filtering result with the highest weight is determined as the final anomaly detection result.

2. The charge detection method according to claim 1, characterized by, Before the principal component feature set and the corresponding category label are input into the detection model, the method further comprises: obtaining a training sample set of an object, the training sample set comprising a plurality of training samples, each training sample comprising a plurality of cost features and a cost category label of the object; a plurality of sample subsets are obtained by randomly sampling cost features and / or cost category labels of objects from the training sample set; based on the plurality of sample subsets, a plurality of decision trees are trained to obtain a plurality of decision trees; the plurality of decision trees are combined to obtain the detection model.

3. The charge detection method according to claim 2, characterized by, The plurality of sample subsets are obtained by randomly sampling cost features from the training sample set, comprising: obtaining a number threshold of decision trees; based on the number threshold of decision trees, a sample subset of the number threshold is obtained by randomly sampling cost features from the training sample set.

4. The charge detection method according to claim 2, characterized by, Before the plurality of sample subsets are obtained by randomly sampling cost features from the training sample set, the method further comprises: dimensionality reduction is performed on relevant cost features in the training sample set to obtain a dimensionally reduced training sample set.

5. The charge detection method according to claim 3, characterized by, Based on the plurality of sample subsets, a plurality of decision trees are trained to obtain a plurality of decision trees, comprising: based on the plurality of sample subsets, the filtering rules of each decision tree node in each decision tree are determined; wherein the depth of each decision tree satisfies a depth threshold of the decision tree; the values of the cost features and / or the cost category labels of the objects in the sample subset are classified using the filtering rules of the decision tree nodes to obtain a decision tree.

6. The charge detection method according to claim 5, characterized by, Each of the cost features and / or the cost category labels of the objects comprises a plurality of candidate values, which are determined based on the values of each cost feature and / or the cost category label of the object. The filtering rules of each decision tree node in each decision tree are determined, comprising: calculating the Gini index of each candidate value of the plurality of cost features and / or the cost category label of the object in each sample subset; determining the candidate cost feature or the candidate cost category label corresponding to the minimum Gini index as the candidate cost feature or the candidate category label; calculating the information gain rate of each candidate value in the candidate cost feature or the candidate cost category label; in the case where the candidate value with the maximum information gain rate is equal to the candidate value corresponding to the minimum Gini index, a filtering rule is generated according to the candidate cost feature or the candidate cost category label and the candidate value with the maximum information gain rate.

7. The charge detection method according to claim 5, characterized by, Before the number threshold of decision trees is obtained, the method further comprises: Obtaining a plurality of combinations of a first test sample and depth latent values and quantity latent values of a decision tree, wherein the first test sample comprises a true label; Mapping each combination to a position vector in a particle swarm, initializing a velocity vector corresponding to the position vector, and constructing an initial particle swarm; Constructing a decision tree based on the depth latent values and the quantity latent values of each combination to obtain an initial detection model; Inputting the test sample into the initial detection model to output a prediction result; Calculating a fitness value according to a matching degree of the prediction result and the true label; Recording a particle position with the highest fitness value as a global optimal position, and recording a position corresponding to a historical optimal fitness value of each particle as an individual optimal position; Calculating a particle velocity update amount based on the global optimal position and the individual optimal position; Adjusting the particle position according to the particle velocity update amount, and if the updated particle position meets a preset condition, outputting a depth latent value corresponding to the updated particle position as the depth threshold value and a quantity latent value corresponding to the updated particle position as the quantity threshold value.

8. The charge detecting method according to any one of claims 2 to 6, characterized by, After the plurality of decision trees are obtained by training the decision trees based on the plurality of sample subsets, the method further comprises: Obtaining a second test sample set; Inputting the second test sample set into the plurality of decision trees to respectively output test results; Comparing the test results with the true labels to obtain, for each decision tree, a number of correctly classified abnormal samples, a number of abnormal samples that are incorrectly classified, and a number of normal samples that are incorrectly classified; Calculating, for each decision tree, a precision rate and a recall rate according to the number of correctly classified abnormal samples, the number of abnormal samples that are incorrectly classified, and the number of normal samples that are incorrectly classified; Harmonizing the precision rate and the recall rate of each tree by weighting with a weight coefficient to obtain a preset weight of each tree.

9. A charge detecting device characterized by comprising: The apparatus comprises: a data acquisition module configured to acquire cost data of a plurality of objects; a dimension reduction module configured to perform dimension reduction processing on relevant cost features in the cost data of the plurality of objects to obtain a principal component feature set of each object; a clustering module configured to cluster the principal component feature sets of the plurality of objects based on similarities between the principal component feature sets to obtain a plurality of feature clusters, each feature cluster being associated with a class label; an input module configured to input the principal component feature sets and corresponding class labels into a detection model; a screening module configured to screen the principal component feature sets and corresponding cost class labels according to screening rules of nodes of a plurality of decision trees in the detection model to output screening results; a weight module configured to determine, based on preset weights of the decision trees, a screening result with the highest weight as a final anomaly detection result.

10. A charge detecting apparatus characterized by comprising: The device comprises a processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the cost detection method of any one of claims 1-8.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores computer program instructions, and the computer program instructions are executed by the processor to implement the cost detection method of any one of claims 1-8.

12. A computer program product, characterised in that, The instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the fee detection method of any one of claims 1-8.