A classification method and device

By receiving and converting the classification conditions input by users, calculating their similarity and classifying them, the problem of inaccurate classification of target objects in the prior art is solved, and higher classification accuracy and rationality are achieved.

CN119740080APending Publication Date: 2025-04-01WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411943213.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, target object classification depends on manual rules, resulting in the same object being classified into multiple categories and being unable to achieve precise operation.

Method used

By receiving at least two classification conditions input by the user, classification is performed using tags, tag values, relational operators and logical operators, converted to homomorphic classification conditions, and their similarity is calculated, and if the similarity does not exceed the threshold, classification is performed.

Benefits of technology

It improves the accuracy of target object classification, reduces classification cross-section phenomenon, and ensures the rationality and effectiveness of classification conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740080A_ABST
    Figure CN119740080A_ABST
Patent Text Reader

Abstract

The present application discloses a classification method and device, wherein the method comprises: receiving at least two classification conditions input by a user; at least two classification conditions are used to classify a target object; for any classification condition, the classification condition is converted according to a conversion rule to obtain a homomorphic classification condition; the similarity between any two homomorphic classification conditions is calculated, and if the similarity does not exceed a similarity threshold, the target object is classified according to the at least two classification conditions; wherein the conversion rule comprises: if the classification condition includes a logical negation, the classification condition is converted into a classification condition with the same meaning and does not include a logical negation; if at least two classification conditions include different relational operators for the same label, the different relational operators are converted into relational operators compatible with the different relational operators. The above method can improve the accuracy of the classification of the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a classification method and device. Background Art

[0002] With the rapid development of information technology, the explosive growth of data has brought huge technical challenges to the effective classification of target objects. For example, products can be classified according to their type, function, and price; customers can be classified according to their age, historical browsing information, and loan amount; and short videos can be classified according to their content, length, and value orientation.

[0003] Currently, the classification of target objects is mainly based on manually set rules, but the classification of target objects based on manually set rules may cause the same object to be classified in multiple categories. In this way, in some scenarios, such as taking different operational measures for target objects of different categories, the same object will have multiple operational measures, which cannot achieve accurate operation. Summary of the invention

[0004] The present application provides a classification method and device for improving the accuracy of classifying target objects.

[0005] In a first aspect, an embodiment of the present application provides a classification method, which can be executed by a classification device, and the method includes: receiving at least two classification conditions input by a user; the at least two classification conditions are used to classify a target object; any classification condition includes a label, a label value, a relational operator and a logical operator, the relational operator is used to connect the label and the label value into a sub-classification item, and the logical operator is used to connect multiple sub-classification items into a classification condition; for any classification condition, the classification condition is converted according to a conversion rule to obtain a homomorphic classification condition; the similarity between any two homomorphic classification conditions is calculated, and if the similarity does not exceed a similarity threshold, the target object is classified according to the at least two classification conditions; wherein the conversion rule includes: if the classification condition includes a logical negation, the classification condition is converted into a classification condition with the same meaning and does not contain a logical negation; if the at least two classification conditions include different relational operators for the same label, the different relational operators are converted into relational operators compatible with the different relational operators.

[0006] By using the above method, the classification conditions are converted to obtain homomorphic classification conditions, and the similarity of the homomorphic classification conditions is calculated as the similarity of the classification conditions. If the similarity does not exceed the similarity threshold, the target user is classified according to the classification conditions. In this way, classification conditions with too high similarity can be screened out to avoid classifying target users according to classification conditions with too high similarity, resulting in a large number of overlapping users.

[0007] In a possible implementation, the conversion rules also include: if the classification conditions include repeated sub-classification items, the repeated sub-classification items are removed; if the classification conditions include logically mutually exclusive sub-classification items, an alarm message is sent; if the classification conditions include at least two sub-classification items for the same label and the relational operators of the at least two sub-classification items are different, a merged sub-classification item is determined to replace the at least two sub-classification items; the merged sub-classification item has the same meaning as the at least two sub-classification items.

[0008] By adopting the above method, the classification conditions are simplified through the above conversion rules, so that the converted homomorphic classification conditions are easier to calculate their similarity.

[0009] In one possible implementation, the similarity between any two homomorphic classification conditions is calculated, including: for any homomorphic classification condition, converting the homomorphic classification condition into a comparison string according to the execution order of the operator, wherein the sub-classification items in the comparison string are arranged in sequence according to the execution order, and the logical operator between the sub-classification items is located after the two connected sub-classification items; calculating the similarity between any two comparison strings.

