Data processing method, data distribution method and related device

By parsing data query rules into data items and splitting them into filter conditions, the problem of low data matching efficiency in complex systems is solved, efficient data matching and distribution is achieved, and the flexibility and scalability of the system are improved.

CN118656523APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410649594.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing technologies are inefficient in efficiently matching and distributing specific data in complex systems, and the data query rule parsing and filtering processes are cumbersome, affecting the efficiency and maintainability of data processing.

Method used

By parsing data query rules into data items, performing string matching and splitting into filter conditions, information loss is reduced and data integrity is improved. The split filter conditions are directly used in the data matching process to avoid repeated parsing and improve Matching efficiency.

Benefits of technology

It improves the efficiency of data matching and the readability and maintainability of rules, simplifies condition configuration, and supports flexible data distribution and expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656523A
    Figure CN118656523A
Patent Text Reader

Abstract

The invention relates to a data processing method and device, computer equipment and a storage medium, and a data distribution method and device, computer equipment and a storage medium. The data processing method comprises the steps of analyzing a rule expression of a data query rule into data items, matching a character string matching rule with the data items, screening out a target data item from the data items, and splitting the data query rule into data filtering conditions based on the target data item. By adopting the method, efficient data matching can be realized. The data distribution method comprises the following steps: in response to a data request, matching data filtering conditions in a request entry participation data filtering condition set in the request, and if the data filtering conditions matched with the request entry participation data filtering condition set exist in the data filtering condition set, obtaining a target routing address corresponding to the data filtering condition set, and forwarding the data request based on the target routing address. By adopting the method, efficient distribution of the data can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a data processing method, a data distribution method and related devices. Background Art

[0002] As production operations become more and more complex, there will be more and more conditions in the system, such as judgment conditions and matching conditions. It is difficult to efficiently match data that meets specific conditions.

[0003] At present, the common processing method for matching specific data is to set a data query rule and use the data query rule to match data. How to perform efficient data query or data matching based on the data query rule is one of the hot issues in the current data processing field. Summary of the invention

[0004] Based on this, a data processing method, a data distribution method and related devices are provided that can achieve efficient data matching.

[0005] In a first aspect, the present application provides a data processing method. The method comprises:

[0006] Parsing the rule expression of the data query rule into data items;

[0007] Match the string matching rule with the data item, and filter out the target data item that matches the string matching rule from the data item;

[0008] Based on the target data items, the data query rules are split into data filtering conditions.

[0009] In a second aspect, the present application further provides a data processing device. The device comprises:

[0010] A parsing module, used for parsing the rule expression of the data query rule into data items;

[0011] A matching module is used to match the string matching rule with the data item, and filter out the target data item that matches the string matching rule from the data item;

[0012] The splitting module is used to split the data query rules into data filtering conditions based on the target data items.

[0013] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the above-mentioned data processing method embodiments are implemented.

[0014] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above-mentioned data processing method embodiments are implemented.

[0015] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned data processing method embodiments are implemented.

[0016] The above data processing method parses the rule expression of the data query rule into data items. Since the data items can retain the necessary information and attributes defined in the rule expression, parsing the data query rule into data items can reduce the possibility of information loss and improve the data integrity and reliability of subsequent data processing. Further, the string matching rule is matched with the data item to filter out the target data item that matches the string matching rule from the data item. Finally, based on the target data item, the data query rule is split into data filtering conditions, so that in the subsequent data matching process, the computer device can directly match the data through the split data filtering conditions. The above data processing process uniformly splits the data query rule into data filtering conditions, and there is no need to re-execute the step of parsing the complex data query rule into data filtering conditions each time the data is matched, which effectively improves the efficiency of data matching. In addition, the splitting of the data query rule is conducive to improving the readability and maintainability of the rule, making the management and modification of the rule more convenient. In summary, the adoption of this scheme can improve the efficiency of data matching.

[0017] In a sixth aspect, the present application also provides a data distribution method. The method comprises:

[0018] In response to a data request carrying a request input parameter, matching the request input parameter with a data filtering condition in a data filtering condition set; the data filtering condition set includes at least one data filtering condition, and the data filtering condition is obtained by using the steps in any one of the above data processing method embodiments;

[0019] If there is a data filtering condition in the data filtering condition set that matches the request input parameter, obtain the target routing address corresponding to the data filtering condition set;

[0020] Forward the data request to the target device corresponding to the target routing address.

[0021] In a seventh aspect, the present application further provides a data distribution device. The device comprises:

[0022] A response module, configured to respond to a data request carrying a request input parameter and match the request input parameter with a data filtering condition in a data filtering condition set; the data filtering condition set includes at least one data filtering condition, and the data filtering condition is obtained by using the steps in any one of the above data processing method embodiments;

[0023] An acquisition module, used for acquiring a target routing address corresponding to the data filtering condition set when there is a data filtering condition matching the request input parameter in the data filtering condition set;

[0024] The distribution module is used to forward the data request to the target device corresponding to the target routing address.

[0025] In an eighth aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the above-mentioned data distribution method embodiments are implemented.

[0026] In a ninth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the above-mentioned data distribution method embodiments are implemented.

[0027] In a tenth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned data distribution method embodiments are implemented.

[0028] In the above data distribution method, after receiving the data request, the request input in the data request is directly matched with the data filter conditions in the data filter condition set, which reduces the redundant operation of the parsing rules and can quickly filter out the data filter conditions that match the request input. When there is a data filter rule that matches the request input from the data filter condition set, the routing address corresponding to the data filter condition set is directly obtained, and then the data request is forwarded to the target device corresponding to the target routing address, thereby realizing efficient forwarding of the data request. The entire scheme directly matches the request input through the data filter condition set and associates the data filter condition set with the routing address. It can not only quickly match data, determine the target routing address, and realize efficient distribution of data requests, but also supports flexible addition and configuration of new data filter condition sets, data query rules, and associations between target devices according to needs to meet the growing data distribution tasks, with higher flexibility and scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 An application environment diagram of a data processing method in an embodiment;

[0030] Figure 2 is a flow chart of a data processing method in one embodiment;

[0031] Figure 3 A schematic diagram of a flow chart of a step of matching a target data item in one embodiment;

[0032] Figure 4 is a flow chart of a data processing method in another embodiment;

[0033] Figure 5 A schematic diagram of a result of querying a filter in another embodiment;

[0034] Figure 6 An application environment diagram of a data distribution method in an embodiment;

[0035] Figure 7 A schematic diagram of a flow chart of a data distribution method in an embodiment;

