Data processing method, electronic device, storage medium and computer program product

By determining the common attributes of the data category in the JSON set and comparing it, the problem of multi -level and multi -element information inquiries in the existing technology in the existing technology, realized efficient data classification and query, reduced development costs and improved. Maintenance and scalability.

CN119377729APending Publication Date: 2025-01-28KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411391007.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively query multi-level multi-element information in JSON collections, resulting in high development costs, low maintenance and scalability.

Method used

By determining the common attributes corresponding to the data category in the classification rules, and comparing the attribute information of the data to be processed, the data is compared with these common attributes to classify the data. This method includes the priority and comparison method of configuring common attributes to improve matching efficiency.

Benefits of technology

The efficient inquiries and classification of complex data in the JSON collection, reduce the cost of code development, and improve the maintenance and scalability of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377729A_ABST
    Figure CN119377729A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method, electronic equipment, a readable storage medium and a computer program product. The data processing method comprises the steps of determining at least one common attribute corresponding to a data category in a classification rule, wherein the classification rule represents the common attribute of data belonging to the data category; comparing the attribute information of the to-be-processed data with the at least one common attribute to obtain a comparison result of the to-be-processed data and the classification rule; and under the condition that the comparison result is matched, determining that the to-be-processed data is the data category.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to technical fields such as data processing, and in particular to a data processing method, an electronic device, a storage medium, and a computer program product. Background Art

[0002] JSON (JavaScript Object Notation) is a lightweight data exchange format that is easy to parse and generate, so it is widely used in business scenarios that require parsing and matching. If you need to find information with a certain attribute value in a JSON collection, regular expressions are usually used in related technologies to search. However, regular expressions are only suitable for finding information with a specific pattern and a single requirement. If you want to query multi-level and multi-element information, it is difficult to achieve. If you write a lot of code to implement complex matching logic, it will have a high development cost and reduce the maintainability and scalability of the JSON collection. Summary of the invention

[0003] The present disclosure provides a data processing method, an electronic device, a storage medium, and a computer program product.

[0004] According to one aspect of the present disclosure, there is provided a data processing method, comprising: determining at least one common attribute corresponding to a data category in a classification rule, wherein the classification rule characterizes the common attribute of data belonging to the data category; Compare the attribute information of the data to be processed with the at least one common attribute to obtain a comparison result between the data to be processed and the classification rule; and if the comparison result is a match, determine that the data to be processed is the data category.

[0005] In some embodiments, the attribute information of the data to be processed is compared with the at least one common attribute to obtain a comparison result between the data to be processed and the classification rule, including: comparing the actual value corresponding to the attribute name of the common attribute in the attribute information with the common value of the common attribute to obtain a comparison result.

[0006] In some implementations, before comparing the attribute information of the data to be processed with the at least one common attribute to obtain the comparison result between the data to be processed and the classification rule, it includes: configuring priorities for the at least one common attribute of the data category respectively.

[0007] In some embodiments, the attribute information of the data to be processed is compared with the at least one common attribute to obtain a comparison result between the data to be processed and the classification rule, including: comparing the actual value corresponding to the attribute name of the common attribute in the attribute information with the common value of the common attribute in descending order of the priority of the common attribute to obtain a comparison result.

[0008] In some implementations, before comparing the attribute information of the data to be processed with the at least one common attribute to obtain the comparison result between the data to be processed and the classification rule, it includes: determining a comparison method of the common attributes in the classification rule.

[0009] In some embodiments, the attribute information of the data to be processed is compared with the at least one common attribute to obtain a comparison result of the data to be processed and the classification rule, including: when the comparison method of the common attribute is inclusion, if the actual value corresponding to the attribute name of the common attribute in the attribute information is different from the common value of the common attribute, the comparison result is determined to be a mismatch; or if the actual value and the common value corresponding to the same attribute name are all the same, the comparison result is determined to be a match.