[0010] By converting the classification conditions into comparison strings using the above method, the execution order and execution logic of each label can be more clearly reflected, making it easier to vectorize the classification conditions.

[0011] In a possible implementation, calculating the similarity between any two comparison strings includes: for any label in any comparison string, sequentially constructing a relational operator and a logical operator that are located after the label in the comparison string into a sub-vector of the label; for any comparison string, according to a preset order of each label, constructing the sub-vector of each label into a vector of the comparison string; and calculating the similarity between any two vectors.

[0012] In a possible implementation, the relational operator and the logical operator located after the label in the comparison string are sequentially constructed into a sub-vector of the label, including: converting the relational operator and the logical operator into preset numerical values; and sequentially constructing the preset numerical values ​​of the relational operator and the preset numerical values ​​of the logical operator located after the label in the comparison string into a sub-vector of the label.

[0013] In a possible implementation, calculating the similarity between any two vectors includes: for a short vector in any two vectors, padding the tail of the short vector according to the long vector in any two vectors until the length of the short vector is equal to the length of the long vector; and calculating the similarity between the padded short vector and the long vector.

[0014] In a possible implementation, after the similarity does not exceed the similarity threshold and before classifying the target object according to the at least two classification conditions, the method further includes: constructing multiple user data; for any user data, determining whether the user data satisfies multiple classification conditions among the at least two classification conditions, and if so, determining that the user data is a classified cross-user; and determining that the proportion of classified cross-users to total users is lower than a cross-rate threshold.

[0015] By adopting the above method, on the premise that the comparison string meets the similarity threshold, the proportion of cross users is further determined by constructing user data. On the premise that the proportion of cross users is lower than the cross rate, the target users are classified, further ensuring that the cross rate of the classification conditions is within the allowed proportion.

[0016] In a second aspect, an embodiment of the present application provides a classification device, which includes a receiving module for receiving at least two classification conditions input by a user; the at least two classification conditions are used to classify a target object; any classification condition includes a label, a label value, a relational operator and a logical operator, the relational operator is used to connect the label and the label value into a sub-classification item, and the logical operator is used to connect multiple sub-classification items into a classification condition; a conversion module is used to convert the classification condition according to a conversion rule for any classification condition to obtain a homomorphic classification condition; a calculation module is used to calculate the similarity between any two homomorphic classification conditions, and if the similarity does not exceed a similarity threshold, the target object is classified according to the at least two classification conditions; the conversion module is specifically used to, if the classification condition includes a logical negation, convert the classification condition into a classification condition with the same meaning and without containing a logical negation; if the at least two classification conditions include different relational operators for the same label, convert the different relational operators into relational operators compatible with the different relational operators.

[0017] In a possible implementation, the conversion module is also specifically used to, if the classification condition includes repeated sub-classification items, remove the repeated sub-classification items; if the classification condition includes logically mutually exclusive sub-classification items, send an alarm message; if the classification condition includes at least two sub-classification items for the same label and the relational operators of the at least two sub-classification items are different, determine a merged sub-classification item to replace the at least two sub-classification items; the merged sub-classification item has the same meaning as the at least two sub-classification items.

[0018] In a possible implementation, the calculation module is specifically used to, for any homomorphic classification condition, convert the homomorphic classification condition into a comparison string according to the execution order of operators, wherein the sub-classification items in the comparison string are arranged in sequence according to the execution order, and the logical operator between the sub-classification items is located after the two connected sub-classification items; and calculate the similarity between any two comparison strings.

[0019] In a possible implementation, the calculation module is further specifically used to, for any label in any comparison string, sequentially construct the relational operator and the logical operator located after the label in the comparison string into a sub-vector of the label; for any comparison string, according to a preset order of each label, construct the sub-vector of each label into a vector of the comparison string; and calculate the similarity between any two vectors.

[0020] In a possible implementation, the calculation module is further specifically configured to convert the relational operator and the logical operator into preset numerical values; and sequentially construct the preset numerical values ​​of the relational operator and the preset numerical values ​​of the logical operator located after the label in the comparison string into a sub-vector of the label.