[0036] Figure 8 is a flow chart of a data distribution method in another embodiment;

[0037] Fig. 9 is a detailed flow chart of a data distribution method in an embodiment;

[0038] Fig.10 is a structural block diagram of a data processing device in one embodiment;

[0039] Fig.11 is a structural block diagram of a data distribution device in one embodiment;

[0040] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

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

[0042] As production operations become more and more complex, there are more and more conditions in the system, such as judgment conditions and matching conditions. Efficiently matching data that meets specific conditions or achieving accurate data distribution is a key issue currently being addressed in the industry.

[0043] Currently, the common way to match specific data is to configure the conditions into the database in a configurable manner. If the conditions change later, you only need to modify the conditions on the configuration page without recoding or testing online.

[0044] There are two common configuration methods: one is flat configuration, adding a configuration table for each condition. However, when adding or modifying configuration items, each related configuration item needs to be modified and updated, which is difficult to modify and not flexible enough, thus affecting the efficiency of data matching. The other is to configure conditions in json. Although it can meet the requirements, if the configured conditions are very complex, the entire json file will be lengthy and difficult to understand. Similarly, it increases the difficulty of the data matching process and affects the efficiency of data matching.

[0045] Furthermore, accurate data distribution depends on efficient and accurate data filtering and matching. Taking product production as an example, with the dramatic increase in business volume, a single business cluster can no longer meet the demand. For example, grayscale verification is required before the product goes online, and some products need to be diverted to the grayscale cluster for grayscale verification. When there is a problem with the data in one of the clusters, the traffic and products need to be diverted to other clusters. The above situations all involve a common problem, that is, how to efficiently distribute data requests to various clusters, and efficient data distribution is inseparable from efficient data filtering and matching operations. It can be seen that it is crucial to provide an efficient data matching solution.

[0046] Based on the above considerations, this application starts from the perspective of simplifying condition configuration. First, a set of simple and easy-to-understand rule syntax is predefined. Developers construct rule expressions for data query rules based on the rule syntax and data matching requirements. After obtaining the rule expression of the data query rule, the computer device parses the rule expression into multiple data items that can represent the elements in the rule expression, and then matches the data items with the preset string matching rules to match the target data items that meet the string matching rules. Finally, based on the matched target data items, the data query rules are split into multiple data filtering conditions that can effectively handle data query and data filtering, and the data filtering conditions can be used and transmitted in different systems and environments, so that data screening can adapt to different application requirements. The entire solution can improve the efficiency of data matching, meet data requirements in different scenarios, and is more flexible.

[0047] The data processing method of the present application can be executed by a computer device, which can be a terminal or a server. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers, and can also be a cloud server capable of cloud computing.

[0048] The data processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 is loaded with a predefined rule grammar file and a predefined plurality of string matching rules. Specifically, the developer can enter the rule expression of the data query rule in the rule configuration interface of the terminal 102 according to the predefined rule grammar, and then send a rule generation message carrying the rule expression to the server 104 through the terminal 102. The server 104 responds to the rule generation message, obtains the rule expression of the data query rule, and then parses the rule expression into multiple data items, and then matches the preset string matching rule with the multiple data items, accurately matches the target data items that meet the string matching rule, and then splits the data query rule into data filtering conditions based on the target data items. It can be understood that the number of data filtering conditions after splitting can be multiple.

[0049] In some embodiments, Figure 2 As shown, a data processing method is provided, which can be executed by a computer device, specifically by a processor of the computer device. Figure 2 The data processing method may include the following steps:

[0050] S200, parsing the rule expression of the data query rule into data items.

[0051] A regular expression is an expression built based on a predefined rule syntax, which is used to describe the logical structure and requirements of a rule or condition. A regular expression is usually composed of keywords, operators, variables, and constants, etc., and is used to express specific judgment, filtering, or operation logic. Among them, keywords refer to words or phrases with special meanings, and operators can include comparison operators (such as equal, not equal, greater than, less than, etc.), logical operators (such as and, or, not, etc.) and arithmetic operators (such as addition, subtraction, multiplication, etc.). Variables in a regular expression refer to placeholders that can represent different values ​​in the expression. Variables can be predefined or dynamically generated according to actual conditions. In a regular expression, variables can be used to represent comparison objects in conditions, attributes or states of data items, etc. Constants can be numbers, strings, Boolean values, etc. Data items represent elements in a regular expression, and can include but are not limited to components of a regular expression such as variables, constants, and operators.

[0052] In this embodiment, the rule expression of the data query rule can be an expression constructed by the developer based on the data query requirements using a predefined rule grammar to express a specific data filtering operation. A set of grammar processors and rule grammar definition files are pre-built in the server, and the rule grammar definition files include various grammar rules for describing and defining rule expressions. Through the grammar processor and the rule grammar file, the rule expression of the custom data query rule can be parsed, and the custom rule expression can be converted into specific data that can be used for data query matching. In other words, the rule expression can be made effective and have the function of data filtering.

[0053] In specific implementation, the developer can enter the rule expression of the data query rule in the rule configuration interface of the terminal according to the data query requirements and the predefined rule syntax, and then send a rule generation message carrying the rule expression to the server through the terminal. The server responds to the rule generation message and obtains the rule expression of the data query rule entered by the developer. For example, the rule expression can be: (productCode: (1410 OR 5* OR 2318 OR 122) AND (free: {* TO 0.06])). It can be understood that the developer can enter multiple or single rule expressions at a time. Among them, productCode is the product code and free is the rate.

[0054] After obtaining the rule expression of the data query rule input by the developer, the rule expression can be parsed into tokens (i.e., data items) by a syntax parser built based on a preset rule syntax definition file and a JavaCC tool. The data items can be components of the rule expression such as variables, constants, and operators. Taking the rule expression as the above rule expression (productCode :(1410 OR 5* OR 2318 OR 122) AND(free:{* TO 0.06])) as an example, the above rule expression can be parsed into the following data items by the syntax parser: (, productCode, :, (, 410, OR, 5*, OR, 2318, OR, 122,), AND, (, free, :, {, *, TO, 0.06,],),). If the number of received rule expressions is multiple, the rule expressions can be parsed one by one, and each rule expression can be split into multiple data items.

[0055] In some other embodiments, the regular expression may be parsed by constructing a parse tree, traversing the parse tree from the root node, and identifying and extracting data items according to different node types and rule definitions.

[0056] In other embodiments, the regular expression may be split into multiple data items by string segmentation. According to the specific format of the regular expression, an appropriate separator may be selected for splitting, and the substrings obtained by the splitting are used as independent data items.