[0010] In some embodiments, the attribute information of the data to be processed is compared with the at least one common attribute to obtain a comparison result of the data to be processed and the classification rule, including: when the comparison method of the common attribute is exclusion, if the actual value corresponding to the attribute name of the common attribute in the attribute information is the same as the common value of the common attribute, the comparison result is determined to be a mismatch; or if the actual value and the common value corresponding to the same attribute name are all different, the comparison result is determined to be a match.

[0011] In some implementations, the method further includes: when the newly added classification rule is the same as the existing classification rule, intercepting the action of adding the newly added classification rule.

[0012] In some implementations, the method further includes: according to the common attributes of the classification rules, a plurality of classification rules having the common attributes are grouped as a rule subset, so that the rule set having the classification rules includes a plurality of rule subsets.

[0013] In some embodiments, after treating multiple classification rules with the common attributes as a rule subset according to the common attributes of the classification rules, the method includes: calling a classification engine to compare the data to be processed with the multiple rule subsets in parallel to determine the data category of the data to be processed, the classification engine is used to determine at least one common attribute of the classification rules in the rule subset, and to obtain a comparison result between the data to be processed and the classification rules.

[0014] According to another aspect of the present disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the data processing method of any one of the above-mentioned embodiments.

[0015] According to another aspect of the present disclosure, a readable storage medium is provided, in which execution instructions are stored. When the execution instructions are executed by a processor, they are used to implement the data processing method of any of the above-mentioned embodiments.

[0016] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the data processing method of any of the above embodiments is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0018] Figure 1 It is a schematic diagram of an application scenario of the data processing method according to an embodiment of the present disclosure.

[0019] Figure 2 It is an interactive schematic flow chart of a data processing method according to an embodiment of the present disclosure.

[0020] Figure 3 It is an architecture diagram of a data processing method according to an embodiment of the present disclosure.

[0021] Figure 4 It is a schematic diagram of the classification engine processing process according to an embodiment of the present disclosure.

[0022] Figure 5 It is a flow chart of a data processing method according to an embodiment of the present disclosure.

[0023] Figure 6 It is a block diagram of a data processing device according to one embodiment of the present disclosure.

[0024] Figure 7 It is a schematic block diagram of the structure of an electronic device equipped with a data processing device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.

[0026] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0027] In the order management scenario, the orders that each business group is responsible for usually have different attributes, such as purchasing city, purchasing company, purchasing purpose, etc. Each business group and the attributes of the orders it is responsible for constitute a classification rule. Since JSON (JavaScript Object Notation) has the advantage of being easy to generate and parse, classification rules are usually described in the form of JSON and form a rule set (that is, a JSON set) corresponding to the order management scenario. In the aforementioned business scenario, if you want to match a new purchase order with a suitable business group, you need to consider whether the actual purchasing city, actual purchasing company, and actual purchasing purpose of the order are compatible with the corresponding attributes supported by each business group. Regular expressions cannot query such multi-dimensional complex data. Usually, it is necessary to write program code that supports complex matching logic to implement the aforementioned query requirements, which obviously incurs a high code development cost; if you want to add or modify the rule set, you need to redevelop the corresponding program code, which reduces the maintainability and scalability of the rule set.

[0028] To this end, the present disclosure proposes a data processing method.

[0029] Figure 1 1 is a schematic diagram of an application scenario of a data processing method according to an embodiment of the present disclosure. In this application scenario, a server 100 and a terminal 200 may be included. The server 100 may be a cloud server or a physical server, which includes a corresponding processor and a memory; the terminal 200 is not limited to a mobile phone, a tablet, a computer, etc. The server 100 and the terminal 200 may communicate via a network, a blue night, etc.

[0030] The data processing method runs on the server 100. When the user uploads the classification rules (such as the attributes of the orders that each business group is responsible for) through the terminal 200, the terminal 200 will synchronize these classification rules to the server 100, and the server 100 will integrate these classification rules into a rule set. In addition, the server 100 will also extract the common attributes of the data categories constrained by the classification rules in the rule set and their comparison methods. When the data to be processed (such as a new purchase order) is obtained, the server 100 executes the data processing method, compares the attribute information of the data to be processed with the classification rules in the rule set, that is, analyzes the relationship between the attribute information of the data to be processed and the common attributes of the data categories defined by the classification rules. When the common attributes of the data categories defined by a certain classification rule match the attribute information of the data to be processed, the data category defined by the classification rule is used as the data category of the data to be processed to achieve the classification of the data to be processed. Finally, the data category of the data to be processed can be synchronized to the terminal 200, so that the user can classify the data to be processed according to the data category or perform other operations (such as assigning the new purchase order to a business group with processing capabilities).