[0021] In a possible implementation, the calculation module is further specifically used to, for a short vector in any two vectors, pad the tail of the short vector according to the long vector in any two vectors until the length of the short vector is equal to the length of the long vector; and calculate the similarity between the padded short vector and the long vector.

[0022] In a possible implementation, the device also includes a construction module and a determination module, the construction module is used to construct multiple user data; the determination module is used to determine, for any user data, whether the user data satisfies multiple classification conditions of the at least two classification conditions, and if so, determines that the user data is a classified cross-user; and determines that the proportion of classified cross-users to total users is lower than a cross-rate threshold.

[0023] In a third aspect, an embodiment of the present application further provides a classification device, comprising a memory and a processor, wherein the memory is used to store computer programs or instructions; the processor is used to call the computer programs or instructions stored in the memory to execute a method in any possible implementation of the first aspect.

[0024] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When a computer reads and executes the instructions, the computer executes a method in any possible implementation of the first aspect.

[0025] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein instructions are stored in the computer program product. When a computer reads and executes the instructions, the computer executes the method in any possible implementation of the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0027] Figure 1 A schematic diagram of a flow chart corresponding to a classification method provided in an embodiment of the present application;

[0028] Figure 2 A schematic diagram of classifying target objects using two classification conditions provided in an embodiment of the present application;

[0029] Figure 3 A schematic diagram of the internal modules of a classification device 3000 provided in an embodiment of the present application;

[0030] Figure 4 A schematic diagram of the structure of a classification device 4000 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0032] In many scenarios, it is necessary to accurately classify the target objects. For example, in the financial field, customers are classified according to their characteristic information, such as whether they are customers who have opened loan projects, the frequency of customers visiting loan product pages, and basic information such as their age, income, and education. Different degrees of marketing strategies are adopted for different categories of customers, such as telephone marketing, SMS marketing, and APP message push.

[0033] However, in the process of classifying customers, the same customer may be classified into different customer categories. For example, the classification criteria for customer category one are: users who have not opened a loan project, and have visited loan product A more than 3 times in the last three months, and have a college degree or above; the classification criteria for customer category two are: users who have not opened a loan project, and have visited loan product B more than 5 times in the last month, and have an annual income of more than 200,000. Under this classification standard, the same customer may meet both customer category one and customer category two. If different marketing strategies are implemented for the two categories of customers, the customer will receive two marketing strategies. In this way, it is impossible to achieve precision marketing for customers, thereby affecting the actual marketing effect of loan products.

[0034] It should be noted that the target object can be not only a customer, but also a product, an employee, or a supplier. The embodiment of the present application does not specifically limit the target object.

[0035] Based on this, an embodiment of the present application provides a classification method for improving the accuracy of classifying target objects.

[0036] Figure 1 A flow chart corresponding to a classification method provided in an embodiment of the present application is shown in FIG. The flow chart can be executed by a classification device, such as Figure 1 As shown, the process includes the following steps:

[0037] Step 101: A classification device receives at least two classification conditions input by a user, where the at least two classification conditions are used to classify a target object.

[0038] The classification device may be a computer, a server or other intelligent device, and the classification device receives at least two classification conditions input by a user to classify the target object. Two classification conditions may classify the target object into two categories, and multiple classification conditions may classify the target object into multiple categories. Figure 2 A schematic diagram of classifying target objects using two classification conditions provided in an embodiment of the present application, wherein the figure 1 represents the target object corresponding to the classification condition 1, and the figure 2 represents the target object corresponding to the classification condition 2. Figure 2 It can be seen that there is an intersection between 1 and 2, which means that the target object corresponding to classification condition one and the target object corresponding to classification condition two have an intersection. Figure 2 It is only a schematic diagram of the classification of target objects by two classification conditions. The target objects corresponding to the two classification conditions may not have any intersection.

[0039] Any classification condition includes labels, label values, relational operators and logical operators. Relational operators are used to connect labels and label values ​​into sub-classification items, and logical operators are used to connect multiple sub-classification items into classification conditions.

[0040] For example, classification condition one: (label A=1 AND label B contains "a") OR (label C not in ("sa", "sc") AND label A=2), this classification condition includes four sub-classification items, namely label A=1, label B contains "a", label C not in ("sa", "sc") and label A=2. For the sub-classification item label A=1, the label is label A, the label value is 1, and the relational operator is =; for the sub-classification item label B contains "a", the label is label B, the label value is "a", and the relational operator is contains; no further details are given for the other sub-classification items. The logical operators in this classification condition are logical AND and logical OR.