[0057] S400, matching the string matching rule with the data item, and filtering out target data items that match the string matching rule from the data item.

[0058] String matching rules refer to a method used to determine whether a string matches a certain pattern or rule, including regular expressions, wildcard patterns, string matching algorithms, and general pattern matching rules.

[0059] The developer may have written multiple string matching rules for string matching in advance according to the rule syntax, and stored the string matching rules in advance on the server. In specific implementation, after obtaining the rule expression, the server can generate the corresponding rule matcher object according to the string matching rule. Then, for each data item, the generated rule matcher is used to match the data. Specifically, the data item is used as input, the corresponding method of the rule matcher is called, and the string matching rule is provided as the matching pattern. The rule matcher will match according to the given rules, filter out the target data items that match the string matching rules, and obtain the data matching results. The data matching results include the complete matched string, the content of the capture group, and the start and end positions of the match.

[0060] S600, splitting the data query rule into data filtering conditions based on the target data item.

[0061] After matching the target data item, the server can split the data query rule into multiple data filtering conditions based on the key fields and attributes in the target data item to obtain a set of data filtering conditions. In this way, in the subsequent data matching process, there is no need to parse the data query rule in real time to determine the data filtering conditions. In addition, for complex data query rules containing multiple data filtering requirements, there is no need to parse the data query rule into multiple data filtering conditions in real time, but data filtering matching can be performed directly through the multiple data filtering conditions after splitting.

[0062] In this embodiment, the data query rules can be split based on the target data items to generate a query filter (Filter) containing multiple data filtering conditions, that is, the data filtering conditions belong to the data in the leaf nodes of the query filter, and the data filtering condition set is presented in the form of a query filter. Exemplarily, multiple data filtering conditions can be generated based on fields in multiple target data items such as operators, parameter values ​​or tags, and each data filtering condition is determined as a leaf node in the query filter. Each leaf node can be a specific query filter or a combined filter. Then, based on the logical operation relationship between the data filtering conditions, the leaf nodes are combined to construct an instantiated query filter (also called a query filter entity) corresponding to the data query rule.

[0063] Furthermore, after obtaining the query filter, the generated query filter can be cached in the rule matching component RuleMatchUtils, and then the rule matching component RuleMatchUtils can be packaged into a data package such as a JAR package so that it can be introduced and used in other projects to achieve data filtering and matching. If the query filter is applied to a data set, data that meets the data filtering conditions specified by the data query rule can be directly filtered out from the data set.

[0064] Specifically, a query filter refers to a condition or rule used to limit the results of a data query, and is usually used to filter data so that only records or data rows that meet specific conditions are returned. The query filter stores information such as attributes, operators, and values, which are used to define the detailed rules and conditions of the query filter. In this embodiment, the query filter can be an entity class. The types of query filters include exact query filters (TermFilter), prefix query filters (PrefixFilter), fuzzy query filters (WildcardFilter), range query filters (RangeFilter), and Boolean query filters (BoolFilter) that implement compound condition filtering.

[0065] Taking the above exemplary rule expression as an example, the query filter constructed corresponding to the rule expression should be BooleanFilter (Boolean query filter), where BooleanFilter can be understood as a non-leaf node of a tree, which can contain multiple child nodes, and the relationship between child nodes can be specified, such as must be satisfied (MUST), must not be satisfied (MUST_NOT), or one of them is satisfied (SHOULD), where each child node can also be a specific filter or a BooleanFilter.

[0066] The above data processing method parses the rule expression of the data query rule into data items. Since the data items can retain the necessary information and attributes defined in the rule expression, parsing the data query rule into data items can reduce the possibility of information loss and improve the data integrity and reliability of subsequent data processing. Further, the string matching rule is matched with the data item to filter out the target data item that matches the string matching rule from the data item. Finally, based on the target data item, the data query rule is split into data filtering conditions, so that in the subsequent data matching process, the computer device can directly match the data through the split data filtering conditions. The above data processing process uniformly splits the data query rule into data filtering conditions, and there is no need to re-execute the step of parsing the complex data query rule into data filtering conditions each time the data is matched, which effectively improves the efficiency of data matching. In addition, the splitting of the data query rule is conducive to improving the readability and maintainability of the rule, making the management and modification of the rule more convenient. In summary, the adoption of this scheme can improve the efficiency of data matching.

[0067] like Figure 3 As shown, in some embodiments, the string matching rule includes a first regular expression for describing the rule type, and a second regular expression for describing the logical operation relationship; S400 includes:

[0068] S420: For each data item, perform regular matching between the first regular expression and the data item, and select first data items matching the first regular expression from the data items.

[0069] S440: For each data item, perform regular matching between the second regular expression and the data item, and select second data items matching the second regular expression from the data items.

[0070] S460: Determine the first data item and the second data item as target data items.

[0071] In practical applications, the rule types of string matching rules include exact matching, prefix matching, range matching, and Boolean matching. The logical operation relationship between data items can be AND, OR, NOT, SHOULD, MUST, and MUST_NOT. A regular expression is an expression used to describe a string pattern, which is specifically written using specific symbols and grammatical rules. Regular expressions include matching patterns, keywords, and wildcards. In this embodiment, the string matching rule includes a first regular expression for describing the rule type, and a second regular expression for describing the logical operation relationship. Among them, the first regular expression is used to describe the required matching pattern. For exact matching, the first expression can be: = value. The second regular expression is used to describe the logical operation relationship between rules. The second regular expression can be =AND.

[0072] In specific implementation, the server may compile and generate a first matcher of the first regular expression and a second matcher of the second regular expression. For each data item, the first matcher of the first regular expression is used to perform regular matching between the data item and the first regular expression. Specifically, the data item is used as input, the matching method of the first matcher is called, and the first regular expression is passed in as the matching pattern. The first matcher matches the data item according to the first regular expression and matches the first data item that matches the first regular expression. Then, the data item is used as input (or the remaining data items other than the first data item are used as input), the matching method of the second regular expression matcher is called, and the second regular expression is passed in as the matching pattern. The second matcher matches the second regular expression with the data item and filters out the second data item that matches the second regular expression. Finally, the first data item and the second data item may be combined to obtain the target data item. It is understandable that in other embodiments, the data item is matched using methods such as a graph wildcard pattern and a string matching algorithm to match the data item that meets the conditions of a specific rule.

