Data rule matching method and device, equipment, medium and product
By obtaining and matching the mapping relationship between data feature values and preset rule feature values, the problem of low matching efficiency of massive data and rules in e-commerce platforms is solved, and efficient rule matching and user experience improvement is achieved.
Patent Information
- Application Number
- CN202411194720.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-24
AI Technical Summary
In e-commerce platforms, the matching efficiency of massive data and business rules is low, especially in the case of large data volume, which leads to inefficient matching efficiency and poor user experience.
By obtaining the mapping relationship between the data characteristic value and the preset rule feature value list, reducing the data volume and improving matching efficiency, a data rule matching method is provided, including obtaining the data characteristic value, target characteristic value and preset rule feature value categories. Generate a list of data to match preset rules that match.
It effectively reduces the amount of data, improves the efficiency of rule matching, simplifies the process of user configuration and modifying rules, and improves user experience.
Smart Images

Figure CN119179718A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a data rule matching method, device, equipment, medium and product. Background Art
[0002] With the development of e-commerce, the business of the platforms used for e-commerce is also expanding, and as a result, the number of business rules is also increasing.
[0003] When using the platform, it is necessary to effectively classify the massive amount of platform data related to e-commerce by matching business rules to obtain the business rules corresponding to each piece of platform data, and then output them to users on the platform.
[0004] In the related art, when matching business rules, each piece of platform data needs to be matched with each business rule.
[0005] This method has low matching efficiency, especially in the case of large data volumes. Summary of the invention
[0006] The purpose of this application is to provide a data rule matching method, device, equipment, medium and product to improve the efficiency of rule matching.
[0007] To achieve the above objectives, this application provides the following solutions:
[0008] In a first aspect, the present application provides a data rule matching method, comprising:
[0009] Obtaining the data characteristic value of each data field included in each piece of data to be processed;
[0010] Obtaining a target feature value in the data feature value that is the same as a rule feature value category in a preset rule feature value list, wherein the preset rule feature value list includes: a mapping relationship between each rule feature value category in the preset rule table and all preset rules where the current rule feature value category is located in the preset rule table;
[0011] Acquire a data list according to the target feature value and the data feature value of each data field included in each piece of data to be processed, wherein the data list includes: a mapping relationship between each target feature value and all the data to be processed where each target feature value is located;
[0012] The preset rule that each of the to-be-processed data complies with is obtained according to the data list and the preset rule feature value list.
[0013] In a second aspect, the present application provides a data rule matching device, comprising:
[0014] A first acquisition module is used to acquire a data characteristic value of each data field included in each piece of data to be processed;
[0015] A second acquisition module is used to acquire a target feature value in the data feature value that is the same as a rule feature value category in a preset rule feature value list, wherein the preset rule feature value list includes: a mapping relationship between each rule feature value category in the preset rule table and all preset rules where the current rule feature value category is located in the preset rule table;
[0016] A third acquisition module is used to acquire a data list according to the target feature value and the data feature value of each data field included in each piece of data to be processed, wherein the data list includes: a mapping relationship between each target feature value and all the data to be processed where each target feature value is located;
[0017] The fourth acquisition module is used to acquire the preset rule that each of the to-be-processed data complies with according to the data list and the preset rule feature value list.
[0018] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any one of the data rule matching methods described above.
[0019] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the data rule matching methods described above.
[0020] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any one of the data rule matching methods described above.
[0021] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0022] The present application provides a data rule matching method, device, equipment, medium and product, by obtaining the data characteristic value of each data field included in each data to be processed; obtaining the target characteristic value in the data characteristic value that is the same as the rule characteristic value category in the preset rule characteristic value list, the preset rule characteristic value list includes: the mapping relationship between each rule characteristic value category in the preset rule table and all preset rules where the current rule characteristic value category is located in the preset rule table; obtaining a data list according to the target characteristic value and the data characteristic value of each data field included in each data to be processed, the data list includes: the mapping relationship between each target characteristic value and all the data to be processed where each target characteristic value is located; obtaining the preset rule that each data to be processed complies with according to the data list and the preset rule characteristic value list. Among them, the preset rules and the massive data to be processed will be characterized, and the rule characteristic values in the data characteristic values of the massive data to be processed that are the same as the rule characteristic values of the preset rules will be found, and then the preset rules corresponding to each data to be processed will be determined based on these same rule characteristic values, thereby reducing the amount of data and improving the efficiency of rule matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in 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 work.
[0024] Figure 1 is a flow chart of a data rule matching method according to an exemplary embodiment;
[0025] Figure 2 A schematic diagram of functional modules of a data rule matching device provided in one embodiment of the present application;
[0026] Figure 3 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0028] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0029] Figure 1 is a flow chart of a data rule matching method according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps S101-S104:
[0030] In step S101, the data characteristic value of each data field included in each piece of data to be processed is obtained.
[0031] The regular expression function regexp_matches can be used to calculate the data feature value of each data field in each data to be processed. For example, the first data to be processed data1 includes two data fields, the data feature value corresponding to the first data field of the first data to be processed is m1, and the data feature value corresponding to the second data field of the first data to be processed is s1, then the data feature value corresponding to the first data to be processed data1 = {m1, s1}; the second data to be processed data2 includes three data fields, the data feature value corresponding to the first data field of the second data to be processed is s2, and the data feature value corresponding to the second data field of the second data to be processed is s3. The data characteristic value corresponding to the second data field is s1, and the data characteristic value corresponding to the third data field of the second data to be processed is m1. Then the data characteristic value corresponding to the second data to be processed is data2={s2, s1, m1}; the third data to be processed data3 includes three data fields. The data characteristic value corresponding to the first data field of the third data to be processed is s2, the data characteristic value corresponding to the second data field of the third data to be processed is s1, and the data characteristic value corresponding to the third data field of the third data to be processed is m2. Then the data characteristic value corresponding to the third data to be processed is data3={s2, s1, m2}.
[0032] In step S102, a target feature value of the data feature value having the same rule feature value category as that in a preset rule feature value list is obtained. The preset rule feature value list includes: a mapping relationship between each rule feature value category in the preset rule table and all preset rules where the current rule feature value category is located in the preset rule table.
[0033] Before executing the data rule matching method in the present disclosure, a preset rule feature value list in step S102 may be obtained, which specifically includes the following sub-steps A1-A3:
[0034] A1. Obtain the rule feature value corresponding to each rule field in each preset rule in the preset rule table.
[0035] The regular expression function regexp_matches can be used to obtain the rule feature value corresponding to each rule field in each preset rule in the preset rule table.
[0036] For example: preset rule 1 includes two preset fields, the rule characteristic value corresponding to the first rule field in preset rule 1 is s1, the rule characteristic value corresponding to the second rule field in preset rule 1 is s2, and the rule characteristic value corresponding to preset rule 1 is c1={s1, s2}; for another example, preset rule 2 also includes three rule fields, the rule characteristic value corresponding to the first rule field in preset rule 2 is s2, the rule characteristic value corresponding to the second rule field in preset rule 2 is s3, the rule characteristic value corresponding to the third rule field in preset rule 2 is s4, and the rule characteristic value corresponding to preset rule 2 is c2={s2, s3, s4}.
[0037] A2. Obtain rule feature value categories in the preset rule table according to all rule feature values in the preset rule table, wherein the same rule feature values constitute one rule feature value category.
[0038] In this step, the same rule feature values are classified. Continuing with the above example, the rule feature value corresponding to preset rule 1 is c1={s1, s2}, and the rule feature value corresponding to preset rule 2 is c2={s2, s3, s4}. Then the rule feature value categories at this time are: s1, s2, s3 and s4.
[0039] A3. Obtain a preset rule feature value list according to the rule feature value corresponding to each rule field in each preset rule in the preset rule table and the rule feature value category in the preset rule table.
[0040] The list of preset rule feature values obtained at this time is shown in Table 1:
[0041] Table 1
[0042] Rule feature value category The default rules s1 c1 s2 c1, c2 s3 c2 s4 c2
[0043] In Table 1, the preset rule for rule feature value category s1 is c1, the preset rules for rule feature value category s2 are c1 and c2, the preset rule for rule feature value category s3 is c2, and the preset rule for rule feature value category s4 is c2.
[0044] From step S101 , it can be seen that the data characteristic value data1 corresponding to the first data to be processed is data1={m1, s1}; the data characteristic value data2 corresponding to the second data to be processed is data2={s2, s1, m1}; and the data characteristic value data3 corresponding to the third data to be processed is data3={s2, s1, m2}.
[0045] Among them, after the data feature value data1={m1, s1} corresponding to the first data to be processed is matched with the preset rule feature value list (Table 1 above), the target feature value s1 is obtained, and the data feature value data2={s2, s1, m1} corresponding to the second data to be processed is matched with the preset rule feature value list (Table 1 above), and the target feature values s1 and s2 are obtained, and after the data feature value data3={s2, s1, m2} corresponding to the third data to be processed is matched with the preset rule feature value list (Table 1 above), the target feature values s1 and s2 are obtained, and the data feature value data3={s2, s1, m2} corresponding to the third data to be processed is matched with the preset rule feature value list (Table 1 above).
[0046] After this step, the target feature values obtained are s1 and s2.
[0047] In this step, if none of the data feature values of the data fields included in the data to be processed matches the rule feature value category, a prompt message is output, which is used to prompt that the data to be processed does not conform to the preset rule in the preset rule feature value list.
[0048] In step S103, a data list is obtained according to the target feature value and the data feature value of each data field included in each piece of data to be processed, wherein the data list includes: a mapping relationship between each target feature value and all the data to be processed where each target feature value is located.
[0049] The obtained data list is shown in Table 2:
[0050] Table 2
[0051]
[0052] In Table 2, the data to be processed where the target characteristic value s1 is located are: the first data to be processed, the second data to be processed and the third data to be processed, and the data to be processed where the target characteristic value s2 is located are: the second data to be processed and the third data to be processed.
[0053] In step S104, the preset rules that each to-be-processed data complies with are obtained according to the data list and the preset rule feature value list.
[0054] Through Table 2 and Table 1, we can get the preset rules that each data to be processed complies with.
[0055] Continuing with the above example: Table 2 shows that the target feature value included in the first data to be processed, the second data to be processed and the third data to be processed is s1, and Table 1 shows that the preset rule where the target feature value s1 is located is c1, then the first data to be processed and the second data to be processed meet the preset rule c1; similarly, the target feature value included in the second bill data to be processed and the third bill data to be processed is s2, and Table 1 shows that the preset rules where the target feature value s2 is located are c1 and c2, then the second bill data to be processed and the third bill data to be processed meet the preset rules c1 and c2.
[0056] Finally, based on the fact that the first data to be processed and the second data to be processed meet the preset rule c1, and the second bill data to be processed and the third bill data to be processed meet the preset rules c1 and c2, it can be known that the first data to be processed meets the preset rule c1, the second bill data to be processed meets the preset rules c1 and c2, and the third bill data to be processed meets the preset rules c1 and c2.
[0057] In the prior art, when matching rules for data, it is necessary to match each piece of data to be processed with each preset rule, so as to obtain the preset rules satisfied by each piece of data to be processed, which will result in very low matching efficiency. Continuing with the above example, the three pieces of data to be processed need to match each preset rule respectively. Since there are 2 preset rules, they have to be matched 6 times. If there are 10,000 pieces of data to be processed and 100 preset rules, each piece of data to be processed must be matched 100 times, and 10,000 pieces of data to be processed must be matched 1 million times. In fact, the data to be processed that meet the same preset rule will have the same characteristics, and there is no need to repeat the execution. Based on this consideration, in the present disclosure, the preset rules and the massive amount of data to be processed will be characterized, and the rule feature values that are the same as the rule feature values of the preset rules in the data feature values of the massive amount of data to be processed are found, and then the preset rules corresponding to each piece of data to be processed are determined based on these same rule feature values, thereby reducing the amount of data and improving the rule matching efficiency. Continuing with the above example, after obtaining Table 2, it is only necessary to match twice based on the target feature value, thereby reducing the amount of data processing and improving matching efficiency.
[0058] New businesses generate new data to be processed, and the original preset rules cannot match them. In this case, new rules need to be added, and modifying the rules requires modifying the code. The rules are hard-coded, which is inefficient and has a poor user experience.
[0059] The present application also provides an application scenario, which applies the above-mentioned data rule matching method. Specifically: The data rule matching method provided in this embodiment can be applied in the ERP system of e-commerce. Taking the bill data in the ERP system as an example, the ERP system will classify and summarize the bill data obtained from each e-commerce platform by expense items. As the business of each e-commerce platform is constantly developing and changing, new business rules in the e-commerce platform emerge in an endless stream, which will correspondingly cause the expense items in the bill data to be constantly updated. Therefore, the ERP system needs to add new classification rules in a timely manner as the business of the e-commerce platform changes. In the relevant technology, the original classification rules are generally hard-coded in the code and are not page-configurable. Each time a rule is modified or a preset rule is added, the rule configuration, the online order number regularity, and the bill expense-related code need to be modified. After the modification is completed, the job service can take effect, which will result in a poor user experience.
[0060] In order to improve the user experience, the preset rule table in this disclosure is configured through a page, and the user can modify and delete the rules at any time. Specifically:
[0061] When adding a preset rule to the preset rule table, the following sub-steps C1-C5 are included:
[0062] C1. Receive newly added preset rules.
[0063] C2. Add the newly added preset rule to the preset rule table to obtain an updated rule table.
[0064] C3. Obtain the rule feature value corresponding to each rule field in each preset rule of the update rule table.
[0065] C4. Obtain the rule feature value category in the update rule table according to all rule feature values in the update rule table.
[0066] C5. According to the rule characteristic value corresponding to each rule field in each preset rule of the update rule table and the rule characteristic value category in the update rule table, obtain the update rule characteristic value list corresponding to the update rule table, wherein the update rule characteristic value list includes: the mapping relationship between the rule characteristic value category in each update rule table and the rule characteristic value category in the current update rule table in all preset rules in the update rule table.
[0067] When adding a new preset rule, the user can directly enter the new preset rule in the preset rule table. After the preset rule table is updated, the rule feature value list will be updated again to obtain the updated rule feature value list. The next time the rule is matched, the updated rule feature value list will be used for matching.
[0068] When deleting a preset rule in the preset rule table, the following sub-steps D1-D5 are included:
[0069] D1. Receive a rule deletion instruction, where the rule deletion instruction includes a target rule in a preset rule table to be deleted;
[0070] D2. Delete the target rule in the preset rule table according to the rule deletion instruction to obtain a deletion rule table;
[0071] D3. Obtain the rule feature value corresponding to each rule field in each preset rule of the deletion rule table;
[0072] D4. Obtain the rule feature value category in the deletion rule table according to all rule feature values in the deletion rule table;
[0073] D5. According to the rule characteristic value corresponding to each rule field in each preset rule of the deletion rule table and the rule characteristic value category in the deletion rule table, obtain the deletion rule characteristic value list corresponding to the deletion rule table; the deletion rule characteristic value list includes: the mapping relationship between the rule characteristic value category in each deletion rule table and the rule characteristic value category in the current deletion rule table in all preset rules in the deletion rule table.
[0074] When deleting preset rules, the user can directly select the target rule in the preset rule table to be deleted, and then delete the target rule in the preset rule table according to the rule deletion instruction to obtain the deleted target rule table. After obtaining the deleted target rule table, the rule feature value list will be updated again to obtain the deleted rule feature value list. The next time the rule is matched, the deleted rule feature value list will be used for matching.
[0075] Based on the same inventive concept, the embodiment of the present application also provides a data rule matching device for implementing the data rule matching method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data rule matching device embodiments provided below can refer to the limitations on the data rule matching method above, and will not be repeated here.
[0076] In an exemplary embodiment, Figure 2 As shown, a data rule matching device is provided, comprising:
[0077] A first acquisition module 11 is used to acquire a data characteristic value of each data field included in each piece of data to be processed;
[0078] The second acquisition module 12 is used to acquire a target feature value in the data feature value that is the same as the rule feature value category in the preset rule feature value list, wherein the preset rule feature value list includes: a mapping relationship between each rule feature value category in the preset rule table and all preset rules where the current rule feature value category is located in the preset rule table;
[0079] The third acquisition module 13 is used to acquire a data list according to the target feature value and the data feature value of each data field included in each piece of data to be processed, wherein the data list includes: a mapping relationship between each target feature value and all the data to be processed where each target feature value is located;
[0080] The fourth acquisition module 14 is used to acquire the preset rules that each to-be-processed data complies with according to the data list and the preset rule feature value list.
[0081] In an exemplary embodiment, the data rule matching device further includes:
[0082] The output module is used to output prompt information if the data characteristic values of each data field included in the data to be processed do not match the rule characteristic value category, and the prompt information is used to prompt that the data to be processed does not meet the preset rules in the preset rule characteristic value list.
[0083] In an exemplary embodiment, the data rule matching device further includes:
[0084] A fifth acquisition module, configured to acquire a rule characteristic value corresponding to each rule field in each preset rule in the preset rule table before the second acquisition module acquires a target characteristic value in the data characteristic value that is of the same category as the rule characteristic value in the preset rule characteristic value list;
[0085] Obtaining rule feature value categories in the preset rule table according to all rule feature values in the preset rule table, wherein the same rule feature values constitute one rule feature value category;
[0086] A preset rule characteristic value list is obtained according to the rule characteristic value corresponding to each rule field in each preset rule in the preset rule table and the rule characteristic value category in the preset rule table.
[0087] In an exemplary embodiment, the data rule matching device further includes:
[0088] A first receiving module, used for receiving a newly added preset rule;
[0089] An adding module is used to add the newly added preset rules to the preset rule table to obtain an updated rule table;
[0090] A sixth acquisition module, used to acquire a rule characteristic value corresponding to each rule field in each preset rule of the update rule table;
[0091] A seventh acquisition module, used to acquire the rule characteristic value category in the update rule table according to all rule characteristic values in the update rule table;
[0092] The eighth acquisition module is used to obtain an update rule characteristic value list corresponding to the update rule table according to the rule characteristic value corresponding to each rule field in each preset rule in the update rule table and the rule characteristic value category in the update rule table, wherein the update rule characteristic value list includes: a mapping relationship between the rule characteristic value category in each update rule table and the rule characteristic value category in the current update rule table in all preset rules in the update rule table.
[0093] In an exemplary embodiment, the data rule matching device further includes:
[0094] A second receiving module, configured to receive a rule deletion instruction, wherein the rule deletion instruction includes a target rule in a preset rule table to be deleted;
[0095] A deletion module, used to delete the target rule in the preset rule table according to the rule deletion instruction, and obtain a deletion rule table;
[0096] A ninth acquisition module, used to acquire a rule characteristic value corresponding to each rule field in each preset rule of the deletion rule table;
[0097] A tenth acquisition module, used for acquiring the rule characteristic value category in the deletion rule table according to all the rule characteristic values in the deletion rule table;
[0098] The eleventh acquisition module is used to obtain a deletion rule characteristic value list corresponding to the deletion rule table according to the rule characteristic value corresponding to each rule field in each preset rule in the deletion rule table and the rule characteristic value category in the deletion rule table; the deletion rule characteristic value list includes: a mapping relationship between the rule characteristic value category in each deletion rule table and the rule characteristic value category in the current deletion rule table in all preset rules in the deletion rule table.
[0099] In an exemplary embodiment, the first acquisition module specifically includes:
[0100] The acquisition submodule is used to use a regular expression function to obtain the data feature value of each data field included in each piece of data to be processed.
[0101] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 3As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data rule matching data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data rule matching method is implemented.
[0102] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0103] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0104] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0105] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0106] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0107] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0108] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0109] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0110] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A data rule matching method, characterized in that: The data rule matching method comprises: Obtaining the data characteristic value of each data field included in each piece of data to be processed; Obtaining a target feature value in the data feature value that is the same as a rule feature value category in a preset rule feature value list, wherein the preset rule feature value list includes: a mapping relationship between each rule feature value category in the preset rule table and all preset rules where the current rule feature value category is located in the preset rule table; Acquire a data list according to the target feature value and the data feature value of each data field included in each piece of data to be processed, wherein the data list includes: a mapping relationship between each target feature value and all the data to be processed where each target feature value is located; The preset rule that each of the to-be-processed data complies with is obtained according to the data list and the preset rule feature value list.
2. The data rule matching method according to claim 1, characterized in that: The data rule matching method further includes: If none of the data feature values of the data fields included in the data to be processed matches the rule feature value category, a prompt message is output, where the prompt message is used to prompt that the data to be processed does not conform to the preset rule in the preset rule feature value list.
3. The data rule matching method according to claim 1, characterized in that: Before obtaining the target feature value in the data feature value that is the same as the rule feature value category in the preset rule feature value list, the data rule matching method further includes: Obtain the rule feature value corresponding to each rule field in each preset rule in the preset rule table; Obtaining a rule feature value category in the preset rule table according to all the rule feature values in the preset rule table, wherein the same rule feature values constitute one rule feature value category; The preset rule characteristic value list is obtained according to the rule characteristic value corresponding to each rule field in each preset rule in the preset rule table and the rule characteristic value category in the preset rule table.
4. The data rule matching method according to claim 3, characterized in that: The data rule matching method further includes: Receive newly added preset rules; Adding the newly added preset rule to the preset rule table to obtain an updated rule table; Obtaining a rule characteristic value corresponding to each rule field in each preset rule of the update rule table; Acquire the rule characteristic value category in the update rule table according to all rule characteristic values in the update rule table; According to the rule characteristic value corresponding to each rule field in each preset rule of the update rule table and the rule characteristic value category in the update rule table, an update rule characteristic value list corresponding to the update rule table is obtained, and the update rule characteristic value list includes: a mapping relationship between each rule characteristic value category in the update rule table and all preset rules in the update rule table where the rule characteristic value category in the current update rule table is located.
5. The data rule matching method according to claim 3, characterized in that: The data rule matching method further includes: receiving a rule deletion instruction, wherein the rule deletion instruction includes a target rule in the preset rule table to be deleted; Deleting the target rule in the preset rule table according to the rule deletion instruction to obtain a deletion rule table; Obtaining a rule characteristic value corresponding to each rule field in each preset rule of the deletion rule table; Acquire the rule characteristic value category in the deletion rule table according to all rule characteristic values in the deletion rule table; According to the rule characteristic value corresponding to each rule field in each preset rule of the deletion rule table and the rule characteristic value category in the deletion rule table, a deletion rule characteristic value list corresponding to the deletion rule table is obtained; the deletion rule characteristic value list includes: a mapping relationship between each rule characteristic value category in the deletion rule table and all preset rules in the deletion rule table where the rule characteristic value category in the current deletion rule table is located.
6. The data rule matching method according to claim 1, characterized in that: The step of obtaining the data characteristic value of each data field included in each piece of data to be processed specifically includes: Use the regular expression function to obtain the data feature value of each data field included in each piece of data to be processed.
7. A data rule matching device, characterized in that: The data rule matching device comprises: A first acquisition module is used to acquire a data characteristic value of each data field included in each piece of data to be processed; A second acquisition module is used to acquire a target feature value in the data feature value that is the same as a rule feature value category in a preset rule feature value list, wherein the preset rule feature value list includes: a mapping relationship between each rule feature value category in the preset rule table and all preset rules where the current rule feature value category is located; A third acquisition module is used to acquire a data list according to the target feature value and the data feature value of each data field included in each piece of data to be processed, wherein the data list includes: a mapping relationship between each target feature value and all the data to be processed where each target feature value is located; The fourth acquisition module is used to acquire the preset rule that each of the to-be-processed data complies with according to the data list and the feature value list.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the data rule matching method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data rule matching method described in any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data rule matching method described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Information recommendation method and device
CN112084291A
Data storage method, data query method and related devices
CN117972012A
Data storage method and device, data query method and device and electronic equipment
CN118193518A
Incremental updates for ordered multi-field classification rules when represented by a tree of longest prefix matching tables
US20150149395A1