[0041] For another example, classification condition 2: (label A=1 AND label B beginwith "abc") OR (label Abetween(2,6)), this classification condition includes three sub-classification items, namely label A=1, label B beginwith "abc" and label Abetween(2,6), and the logical operators in this classification condition are logical negation, logical AND and logical OR.

[0042] The above two classification conditions are only an example in the embodiment of the present application, and the present application does not specifically limit the specific content of the classification conditions. Both the label and the label value can be flexibly set according to actual business needs.

[0043] Step 102: The classification device converts any classification condition according to the conversion rule to obtain a homomorphic classification condition.

[0044] Specifically, the conversion rules include: if the classification condition includes a logical negation, the classification condition is converted into a classification condition with the same meaning and does not include a logical negation; if at least two classification conditions include different relational operators for the same label, the different relational operators are converted into relational operators that are compatible with different relational operators.

[0045] Since logical negation will lead to the complete opposite execution logic of the classification condition, thereby increasing the complexity of the classification condition, when the classification condition includes logical negation, the classification condition needs to be converted into a classification condition that does not contain logical negation but has the same meaning. For example, the above classification condition 2 includes logical negation, and after conversion, classification condition 2 becomes: (label A!=1OR label B not like "abc*")OR (label Abetween(2,6)). For classification condition 1, classification condition 1 does not include logical negation, so classification condition 1 does not need to be converted in this way.

[0046] In the classification conditions, the format of the label can be string, boolean, int, enum, and multiple relational operators can be supported for the same format. For example, for the int format, multiple relational operators such as >, >=, =, <=, <, between can be supported. For the same label in different classification conditions, if the label has different relational operators, different relational operators can be converted into relational operators that are compatible with different relational operators.

[0047] For example, for label A, in classification condition 1, the relational operator of label A is =, and in the converted classification condition 2, the relational operators of label A are ! = and between, between is compatible with = and ! =, so all the relational operators of label A are converted to between. That is, classification condition 1 is converted to: (label A between (1, 1) AND label B contains "a") OR (label C not in ("sa", "sc") and label A between (2, 2)); classification condition 2 is converted to: (label A between (-∞, 0) OR label A between (2, +∞) OR label B not like "abc*") OR (label A between (2, 6)).

[0048] For label B, in the converted classification condition 1, the relational operator of label B is contains, and in the converted classification condition 2, the relational operator of label B is not like, and like is compatible with contains, so all the relational operators of label B are converted to like operators. That is, the converted classification conditions are further converted, and classification condition 1 is converted to: (label Abetween(1,1)AND label B like "*a*")OR(label C not in("sa", "sc")and label Abetween(2,2)); classification condition 2 is converted to: (label Abetween(-∞,0)OR label Abetween(2,+∞)OR label B not like "abc*")OR(label Abetween(2,6)).

[0049] Optionally, the conversion of classification conditions may also include: if the classification conditions include repeated sub-classification items, removing the repeated sub-classification items; if the classification conditions include logically mutually exclusive sub-classification items, sending an alarm message; if the classification conditions include at least two sub-classification items for the same label and the relational operators of at least two sub-classification items are different, determining to replace the merged sub-classification items of the at least two sub-classification items; the merged sub-classification item has the same meaning as the at least two sub-classification items.

[0050] Exemplarily, if there are repeated sub-classification items in the classification condition, these repeated sub-classification items have no additional impact on the classification result and are directly deleted. For example, in the classification condition (A = 1AND B = 2AND A = 1), the last A = 1 is repeated and can be simplified to (A = 1AND B = 2). If there are logically mutually exclusive sub-classification items in the classification condition, it is determined that the classification condition has a logical error and an alarm message is sent to the relevant staff. For example, A = 1AND A = 2, it is obviously logically mutually exclusive, so an alarm is directly issued. If the classification condition includes at least two sub-classification items with the same label, and the relational operators in the sub-classification items are different, at least two sub-classification items are merged into a merged sub-classification item, and the meaning of the merged sub-classification item is the same as that of the merged sub-classification item. For example, A>1AND A<30 can be merged into A between(2,29), and the expression A = 1Or A = 2 can be merged into A between(1,2).