[0073] In the above embodiment, by using a first regular expression representing a rule type and a second regular expression representing a logical operation relationship to match data items, complex pattern matching and logical operation relationship screening can be achieved. In addition, regular expressions provide rich syntax and functions, which can meet different matching requirements and support flexible definition of rule types and rule logical operation relationships. By defining multiple rule types and rule logical operation relationships, different matching scenarios and business needs can be expanded and adapted.

[0074] like Figure 4 As shown, in some embodiments, S600 includes:

[0075] S620, determine the rule type of the first data item, and generate a data filtering condition for the first data item based on the rule type and the first data item, and combine the data filtering condition for the first data item according to the logical operation relationship represented by the second data item to obtain the data filtering condition for the data query rule.

[0076] In specific implementation, after matching the first data item and the second data item that conform to the regular expression, the rule type corresponding to the first data item may be determined according to the predefined rule syntax, such as exact match, prefix match, range match, Boolean match, etc. For example, if the first data item is identified as "productCode = 5103", the corresponding matching requirement is "matching data with a product code of 5103", then the rule type corresponding to the first data item is determined to be exact match; if the first data item is "productCode = 5*", the corresponding matching requirement is "matching data with a product code starting with 5", then the rule type corresponding to the first data item is determined to be prefix match; if the first data item is "productCode = 51*3, 5?03", the corresponding matching requirement is "matching data with product codes similar to 51*3, 5?03, etc.", then the rule type corresponding to the first data item is determined to be fuzzy match; if the first data item is "free<=0.06", the corresponding matching requirement is "matching data with a rate less than or equal to 0.06", then the rule type corresponding to the first data item is determined to be range match. Then, the logical operation relationship between the first data items represented by the second data items is determined. For example, if the second data item is identified as "AND", the logical operation relationship between the first data items is determined to be "AND".

[0077] Further, based on the determined rule type and the first data item, a query filter corresponding to the first data item is generated. For example, if the rule type of the first data item is prefix matching, a prefix query filter corresponding to the first data item is generated; if the rule type of the first data item is range matching, a range query filter corresponding to the first data item is generated. Next, the target field in the first data item is applied to the filtering condition in the query filter. The target field includes but is not limited to specific keywords, operators, parameter values ​​or tags used in the matched rule expression, and the parameters of the data filtering condition in the query filter are determined based on the target field. For example, if the match is successful and the rule expression is = value, the target field in the first data item, such as value, is used as the specific value of the data filtering condition. If the first data item includes "productCode: 1410", 1410 in the first data item is extracted as the specific value of the data filtering condition, that is, the data filtering condition in the query filter corresponding to the first data item is productCode = 1410.

[0078] Finally, the data filtering condition corresponding to the first data item is regarded as a leaf node, and according to the logical operation relationship between the first data items represented by the second data item, for example, using logical operators such as AND, OR, and NOT, multiple leaf nodes are combined, that is, the data filtering conditions corresponding to the first data items are combined to generate the final query filter. At this time, the query filter can be regarded as a data filtering condition set. In this way, the data can be accurately filtered according to the set rules.

[0079] Take the above rule expression (productCode :(1410 OR 5* OR 2318 OR 122) AND(free:{*TO 0.06])) as an example. Finally, the query filter generated corresponding to the rule expression is shown in the following figure. Figure 5 .

[0080] In this embodiment, the rule type of the first data item is determined and the filtering condition is generated based on it. The method can flexibly adapt to different types of data and different filtering requirements, and the filtering conditions of each data item are combined according to the logical operation relationship represented by the second data item, so that the constructed data query rule is both intuitive and easy to understand. The entire solution can efficiently generate query filters that conform to the regular expression, realize accurate and automatic screening of data, and improve the efficiency and accuracy of data processing.

[0081] In order to make a clearer description of the data processing method provided by the present application, the following is a specific embodiment and Figure 4 To illustrate, this specific embodiment includes the following contents:

[0082] S200, parsing the rule expression of the data query rule into data items.

[0083] S420: For each data item, perform regular matching between the first regular expression and the data item, and select first data items matching the first regular expression from the data items.

[0084] S440: For each data item, perform regular matching between the second regular expression and the data item, and select second data items matching the second regular expression from the data items.

[0085] S460: Determine the first data item and the second data item as target data items.

[0086] S620, determine the rule type of the first data item, and generate a data filtering condition for the first data item based on the rule type and the first data item, and combine the data filtering condition for the first data item according to the logical operation relationship represented by the second data item to obtain the data filtering condition for the data query rule.

[0087] In this embodiment, the rule expression of the data query rule is constructed based on a predefined rule syntax, and the number can be one or more. The rule expression can be (productCode :(1410 OR 5* OR 2318 OR 122) AND(free:{* TO 0.06])).

[0088] Specifically, after the server obtains the above regular expression, it can be a syntax parser generated by javacc to parse the regular expression into multiple data items. Through the syntax parser, the above regular expression is decomposed, and the data items obtained are as follows: (,productCode,:,(,410,OR,5*,OR,2318,OR,122,),AND, (,free,:,{,*,TO,0.06,],),).

[0089] Then, for each data item, the first matcher of the pre-built first regular expression is called to perform regular matching on the data item and the first regular expression. Specifically, the data item is used as input, the matching method of the first matcher is called, and the first regular expression is passed in as the matching pattern. The first matcher matches the data item according to the first regular expression and matches the first data item that matches the first regular expression. Then, the matching method of the second matcher of the second regular expression is called with the data item as input (or the remaining data items except the first data item as input), the second regular expression is passed in as the matching pattern, and the second matcher matches the second regular expression with the data item and filters out the second data item that matches the second regular expression. The first data item and the second data item are then combined to obtain the target data item.

[0090] After matching the first data item and the second data item that conform to the regular expression, the rule type corresponding to the first data item may be determined according to the predefined rule syntax, such as exact match, prefix match, range match, and Boolean match. For example, if the first data item is identified as "productCode = 5103", it is an exact match; if the first data item is "productCode = 5*", it is determined to be a prefix match; if the first data item is "productCode = 51*3, 5?03", it is determined to be a fuzzy match; if the first data item is "free<=0.06", it is determined to be a range match. Then, the logical operation relationship between the first data item represented by the second data item is determined. For example, if the second data item is identified as "AND", the logical operation relationship between the first data items is determined to be "AND".