[0031] It is understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, and usage scenarios of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. For example, in response to receiving the user's active request, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require the acquisition and use of the user's personal information. The user can autonomously choose whether to provide personal information to the software or hardware such as the terminal 200, application, server or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message. As an optional but non-limiting implementation method, in response to receiving the user's active request, the method of sending the prompt message to the user can be, for example, a pop-up window, and the prompt information can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the terminal 200. The above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation method of the present disclosure. Other methods that meet relevant laws and regulations can also be applied to the implementation method of the present disclosure. At the same time, it can be understood that the data involved in the technical solution of the present disclosure (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0032] For the convenience of description and to make the technical solutions of the specific implementation methods of the present disclosure easier to understand, before describing the data processing method implemented in the present disclosure, the technical terms involved in the specific implementation methods of the present disclosure are defined as follows: Classification rules: used to limit at least one common attribute of data belonging to a certain data category, as well as the comparison method of the common attribute when classifying data. Classification rules are usually presented in the form of JSON. There are connection identifiers between different common attributes in the same data category, such as the nextFilter (next filter condition) field, which is used to indicate the start and end interval of the common attribute. If the common attributes of the classification rule have been described, the value of the last nextFilter field is empty.

[0033] Common attributes are the characteristics shared by multiple data belonging to the defined data category in a certain classification rule.

[0034] Comparison method: It is used to indicate the specific form of the comparison process between the common attributes and the attribute information of the data to be processed, such as inclusion or exclusion.

[0035] Rule set: is a collection of classification rules that describe the same business scenario.

[0036] Classification engine: a processing system that determines the data category by comparing the data to be processed with the classification rules, including a processing module, a matching module and a category determination module.

[0037] Figure 2 FIG. 1 is a schematic flow chart of an interactive data processing method according to an embodiment of the present disclosure. Figure 2 As shown, the data processing method involves data interaction between the rule management platform, the classification engine and the client. Through steps S201 to S213, the complexity of the screening logic involved in determining the data category of the data to be processed and the simplicity of the matching process are balanced. The rule management platform and the classification engine are both configured in Figure 1 The rule management platform and the classification engine can obtain various classification rules from the terminal 200 through the network or Bluetooth, etc. Figure 1 The terminal 200 in the system provides a configuration platform for classification rules for regular users. Figure 1 Not shown, it may be another terminal other than the terminal 200, which is used to obtain the data to be processed and send the data to be processed to the classification engine configured in the server 100. The terminal running the client interacts with the server 100 through the network or Bluetooth.

[0038] In step S201, the classification rules are obtained by the rule management platform. Figure 1After the classification rules are configured on the terminal 200, the rule management platform configured on the server can obtain various classification rules in the terminal 200 through the network or Bluetooth. Among them, the classification rules obtained from the terminal 200 are usually in the form of JSON, which is easy to write. In the order management scenario, the classification rules may include the common attributes of each business group and the data they can process, as well as the comparison method of the common attributes. In the aforementioned scenario, the business group serves as the data category; the purchase city code, purchase asset category code, purchase company code, etc. of the purchase order supported by each business group are the common attributes of the data supported by the business group. Different classification rules define different data categories and different common attributes of the data they support.