[0051] Step 103: The classification device calculates the similarity between any two homomorphic classification conditions. If the similarity does not exceed a similarity threshold, the target object is classified according to at least two classification conditions.

[0052] Further, the similarity between the homomorphic classification conditions is calculated. According to step 102, the homomorphic classification condition of classification condition one is: (label A between (1,1) AND label B like "*a*") OR (label C not in ("sa", "sc") and label A between (2,2)); the homomorphic classification condition of classification condition two is: (label A between (-∞,0) OR label A between (2,+∞) OR label B not like "abc*") OR (label A between (2,6)). The similarity between the two homomorphic classification conditions is calculated, that is, the similarity between classification condition one and classification condition two.

[0053] There are many ways to calculate the similarity between any two homomorphic classification conditions, such as Levenshtein distance, which is a kind of edit distance. It refers to the minimum number of edit operations required to convert one string into another. The allowed edit operations include replacing one character with another, inserting a character, and deleting a character. There is also Hamming distance, which is used in data transmission error control coding. Hamming distance is a concept that represents the number of different characters in corresponding positions of two (same length) strings.

[0054] In an embodiment of the present application, the similarity between any two homomorphic classification conditions is calculated, including: for any homomorphic classification condition, the homomorphic classification condition is converted into a comparison string according to the execution order of the operator, wherein the sub-classification items in the comparison string are arranged in sequence according to the execution order, and the logical operator between the sub-classification items is located after the two connected sub-classification items, and the similarity between any two comparison strings is calculated.

[0055] For example, using the above example, for the homomorphic classification condition 1, the sub-classification item of label Abetween(1,1) is executed first, and then the sub-classification item of label B like "*a*" is executed, and then the logical AND of the two classification items is executed, and then the sub-classification item of label C not in("sa", "sc") is executed, and then the sub-classification item of label Abetween(2,2) is executed, and then the logical AND of label C not in("sa", "sc") and Abetween(2,2) is executed, and finally the logical OR is executed. Among them, the execution order of label Abetween(1,1) and label B like "*a*" is not restricted, and the execution order of label C not in("sa", "sc") and label A between(2,2) is not restricted. Therefore, the homomorphic classification condition 1 is converted into the comparison string 1: label A between (1, 1) label B like "*a*" AND label A between (2, 2) label C not in ("sa", "sc") AND OR; similarly, the homomorphic classification condition 2 is converted into the comparison string 2: label A between (-∞, 0) label A between (2, +∞) label B not like "abc*" OR. Optionally, when there are two or more consecutive logical operators in the string, multiple consecutive logical operators can be simplified into one.

[0056] There are also multiple ways to calculate the similarity between any two comparison strings. Optionally, the similarity between any two comparison strings is calculated, including: for any label in any comparison string, sequentially constructing the relational operators and logical operators that follow the label in the comparison string into a sub-vector of the label; for any comparison string, according to the preset order of each label, constructing the sub-vector of each label into a vector of the comparison string; and calculating the similarity between any two vectors.

[0057] Exemplarily, for label A in comparison string 1, the relational operator after label A is between, the logical operator is AND, the next one is relational operator between, and the next ones are AND and OR. Therefore, a sub-vector is constructed according to label A's between, AND, between, AND, and OR; for label B, a sub-vector is constructed according to label B's like, AND, AND, and OR; a sub-vector is constructed according to label C's not in, AND, and OR. There are many ways to construct a sub-vector according to each relational operator and logical operator of a label, such as converting each operator to a corresponding frequency according to the frequency of occurrence of each operator; such as converting each operator to a preset value according to the relationship between the previous and next operators. According to the preset label order, with label A, label B, and label C as the preset order, the sub-vector of label A, the sub-vector of label B, and the sub-vector of label C are constructed into the vector of comparison string 1. Similarly, the sub-vectors of each label are constructed according to the relational operator and logical operator of each label in comparison string 2, and then the vector of comparison string 2 is constructed according to the sub-vectors of each label in the preset label order.

[0058] Optionally, an embodiment of the present application provides a method of sequentially constructing a relational operator and a logical operator located after a label in a comparison string into a sub-vector of the label, including: converting the relational operator and the logical operator into preset numerical values; and sequentially constructing the preset numerical values ​​of the relational operator and the preset numerical values ​​of the logical operator located after the label in the comparison string into a sub-vector of the label.