[0091] Further, based on the determined rule type and the first data item, a query filter corresponding to the first data item is generated. For example, if the rule type of the first data item is prefix matching, a prefix query filter corresponding to the first data item is generated; if the rule type of the first data item is range matching, a range query filter corresponding to the first data item is generated. Next, the target field in the first data item is applied to the filtering condition in the query filter. The target field includes but is not limited to specific keywords, operators, parameter values ​​or tags used in the matched rule expression, and the parameters of the data filtering condition in the query filter are determined based on the target field. For example, if the match is successful and the rule expression is = value, the target field in the first data item, such as value, is used as the specific value of the data filtering condition. If the first data item includes "productCode: 1410", 1410 in the first data item is extracted as the specific value of the data filtering condition, that is, the data filtering condition in the query filter corresponding to the first data item is productCode = 1410.

[0092] Finally, the data filtering conditions corresponding to the first data items are regarded as leaf nodes. According to the logical operation relationship between the first data items represented by the second data items, for example, using logical operators such as AND, OR, and NOT, the leaf nodes are combined, that is, the data filtering conditions corresponding to the first data items are combined to generate the final query filter. At this time, the query filter can be regarded as a set of data filtering conditions.

[0093] Take the above rule expression (productCode :(1410 OR 5* OR 2318 OR 122) AND(free:{*TO 0.06])) as an example. Finally, the query filter corresponding to the rule expression is generated. Figure 5 .

[0094] Considering that the efficient forwarding of current data requests is inseparable from efficient data matching, based on the same inventive concept, this application also proposes a data distribution method based on the data processing method proposed in the above embodiment. Specifically, the data query rule can be split into multiple data filtering conditions through the above data processing method, and after obtaining the data filtering condition set, the corresponding routing address is pre-set for each data filtering condition set to facilitate the subsequent routing distribution of data.

[0095] The data distribution method provided in the embodiment of the present application can be applied to Figure 6In the application environment shown. Among them, the terminal 105 communicates with the server 106 through the network, and the server 106 communicates with multiple downstream target devices 108 through the network. The data storage system can store the data that the server 106 needs to process. The data storage system can be integrated on the server 106, or it can be placed on the cloud or other network servers. The server 106 is loaded with a data packet exported by the above-mentioned rule matching component RuleMatchUtils, that is, the server 106 can call the query filter in the component. The query filter is constructed using the steps in the above-mentioned data construction method embodiments.

[0096] Specifically, the business personnel may send a data request carrying a request input parameter to the server 106 through the terminal 105. The server 106 receives the request, extracts the request input parameter carried in the request, i.e., the parameter value to be screened, and then matches the request input parameter with the data filter condition in the data filter condition set to determine whether the request input parameter can satisfy a certain data filter condition, wherein the data filter condition is obtained by adopting the steps in the above-mentioned data processing method embodiments. In the case that there is a data filter condition matching the request input parameter in the data filter condition set, the target routing address corresponding to the data filter condition set is obtained, and then the data request is forwarded to the downstream target device 108 corresponding to the target routing address, so that the target device 108 performs corresponding business processing for the request.

[0097] The terminal 105 and the target device 108 may be, but are not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 106 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0098] In some embodiments, Figure 7 As shown, a data distribution method is provided, which is applied to Figure 6 The server 108 in the example is used as an example to illustrate, and the following steps are included:

[0099] S802, in response to a data request carrying a request input parameter, matching the request input parameter with a data filtering condition in a data filtering condition set.

[0100] The data request may be, but is not limited to, an http (Hypertext Transfer Protocol Request) request and an https (Hypertext Transfer Protocol Secure) request. Request input parameters refer to the parameters or data that are included when the client sends a request to the server when making a data request. In this embodiment, the request input parameter may refer to the actual parameter value used as input to a function or interface, which represents the specific value passed to the corresponding function or interface when calling a function or sending a request. The request input parameter may contain various types of data, such as integers, floating point numbers, strings, Boolean values, objects, and arrays, etc., depending on the specific application scenario and requirements.

[0101] In this embodiment, the data filtering condition set is taken as a query filter as an example for explanation. In actual application, the server preliminarily constructs a query filter corresponding to the data query rule for each data query rule written according to the preset rule syntax, adopts the steps in any of the above data processing method embodiments, and then caches the query filter in the rule matching component RuleMatchUtil, and then the rule matching component RuleMatchUtils exports the data packet, imports or introduces the above data packet into the system, so as to directly call the query filter in the component.

[0102] Exemplarily, a business person may send a data request carrying request input parameters, such as an http application request, to a server through a terminal. The server receives the http application request, parses the data request, extracts the request input parameters in the data request, traverses all query filters in the rule matching component RuleMatchUtils, and matches the request input parameters with the data filtering conditions in each query filter to find the data filtering conditions that match the request input parameters.

[0103] Specifically, the server is pre-loaded with multiple filter classes, including request filter, preFilter, RouteFilter, postFilter and DefaultRouteFilter. Among them, the request filter is implemented based on the zuul extension, and is used to intercept data requests and process them according to its own predefined business. In this embodiment, the request filter is used to intercept requests, match the corresponding routing address for the data request, and then forward the request to the downstream processing node corresponding to the routing address. PreFilter is used to pre-process the request, including legality verification, input parameter verification and format verification. RouteFilter is a network routing filter that controls how data packets are forwarded and filtered in the network. RouteFilter can call the data filtering conditions in the query filter to match and route data requests. It can be understood that the data filtering conditions in the query filter entity can also be called routing rules.

[0104] DefaultRouteFilter is used to limit or control whether packets can use the default route. It can decide whether to allow the use of the default route based on specific conditions, rules or policies. For example, it can filter and judge based on parameters such as source IP address, destination IP address, protocol type, port, etc. If a packet does not meet the rules of DefaultRouteFilter, it will be processed according to other rules in the routing table, or the packet will be discarded directly. postFilter is often used to reprocess or filter the acquired data.

[0105] In specific implementation, when the server receives an http application request, the request will first be processed by preFilter. After the request input is preprocessed, the request input can be persistently stored in the database. Then, the request input will be processed by RouteFilter. RouteFilter can obtain the query filter from the rule matching component RuleMatchUtils, and then traverse all query filters, calling the matching method filter.match() in the query filter entity one by one to match the request input. The specific matching logic can be:

[0106] In the process of traversing the query filter, determine whether the current query filter is an ordinary single matching mode query filter (such as the precise query filter TermFilter or fuzzy query filter, WildcardFilter mentioned above). If so, execute the matching method filter.match() in the query filter entity to request the input parameter for matching. If the current query filter is a combined query filter containing multiple matching modes, that is, BooleanFilter, traverse each subfilter (query filter entity) in BooleanFilter. If there is a should relationship between filters, it means that the request input parameter only needs to meet the rules in one filter, that is, any filter. If it is must, it means that the request input parameter must meet the rules in all filters. If it is MUST_NOT, it means that the request input parameter cannot meet any rule in all subfilters.