[0039] Taking business group 1 as the data category, the data that business group 1 can process should have the following characteristics: the purchase city code is 120000, the purchase asset category code is 1, and the purchase company code is 5045. The characteristics mentioned in this example are the common attributes of the data corresponding to business group 1. The purchase city code, purchase asset category code, and purchase company code are the attribute names of the common attributes. 120000 is the common value of the purchase city code, 1 is the common value of the purchase asset category code, and 5045 is the common value of the purchase company code. In the current scenario, the business group ID can be directly used as the data category ID of the purchase order; for example, the business group ID is "1". If the attribute information of the newly added purchase order matches the common attributes of the orders that the business group can process, the business group ID is used as the data category of the purchase order, that is, the data category of the purchase order is "1". The business group ID is not limited here. The comparison methods include inclusion and exclusion. When the comparison method is inclusion, if the common value of the common attribute includes the actual value corresponding to the attribute name of the common attribute in the attribute information, then the attribute information matches the common attribute; for example, the common values ​​of the purchasing city code are 120000 and 130000, and the actual value of the purchasing city code in the attribute information is 120000. At this time, the relationship between the actual value and the common value is inclusion. When the comparison method is exclusion, if the actual value corresponding to the attribute name of the common attribute in the attribute information does not fall into the common value of the common attribute, then the attribute information matches the common attribute; for example, the common values ​​of the purchasing city code are 120000 and 130000, and the actual value of the purchasing city code in the attribute information is 140000. At this time, the actual value does not fall into the common value, and the relationship between the two is exclusion.

[0040] In step S202, the rule management platform creates rule sets for multiple classification rules belonging to the same business scenario according to the business scenarios of the various classification rules obtained. Business scenarios can be, for example, order management scenarios, human resource management scenarios, asset management scenarios, etc. The data categories in the same rule set have the same category attributes. For example, in the order management scenario, the category attributes of the data categories can be set to business groups. The common values ​​and / or comparison methods of the same common attributes of different business groups are different, and the number and attribute names of the common attributes in different business groups may also be different. However, for a piece of data to be processed, in the same rule set, it is usually only adapted to a unique classification rule, corresponding to a unique data category.

[0041] In step S203, the rule management platform sends the established rule set to the classification engine. Figure 1 In the server 100.

[0042] In step S204, the classification engine deserializes each classification rule. Deserialization refers to the process of converting the classification rules from JSON format to a data structure that can be used in the program, providing an easily identifiable structure for the subsequent determination of the common attributes corresponding to the data category and its comparison method. This process is usually performed by a processing module in the classification engine.

[0043] In step S205, the classification engine determines the common attributes of the data category and its comparison method in the classification rules that have been deserialized. This process is still executed by the processing module, which identifies the data category constrained by the classification rules that have been deserialized, as well as the common attributes and comparison methods that the data belonging to this category should satisfy. After obtaining the above information, the data category is used as the key, and the common attributes and their comparison methods are used as the value, and stored in the form of a key-value pair so that it can be called when classifying the data to be processed. The above process requires traversing each classification rule in the rule set.

[0044] In step S206, the classification engine configures a priority for each common attribute. The priority is used to indicate the order in which each common attribute is compared with the attribute information of the data to be processed in the process of comparing the common attributes of the same classification rule. Generally, if the relationship between the common value of a common attribute of a certain classification rule and the corresponding actual value of the data to be processed does not meet the comparison method of the common attribute, it is proved that the classification rule does not match the data to be processed, and there is no need to continue to compare. Therefore, the priority of each common attribute should be set according to the degree of distinction of the data, so that the common attribute with a relatively greater degree of distinction is first compared with the attribute information of the data to be processed, thereby improving the efficiency of determining the unmatched classification rules. For example, when the relationship between the common value of the procurement city code and the actual value of the procurement city in the attribute information is inconsistent with the comparison method corresponding to the procurement city, the corresponding classification rule is directly determined as unmatched, and there is no need to make meaningless comparisons of the remaining common attributes of the rule. Through the setting of the priority, the efficiency of identifying unmatched classification rules is improved, the speed of determining the data category of the data to be processed is accelerated, and the real-time requirements of the business scenario are maximized.

[0045] In step S207, the client obtains the data to be processed. The data to be processed refers to data that has classification requirements, such as a newly generated purchase order that needs to be classified to determine the business group responsible for processing the order. The client can be run on the client's terminal ( Figure 1 The client and the classification engine (or the server running the classification engine) are connected via a network or Bluetooth.