[0059] Exemplarily, the preset values ​​of relational operators and logical operators are set, such as logical OR is 0, logical AND is 1, relational operator between is 2, like is 3, not like is -3, not in is -4, and relational operators with opposite meanings can be set to opposite numbers. Therefore, according to the between, AND, between, AND and OR of label A, the subvector can be constructed in sequence according to the preset values ​​to be [2,1,2,1,0], according to the like, AND, AND and OR of label B to be constructed to be [3,0,0,1], and according to the not in, AND and OR of label C to be constructed to be [-4,1,0]. In the same way, the comparison string 2 label A's between, between and or is constructed to be [2,2,0], and label B's not like and or are constructed to be [-3,0]. Therefore, the vector corresponding to comparison string one is [2,1,2,1,0,3,0,0,1,-4,1,0], and the vector corresponding to comparison string two is [2,2,0,-3,0]. The similarity is calculated based on the two comparison strings.

[0060] Optionally, calculating the similarity between any two vectors includes: for a short vector in any two vectors, padding the tail of the short vector according to the long vector in any two vectors until the length of the short vector is equal to the length of the long vector, and calculating the similarity between the padded short vector and the long vector.

[0061] Specifically, the vector constructed by the comparison string 1 can be [2,1,2,1,0,3,0,0,1,-4,1,0], and the vector constructed by the comparison string 2 can be [2,2,0,-3,0]. There is no label C in the comparison string 2, and label C can be padded with 0. Exemplarily, the longer vector of the two vectors is used as the reference, and the tail of the short vector is padded until the length of the short vector is equal to the length of the long vector. Therefore, the vector constructed by the comparison string 2 is padded to [2,2,0,-3,0,0,0,0,0,0,0,0]. Optionally, for two comparison strings, if the same label corresponds to two sub-vectors, the longer sub-vector is used as the reference, and the tail of the shorter sub-vector is padded until the length of the sub-vectors corresponding to each label is the same. Therefore, the vector constructed by the comparison string 2 is padded to [2,2,0,0,0,-3,0,0,0,0,0,0,0].

[0062] According to the two padded vectors, the similarity between the two vectors can be calculated using the cosine formula. According to the definition of the cosine formula The specific calculation process will not be described in detail here.

[0063] Furthermore, after the similarity does not exceed the similarity threshold and before classifying the target object according to at least two classification conditions, it also includes: constructing multiple user data, and for any user data, determining whether the user data satisfies multiple classification conditions of at least two classification conditions; if so, determining that the user data is a classified cross-user, and determining that the proportion of classified cross-users to total users is lower than the cross-rate threshold.

[0064] Specifically, the similarity is calculated based on the two padded vectors, and the calculated similarity is compared with the similarity threshold. If it does not exceed the similarity threshold, it means that the similarity of the two classification conditions is not high; if it exceeds the similarity threshold, it means that the similarity of the two classification conditions is too high, that is, the two classification conditions are unreasonable. Because users are classified according to two classification conditions with too high similarity, a large number of duplicate users will appear in the two obtained groups, that is, more users are classified into both group one and group two. Therefore, if the similarity exceeds the similarity threshold, it will be fed back to the relevant staff to reset the classification conditions.

[0065] On the premise that the two vectors do not exceed the similarity threshold, the two classification conditions are further studied, and multiple pieces of user data, such as 10,000 pieces, are constructed based on the logical relationship between the sub-classification items of the two classification conditions. Each piece of user data among the 10,000 pieces of user data is brought into the two classification conditions respectively. If the user data satisfies both classification condition one and classification condition two, it means that the user belongs to a cross-classification user; if the user data only satisfies one of the classification conditions, the user does not belong to a cross-classification user. The multiple pieces of user data constructed are brought into the two classification conditions one by one to determine whether they belong to cross-classification users, and the proportion of cross-classification users to the total users is counted. If the proportion is lower than the preset cross-rate threshold, the target object is classified according to the classification conditions.

[0066] Optionally, constructing multiple users is determined based on the classification condition logic and the value of the label. For example, for the value range of label A, the value range of label A is 1 or 2, which may satisfy classification condition one, and the possible value range of label A in classification condition two is (-∞,0) or [2,+∞), so when the value of label A is 2, it may cause cross-users. For the value range of label B, label B in classification condition one needs to contain a, and label B in classification condition two does not contain the pattern of "abc*", so when the value of label B is a, it may cause cross-users.