[0107] S804: When there is a data filtering condition in the data filtering condition set that matches the request input parameter, obtain a target routing address corresponding to the data filtering condition set.

[0108] The target routing address refers to the network address of the final destination that a data packet needs to reach during transmission in network communication. It is usually composed of an IP (Internet Protocol Address) address and a port number, and is used to uniquely identify a host or service in the network. In this embodiment, the routing address can be a specific IP address or a message middleware such as Kafka.

[0109] In actual applications, developers can define routing configuration files. In the routing configuration files, a routing address is configured for each query filter, and the query filter is bound to the routing address. In addition, it also includes configuring the routing mode, diversion ratio, whether it is effective, writing time, update time, writer, and updater information. In the subsequent data matching and filtering process, if the input parameter in the request meets the data filtering conditions in a query filter, the routing address bound to the query filter is obtained, and the request is forwarded to the target device corresponding to the routing address.

[0110] Following the previous step, the server calls all query filters to match the request input parameters. If the request input parameters meet the data filtering conditions in a query filter, it means that the request input parameters hit the data filtering conditions. At this time, the target routing address bound to the query filter can be found from the routing configuration file. If the request input parameters do not meet any of the data filtering conditions in the query filter, the request data is forwarded to the default target device by default.

[0111] S806, forwarding the data request to a target device corresponding to the target routing address.

[0112] The target device may be, but is not limited to, a host, a downstream service cluster, a target device, or a message middleware device.

[0113] After finding the target routing address, the data request can be encapsulated into a data packet or message, including the source routing address, the target routing address and other necessary information, and the correct path and forwarding strategy are selected according to the target routing address to send the data request to the target device. After receiving the data request, the target device can perform data processing operations according to the pre-defined data processing logic.

[0114] In the above data distribution method, after receiving the data request, the request input in the data request is directly matched with the data filter conditions in the data filter condition set, which reduces the redundant operation of the parsing rules and can quickly filter out the data filter conditions that match the request input. When there is a data filter rule that matches the request input from the data filter condition set, the routing address corresponding to the data filter condition set is directly obtained, and then the data request is forwarded to the target device corresponding to the target routing address, thereby realizing efficient forwarding of the data request. The entire scheme directly matches the request input through the data filter condition set and associates the data filter condition set with the routing address. It can not only quickly match data, determine the target routing address, and realize efficient distribution of data requests, but also supports flexible addition and configuration of new data filter condition sets, data query rules, and associations between target devices according to needs to meet the growing data distribution tasks, with higher flexibility and scalability.

[0115] like Figure 8 As shown, in some embodiments, S802 includes: S822, in response to a data request carrying a request input parameter, performing a data type conversion on the request input parameter to obtain a target request input parameter, matching the target request input parameter with a data filter condition in a data filter condition set, and matching the data type of the target request input parameter with the data filter condition set.

[0116] As described in the above embodiments, the request input parameters may contain various types of data, such as integers, floating point numbers, strings, Boolean values, objects, and arrays. Since the type of data in the request input parameters may be inconsistent with the data type in the query filter, in order to improve the data matching efficiency, a schema file may be defined, and the schema file is used to perform type conversion on the fields. In the schema file, data type conversion rules are defined to perform data type conversion on the request input parameters, and the type of the data in the request input parameters is converted to a data type that matches the query filter. The data type conversion rules include converting data of type number to long or double, converting time to date type, and keeping other non-specified data types as string types.

[0117] In specific implementation, the data type conversion of the request input parameter can be performed according to the preset data type conversion rules. Specifically, the data type of the request input parameter can be converted into the data type matching the query filter by parsing the value of the field of the request input parameter and according to the data type conversion rules, the target request input parameter can be obtained. For example, a string of number type is converted into a long integer type (long) or a double precision floating point type (double), a time string is converted into a date type, and other values ​​of non-specified types are kept as string types. Then, the target request input parameter is matched with the data filtering condition in the query filter. Specifically, the fields, types, and attribute values ​​in the data filtering condition defined in the query filter can be compared and matched with the target request input parameter to determine whether the target request input parameter meets the data filtering condition. If the type of the field of the request input parameter is not sure, the field type can be predicted. For example, for integer type (int) and long integer type (long), both are predicted to be converted into long integer type (long); for floating point type (float) and double precision floating point type (double).

[0118] In this embodiment, by performing data type conversion on the request input parameter, the target request input parameter data can be made to conform to the expected type and format, thereby reducing the possibility of data processing errors and improving the accuracy and reliability of data matching.

[0119] In one of the embodiments, before matching the data filtering conditions in the data filtering condition set with the request input, it also includes: performing data verification on the request input parameters, matching the data filtering conditions in the data filtering condition set with the request input, including: when the request input parameters pass the data verification, matching the data filtering conditions in the data filtering condition set with the request input.

[0120] In this embodiment, data verification includes but is not limited to data input verification, garbled code verification, basic format verification, and legality verification.

[0121] Among them, data input parameter verification refers to the verification of request parameters to ensure the existence, integrity and correctness of the data type of the parameters. Specifically, it includes checking whether the required parameters exist, whether the parameter values ​​conform to the specified data type, and whether the parameter length meets the requirements.

[0122] Garbled code check can be performed if the request parameter contains text content to ensure that the encoding format of the text content is correct. This can be achieved by comparing the matching degree between the encoding format of the request parameter and the expected encoding format.

[0123] Basic format verification may be a basic format verification of request parameters, such as verifying whether a mobile phone number conforms to a mobile phone number format, verifying whether an email address conforms to an email address format, and so on.

[0124] The legality check can be, for example, checking whether the request parameters exist in the database, verifying whether the permissions are legal, etc. If illegal request parameters are found, according to specific needs, the corresponding error information can be returned to the client and the subsequent request processing flow can be terminated.

[0125] In specific implementation, preFilter performs data input verification, garbled code verification, basic format verification, and legality verification on the request input according to the above data verification scheme. If the request input passes the data verification of all the above dimensions, the request input is matched with the data filtering conditions in the query filter. If the request input does not meet at least one of the above data verification schemes, the data request will not be processed, and a request exception message will be pushed to the terminal to prompt the user to send a compliant data request again.

[0126] In this embodiment, data verification is performed by requesting input parameters, which can effectively filter out data requests that do not meet data specifications, ensure data accuracy in subsequent processing, and reduce the propagation of erroneous data and processing costs.