[0046] In step S208, the client sends the obtained data to be processed to the classification engine.

[0047] In step S209, the matching module in the classification engine determines whether the comparison method of the common attributes of the classification rules is inclusion.

[0048] In step S210, when the comparison mode is inclusion, the matching module determines whether the common value of the common attribute is the same as the actual value of the attribute name corresponding to the common attribute in the data to be processed.

[0049] In step S211, when the comparison mode is exclusion, the matching module determines whether the shared value and the corresponding actual value are different.

[0050] In step S212, for each common attribute in the classification rule, when the comparison mode is inclusion and the actual value is the same as the common value, or when the comparison mode is exclusion and the actual value is different from the common value, the matching module determines that the comparison result is a match.

[0051] If there is a common attribute in the classification rule, and the comparison mode is inclusion but the actual value is different from the common value, or the comparison mode is exclusion but the actual value is the same as the common value, then the comparison result between the classification rule and the data to be processed is mismatched. Then, the classification rules in the rule set are traversed, and steps S209 to S211 are re-executed until a classification rule is found that matches the comparison result of the data to be processed.

[0052] In step S213, the category determination module determines the data category of the to-be-processed data according to the data category defined by the classification rule whose comparison result is matched.

[0053] The present disclosure proposes a configuration architecture for classification rules, which includes at least one common attribute of the constrained data category and its comparison method, indicating a clear comparison method and comparison object for the matching process of the classification engine. In addition, the matching logic of the classification engine is proposed, which reduces the code writing cost of the matching program; if there is a need to add or modify rules, the classification rules can be modified directly without adjusting the classification engine, which improves the maintainability of the rule set.

[0054] Figure 3 This is a diagram of the data processing method architecture according to the embodiment of the present disclosure. Figure 3 The data processing method of the present disclosure is described in detail.

[0055] According to the business scenarios of the obtained classification rules, a rule set is created so that multiple classification rules constraining the same business scenario are concentrated in the same set. After obtaining the data to be processed, an appropriate rule set can be selected according to the business scenario of the data to be processed or the classification requirements.

[0056] Furthermore, the rule set is input to the classification engine, and the processing module in the classification engine deserializes each classification rule in the rule set, and determines the common attributes of the data belonging to the data category and the comparison method thereof in the classification rules after deserialization.

[0057] In addition, you can also configure priorities for the common attributes of the same classification rule. When comparing the data to be processed with the classification rules, you can quickly filter out the unmatched classification rules by comparing the least common attributes, thereby improving the real-time performance of data classification.

[0058] In some embodiments, the rule set can also be divided into multiple rule subsets according to common attributes. For example, according to the purchase city code, the classification rules with the same purchase city code are packaged into a rule subset. In this way, after obtaining the data to be processed, different rule subsets execute the comparison process in parallel, which can maximize the speed of data classification. For example, if there are 100 classification rules in the rule set, and the classification rule matching the data to be processed is at the last position of the rule set, then if the rule set is taken as a whole to analyze whether the data to be processed matches multiple classification rules, it takes 100 matching times to determine the data category. However, if the rule set is divided into 10 rule subsets according to a common attribute and processed in parallel, assuming that each rule subset has 10 classification rules, even if the classification rule corresponding to the data to be processed is at the last position of a certain rule subset, the data category can be determined only after 100 matching times. Obviously, the above method can further improve the real-time performance of data classification and improve the user's search experience.

[0059] In some implementations, each rule subset is used as a matching basis, and the attribute information of the data to be processed is compared with the i-th classification rule in the rule subset, and the total number of classification rules in the rule subset is n, and i is 1 to n. Of course, the value of n in each rule subset may be different, and is not limited here.