[0067] For example, if label A=2, label B=“a”, and label C=“sd”, the user data meets both classification condition 1 and classification condition 2, therefore, the user data belongs to cross-user data; if label A=1, label B=“a”, and label C=“sd”, the user data only meets classification condition 1 but does not meet classification condition 2, therefore, it does not belong to cross-user data.

[0068] Figure 3 A schematic diagram of the internal modules of a classification device 3000 provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the device may include: a receiving module 301, a conversion module 302, a calculation module 303, a construction module 304 and a determination module 305.

[0069] Among them, the receiving module 301 is used to receive at least two classification conditions input by the user; the at least two classification conditions are used to classify the target object; any classification condition includes a label, a label value, a relational operator and a logical operator, the relational operator is used to connect the label and the label value into a sub-classification item, and the logical operator is used to connect multiple sub-classification items into a classification condition; the conversion module 302 is used to convert the classification condition according to the conversion rule for any classification condition to obtain a homomorphic classification condition; the calculation module 303 is used to calculate the similarity between any two homomorphic classification conditions, if the similarity does not exceed the similarity threshold, the target object is classified according to the at least two classification conditions; the conversion module 302 is specifically used to, if the classification condition includes a logical negation, convert the classification condition into a classification condition with the same meaning and not containing a logical negation; if the at least two classification conditions include different relational operators for the same label, convert the different relational operators into relational operators compatible with the different relational operators.

[0070] In a possible implementation, the conversion module 302 is also specifically used to, if the classification condition includes repeated sub-classification items, remove the repeated sub-classification items; if the classification condition includes logically mutually exclusive sub-classification items, send an alarm message; if the classification condition includes at least two sub-classification items for the same label and the relational operators of the at least two sub-classification items are different, determine a merged sub-classification item to replace the at least two sub-classification items; the merged sub-classification item has the same meaning as the at least two sub-classification items.

[0071] In a possible implementation, the calculation module 303 is specifically used to, for any homomorphic classification condition, convert the homomorphic classification condition into a comparison string according to the execution order of the operator, wherein the sub-classification items in the comparison string are arranged in sequence according to the execution order, and the logical operator between the sub-classification items is located after the two connected sub-classification items; and calculate the similarity between any two comparison strings.

[0072] In a possible implementation, the calculation module 303 is further specifically used to, for any label in any comparison string, sequentially construct the relational operator and the logical operator that follow the label in the comparison string into a sub-vector of the label; for any comparison string, construct the sub-vectors of each label into a vector of the comparison string according to a preset order of each label; and calculate the similarity between any two vectors.

[0073] In a possible implementation, the calculation module 303 is further specifically configured to convert the relational operator and the logical operator into preset values; and sequentially construct the preset values ​​of the relational operator and the preset values ​​of the logical operator located after the label in the comparison string into a sub-vector of the label.

[0074] In a possible implementation, the calculation module 303 is further specifically used to, for a short vector in any two vectors, pad the tail of the short vector according to the long vector in any two vectors until the length of the short vector is equal to the length of the long vector; and calculate the similarity between the padded short vector and the long vector.

[0075] In a possible implementation, the device also includes a construction module 304 and a determination module 305, the construction module is used to construct multiple user data; the determination module is used to determine, for any user data, whether the user data satisfies multiple classification conditions of the at least two classification conditions, and if so, determines that the user data is a classified cross-user; and determines that the proportion of classified cross-users to total users is lower than a cross rate threshold.

[0076] Figure 4 This is a structural diagram of a classification device 4000 provided in an embodiment of the present application. Figure 4 As shown, it includes at least one processor 401 and a memory 402 connected to the at least one processor 401. The specific connection medium between the processor 401 and the memory 402 is not limited in the embodiment of the present application. Figure 4 For example, the processor 401 and the memory 402 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0077] In the embodiment of the present application, the memory 402 stores instructions that can be executed by at least one processor 401, and the at least one processor 401 can implement the steps of the above classification method by executing the instructions stored in the memory 402.

[0078] The processor 401 is the control center of the computer device, and can use various interfaces and lines to connect various parts of the computer device, and perform resource settings by running or executing instructions stored in the memory 402 and calling data stored in the memory 402. Optionally, the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.

[0079] Processor 401 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.