[0127] like Figure 8 As shown, in some embodiments, the method further includes: S900, when the data request cannot be forwarded to the target device, generating an asynchronous data distribution task, and executing the asynchronous data distribution task to forward the data request to the target device.

[0128] Asynchronous data distribution tasks are tasks that are used to retransmit abnormal data requests that have not been successfully forwarded to the target device and are executed asynchronously in an independent thread or task scheduler.

[0129] In actual applications, affected by network factors and other factors such as hardware devices, data requests may not be forwarded to the target device normally. If the data request cannot be forwarded to the target device normally, an asynchronous data distribution task can be generated at this time. The task contains the data request information to be distributed, as well as the relevant parameters set, such as the maximum number of retries, current limiting, etc. The asynchronous data distribution task can be stored and managed using an appropriate data structure (such as a queue or a message queue). In order to forward the data request to the target device, an independent thread (or task scheduler) can be called to execute the asynchronous data distribution task. Inside the thread, the processing of executing the asynchronous data distribution task can be adopted in the manner described in the above data distribution embodiment, and the abnormal data request that could not be forwarded normally before is forwarded to the corresponding target device. If the abnormal data request has been forwarded to the target device normally, the abnormal data request is cleared, otherwise, the asynchronous data distribution task is re-executed again until the maximum number of retries is reached. If the maximum number of retries is reached and the abnormal data request is still not forwarded to the target device, the abnormal task data is reported to the background server, and the operation and maintenance personnel are requested to check the abnormal task in time and solve the abnormal problem.

[0130] In this embodiment, the method of using an asynchronous data distribution task to forward abnormal data requests to the target device can ensure that the task is still created and stored when the data request cannot be immediately forwarded to the data processing node.

[0131] In order to provide a more detailed description of the data distribution method provided by the present application, the following is a specific embodiment and the attached Fig. 9 To illustrate, this specific embodiment includes the following contents:

[0132] S102, in response to a data request carrying a request input parameter, performing data verification on the request input parameter.

[0133] S104, when the request input parameter passes the data verification, the data type of the request input parameter is converted to obtain the target request input parameter, and the target request input parameter is matched with the data filtering condition in the query filter, and the data type of the target request input parameter matches the data type of the data filtering condition set.

[0134] S106: When there is a data filtering condition in the query filter that matches the request input parameter, obtain the target routing address corresponding to the query filter.

[0135] S108, forwarding the data request to a target device corresponding to the target routing address.

[0136] S110, when the data request cannot be forwarded to the target device, generating an asynchronous data distribution task, and executing the asynchronous data distribution task to forward the data request to the target device.

[0137] In this embodiment, the query filter is a query filter corresponding to the data query rule obtained by processing the rule expression corresponding to the data query rule through the steps in any of the above data processing method embodiments. In addition, the developer can cache each query filter in the rule matching component RuleMatchUtils, and then configure the corresponding routing address for each query filter (i.e., data query rule) in the routing configuration file, and bind the query filter to the routing address to realize the routing distribution of data.

[0138] In specific implementation, the business personnel may send a data request carrying request input parameters, such as an http application request, to the server through the terminal. The server receives and starts to process the http application request. Specifically, the request will first be processed by the preFilter, which will pre-process the request, including data input parameter verification, garbled code verification, basic format verification, and legality verification.

[0139] When the request input parameters pass the data verification, the request input parameters can be persistently stored in the database, and then the request input parameters will be processed by RouteFilter. RouteFilter can obtain all query filters from the rule matching component RuleMatchUtils, and then traverse all query filters, calling the matching method filter.match() in the query filter one by one to match the request input parameters. The specific matching logic can be:

[0140] In the process of traversing the query filter, determine whether the current query filter is a common single matching mode query filter (such as precise query filter TermFilter or fuzzy query filter, WildcardFilter). If so, execute the matching method filter.match() in the query filter to request the input parameter for matching. If the current query filter is a combined query filter containing multiple matching modes, that is, BooleanFilter, traverse each subfilter (query filter) in BooleanFilter. If the relationship between filters is should, it means that the request input parameter only needs to meet the rules in one filter, that is, any filter. If it is must, it means that the request input parameter must meet the rules in all filters. If it is MUST_NOT, it means that the request input parameter cannot meet the rules in all subfilters.

[0141] If the request input parameter meets the data filtering condition in a query filter, it means that the request input parameter hits the data filtering condition. At this time, the target routing address bound to the hit data filtering condition can be found from the routing configuration file. If the request input parameter does not meet any data filtering condition in the query filter, the request data is forwarded to the default target device by default.

[0142] After finding the target routing address, the data request can be encapsulated into a data packet or message, including the source routing address, the target routing address and other necessary information, and the correct path and forwarding strategy are selected according to the target routing address to send the data request to the target device. After receiving the data request, the target device can perform data processing operations according to the pre-defined data processing logic.

[0143] If the data request cannot be forwarded to the target device normally, an asynchronous data distribution task can be generated at this time. The task contains the data request information to be distributed, as well as the relevant parameters set, such as the maximum number of retries, current limiting, etc. The asynchronous data distribution task can be stored and managed using an appropriate data structure (such as a queue or a message queue). In order to forward the data request to the target device, an independent thread (or task scheduler) can be called to execute the asynchronous data distribution task. Inside the thread, the processing of executing the asynchronous data distribution task can be to adopt the method described in the above data distribution embodiment to forward the abnormal data request that could not be forwarded normally before to the corresponding target device. If the abnormal data request has been forwarded to the target device normally, the abnormal data request is cleared, otherwise, the asynchronous data distribution task is re-executed again until the maximum number of retries is reached. If the maximum number of retries is reached and the abnormal data request is still not forwarded to the target device, the abnormal task data is reported to the background server, and the operation and maintenance personnel are requested to check the abnormal task in time and solve the abnormal problem.

[0144] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0145] Based on the same inventive concept, the embodiment of the present application also provides a data processing device for implementing the data processing method involved above, and a data distribution device for implementing the data distribution 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 processing device embodiments provided below can refer to the above limitations on the data processing method, and the specific limitations in one or more data distribution device embodiments provided can refer to the above limitations on the data distribution device, which will not be repeated here.

[0146] In some embodiments, Fig.10 As shown, a data processing device 800 is provided, including: a parsing module 810, a matching module 820 and a splitting module 830, wherein:

[0147] The parsing module 810 is used to parse the rule expression of the data query rule into data items.

[0148] The matching module 820 is used to match the string matching rule with the data item, and filter out the target data item that matches the string matching rule from the data item.