[0060] When judging whether the i-th classification rule matches the data to be processed, it is necessary to compare whether the relationship between the common attributes of the i-th classification rule and the attribute information of the data to be processed conforms to the comparison method of the common attributes. Assuming that there are q common attributes in the i-th classification rule, an attribute sequence about the q common attributes can be created according to the priority; then, according to the priority sequence, analyze whether the relationship between the common value of the m-th common attribute and the actual value corresponding to the same attribute name in the data to be processed is consistent with the comparison method of the m-th common attribute. For example, the m-th common attribute is the procurement city code of 120000 and 130000, and the comparison method is inclusion; and the actual value corresponding to the attribute named procurement city code in the attribute information of the data to be processed is 120000. Obviously, the actual value is included by the common value of the m-th common attribute, which is consistent with the comparison method of the m-th common attribute, and m takes values ​​from 1 to q. Then, according to the priority sequence, determine whether there is an m+1th common attribute, that is, determine whether the value of m is q. If there is no m+1th common attribute, it proves that the relationship between the q common attributes of the ith classification rule and the attribute information of the data to be processed conforms to their respective comparison methods, and the comparison result between the ith classification rule and the data to be processed is a match.

[0061] On the contrary, if the actual value of a certain attribute name of the data to be processed is inconsistent with the comparison method of the corresponding mth common attribute, it is determined that the i-th classification rule does not match the comparison result of the data to be processed. Then, the i+1-th classification rule is analyzed until i is n.

[0062] Furthermore, if the actual value of a certain attribute name of the data to be processed is consistent with the comparison method of the corresponding m-th common attribute, and there is an m+1-th common attribute, repeat the above steps to compare whether the relationship between the common value of the m+1-th common attribute and the actual value corresponding to the data to be processed satisfies the comparison method of the m+1-th common attribute, until the q-th common attribute is traversed.

[0063] Figure 4 It is a schematic diagram of the classification engine processing process according to an embodiment of the present disclosure. Figure 4 The process of the aforementioned classification engine processing the rule set and matching the rule set with the data to be processed is demonstrated.

[0064] Assuming that the rule set contains classification rules 1 to n, the classification engine deserializes each classification rule and determines the common attributes and comparison methods corresponding to its data category. For classification rule i, after being processed by the processing module, the classification engine determines that it corresponds to data category A, and describes that the data belonging to data category A should have a common attribute a1 with a common value of a1, and its comparison method; a common attribute a2 with a common value of a2, and its comparison method; a common attribute a3 with a common value of a3, and its comparison method. After receiving the data to be processed, the attribute information of the data to be processed is usually stored in the form of key-value pairs, so it can be directly used for comparison. Then, compare the actual value of the first attribute with the attribute name a1 in the data to be processed with the shared value of the shared attribute with the attribute name a1. If both are a1, and the comparison method is inclusive at this time, the shared attribute a1 is adapted to the first attribute a1; then, compare the shared value of the shared attribute a2 with the shared value of the second attribute a2. If both are a2, and the comparison method is inclusive, the shared attribute a2 is adapted to the second attribute a2; then, compare the shared value of the shared attribute a3 with the shared value of the third attribute a3. If both are a3, and the comparison method is inclusive, the shared attribute a3 is adapted to the third attribute a3. When the attribute information of the data to be processed is adapted to the shared attributes of the classification rule i, it is determined that the data category of the data to be processed is the data category A of the classification rule i.

[0065] In some implementations, if there are newly added classification rules, it is necessary to determine whether the newly added classification rules are exactly the same as the existing classification rules. If they are the same, the addition action of the newly added classification rules is intercepted to avoid redundant rules in the rule set and increase the classification time of the data to be processed. If they are different, it is determined whether the common attributes set for a certain data category in the newly added classification rules are inconsistent with the common attributes set for the same data category in the existing classification rules. If they are inconsistent, the existing classification rules are replaced by the newly added classification rules.

[0066] In addition, if there is a need to delete or modify the common attributes in an existing classification rule, the corresponding part of the classification rule in JSON format can be deleted or modified directly. For example, if a common attribute of a classification rule is added, the added common attribute is written after the last connection identifier nextFilter field, and ends with a new nextFilter field and a null value. When deleting or modifying classification rules, the present disclosure does not need to adjust the classification engine, which reduces the expansion and maintenance costs of the classification rules.