[0080] The memory 402 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 402 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 402 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 402 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0081] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0082] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, 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, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0083] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0085] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A classification method, characterized in that: The method comprises: Receive at least two classification conditions input by a user; the at least two classification conditions are used to classify the target object; any classification condition includes a label, a label value, a relational operator and a logical operator, the relational operator is used to connect the label and the label value into a sub-classification item, and the logical operator is used to connect multiple sub-classification items into a classification condition; For any classification condition, the classification condition is transformed according to the transformation rule to obtain a homomorphic classification condition; Calculating the similarity between any two homomorphic classification conditions, and if the similarity does not exceed a similarity threshold, classifying the target object according to the at least two classification conditions; Wherein, the conversion rules include: If the classification condition includes a logical negation, converting the classification condition into a classification condition with the same meaning and not including a logical negation; If the at least two classification conditions include different relational operators for the same label, the different relational operators are converted into relational operators that are compatible with the different relational operators.

2. The method according to claim 1, characterized in that The conversion rules also include: If the classification condition includes repeated sub-classification items, the repeated sub-classification items are removed; If the classification condition includes logically mutually exclusive sub-classification items, sending an alarm message; If the classification condition includes at least two sub-classification items for the same label and the relational operators of the at least two sub-classification items are different, a merged sub-classification item is determined to replace the at least two sub-classification items; the merged sub-classification item has the same meaning as the at least two sub-classification items.

3. The method according to claim 1, characterized in that Calculate the similarity between any two homomorphic classification conditions, including: For any homomorphic classification condition, convert the homomorphic classification condition into a comparison string according to the execution order of the operator, wherein the sub-classification items in the comparison string are arranged in sequence according to the execution order, and the logical operator between the sub-classification items is located after the two connected sub-classification items; Compute the similarity between any two compared strings.

4. The method according to claim 3, characterized in that Calculate the similarity between any two comparison strings, including: For any label in any comparison string, sequentially construct the relational operator and the logical operator following the label in the comparison string into a subvector of the label; For any comparison string, construct the sub-vectors of each label into a vector of the comparison string according to the preset order of each label; Compute the similarity between any two vectors.

5. The method according to claim 4, characterized in that The relational operator and the logical operator following the label in the comparison string are sequentially constructed into a subvector of the label, including: Converting the relational operator and the logical operator into preset values; The preset values ​​of the relational operators and the preset values ​​of the logical operators in the comparison string that follow the label are sequentially constructed into a sub-vector of the label.

6. The method according to claim 4, characterized in that Calculate the similarity between any two vectors, including: For the shorter vector of any two vectors, pad the tail of the shorter vector according to the longer vector of any two vectors until the length of the shorter vector is equal to the length of the longer vector; The similarity between the padded short vector and the long vector is calculated.

7. The method according to any one of claims 1 to 6, characterized in that After the similarity does not exceed the similarity threshold and before classifying the target object according to the at least two classification conditions, the method further includes: Construct multiple user data; For any piece of user data, determining whether the user data satisfies multiple classification conditions among the at least two classification conditions, and if so, determining that the user data is a cross-classification user; It is determined that the proportion of classified cross-users to total users is lower than the cross-rate threshold.

8. A classification device, characterized in that: include: A receiving module, used for receiving at least two classification conditions input by a user; The at least two classification conditions are used to classify the target object; any classification condition includes a label, a label value, a relational operator and a logical operator, the relational operator is used to connect the label and the label value into a sub-classification item, and the logical operator is used to connect multiple sub-classification items into a classification condition; A conversion module is used to convert any classification condition according to the conversion rule to obtain a homomorphic classification condition; A calculation module, used for calculating the similarity between any two homomorphic classification conditions, and if the similarity does not exceed a similarity threshold, classifying the target object according to the at least two classification conditions; The conversion module is specifically used to, if the classification condition includes a logical negation, convert the classification condition into a classification condition with the same meaning and without a logical negation; if the at least two classification conditions include different relational operators for the same label, convert the different relational operators into relational operators compatible with the different relational operators.

9. A sorting device, characterized in that: include: Memory, used to store computer programs or instructions; A processor, configured to call a computer program or instruction stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when a computer reads and executes the instructions, the computer executes the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The computer program product stores instructions, and when a computer reads and executes the instructions, the computer executes the method according to any one of claims 1 to 7.