[0149] The splitting module 830 is used to split the data query rule into data filtering conditions based on the target data item.

[0150] In some embodiments, the string matching rule includes a first regular expression for describing the rule type and a second regular expression for describing a logical operation relationship.

[0151] The matching module 820 is also used to perform regular matching between the first regular expression and the data item for each data item, filter out the first data item that matches the first regular expression from the data item, perform regular matching between the second regular expression and the data item for each data item, filter out the second data item that matches the second regular expression from the data item, and determine the first data item and the second data item as target data items.

[0152] In some embodiments, the splitting module 830 is also used to determine the rule type of the first data item, and based on the rule type and the first data item, generate data filtering conditions for the first data item, and combine the data filtering conditions of the first data item according to the logical operation relationship represented by the second data item to obtain the data filtering conditions of the data query rule.

[0153] In some embodiments, Fig.11 As shown, a data distribution device 900 is provided, including: a response module 910, an acquisition module 920 and a distribution module 930, wherein:

[0154] Response module 910 is used to respond to a data request carrying request input parameters and match the data filtering conditions in the data filtering condition set with the request input parameters; the data filtering condition set includes at least one data filtering condition, and the data filtering conditions are obtained using the steps in any of the data processing method embodiments described above.

[0155] The acquisition module 920 is used to acquire the target routing address corresponding to the data filtering condition set when there is a data filtering condition matching the request input parameter in the data filtering condition set.

[0156] The distribution module 930 is used to forward the data request to the target device corresponding to the target routing address.

[0157] In some embodiments, the device also includes: a conversion module 912, which is also used to convert the data type of the request input parameter to obtain the target request input parameter, and a response module 910, which is also used to match the target request input parameter with the data filtering condition in the data filtering condition set.

[0158] In some embodiments, the apparatus further includes: an exception handling module 950 for generating an asynchronous data distribution task and executing the asynchronous data distribution task to forward the data request to the target device when the data request cannot be forwarded to the target device.

[0159] In some embodiments, the device also includes: a verification module 911, which is used to perform data verification on the request input parameters, and a response module 910, which is also used to match the request input parameters with the data filtering conditions in the data filtering condition set when the request input parameters pass the data verification.

[0160] Each module in the above-mentioned data processing device and data distribution device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0161] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Fig.12As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. 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. 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 such as query filter entities, regular expressions and routing addresses. 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 processing method or a data distribution method is implemented.

[0162] Those skilled in the art will understand that Fig.12 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.

[0163] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the above-mentioned data processing method embodiments or the above-mentioned data distribution method embodiments are implemented.

[0164] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned data processing method embodiments or the above-mentioned data distribution method embodiments are implemented.

[0165] In some embodiments, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps in the above-mentioned data processing method embodiments or the above-mentioned data distribution method embodiments.

[0166] It should be noted that the data involved in this application (including but not limited to data used for analysis such as regular expressions, stored data such as query filter entities, displayed data, etc.) 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 laws, regulations and standards of relevant countries and regions.

[0167] 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 this 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. 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 are not limited to this.

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

[0169] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data processing method, characterized in that: The method comprises: Parsing the rule expression of the data query rule into data items; Matching the string matching rule with the data item, and filtering out target data items that match the string matching rule from the data item; Based on the target data item, the data query rule is split into data filtering conditions.

2. The method according to claim 1, characterized in that The string matching rule includes a first regular expression for describing a rule type and a second regular expression for describing a logical operation relationship; The step of matching the string matching rule with the data item and selecting target data items that match the string matching rule from the data item includes: For each data item, performing regular matching between the first regular expression and the data item, and filtering out the first data item matching the first regular expression from the data items; For each data item, performing regular matching between the second regular expression and the data item, and filtering out second data items matching the second regular expression from the data items; The first data item and the second data item are determined as the target data items.

3. The method according to claim 2, characterized in that The step of splitting the data query rule into data filtering conditions based on the target data item includes: Determining a rule type of the first data item, and generating a data filtering condition for the first data item based on the rule type and the first data item; The data filtering conditions of the data query rule are obtained by combining the data filtering conditions of the first data item according to the logical operation relationship represented by the second data item.

4. A data distribution method, characterized in that: The method comprises: In response to a data request carrying a request input parameter, matching the request input parameter with a data filtering condition in a data filtering condition set; the data filtering condition set includes at least one data filtering condition, and the data filtering condition is obtained by using the data processing method according to any one of claims 1 to 3; If there is a data filtering condition matching the request input parameter in the data filtering condition set, obtaining a target routing address corresponding to the data filtering condition set; The data request is forwarded to a target device corresponding to the target routing address.

5. The data distribution method according to claim 4, characterized in that: The step of matching the request to a data filtering condition in a set of participating data filtering conditions includes: Performing data type conversion on the request input parameter to obtain a target request input parameter, wherein the data type of the target request input parameter matches the data type of the data filtering condition set; The target request is matched with the data filtering conditions in the data filtering condition set.

6. The data distribution method according to any one of claims 4 to 5, characterized in that: The method further comprises: In the case that the data request cannot be forwarded to the target device, an asynchronous data distribution task is generated and executed to forward the data request to the target device.

7. The data distribution method according to any one of claims 4 to 5, characterized in that: Before matching the request to a data filtering condition in a set of participating data filtering conditions, the method further includes: Performing data verification on the request input parameter; The step of matching the request to a data filtering condition in a set of participating data filtering conditions includes: When the request input parameter passes the data verification, the request input parameter is matched with the data filtering condition in the data filtering condition set.

8. A data processing device, characterized in that: The device comprises: A parsing module, used for parsing the rule expression of the data query rule into data items; A matching module, used to match the string matching rule with the data item, and filter out target data items that match the string matching rule from the data item; A splitting module is used to split the data query rule into data filtering conditions based on the target data item.

9. A data distribution device, characterized in that: The device comprises: A response module, configured to respond to a data request carrying a request input parameter and match the request input parameter with a data filtering condition in a data filtering condition set; the data filtering condition set includes at least one data filtering condition, and the data filtering condition is obtained by using the data processing method according to any one of claims 1 to 3 above; An acquisition module, configured to acquire a target routing address corresponding to the data filtering condition set if there is a data filtering condition matching the request input parameter in the data filtering condition set; The distribution module is used to forward the data request to the target device corresponding to the target routing address.

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

11. 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 method according to any one of claims 1 to 3 or 4 to 7 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 or 4 to 7 are implemented.

Citation Information

Cited By

  • Segmented data exporting method and system based on dynamic routing

    CN118860989A