[0067] Figure 5 is a flow chart of a data processing method according to an embodiment of the present disclosure. Figure 5 As shown, in order to implement the aforementioned technical solution, the present disclosure proposes a data processing method M500, including: step S510, determining at least one common attribute corresponding to the data category in the classification rule, the classification rule characterizing the common attributes of the data belonging to the data category; step S520, comparing the attribute information of the data to be processed with at least one common attribute to obtain a comparison result between the data to be processed and the classification rule; and step S530, when the comparison result is a match, determining that the data to be processed is a data category. The specific execution method of each step is referred to above and will not be repeated here.

[0068] The present disclosure proposes a classification engine and its matching logic, which reduces the code writing cost of the matching program; if there is a need to add or modify rules, the classification rules can be directly modified without adjusting the classification engine, thereby improving the maintainability and scalability of the rule set.

[0069] Figure 6 It is a block diagram of a data processing device of an embodiment of the present disclosure. Based on any of the above embodiments, the present disclosure proposes a data processing device 600 (corresponding to a data processing method M500).

[0070] like Figure 6 As shown, the data processing device 600 includes: The processing module 610 is used to determine at least one common attribute corresponding to the data category in the classification rule, and the classification rule represents the common attribute of the data belonging to the data category. The matching module 620 is used to compare the attribute information of the data to be processed with at least one common attribute to obtain the comparison result between the data to be processed and the classification rule. The category determination module 630 is used to determine that the data to be processed is a data category when the comparison result is a match.

[0071] The data processing device 600 includes a classification engine, and the processing module 610, the matching module 620 and the category determination module 630 are three modules in the classification engine. It should be understood that the data processing device 600 also includes Figure 6 and Figure 7 The remaining modules outside the classification engine are not shown in FIG.

[0072] In some implementations, the execution step of the matching module 620 includes: comparing the actual value corresponding to the attribute name of the common attribute in the attribute information with the common value of the common attribute to obtain a comparison result.

[0073] In some implementations, the processing module 610 is further configured to respectively configure a priority for at least one common attribute of the data categories.

[0074] Furthermore, the execution step of the matching module 620 includes: comparing the actual value corresponding to the attribute name of the common attribute in the attribute information with the common value of the common attribute in descending order of priority of the common attribute to obtain a comparison result.

[0075] In some implementations, the processing module 610 is further configured to determine a comparison method for common attributes in the classification rule.

[0076] Furthermore, the execution steps of the matching module 620 include: when the comparison method of the common attribute is inclusion, if the actual value corresponding to the attribute name of the common attribute in the attribute information is different from the common value of the common attribute, determining the comparison result is a mismatch; or if the actual value and the common value corresponding to the same attribute name are all the same, determining the comparison result is a match.

[0077] Specifically, when the comparison method of the common attributes is exclusion, if the actual value corresponding to the attribute name of the common attribute in the attribute information is the same as the common value of the common attribute, the comparison result is determined to be a mismatch; or if the actual value and the common value corresponding to the same attribute name are all different, the comparison result is determined to be a match.

[0078] In some implementations, a verification module (not shown) is further included, which is used to intercept the adding action of the new classification rule when the new classification rule is the same as the existing classification rule.

[0079] In some implementations, the processing module 610 is further configured to, according to the common attributes of the classification rules, group multiple classification rules having common attributes as a rule subset, so that the rule set having classification rules includes multiple rule subsets.

[0080] Furthermore, the execution steps of the matching module 620 include: comparing the data to be processed with a plurality of rule subsets in parallel to determine the data category of the data to be processed.

[0081] The classification engine comprises a processing module 610, a matching module 620 and a category determination module 630, which are used to determine at least one common attribute of the classification rules in the rule subset and to obtain a comparison result between the data to be processed and the classification rules.

[0082] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0083] The execution subject of the data processing method in the specific implementation manner of the present disclosure may be an electronic device such as a mobile phone, a tablet computer, or a server.

[0084] Therefore, based on any of the above embodiments, the present disclosure further provides an electronic device, which can execute the data processing method of any of the above embodiments of the present disclosure, and the data processing device of any of the above embodiments can be configured on the electronic device.

[0085] Figure 7 It is a schematic block diagram of the structure of an electronic device equipped with a data processing device according to an embodiment of the present disclosure.

[0086] The hardware structure of the electronic device 6000 can be implemented using a bus architecture. The bus architecture can include any number of interconnected buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 6100 connects various circuits including one or more processors 6200, memory 6300 and / or hardware modules together. The bus 6100 can also connect various other circuits 6400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.

[0087] The bus 6100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. A bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one connecting line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0088] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.

[0089] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.

[0090] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

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

[0092] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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.

[0093] 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.

[0094] 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.

[0095] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.

[0096] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0097] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.

Claims

1. A data processing method, characterized in that: include: Determining at least one common attribute corresponding to a data category in a classification rule, wherein the classification rule characterizes a common attribute of data belonging to the data category; Comparing the attribute information of the data to be processed with the at least one common attribute to obtain a comparison result between the data to be processed and the classification rule; as well as When the comparison result is a match, the data to be processed is determined to be the data category.

2. The data processing method according to claim 1, characterized in that: Comparing the attribute information of the data to be processed with the at least one common attribute to obtain a comparison result between the data to be processed and the classification rule, including: The actual value corresponding to the attribute name of the common attribute in the attribute information is compared with the common value of the common attribute to obtain a comparison result.

3. The data processing method according to claim 1, characterized in that: Before comparing the attribute information of the data to be processed with the at least one common attribute to obtain the comparison result between the data to be processed and the classification rule, the method includes: A priority is respectively assigned to at least one common attribute of the data categories.

4. The data processing method according to claim 3, characterized in that: Comparing the attribute information of the data to be processed with the at least one common attribute to obtain a comparison result between the data to be processed and the classification rule, including: In descending order of priority of the common attributes, the actual value corresponding to the attribute name of the common attribute in the attribute information is compared with the common value of the common attribute to obtain a comparison result.

5. The data processing method according to claim 1, characterized in that: Before comparing the attribute information of the data to be processed with the at least one common attribute to obtain the comparison result between the data to be processed and the classification rule, the method includes: The comparison method of the common attributes is determined in the classification rules.

6. The data processing method according to claim 5, characterized in that: Comparing the attribute information of the data to be processed with the at least one common attribute to obtain a comparison result between the data to be processed and the classification rule, including: When the comparison mode of the common attribute is inclusion, In the case where the actual value corresponding to the attribute name of the common attribute in the attribute information is different from the common value of the common attribute, determining that the comparison result is a mismatch; or In the case where the actual value and the shared value corresponding to the same attribute name are all the same, the comparison result is determined to be a match.

7. The data processing method according to claim 5, characterized in that: Comparing the attribute information of the data to be processed with the at least one common attribute to obtain a comparison result between the data to be processed and the classification rule, including: When the comparison mode of the common attributes is exclusion, In the case where the actual value corresponding to the attribute name of the common attribute in the attribute information is the same as the common value of the common attribute, determining that the comparison result is a mismatch; or In the case where the actual value and the shared value corresponding to the same attribute name are all different, the comparison result is determined to be a match.

8. The data processing method according to claim 1, characterized in that: Also includes: In the case where the newly added classification rule is the same as the existing classification rule, the adding action of the newly added classification rule is intercepted.

9. The data processing method according to claim 1, characterized in that: Also includes: According to the common attributes of the classification rules, multiple classification rules with the common attributes are taken as a rule subset, so that the rule set with the classification rules contains multiple rule subsets.

10. The data processing method according to claim 9, characterized in that: After the common attributes of the classification rules are used as a rule subset, the method includes: A classification engine is called to compare the data to be processed with a plurality of the rule subsets in parallel to determine the data category of the data to be processed. The classification engine is used to determine at least one common attribute of the classification rules in the rule subsets, and to obtain a comparison result between the data to be processed and the classification rules.

11. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory, so that the processor executes the data processing method according to any one of claims 1 to 10.

12. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which are used to implement the data processing method according to any one of claims 1 to 10 when executed by a processor.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 10 is implemented.