Data processing method and device, equipment and storage medium
By optimizing the pattern sequence and structure of the Rete network, the complexity and high memory usage problems caused by redundant nodes in the Rete network are solved, and the rule matching efficiency and performance are improved.
Patent Information
- Application Number
- CN202411118035.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-13
AI Technical Summary
In financial service scenarios, the Rete network has complex structure and high memory occupancy due to the redundancy of pattern nodes, which affects the efficiency of rule matching.
By obtaining the set of pattern sequences related to the network structure optimization task, filtering and cloning deformation according to the evaluation incentive degree of the pattern sequence, the optimized Rete network is built, redundant nodes are reduced, and the network structure is optimized.
It significantly shortens the rule matching time, reduces memory usage, and improves the performance and efficiency of the Rete network.
Smart Images

Figure CN119128536A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to a data processing method, device, equipment and storage medium. Background Art
[0002] In financial service scenarios, business personnel usually predefine a large number of service rules to conditionally filter and aggregate service data such as user account information and transaction behavior, so as to obtain the expected statistics and case data. Among them, the rule matching network built based on the Rete algorithm, such as the Rete network, can be used to conditionally filter and aggregate service data.
[0003] In the related art, the Rete algorithm builds a Rete network in accordance with the fixed pattern sequence in the service rules formulated by business personnel, and the process does not consider the distribution of pattern nodes in the Rete network. If there are multiple identical patterns in multiple service rules, the Rete network will include a large number of redundant pattern nodes, making the Rete network complex and the memory usage high. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, apparatus, device and storage medium, which can solve the problems of complex Rete network structure and high memory occupancy in related technologies.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, which may include:
[0006] Acquire a first pattern sequence set related to a network structure optimization task; patterns in M first pattern sequences in the first pattern sequence set are decomposed from M service rules, the first pattern sequence includes a pattern, the pattern is used to characterize a constraint condition of the service rule, the network structure optimization task is used to indicate that the number of network nodes corresponding to the target pattern is less than or equal to a preset number, and the target pattern is used to characterize the same constraint condition in at least two service rules of the M service rules;
[0007] According to the evaluation incentives of the M first pattern sequences, a second pattern sequence set is extracted from the first pattern sequence set; the second pattern sequence set includes N second pattern sequences, the evaluation incentive of the second pattern sequence is greater than or equal to the first preset threshold, the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set, and the pattern sequence includes the first pattern sequence;
[0008] A third pattern sequence is selected from a cloned variant pattern sequence set of the i-th second pattern sequence among the N second pattern sequences; the cloned variant pattern sequence set includes the i-th second pattern sequence, a cloned pattern sequence of the i-th second pattern sequence, and a variant pattern sequence of the cloned pattern sequence, and an evaluation incentive degree of the third pattern sequence is greater than or equal to a second preset threshold;
[0009] Through the third pattern sequence, a first Rete network is constructed, and the first Rete network meets the instructions of the network structure optimization task.
[0010] In a second aspect, an embodiment of the present application provides a data processing device, which may include:
[0011] An acquisition module is used to acquire a first pattern sequence set related to a network structure optimization task; the patterns in the M first pattern sequences in the first pattern sequence set are obtained by disassembling the M service rules, the first pattern sequence includes a pattern, the pattern is used to characterize the constraint conditions of the service rules, the network structure optimization task is used to indicate that the number of network nodes corresponding to the target pattern is less than or equal to a preset number, and the target pattern is used to characterize the same constraint conditions in at least two service rules of the M service rules;
[0012] A generation module is used to extract a second pattern sequence set from the first pattern sequence set according to the evaluation incentives of the M first pattern sequences; the second pattern sequence set includes N second pattern sequences, the evaluation incentive of the second pattern sequence is greater than or equal to the first preset threshold, the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set, and the pattern sequence includes the first pattern sequence;
[0013] A screening module is used to screen a third pattern sequence from a cloned variant pattern sequence set of the i-th second pattern sequence among the N second pattern sequences; the cloned variant pattern sequence set includes the i-th second pattern sequence, a cloned pattern sequence of the i-th second pattern sequence, and a variant pattern sequence of the cloned pattern sequence, and the evaluation incentive degree of the third pattern sequence is greater than or equal to a second preset threshold;
[0014] The construction module is used to construct a first Rete network through a third pattern sequence, and the first Rete network meets the instructions of the network structure optimization task.
[0015] In a third aspect, an embodiment of the present application provides a computer device, the computer device comprising: a processor and a memory storing computer program instructions;
[0016] When the processor executes the computer program instructions, the data processing method shown in the first aspect is implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the data processing method shown in the first aspect is implemented.
[0018] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the data processing method shown in the first aspect.
[0019] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the data processing method shown in the first aspect.
[0020] The data processing method, apparatus, device and storage medium of the embodiments of the present application obtain a first pattern sequence set related to a network structure optimization task; the patterns in the M first pattern sequences in the first pattern sequence set are decomposed from M service rules, the first pattern sequence includes a pattern, the pattern is used to characterize the constraint conditions of the service rule, the network structure optimization task is used to indicate that the number of network nodes corresponding to the target pattern is less than or equal to a preset number, and the target pattern is used to characterize the same constraint conditions in at least two service rules of the M service rules; then, according to the evaluation incentive degree of the M first pattern sequences, a second pattern sequence set is extracted from the first pattern sequence set; the second pattern sequence set includes N second pattern sequences, and the evaluation incentive degree of the second pattern sequence is greater than or equal to a first preset threshold value , the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set, and the pattern sequence includes the first pattern sequence; furthermore, a third pattern sequence is screened from the cloned deformation pattern sequence set of the i-th second pattern sequence in the N second pattern sequences; the cloned deformation pattern sequence set includes the i-th second pattern sequence, the cloned pattern sequence of the i-th second pattern sequence and the variant pattern sequence of the cloned pattern sequence, and the evaluation incentive of the third pattern sequence is greater than or equal to the second preset threshold; then, the first Rete network is constructed through the third pattern sequence, and the first Rete network meets the instructions of the network structure optimization task. Therefore, without relying on any network training data, the arrangement order of network nodes corresponding to each mode in the Rete network can be adjusted, the number of network nodes corresponding to a large number of identical modes in the Rete network can be reduced, the Rete network structure is optimized, the complexity and redundancy of the Rete network are reduced, and the memory occupancy rate of the Rete network is reduced. In this way, when the service data is conditionally screened and aggregated through the first Rete network, since the same constraints in multiple service rules correspond to the same network node, the calculation results of the network node can be shared among multiple service rules, reducing the number of repeated calculations of the network node, significantly shortening the rule matching time, improving the rule matching efficiency, and optimizing the Rete network performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 This is a schematic diagram of the structure of the Alpha network in the Rete network before optimization;
[0023] Figure 2This is a schematic diagram of the optimized structure of the Alpha network in the Rete network;
[0024] Figure 3 This is a schematic diagram of the structure of a Beta network in a Rete network before optimization;
[0025] Figure 4 This is a schematic diagram of the optimized structure of the Alpha network in the Rete network;
[0026] Figure 5 This is a schematic diagram of the structure of the Alpha network in the Rete network before optimization;
[0027] Figure 6 This is a schematic diagram of the optimized structure of the Alpha network in the Rete network;
[0028] Figure 7 A flowchart of a data processing method provided in an embodiment of the present application;
[0029] Figure 8 One of the schematic diagrams for comparing data processing results of a data processing method provided in an embodiment of the present application;
[0030] Fig. 9 A second schematic diagram for comparing data processing results of a data processing method provided in an embodiment of the present application;
[0031] Fig.10 is a structural schematic diagram of a data processing device provided by an embodiment of the present application;
[0032] Fig.11 It is a schematic diagram of the structure of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0033] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0034] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0035] The acquisition, storage, use, and processing of data (including but not limited to the features and information in the text) in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0036] In financial risk control business scenarios, it is usually necessary to perform conditional screening and aggregate calculations on the account information and transaction behaviors of a large number of users according to pre-defined service rules, so as to obtain the expected statistics and case information. This often requires a lot of logical judgment, which is difficult to maintain and expand if the traditional hard-coded method is used. Therefore, a service rule engine can be used to separate the process of service rule judgment and execution from the business code. The execution steps of the service rule engine usually include matching, selection and execution. Matching refers to testing and comparing the object to be matched with the conditions in the service rule. Only objects that meet the conditions can perform subsequent selection or service rule conflict resolution, as well as execute the actions specified in the service rule. Service rules can be composed of one or more patterns (indivisible atomic conditions) connected by logical operators.
[0037] Based on this, in actual risk control scenarios, a large number of service rules defined by business personnel usually have some of the same patterns, such as large transaction judgment, merchant type check and business type verification, etc. If the service rule engine does not consider the problem of pattern duplication when generating a matching network, it will lead to a large number of redundant network nodes. Usually, service rule engines are based on the Rete algorithm to build service rule matching networks. Rete networks are divided into Alpha networks and Beta networks. In the Alpha network, type nodes are checked and Alpha network nodes store patterns; in the Beta network, Beta nodes are responsible for association matching between objects of different classes. The Rete algorithm has the characteristic of node sharing, and different service rules can share the same pattern node to avoid repeated matching. However, when building a Rete network, the order of patterns in the service rules will seriously affect the performance of Rete network node sharing.
[0038] Here, we use a simple example to analyze the impact of the order of patterns in service rules on the performance of the Alpha network. Assume that there are three service rules a1&a2&a3&a4, a1&a3&a4, a1&a4, and ai represents the same type of pattern. According to the order of patterns in the above service rules, the Alpha network is constructed as follows: Figure 1 As shown. Figure 1 It can be clearly seen that the Alpha network nodes corresponding to a1 are shared, but a3 and a4 have redundant nodes. If the pattern order of the first service rule is adjusted to a1&a3&a4&a2, the corresponding Alpha network is as follows Figure 2 As shown, two unnecessary duplicate nodes can be avoided. In addition, the following uses a simple example to analyze the impact of the order of service rule types on the performance of the Beta network. Assume that there are currently two service rules a&b&c, b&c&d, where a, b, c, and d represent different types of modes. If the Rete network is constructed according to the mode order in the above service rules, four Beta nodes need to be constructed in the Beta network, such as Figure 3 If the order of the first service rule is adjusted to b&c&a, the corresponding Rete network is as follows Figure 4 As shown, the number of nodes in the Beta network is 3, which can improve the performance of the Rete network by comparison.
[0039] In the related technology, the traditional Rete algorithm builds the Rete network completely according to the pattern order in the service rules formulated by the business personnel, without considering the distribution of the service rule nodes, which will lead to the generation of a large number of redundant nodes, increase unnecessary memory storage costs, and slow down the matching speed of the service rules. Therefore, the Rete network structure can be improved in the following two ways. There are two main existing solutions for improving the Rete network structure: the first is to calculate the time and memory cost of the Rete network in the service rule matching process through the Rete network cost model. The execution process of the model is divided into three steps: the first step is to initialize all Alpha network nodes with the same Token value, the second step is to input training data, and calculate the cost value of the current Rete network structure according to the cost formula, and the third step is to adjust the network structure and execute the first step again until the iteration is completed when the cost value of the current network structure is minimized. The second is to establish a sharing degree model according to the number of repetitions of the pattern in the service rule set, and reorder the pattern to improve the Rete network structure.
[0040] However, in the former method, the cost model relies on a large amount of training data to continuously optimize the Rete network structure, and each time the service rules are updated, new data is required for iterative calculations. This will increase the burden on developers and delay the development process. The quality of training data will greatly affect the performance of the Rete network, and there is no guarantee that high-quality training data can be found after each service rule update. In the latter method, although the sharing degree model can effectively improve the performance of the Rete network, when the sharing degrees of the Alpha network nodes are the same, the original method of arranging the service rules in descending order according to the sharing degrees may not necessarily obtain the optimal solution. For example, suppose there are currently four service rules a1&a2&a3, a1&a2, a1&a3&a4, a1&a4&a5, ai represent the same type of pattern. If the patterns can be arranged in descending order as a1, a3, a4, a2, a5 according to the above sharing degree model, the Rete network constructed in this order is as follows Figure 5 As shown, it can be found that this pattern order is not the optimal solution. If the pattern order is changed to a1, a2, a4, a3, a5, the Rete network constructed by this pattern order is as follows Figure 6 As shown. Figure 6 It can be seen that the optimized pattern order corresponds to fewer network nodes and better performance.
[0041] When the number of rules and the scale of data to be matched are large, the impact of pattern order on Rete network performance is very significant. Therefore, in order to solve the above technical problems, the embodiments of the present application provide a data processing method, a data processing method, an apparatus, a computer device and a storage medium, which can reduce network complexity and redundancy, reduce the number of repeated calculations, improve the efficiency of the Rete algorithm, and reduce the memory usage of the Rete network.
[0042] Based on this, the following will combine the attached Figures 7 to 9 , the methods, devices, computer equipment and storage media of the embodiments of the present application are described in detail. It should be noted that these embodiments are not intended to limit the scope of the disclosure of the present application.
[0043] first, Figure 7 A flowchart of a data processing method provided in an embodiment of the present application.
[0044] like Figure 7 As shown, the data processing method can be applied to a data processing system, and the data processing method can specifically include the following steps:
[0045] Step 710, obtaining a first pattern sequence set related to a network structure optimization task; the patterns in the M first pattern sequences in the first pattern sequence set are decomposed from M service rules, the first pattern sequence includes a pattern, the pattern is used to characterize the constraint conditions of the service rule, the network structure optimization task is used to indicate that the number of network nodes corresponding to the target pattern is less than or equal to a preset number, and the target pattern is used to characterize the same constraint conditions in at least two service rules of the M service rules; Step 720, extracting a second pattern sequence set from the first pattern sequence set according to the evaluation incentive of the M first pattern sequences; the second pattern sequence set includes N second pattern sequences, the evaluation incentive of the second pattern sequence is greater than or equal to a first preset threshold, and the evaluation incentive is determined by affinity and The antibody concentration is determined, and the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task. The antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set, and the pattern sequence includes the first pattern sequence; step 730, screening the third pattern sequence from the cloned deformation pattern sequence set of the i-th second pattern sequence in the N second pattern sequences; the cloned deformation pattern sequence set includes the i-th second pattern sequence, the cloned pattern sequence of the i-th second pattern sequence and the variant pattern sequence of the cloned pattern sequence, and the evaluation incentive of the third pattern sequence is greater than or equal to the second preset threshold; step 740, constructing a first Rete network through the third pattern sequence, and the first Rete network meets the instructions of the network structure optimization task.
[0046] In this way, it is possible to adjust the arrangement order of network nodes corresponding to each mode in the Rete network without relying on any network training data, reduce the number of network nodes corresponding to a large number of identical modes in the Rete network, optimize the Rete network structure, reduce the complexity and redundancy of the Rete network, and thus reduce the memory occupancy rate of the Rete network. In this way, when conditionally screening and aggregating service data through the first Rete network, since the same constraints in multiple service rules correspond to the same network node, the calculation results of the network node can be shared among multiple service rules, reducing the number of repeated calculations of network nodes, significantly shortening the rule matching time, improving the rule matching efficiency, and optimizing the Rete network performance.
[0047] The above steps are described in detail below, as shown below.
[0048] First, involving step 710, in some embodiments of the present application, before step 710, the data processing method also includes a process of generating a first pattern sequence. Based on this, before step 710, the data processing method may also include steps 7401 to 7403.
[0049] Step 7401, based on the network structure optimization task, M service rules are screened from a service rule set, and at least two service rules among the M service rules include the same constraint condition.
[0050] Exemplarily, the service rule set is traversed, and at least two service rules in the service rule set that include the same constraint condition are determined as M service rules, where M is an integer greater than 1.
[0051] Here, by screening at least two service rules in the service rule set that include the same constraint condition, interference of service rules that do not include the same constraint condition can be avoided, thereby increasing the computational complexity of subsequent decomposition.
[0052] It should be noted that the embodiment of the present application can determine M service rules through the above step 7401, or it can traverse the service rule set based on the network structure optimization task and determine all service rules in the service rule set as M service rules.
[0053] Step 7402: Decompose at least two constraints in the M service rules to obtain a constraint sequence, where the constraint sequence includes a pattern for characterizing each constraint in the at least two constraints.
[0054] Exemplarily, at least two constraints in the M service rules may be decomposed to obtain a constraint sequence, which may be expressed as P(p1, p2, ...pe), where P represents a mode and e represents the number of modes. Step 7403: Generate a first mode sequence based on the constraint sequence.
[0055] Specifically, step 7403 may include step 74031 and step 74032.
[0056] Step 74031, divide at least two patterns in the constraint condition sequence according to the pattern type to obtain a pattern class sequence; wherein the pattern class sequence includes at least one pattern class, the pattern class includes at least one pattern, the pattern class corresponds to a class sharing degree, the patterns in the pattern class correspond to a sharing degree, the sharing degree is used to characterize the number of times the constraint condition corresponding to the pattern is repeated in M service rules, the class sharing degree is determined by the sharing degree of each pattern in the pattern class, and the class sharing degree is used to characterize the number of times the same class of constraint conditions are repeated in M service rules.
[0057] For example, there are M service rules, namely r1, r2, ..., rM, and the sharing degree of the pattern can be the number of repetitions of the constraint condition corresponding to the pattern in the M service rules. The sharing degree dp of pattern p can be calculated by the following formula (1):
[0058]
[0059] The sharing degree of a service rule is defined as the sum of the sharing degrees of all patterns in the rule. Assuming that a rule contains m patterns p1, p2, ... pm, the corresponding sharing degrees are dp1, dp2, ..., dpm. The sharing degree dr of the rule can be calculated by the following formula (2):
[0060]
[0061] Assuming that pattern p exists in service rules r1, r2, ..., rM, the corresponding sharing degree is dr1, dr2, ... drM, and the sharing degree dpr of the service rule of pattern p can be calculated by the following formula (3):
[0062]
[0063] And, the class sharing degree of a pattern class is equal to the sum of the sharing degrees of all patterns under the pattern class. Assuming that there are q patterns p1, p2, ... pq in category A, the corresponding pattern sharing degrees are dp1, dp2, ..., dpq. The class sharing degree dc of the pattern class A is calculated by the following formula (4):
[0064]
[0065] Based on this, after grouping by pattern category, the pattern sequence P can be expressed as (C1, C2, ..., Cf), and Ci is a pattern class sequence composed of patterns of the same category, which can be expressed as (pCi,1, pCi,2, ..., pCi,g).
[0066] Step 74032: Sort the patterns in the pattern class sequence according to the class sharing degree corresponding to the pattern class and / or the sharing degree corresponding to the pattern to obtain the first pattern sequence.
[0067] Specifically, the embodiments of the present application provide the following three methods for obtaining the first pattern sequence, as shown below.
[0068] In some embodiments, at least one pattern class includes at least two pattern classes, each of the at least two pattern classes includes one pattern. In this case, each pattern class includes only one pattern. Then, the first pattern sequence can be obtained by arranging the at least two pattern classes only according to the class sharing degree values. Based on this, step 74032 includes:
[0069] At least two pattern classes in the pattern class sequence are arranged in descending order of class sharing degree values to obtain a first pattern sequence.
[0070] Exemplarily, the pattern classes are arranged in descending order according to the class sharing degree, and the patterns in each pattern class are arranged in descending order according to the pattern sharing degree. Pattern categories with the same sharing degree are put into a class group, and ClassSeqi means a class sequence with the same class sharing degree of the i-th class, which can be expressed as (CClassSeqi,1, CClassSeqi,2,..., CClassSeqi,h). Among them, each pattern class in at least two pattern classes in the class sequence, such as CClassSeqi,1, includes only one pattern.
[0071] In some other embodiments, at least one pattern class includes one pattern class, and one pattern class includes at least two patterns. Since there is only one pattern class, the first pattern sequence can be obtained by arranging at least two patterns in one pattern class only according to the sharing degree value. Based on this, step 74032 includes:
[0072] According to the order of sharing degree values from large to small, the patterns in a pattern class are arranged from large to small to obtain a first pattern sequence.
[0073] Exemplarily, patterns with the same sharing degree under the same pattern class are put into a pattern group, and SubSeqi is used to represent the i-th subsequence of the same pattern sharing degree. Here, the pattern sequence is encoded as (ClassSeq1), and in the subsequence ClassSeq1, the pattern sequence is encoded as (SubSeq1, SubSeq2, ..., SubSeqj) according to the pattern sharing degree.
[0074] In some further embodiments, at least one pattern class includes at least two pattern classes, and each of the at least two pattern classes includes at least one pattern. Based on this, step 74032 includes:
[0075] Arrange at least two pattern classes in the pattern class sequence in order of class sharing values from large to small; and arrange the patterns in each pattern class of at least two pattern classes in order of sharing values from large to small to obtain a first pattern sequence.
[0076] Exemplarily, the pattern classes are arranged in descending order according to the class sharing degree, and the patterns in each pattern class are arranged in descending order according to the pattern sharing degree. Pattern categories with the same sharing degree are put into a class group, and ClassSeqi means the class sequence with the same i-th class sharing degree, which can be expressed as (CClassSeqi,1, CClassSeqi,2,..., CClassSeqi,h); patterns with the same sharing degree under the same class are put into a pattern group, and SubSeqi is used to represent the subsequence of the i-th same pattern sharing degree.
[0077] In this way, the pattern sequence can be encoded in two layers, that is, the pattern sequence is encoded as (ClassSeq1, ClassSeq2, ..., ClassSeqk) according to the class sharing degree; in the subsequence ClassSeqi, the pattern sequence is encoded as (SubSeq1, SubSeq2, ..., SubSeqj) according to the pattern sharing degree.
[0078] It should be noted that the type nodes of the Rete network are arranged in descending order according to the class sharing degree of the pattern class, and the Alpha network nodes are arranged in descending order according to the pattern sharing degree. When the pattern sharing degrees are the same, they are arranged in descending order according to the rule sharing degree of the pattern.
[0079] Next, step 720 is involved. In some embodiments of the present application, step 720 may specifically include step 7201 and step 7202.
[0080] Step 7201, according to the evaluation incentive levels of the M first pattern sequences, select N evaluation incentive levels greater than or equal to the first preset threshold from each of the M first pattern sequences; wherein, M is an even number greater than 0, and N is M / 2; M is an odd number greater than 1, and N is (M+1) / 2 or (M-1) / 2.
[0081] For example, if M is 4, then 2 evaluation incentives are selected from each of the 4 first pattern sequences. If M is 5, then 3 evaluation incentives are selected from each of the 5 first pattern sequences. In this way, the number of evaluation incentives can be guaranteed, and more pattern sequences can be collected within a reasonable range to ensure the rationality of obtaining the second pattern sequence set below.
[0082] Step 7202: determine the first pattern sequence corresponding to each evaluation incentive degree among the N evaluation incentive degrees as the second pattern sequence.
[0083] Based on this, the evaluation incentive degree of each of the M first pattern sequences can be calculated by the following steps. The evaluation incentive degrees of the M first pattern sequences, including the first evaluation incentive degree of the i-th first pattern sequence, are taken as an example for explanation. Thus, before step 720, the data processing method can also include steps 7501 and 7502.
[0084] Step 7501, obtain the first affinity and first antibody concentration of the ith first pattern sequence; wherein the first affinity is used to characterize the matching degree between the ith first pattern sequence and the network structure optimization task, and the first antibody concentration is used to characterize the similarity between the ith first pattern sequence and the jth first pattern sequence in the first pattern sequence set, i≠j.
[0085] Step 7502, generates a first evaluation incentive based on the first affinity, the first antibody concentration, the first affinity coefficient corresponding to the first affinity, and the first antibody concentration coefficient corresponding to the first antibody concentration; the first affinity coefficient is used to characterize the proportion of the affinity operator for calculating the first affinity in the first evaluation incentive operator, the first antibody concentration coefficient is used to characterize the proportion of the antibody concentration operator for calculating the first antibody concentration in the first evaluation incentive operator, and the first evaluation incentive operator is the operator for calculating the first evaluation incentive.
[0086] Here, it should be noted that in the embodiments of the present application, pattern sequences such as the first pattern sequence, the second pattern sequence, and the pattern sequences in the cloned deformation pattern sequence set described below can all be regarded as antibodies in the immune algorithm, and their network structure optimization tasks serve as antigens corresponding to their antibodies.
[0087] Exemplarily, the evaluation incentive can represent the final quality of the antibody. The higher the affinity, the lower the antibody concentration, the higher the evaluation incentive. The evaluation incentive of Pi can be calculated by the following formula (5):
[0088] sim(P i )=a·aff(P i )-b·den(P i ) (5)
[0089] Among them, aff(P i ) is the affinity, which can be expressed as the first affinity in this embodiment; a is the first affinity coefficient corresponding to the first affinity; den(P i ) is the antibody concentration, which can be expressed as the first antibody concentration in this embodiment; b is the first antibody concentration coefficient corresponding to the first antibody concentration. a can be expressed as the proportion of the affinity operator in the excitation operator, and b can be expressed as the proportion of the concentration operator in the excitation operator.
[0090] In some embodiments, the above-mentioned step 7501 can be specifically carried out through the following steps 75011 to 75016 to obtain the first affinity and the first antibody concentration, which are respectively described below.
[0091] In the embodiment of the present application, step 7501 may include steps 75011 to 75014 to obtain the first affinity of the i-th first pattern sequence, as shown below.
[0092] Step 75011, when the network structure optimization task corresponds to a task pattern sequence, a second Rete network is constructed according to the i-th first pattern sequence, and the second Rete network includes an Alpha network and a Beta network. The Alpha network includes first network nodes corresponding to the same type of pattern, and the Beta network includes second network nodes corresponding to different types of patterns.
[0093] Step 75012, calculate the affinity of the Alpha network based on the first number of the first network nodes and the first mode number of the i-th first mode sequence, and the affinity of the Alpha network is used to characterize the similarity between the arrangement order of similar modes in the i-th first mode sequence and the arrangement order of similar modes in the task mode sequence.
[0094] Exemplarily, in the immune algorithm process, the embodiment of the present application defines the following operators:
[0095] Affinity evaluation operator. Affinity is used to evaluate the degree of fit between the current antibody and antigen, that is, the degree of closeness between the current solution and the optimal solution. The Rete network is constructed according to the current pattern sequence, and the number of Alpha network nodes A and Beta network nodes B are calculated. Assuming that there are currently j rules r1, r2, ..., rj, and the number of patterns contained in each rule corresponds to q1, q2, ..., qj, the affinity of the Ahpha network can be calculated by the following formula (6):
[0096]
[0097] Step 75013, calculate the affinity of the Beta network based on the second number of second network nodes and the first pattern number, and the affinity of the Beta network is used to characterize the similarity between the arrangement order of different types of patterns in the i-th first pattern sequence and the arrangement order of different types of patterns in the task pattern sequence.
[0098] For example, the affinity of the Beta network can be calculated by the following formula (7):
[0099]
[0100] Step 75014, based on the affinity of the Alpha network and the affinity of the Beta network, generate the first affinity of the i-th first pattern sequence.
[0101] For example, the first affinity of the Rete network can be calculated by the following formula (8):
[0102] aff(P)=aff α (P)+aff β (P) (8)
[0103] Based on this, the higher the Rete network affinity of the antibody, the closer it is to the optimal solution. When the antibody Rete network affinity is the same, the solution with a higher Beta network affinity is considered to be a better solution, because association matching is usually more time-consuming than ordinary matching.
[0104] In the embodiment of the present application, step 7501 may include step 75015 and step 15016 to obtain the first antibody concentration of the i-th first pattern sequence, as shown below.
[0105] Step 75015, when the pattern length and pattern number of the i-th first pattern sequence and the j-th first pattern sequence are the same, compare the patterns in the same position in the i-th first pattern sequence and the j-th first pattern sequence to obtain the pattern matching degree between the i-th first pattern sequence and the j-th first pattern sequence.
[0106] Step 75016, generating the antibody concentration of the ith first pattern sequence based on the pattern matching degree, the pattern length of the ith first pattern sequence, and the number of patterns of the ith first pattern sequence.
[0107] For example, the antibody concentration indicates the similarity between the antibody and other antibodies. The lower the antibody concentration, the more dispersed the antibody is in the solution space, the less likely it is to fall into the local optimal solution, and the higher the credibility. Assuming that there are R antibodies, which are pattern sequences P1, P2, ..., PR, and the pattern length is L, the concentration of Pi can be calculated by the following formula (9):
[0108]
[0109] Furthermore, with respect to step 730 , in one or more possible embodiments, step 730 may specifically include steps 7301 to 7303 .
[0110] Step 7301: select an evaluation motivation degree greater than or equal to a third preset threshold from the clone deformation pattern sequence set of the i-th second pattern sequence.
[0111] Step 7302, select G evaluation incentive degrees greater than or equal to a fourth preset threshold from an evaluation incentive degree corresponding to each second pattern sequence in N second pattern sequences; wherein, if N is an even number greater than 0, G is N / 2; if N is an odd number greater than 1, G is (N+1) / 2 or (N-1) / 2.
[0112] Exemplarily, the N second pattern sequences may be arranged in descending order according to the evaluation excitation degree, and the first half of the second pattern sequences are taken as antibodies, and the remaining solutions are discarded.
[0113] Step 7303: determine the pattern sequence corresponding to each evaluation incentive degree among the G evaluation incentive degrees as the third pattern sequence.
[0114] Based on this, the evaluation incentive degree of each clone deformation pattern sequence in the N clone deformation pattern sequence set can be calculated through the following steps. The i-th clone deformation pattern sequence and the j-th clone deformation pattern sequence in the N clone deformation pattern sequence set are taken as examples for explanation below. The pattern sequence can also include the i-th clone deformation pattern sequence in the clone deformation pattern sequence set.
[0115] In this way, before step 730, the data processing method may also include step 7601 and step 7602.
[0116] Step 7601, obtaining the second affinity and second antibody concentration of the i-th clone deformation pattern sequence in the clone deformation pattern sequence set; wherein the second affinity is used to characterize the matching degree between the i-th clone deformation pattern sequence and the network structure optimization task, and the second antibody concentration is used to characterize the similarity between the i-th clone deformation pattern sequence and the j-th clone deformation pattern sequence in the clone deformation pattern sequence set.
[0117] Step 7602, based on the second affinity, the second antibody concentration, the second affinity coefficient corresponding to the second affinity, and the second antibody concentration coefficient corresponding to the second antibody concentration, generate the second evaluation incentive of the i-th clone deformation pattern sequence; wherein the second affinity coefficient is used to characterize the proportion of the affinity operator for calculating the second affinity in the second evaluation incentive operator, the second antibody concentration coefficient is used to characterize the proportion of the antibody concentration operator for calculating the second antibody concentration in the second evaluation incentive operator, and the second evaluation incentive operator is an operator for calculating the second evaluation incentive of the i-th clone deformation pattern sequence.
[0118] In some embodiments, the above-mentioned step 7601 can be specifically performed through the following steps 76011 to 76016 to obtain the second affinity and the second antibody concentration, which are respectively described below.
[0119] In the embodiment of the present application, step 7601 may include steps 76011 to 76014 to obtain the second affinity of the i-th clone deformation pattern sequence, as shown below.
[0120] Step 76011, when the network structure optimization task corresponds to the task pattern sequence, construct a third Rete network according to the i-th clone deformation pattern sequence, the third Rete network includes an Alpha network and a Beta network, the Alpha network includes a third network node corresponding to the same type of pattern, and the Beta network includes a fourth network node corresponding to a different type of pattern.
[0121] Step 76012, calculate the affinity of the Alpha network based on the number of the third network nodes and the number of modules of the i-th clone deformation pattern sequence, and the affinity of the Alpha network is used to characterize the similarity between the arrangement order of similar patterns in the i-th clone deformation pattern sequence and the arrangement order of similar patterns in the task pattern sequence.
[0122] Step 76013, calculate the affinity of the Beta network based on the number of the second network nodes and the number of patterns in the i-th clone deformation pattern sequence. The affinity of the Beta network is used to characterize the similarity between the arrangement order of different types of patterns in the i-th clone deformation pattern sequence and the arrangement order of different types of patterns in the task pattern sequence.
[0123] Step 76014, based on the affinity of the Alpha network and the affinity of the Beta network, generate a second affinity of the i-th clone deformation pattern sequence.
[0124] In the embodiment of the present application, step 7601 may include step 76015 and step 76016 to achieve the acquisition of the first antibody concentration of the i-th clone deformation pattern sequence, as shown below.
[0125] Step 76015, when the pattern length and pattern number of the i-th clone deformation pattern sequence and the j-th clone deformation pattern sequence are the same, compare the patterns in the same position in the i-th clone deformation pattern sequence and the j-th clone deformation pattern sequence to obtain the pattern matching degree between the i-th clone deformation pattern sequence and the j-th clone deformation pattern sequence.
[0126] Step 76016, generating the antibody concentration of the i-th clone deformation pattern sequence based on the pattern matching degree, the pattern length of the i-th clone deformation pattern sequence, and the number of patterns of the i-th clone deformation pattern sequence.
[0127] In addition, before step 730, a cloned deformed pattern sequence set of each second pattern sequence in the N second pattern sequences needs to be generated so as to screen the third pattern sequence in the cloned deformed pattern sequence set of each second pattern sequence. Here, the i-th second pattern sequence in the N second pattern sequences is still taken as an example for description.
[0128] Based on this, before step 730, the data processing method may further include steps 7701 and 7703.
[0129] Step 7701: construct C clone pattern sequences corresponding to the ith second pattern sequence among N second pattern sequences, where C is a positive integer.
[0130] Step 7702, performing mutation processing on each clone pattern sequence in the C clone pattern sequences to obtain a clone deformation pattern sequence corresponding to each clone pattern sequence.
[0131] Step 7703: construct a cloned deformation pattern sequence set of the i-th second pattern sequence based on the i-th second pattern sequence, the C cloned pattern sequences corresponding to the i-th second pattern sequence, and the cloned deformation pattern sequence corresponding to each cloned pattern sequence.
[0132] Exemplarily, C clones are made for each second pattern sequence to obtain C clone pattern sequences; then, mutation processing is performed on each of the C clone pattern sequences to obtain a clone deformation pattern sequence corresponding to each clone pattern sequence; then, the C clone pattern sequences of each second pattern sequence and the clone deformation pattern sequence corresponding to each clone pattern sequence are mixed to obtain a clone deformation pattern sequence set.
[0133] In some embodiments, each clone pattern sequence includes T pattern classes, each pattern class of the T pattern classes includes K patterns, and K is an integer greater than 1. Based on this, the above step 7702 can specifically include steps 77021 to 77024.
[0134] Step 77021, traverse the T pattern classes in each clone pattern sequence, and obtain a random value corresponding to the rth pattern class in the T pattern classes, r∈[1, T-1].
[0135] Step 77022, when the random value of the rth pattern class is greater than the first preset random value, exchange the positions of the rth pattern class and the r+1th pattern class in the clone pattern sequence until traversing to the T-1th pattern class to obtain the pattern class exchange pattern sequence corresponding to each clone pattern sequence.
[0136] Step 77023, traverse the K patterns in the rth pattern class in the pattern class exchange pattern sequence, and obtain a random value corresponding to the hth pattern among the K patterns.
[0137] Step 77024, when the random value of the hth pattern is greater than the second preset random value, swap the positions of the hth pattern and the h+1th pattern in the rth pattern class until the Tth pattern class is traversed to obtain a clone deformation pattern sequence corresponding to each clone pattern sequence.
[0138] Exemplarily, the first pattern sequence P can be encoded as follows, (ClassSeq1, ClassSeq2, ..., ClassSeqk). When performing mutation processing, the sequence groups ClassSeq are accessed one by one. ClassSeqi can be expressed as (CClassSeqi,1, CClassSeqi,2, ..., CClassSeqi,h). When accessing ClassSeqi, the sequence will be traversed, and a random value will be generated each time it is traversed. Assuming that the currently traversed category sequence is CClassSeqi,j, if the random value is greater than the mutation value, CClassSeqi,j will exchange positions with CClassSeqi,j+1; otherwise, the sequence position of CClassSeqi,j remains unchanged.
[0139] At the same time, the pattern sequence P will be encoded as (SubSeq1, SubSeq2, ..., SubSeqj). After executing the above steps, the sequence groups SubSeq will be accessed one by one. Assuming that SubSeqi can be expressed as (pSubSeqi,1, pSubSeqi,2, ..., pSubSeqi,k), the pattern sequence will be traversed when accessing SubSeqi, and a random value will be generated each time it is traversed. Assuming that the currently traversed pattern sequence is pSubSeqi,j, if the random value is greater than the mutation value, pSubSeqi,j will exchange positions with pSubSeqi,j+1; otherwise, the sequence position of pSubSeqi,j remains unchanged.
[0140] Then, step 740 is involved. In some embodiments of the present application, the third pattern sequence includes G third pattern sequences. Based on this, step 740 may specifically include step 7401:
[0141] A first Rete network is constructed based on G third pattern sequences and NG randomly generated fourth pattern sequences.
[0142] Specifically, step 7401 may include steps 74011 to 74014.
[0143] Step 74011, based on G third pattern sequences and NG fourth pattern sequences, generate a first pattern sequence set for the next iteration.
[0144] Step 74012, perform an iteration step on the first pattern sequence set of the next iteration until the number of iterations is greater than the preset number of iterations, and use the G third pattern sequences output from the xth iteration corresponding to the number of iterations greater than the preset number of iterations as the G fifth pattern sequences.
[0145] The iteration steps include:
[0146] According to the evaluation incentives of the M first pattern sequences, a second pattern sequence set is extracted from the first pattern sequence set, wherein the second pattern sequence set includes N second pattern sequences selected from the M first pattern sequences, the evaluation incentive of the second pattern sequence is greater than or equal to a first preset threshold, the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set where the pattern sequence is located, and the pattern sequence includes the first pattern sequence;
[0147] A third pattern sequence is selected from the set of cloned and deformed pattern sequences of the ith second pattern sequence among N second pattern sequences; the set of cloned and deformed pattern sequences includes the ith second pattern sequence, the cloned pattern sequence of the ith second pattern sequence and the variant pattern sequence of the cloned pattern sequence, and the evaluation incentive degree of the third pattern sequence is greater than or equal to the second preset threshold.
[0148] Step 74013, select a target pattern sequence from G fifth pattern sequences and NG randomly generated sixth pattern sequences, the evaluation incentive degree of the target pattern sequence is greater than or equal to a fourth preset threshold, the target pattern sequence includes a target pattern, and the target pattern is the same pattern in at least two service rules of the M service rules.
[0149] Step 74014, sharing the network nodes corresponding to the target pattern to construct the first Rete network of the target pattern sequence.
[0150] Therefore, for the pattern node sorting problem, the embodiment of the present application can group the pattern sequences according to the sharing degree model and encode them into feasible solutions in the solution space, namely antibodies. It defines operators such as affinity, antibody concentration, encouragement, immune selection, cloning and mutation for this problem, and proposes a process for building a high-performance Rete network through an immune algorithm. Through multiple iterative calculations, the optimal solution for pattern sorting is finally obtained with a high probability.
[0151] In order to better illustrate the data processing method in the embodiment of the present application, the improved Rete algorithm process of the immune algorithm is taken as an example for detailed description.
[0152] Step 1: Initialize the relevant parameters of the immune algorithm, set N first pattern sequences P, maximum immune generation G, clone number NC, mutation probability pm, and excitation coefficients a and b.
[0153] Step 2: Take the network structure optimization task as the antigen and randomly generate NP first pattern sequences as the initial solution. These pattern sequences are sorted according to the sharing degree model. The pattern classes and patterns with the same sharing degree are randomly arranged, and the current immune generation is set to 0.
[0154] Step 3: If the current immune generation number is less than G, a round of iterative calculation is started to calculate the affinity and antibody concentration of each first pattern sequence in the N first pattern sequences, that is, all solutions, to obtain the evaluation incentive degree.
[0155] Step 4: Arrange the NP solutions in descending order according to the evaluation incentive, take the top NP / 2 solutions as antibodies, and discard the rest of the solutions, i.e., perform immune selection.
[0156] Step 5, traverse the antibodies, clone NC for each antibody, obtain clones, i.e., clone pattern sequences, perform mutations on the NC clones, obtain variants, i.e., clone deformation pattern sequences, after the execution is completed, mix the original antibodies, clones, and variants to obtain a clone deformation pattern sequence set, and calculate the evaluation incentive of each antibody in the clone deformation pattern sequence set, take the individual with the largest incentive as the antibody, and obtain NP / 2 antibodies.
[0157] Step 6, randomly generate NP / 2 solutions, mix them with the individuals in Step 5, return to Step 3, and repeat Step 3 to Step 6.
[0158] Step 7: After the iteration is completed, the solution with the largest evaluation excitation degree among the NP solutions is taken as the third pattern sequence.
[0159] Therefore, for a rule set with a large number of nodes with the same shared degree pattern, the data processing method provided in the embodiment of the present application does not rely on any training data, and can find a theoretically approximately optimal pattern ordering within a limited time, as well as verification through the panoramic risk monitoring platform data. The technical solution proposed in the embodiment of the present application can significantly improve the matching efficiency of the Rete network, shorten the matching time, and reduce the memory consumption of the Rete network.
[0160] In order to better illustrate the above technical effects that can be achieved in the embodiments of the present application, the following Figure 8 and Fig. 9 Provide detailed explanation.
[0161] like Figure 8As shown, based on the billions of data connected to the panoramic risk monitoring platform, including the large blending table blending organization table, the UPMP flow blending organization table and the merchant daily statistics table blending organization table, as of May 20, 2024, business personnel have formulated 704, 21, and 36 statistics for each data source respectively. In order to better compare the performance of the algorithm, we expanded the number of rules of the latter two data sources to 100 and 200 respectively during the test, and used the traditional Rete algorithm, the shared degree Rete algorithm and the immune Rete algorithm proposed in the embodiment of the present application to perform rule matching and aggregation calculations. The matching network construction performance of the three algorithms is shown in the following table, where the number of groups refers to grouping all patterns according to the pattern sharing degree. From the table, we can see that the time to build a network using the improved Rete algorithm based on the immune algorithm proposed in the embodiment of the present application will be extended, but the number of network nodes is significantly reduced, which effectively reduces the number of pattern matching and association matching.
[0162] And, if Fig. 9 As shown in the table below, the performance indicators of the network constructed by the three algorithms in rule matching and aggregation calculation are shown in the table below. As can be seen from the table, the immune improved Rete algorithm has significantly improved matching time and memory usage. The matching time of the immune Rete algorithm is 26.4% to 47.0% shorter than that of the traditional Rete algorithm, and about 8.2% to 12.2% shorter than that of the shared Rete algorithm; the memory usage of the immune Rete algorithm is about 21.6% to 48.6% less than that of the traditional Rete algorithm, and about 9.1% to 18.3% less than that of the shared Rete algorithm. The matching accuracy of the three algorithms is 100%.
[0163] In summary, the improved Rete algorithm based on the immune algorithm prolongs the time to build the network, but significantly optimizes the execution time and memory usage of the Rete network, and improves the execution efficiency of the Rete network. Since the frequency of rule set changes is very low, for big data scenarios, the increased network construction time cost is minimal compared to the performance improvement of the Rete network in terms of matching time and memory usage.
[0164] The present application also provides a data processing device, specifically in combination with Fig.10 Provide detailed explanation.
[0165] Fig.10 It is a structural diagram of a data processing device provided by an embodiment of the present application.
[0166] In some embodiments of the present application, Fig.10 The data processing device shown can be arranged in the data processing system provided in the embodiment of the present application.
[0167] like Fig.10 As shown, the data processing device 100 may specifically include:
[0168] An acquisition module 1001 is used to acquire a first pattern sequence set related to a network structure optimization task; the patterns in the M first pattern sequences in the first pattern sequence set are obtained by decomposing M service rules, the first pattern sequence includes a pattern, the pattern is used to characterize the constraint conditions of the service rules, the network structure optimization task is used to indicate that the number of network nodes corresponding to the target pattern is less than or equal to a preset number, and the target pattern is used to characterize the same constraint conditions in at least two service rules of the M service rules;
[0169] A generating module 1002 is used to extract a second pattern sequence set from the first pattern sequence set according to the evaluation incentives of the M first pattern sequences; the second pattern sequence set includes N second pattern sequences, the evaluation incentive of the second pattern sequence is greater than or equal to the first preset threshold, the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set, and the pattern sequence includes the first pattern sequence;
[0170] A screening module 1003 is used to screen a third pattern sequence from a cloned variant pattern sequence set of an i-th second pattern sequence among the N second pattern sequences; the cloned variant pattern sequence set includes the i-th second pattern sequence, a cloned pattern sequence of the i-th second pattern sequence, and a variant pattern sequence of the cloned pattern sequence, and the evaluation incentive degree of the third pattern sequence is greater than or equal to a second preset threshold;
[0171] The construction module 1004 is used to construct a first Rete network through a third pattern sequence, and the first Rete network meets the instructions of the network structure optimization task.
[0172] In this way, it is possible to adjust the arrangement order of network nodes corresponding to each mode in the Rete network without relying on any network training data, reduce the number of network nodes corresponding to a large number of identical modes in the Rete network, optimize the Rete network structure, reduce the complexity and redundancy of the Rete network, and thus reduce the memory occupancy rate of the Rete network. In this way, when conditionally screening and aggregating service data through the first Rete network, since the same constraints in multiple service rules correspond to the same network node, the calculation results of the network node can be shared among multiple service rules, reducing the number of repeated calculations of network nodes, significantly shortening the rule matching time, improving the rule matching efficiency, and optimizing the Rete network performance.
[0173] The data processing device 100 in the embodiments of the present application is described in detail below.
[0174] In some embodiments of the present application, the screening module 1003 in the embodiments of the present application may also be used to screen M service rules from a service rule set based on a network structure optimization task, wherein at least two service rules of the M service rules include the same constraint condition;
[0175] The data processing device 100 in the embodiment of the present application may further include a disassembly module, which is used to disassemble at least two constraints in the M service rules to obtain a constraint sequence, where the constraint sequence includes a pattern for characterizing each constraint in the at least two constraints;
[0176] The generating module 1002 may also be configured to generate a first pattern sequence based on the constraint condition sequence.
[0177] In some embodiments of the present application, the screening module 1003 in the embodiments of the present application can also be used to divide at least two patterns in the constraint condition sequence according to the pattern type to obtain a pattern class sequence; wherein the pattern class sequence includes at least one pattern class, the pattern class includes at least one pattern, the pattern class corresponds to a class sharing degree, the pattern in the pattern class corresponds to a sharing degree, the sharing degree is used to characterize the number of times the constraint condition corresponding to the pattern is repeated in M service rules, the class sharing degree is determined by the sharing degree of each pattern in the pattern class, and the class sharing degree is used to characterize the number of times the same type of constraint condition is repeated in M service rules;
[0178] The data processing device 100 in the embodiment of the present application may further include a sorting module for sorting the patterns in the pattern class sequence according to the class sharing degree corresponding to the pattern class and / or the sharing degree corresponding to the pattern to obtain a first pattern sequence.
[0179] In some embodiments of the present application, the sorting module can be specifically used to arrange at least two pattern classes in a pattern class sequence in order of class sharing values from large to small to obtain a first pattern sequence when at least one pattern class includes at least two pattern classes and each of the at least two pattern classes includes one pattern.
[0180] In some embodiments of the present application, the sorting module can be specifically used to arrange the patterns in a pattern class from large to small in order of sharing degree values from large to small, when at least one pattern class includes a pattern class, and a pattern class includes at least two patterns, to obtain a first pattern sequence.
[0181] In some embodiments of the application, the sorting module can be specifically used to, when at least one pattern class includes at least two pattern classes and each pattern class in the at least two pattern classes includes at least one pattern, arrange the at least two pattern classes in the pattern class sequence in order of class sharing values from large to small; and arrange the patterns in each pattern class of the at least two pattern classes in order of sharing values from large to small to obtain a first pattern sequence.
[0182] In some embodiments of the present application, the screening module 1003 in the embodiments of the present application is used to screen N evaluation incentives greater than or equal to a first preset threshold from each of the M first pattern sequences according to the evaluation incentives of the M first pattern sequences; wherein M is an even number greater than 0, and N is M / 2; M is an odd number greater than 1, and N is (M+1) / 2 or (M-1) / 2;
[0183] The data processing device 100 in the embodiment of the present application may further include a determination module for determining a first pattern sequence corresponding to each of the N evaluation incentive levels as a second pattern sequence.
[0184] In some embodiments of the present application, the acquisition module 1001 is used to acquire the first affinity and the first antibody concentration of the i-th first pattern sequence when the M first pattern sequences include the i-th first pattern sequence and the evaluation incentives of the M first pattern sequences include the first evaluation incentive of the i-th first pattern sequence; wherein the first affinity is used to characterize the degree of matching between the i-th first pattern sequence and the network structure optimization task, and the first antibody concentration is used to characterize the degree of similarity between the i-th first pattern sequence and the j-th first pattern sequence in the first pattern sequence set;
[0185] Generation module 1002 is used to generate a first evaluation incentive based on the first affinity, the first antibody concentration, the first affinity coefficient corresponding to the first affinity and the first antibody concentration coefficient corresponding to the first antibody concentration; the first affinity coefficient is used to characterize the proportion of the affinity operator for calculating the first affinity in the first evaluation incentive operator, the first antibody concentration coefficient is used to characterize the proportion of the antibody concentration operator for calculating the first antibody concentration in the first evaluation incentive operator, and the first evaluation incentive operator is an operator for calculating the first evaluation incentive.
[0186] In some embodiments of the present application, the construction module 1004 is used to construct a second Rete network according to the i-th first pattern sequence when the network structure optimization task corresponds to the task pattern sequence, the second Rete network includes an Alpha network and a Beta network, the Alpha network includes first network nodes corresponding to the same type of pattern, and the Beta network includes second network nodes corresponding to different types of patterns;
[0187] The data processing device 100 in the embodiment of the present application may further include a calculation module, which is used to calculate the affinity of the Alpha network according to the first number of the first network nodes and the first number of the first mode sequence of the i-th first mode sequence, and the affinity of the Alpha network is used to characterize the similarity between the arrangement order of the same mode in the i-th first mode sequence and the arrangement order of the same mode in the task mode sequence;
[0188] The calculation module is also used to calculate the affinity of the Beta network according to the second number of the second network nodes and the number of the first patterns, and the affinity of the Beta network is used to characterize the similarity between the arrangement order of different types of patterns in the i-th first pattern sequence and the arrangement order of different types of patterns in the task pattern sequence;
[0189] The generating module 1002 is used to generate the first affinity of the i-th first pattern sequence based on the affinity of the Alpha network and the affinity of the Beta network.
[0190] In some embodiments of the present application, the data processing device 100 in the embodiment of the present application may further include a comparison module, which is used to compare the patterns in the same position in the i-th first pattern sequence and the j-th first pattern sequence when the pattern length and the pattern number of the i-th first pattern sequence and the j-th first pattern sequence are the same, to obtain the pattern matching degree between the i-th first pattern sequence and the j-th first pattern sequence;
[0191] The antibody concentration of the ith first pattern sequence is generated based on the pattern matching degree, the pattern length of the ith first pattern sequence, and the number of patterns of the ith first pattern sequence.
[0192] In some embodiments of the present application, the construction module 1004 may also be used to construct C clone pattern sequences corresponding to the i-th second pattern sequence according to the i-th second pattern sequence among the N second pattern sequences;
[0193] The data processing device 100 in the embodiment of the present application may further include a processing module, which is used to perform a mutation process on each of the C clone pattern sequences to obtain a clone deformation pattern sequence corresponding to each clone pattern sequence;
[0194] The construction module 1004 may also be configured to construct a cloned deformation pattern sequence set of the ith second pattern sequence based on the ith second pattern sequence, C cloned pattern sequences corresponding to the ith second pattern sequence, and cloned deformation pattern sequences corresponding to each cloned pattern sequence.
[0195] In some embodiments of the present application, the data processing device 100 in the embodiment of the present application may further include a traversal module, which is used to traverse the T pattern classes in each clone pattern sequence when each clone pattern sequence includes T pattern classes and each pattern class of the T pattern classes includes K patterns, and obtain a random value corresponding to the r-th pattern class in the T pattern classes, r∈[1,T-1];
[0196] The traversal module is also used for, when the random value of the rth pattern class is greater than the first preset random value, exchanging the positions of the rth pattern class and the r+1th pattern class in the clone pattern sequence, until the T-1th pattern class is traversed to obtain a pattern class exchange pattern sequence corresponding to each clone pattern sequence;
[0197] The traversal module is also used to traverse the K patterns in the rth pattern class in the pattern class exchange pattern sequence to obtain a random value corresponding to the hth pattern in the K patterns;
[0198] The data processing device 100 in the embodiment of the present application may further include an exchange module for exchanging the positions of the hth pattern and the h+1th pattern in the rth pattern class when the random value of the hth pattern is greater than a second preset random value, until the Tth pattern class is traversed to obtain a clone deformation pattern sequence corresponding to each clone pattern sequence.
[0199] In some embodiments of the present application, the screening module 1003 may also be used to screen an evaluation incentive degree greater than or equal to a third preset threshold from the clone deformation pattern sequence set of the i-th second pattern sequence;
[0200] The screening module 1003 may also be used to screen G evaluation incentive degrees greater than or equal to a fourth preset threshold value from an evaluation incentive degree corresponding to each second pattern sequence in the N second pattern sequences; wherein N is an even number greater than 0, G is N / 2; N is an odd number greater than 1, G is (N+1) / 2 or (N-1) / 2;
[0201] The data processing device 100 in the embodiment of the present application may further include a determination module for determining a pattern sequence corresponding to each of the G evaluation incentive levels as a third pattern sequence.
[0202] In some embodiments of the present application, the acquisition module 1001 is used to acquire the second affinity and the second antibody concentration of the i-th clone deformation pattern sequence in the clone deformation pattern sequence set when the pattern sequence also includes the i-th clone deformation pattern sequence in the clone deformation pattern sequence set; wherein the second affinity is used to characterize the matching degree between the i-th clone deformation pattern sequence and the network structure optimization task, and the second antibody concentration is used to characterize the similarity between the i-th clone deformation pattern sequence and the j-th clone deformation pattern sequence in the clone deformation pattern sequence set;
[0203] Generation module 1002 is used to generate a second evaluation incentive for the i-th clone deformation pattern sequence based on the second affinity, the second antibody concentration, the second affinity coefficient corresponding to the second affinity, and the second antibody concentration coefficient corresponding to the second antibody concentration; wherein the second affinity coefficient is used to characterize the proportion of the affinity operator for calculating the second affinity in the second evaluation incentive operator, the second antibody concentration coefficient is used to characterize the proportion of the antibody concentration operator for calculating the second antibody concentration in the second evaluation incentive operator, and the second evaluation incentive operator is an operator for calculating the second evaluation incentive of the i-th clone deformation pattern sequence.
[0204] In some embodiments of the present application, the construction module 1004 is used to construct a first Rete network based on G third pattern sequences and NG randomly generated fourth pattern sequences.
[0205] In some embodiments of the present application, the generating module 1002 may be specifically configured to generate a first pattern sequence set for the next iteration based on G third pattern sequences and NG fourth pattern sequences;
[0206] The data processing device 100 in the embodiment of the present application may further include an iteration module, configured to perform an iteration step on the first pattern sequence set of the next iteration until the number of iterations is greater than a preset number of iterations, and use the G third pattern sequences outputted in the xth iteration corresponding to the number of iterations greater than the preset number of iterations as the G fifth pattern sequences;
[0207] The screening module 1003 may also be used to screen a target pattern sequence from the G fifth pattern sequences and the randomly generated NG sixth pattern sequences, the evaluation incentive degree of the target pattern sequence being greater than or equal to a fourth preset threshold, the target pattern sequence including a target pattern, and the target pattern being the same pattern in at least two of the M service rules;
[0208] The data processing device 100 in the embodiment of the present application may further include a sharing module, which is used to share the network nodes corresponding to the target mode to construct a first Rete network of the target mode sequence;
[0209] The iteration steps include:
[0210] According to the evaluation incentives of the M first pattern sequences, a second pattern sequence set is extracted from the first pattern sequence set, wherein the second pattern sequence set includes N second pattern sequences selected from the M first pattern sequences, the evaluation incentive of the second pattern sequence is greater than or equal to a first preset threshold, the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set where the pattern sequence is located, and the pattern sequence includes the first pattern sequence;
[0211] A third pattern sequence is selected from the set of cloned and deformed pattern sequences of the ith second pattern sequence among N second pattern sequences; the set of cloned and deformed pattern sequences includes the ith second pattern sequence, the cloned pattern sequence of the ith second pattern sequence and the variant pattern sequence of the cloned pattern sequence, and the evaluation incentive degree of the third pattern sequence is greater than or equal to the second preset threshold.
[0212] Therefore, the data processing device 100 in the embodiment of the present application can be used to obtain a first pattern sequence set related to a network structure optimization task; the patterns in the M first pattern sequences in the first pattern sequence set are obtained by decomposing M service rules, the first pattern sequence includes a pattern, the pattern is used to characterize the constraints of the service rules, the network structure optimization task is used to indicate that the number of network nodes corresponding to the target pattern is less than or equal to a preset number, and the target pattern is used to characterize the same constraints in at least two service rules of the M service rules; then, according to the evaluation incentives of the M first pattern sequences, a second pattern sequence set is extracted from the first pattern sequence set; the second pattern sequence set includes N second pattern sequences, and the evaluation incentives of the second pattern sequences are greater than or equal to a first preset threshold value , the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set, and the pattern sequence includes the first pattern sequence; furthermore, a third pattern sequence is screened from the cloned deformation pattern sequence set of the i-th second pattern sequence in the N second pattern sequences; the cloned deformation pattern sequence set includes the i-th second pattern sequence, the cloned pattern sequence of the i-th second pattern sequence and the variant pattern sequence of the cloned pattern sequence, and the evaluation incentive of the third pattern sequence is greater than or equal to the second preset threshold; then, the first Rete network is constructed through the third pattern sequence, and the first Rete network meets the instructions of the network structure optimization task. Therefore, without relying on any network training data, the arrangement order of network nodes corresponding to each mode in the Rete network can be adjusted, the number of network nodes corresponding to a large number of identical modes in the Rete network can be reduced, the Rete network structure is optimized, the complexity and redundancy of the Rete network are reduced, and the memory occupancy rate of the Rete network is reduced. In this way, when the service data is conditionally screened and aggregated through the first Rete network, since the same constraints in multiple service rules correspond to the same network node, the calculation results of the network node can be shared among multiple service rules, reducing the number of repeated calculations of the network node, significantly shortening the rule matching time, improving the rule matching efficiency, and optimizing the Rete network performance.
[0213] Based on the same inventive concept, the present application also provides a computer device. Fig.11 Provide detailed explanation.
[0214] Fig.11 It is a schematic diagram of the structure of a computer device provided by an embodiment of the present application.
[0215] like Fig.11As shown, the computer device may include at least one of the following involved in the embodiments of the present application: a user terminal device, a server terminal device. The computer device may include a processor 1101 and a memory 1102 storing computer program instructions.
[0216] Specifically, the processor 1101 may include a central processing unit (CPU), or an application specific integrated circuit (Application Specific Integrated Circuit (ASTC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0217] The memory 1102 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 1102 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 1102 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 1102 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1102 is a non-volatile solid-state memory. In a specific embodiment, the memory 1102 includes a solid-state storage (ROM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.
[0218] The processor 1101 implements any one of the data processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 1102 .
[0219] In one example, the computer device may further include a communication interface 1103 and a bus 1110. Fig.11 As shown, the processor 1101, the memory 1102, and the communication interface 1103 are connected via a bus 1110 and communicate with each other.
[0220] The communication interface 1103 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0221] Bus 1110 includes hardware, software or both, and the parts of flow control device are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard system (ETSA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard system (TSA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel system (MCA) bus, peripheral component interconnection (PCT) bus, PCT-Express (PCT-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In suitable cases, bus 1110 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0222] The data processing device can execute the data processing method in the embodiment of the present application, thereby realizing the combination Figures 5 to 11 The data processing method and device described.
[0223] In addition, in combination with the data processing method in the above embodiments, the present application embodiment can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the data processing methods in the above embodiments is implemented.
[0224] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0225] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0226] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0227] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A data processing method, comprising: Acquire a first pattern sequence set related to a network structure optimization task; The patterns in the M first pattern sequences in the first pattern sequence set are obtained by decomposing the M service rules, the first pattern sequence includes a pattern, the pattern is used to characterize the constraint condition of the service rule, the network structure optimization task is used to indicate that the number of network nodes corresponding to the target pattern is less than or equal to a preset number, and the target pattern is used to characterize the same constraint condition in at least two service rules of the M service rules; extracting a second pattern sequence set from the first pattern sequence set according to the evaluation excitation degrees of the M first pattern sequences; The second pattern sequence set includes N second pattern sequences, the evaluation incentive of the second pattern sequence is greater than or equal to a first preset threshold, the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set, and the pattern sequence includes the first pattern sequence; A third pattern sequence is selected from a cloned variant pattern sequence set of the i-th second pattern sequence among the N second pattern sequences; the cloned variant pattern sequence set includes the i-th second pattern sequence, a cloned pattern sequence of the i-th second pattern sequence, and a variant pattern sequence of the cloned pattern sequence, and an evaluation incentive degree of the third pattern sequence is greater than or equal to a second preset threshold; Through the third pattern sequence, a first Rete network is constructed, and the first Rete network meets the instructions of the network structure optimization task.
2. The method according to claim 1, wherein: Before acquiring the first pattern sequence set related to the network structure optimization task, the method includes: Based on the network structure optimization task, M service rules are selected from a service rule set, wherein at least two service rules of the M service rules include the same constraint condition; Decomposing at least two constraints in the M service rules to obtain a constraint sequence, wherein the constraint sequence includes a pattern for characterizing each constraint in the at least two constraints; Based on the constraint condition sequence, the first pattern sequence is generated.
3. The method according to claim 2, wherein: The step of generating the first pattern sequence based on the constraint condition sequence includes: According to the pattern type, at least two patterns in the constraint condition sequence are divided to obtain a pattern class sequence; wherein the pattern class sequence includes at least one pattern class, the pattern class includes at least one pattern, the pattern class corresponds to a class sharing degree, the patterns in the pattern class correspond to a sharing degree, the sharing degree is used to characterize the number of times the constraint condition corresponding to the pattern is repeated in the M service rules, the class sharing degree is determined by the sharing degree of each pattern in the pattern class, and the class sharing degree is used to characterize the number of times the same class constraint condition is repeated in the M service rules; The patterns in the pattern class sequence are sorted according to the class sharing degree corresponding to the pattern class and / or the sharing degree corresponding to the pattern to obtain the first pattern sequence.
4. The method according to claim 3, wherein: The at least one pattern class includes at least two pattern classes, each of the at least two pattern classes includes a pattern; The step of sorting the patterns in the pattern class sequence according to the class sharing degree corresponding to the pattern class and / or the sharing degree corresponding to the pattern to obtain the first pattern sequence includes: At least two pattern classes in the pattern class sequence are arranged in descending order of class sharing degree values to obtain the first pattern sequence.
5. The method according to claim 3, wherein: The at least one pattern class includes a pattern class, and the pattern class includes at least two patterns; The step of sorting the patterns in the pattern class sequence according to the class sharing degree corresponding to the pattern class and / or the sharing degree corresponding to the pattern to obtain the first pattern sequence includes: The patterns in the pattern class are arranged in descending order according to the sharing degree values to obtain the first pattern sequence.
6. The method according to claim 3, wherein: The at least one pattern class includes at least two pattern classes, each of the at least two pattern classes includes at least a pattern; The step of sorting the patterns in the pattern class sequence according to the class sharing degree corresponding to the pattern class and / or the sharing degree corresponding to the pattern to obtain the first pattern sequence includes: Arrange at least two pattern classes in the pattern class sequence in order of class sharing values from large to small; and arrange the patterns in each pattern class of the at least two pattern classes in order of sharing values from large to small to obtain a first pattern sequence.
7. The method according to claim 1, wherein: The step of extracting a second pattern sequence set from the first pattern sequence set according to the evaluation excitation degrees of the M first pattern sequences comprises: According to the evaluation incentive degrees of the M first pattern sequences, N evaluation incentive degrees greater than or equal to the first preset threshold are selected from each of the M first pattern sequences; wherein M is an even number greater than 0, and N is M / 2; M is an odd number greater than 1, and N is (M+1) / 2 or (M-1) / 2; The first pattern sequence corresponding to each evaluation incentive degree among the N evaluation incentive degrees is determined as the second pattern sequence.
8. The method according to claim 1, wherein: The M first pattern sequences include the ith first pattern sequence, and the evaluation incentive levels of the M first pattern sequences include the first evaluation incentive level of the ith first pattern sequence; Before extracting the second pattern sequence set from the first pattern sequence set according to the evaluation excitation degrees of the M first pattern sequences, the method further includes: Obtaining a first affinity and a first antibody concentration of the i-th first pattern sequence; wherein the first affinity is used to characterize the degree of matching between the i-th first pattern sequence and the network structure optimization task, and the first antibody concentration is used to characterize the degree of similarity between the i-th first pattern sequence and the j-th first pattern sequence in the first pattern sequence set; The first evaluation incentive is generated based on the first affinity, the first antibody concentration, the first affinity coefficient corresponding to the first affinity, and the first antibody concentration coefficient corresponding to the first antibody concentration; the first affinity coefficient is used to characterize the proportion of the affinity operator for calculating the first affinity in the first evaluation incentive operator, and the first antibody concentration coefficient is used to characterize the proportion of the antibody concentration operator for calculating the first antibody concentration in the first evaluation incentive operator; the first evaluation incentive operator is the operator for calculating the first evaluation incentive.
9. The method according to claim 8, wherein: The network structure optimization task corresponds to a task mode sequence; The obtaining the first affinity and the first antibody concentration of the i-th first pattern sequence comprises: According to the i-th first pattern sequence, a second Rete network is constructed, wherein the second Rete network includes an Alpha network and a Beta network, wherein the Alpha network includes first network nodes corresponding to the same type of pattern, and the Beta network includes second network nodes corresponding to different types of patterns; Calculating the affinity of the Alpha network according to the first number of the first network nodes and the first number of modes of the i-th first mode sequence, wherein the affinity of the Alpha network is used to characterize the similarity between the arrangement order of similar modes in the i-th first mode sequence and the arrangement order of similar modes in the task mode sequence; Calculating the affinity of the Beta network according to the second number of the second network nodes and the first number of patterns, wherein the affinity of the Beta network is used to characterize the similarity between the arrangement order of different types of patterns in the i-th first pattern sequence and the arrangement order of different types of patterns in the task pattern sequence; Based on the affinity of the Alpha network and the affinity of the Beta network, a first affinity of the i-th first pattern sequence is generated.
10. The method according to claim 8, wherein: The pattern length and pattern number of the i-th first pattern sequence and the j-th first pattern sequence are the same; The obtaining the first affinity and the first antibody concentration of the i-th first pattern sequence comprises: Comparing the patterns in the same position in the i-th first pattern sequence and the j-th first pattern sequence to obtain the pattern matching degree between the i-th first pattern sequence and the j-th first pattern sequence; The antibody concentration of the i-th first pattern sequence is generated based on the pattern matching degree, the pattern length of the i-th first pattern sequence, and the number of patterns of the i-th first pattern sequence.
11. The method according to claim 1, wherein: Before selecting the third pattern sequence from the cloned deformed pattern sequence set of the i-th second pattern sequence among the N second pattern sequences, the method further includes: According to the i-th second pattern sequence among the N second pattern sequences, construct C clone pattern sequences corresponding to the i-th second pattern sequence; Performing mutation processing on each clone pattern sequence in the C clone pattern sequences to obtain a clone deformation pattern sequence corresponding to each clone pattern sequence; Based on the i-th second pattern sequence, the C clone pattern sequences corresponding to the i-th second pattern sequence and the clone deformation pattern sequences corresponding to each clone pattern sequence, a clone deformation pattern sequence set of the i-th second pattern sequence is constructed.
12. The method according to claim 11, wherein: Each clone pattern sequence includes T pattern classes, and each pattern class of the T pattern classes includes K patterns; The performing mutation processing on each clone pattern sequence of the C clone pattern sequences to obtain a clone deformation pattern sequence corresponding to each clone pattern sequence includes: Traverse the T pattern classes in each clone pattern sequence to obtain a random value corresponding to the rth pattern class in the T pattern classes, r∈[1,T-1]; When the random value of the r-th pattern class is greater than the first preset random value, the positions of the r-th pattern class and the r+1-th pattern class in the clone pattern sequence are exchanged until the T-1-th pattern class is traversed to obtain a pattern class exchange pattern sequence corresponding to each clone pattern sequence; Traversing the K patterns in the rth pattern class in the pattern class exchange pattern sequence, and obtaining a random value corresponding to the hth pattern in the K patterns; When the random value of the hth pattern is greater than the second preset random value, the positions of the hth pattern and the h+1th pattern in the rth pattern class are exchanged until the Tth pattern class is traversed to obtain a clone deformation pattern sequence corresponding to each clone pattern sequence.
13. The method according to claim 1, characterized in that The step of selecting a third pattern sequence from the cloned deformation pattern sequence set of the i-th second pattern sequence among the N second pattern sequences comprises: Selecting an evaluation incentive degree greater than or equal to a third preset threshold from the clone deformation pattern sequence set of the i-th second pattern sequence; Selecting G evaluation incentive degrees greater than or equal to a fourth preset threshold value from an evaluation incentive degree corresponding to each second pattern sequence in the N second pattern sequences; wherein N is an even number greater than 0, G is N / 2; N is an odd number greater than 1, G is (N+1) / 2 or (N-1) / 2; The pattern sequence corresponding to each evaluation incentive degree among the G evaluation incentive degrees is determined as the third pattern sequence.
14. The method according to claim 1 or 13, characterized in that: The pattern sequence also includes the i-th clone deformation pattern sequence in the clone deformation pattern sequence set; Before selecting the third pattern sequence from the cloned deformed pattern sequence set of the i-th second pattern sequence among the N second pattern sequences, the method further includes: Obtaining a second affinity and a second antibody concentration of the i-th clone deformation pattern sequence in the clone deformation pattern sequence set; wherein the second affinity is used to characterize the matching degree between the i-th clone deformation pattern sequence and the network structure optimization task, and the second antibody concentration is used to characterize the similarity between the i-th clone deformation pattern sequence and the j-th clone deformation pattern sequence in the clone deformation pattern sequence set; Based on the second affinity, the second antibody concentration, the second affinity coefficient corresponding to the second affinity, and the second antibody concentration coefficient corresponding to the second antibody concentration, a second evaluation incentive of the i-th clone deformation pattern sequence is generated; wherein the second affinity coefficient is used to characterize the proportion of the affinity operator for calculating the second affinity in the second evaluation incentive operator, the second antibody concentration coefficient is used to characterize the proportion of the antibody concentration operator for calculating the second antibody concentration in the second evaluation incentive operator, and the second evaluation incentive operator is an operator for calculating the second evaluation incentive of the i-th clone deformation pattern sequence.
15. The method according to claim 1, wherein: The third pattern sequence includes G third pattern sequences; and constructing a first Rete network by using the third pattern sequence includes: A first Rete network is constructed based on the G third pattern sequences and the randomly generated NG fourth pattern sequences.
16. The method according to claim 15, wherein: The constructing a first Rete network based on the G third pattern sequences and the randomly generated NG fourth pattern sequences includes: generating a first pattern sequence set for next iteration based on the G third pattern sequences and the NG fourth pattern sequences; Performing an iterative step on the first pattern sequence set of the next iteration until the number of iterations is greater than a preset number of iterations, and using the G third pattern sequences output from the xth iteration corresponding to the number of iterations greater than the preset number of iterations as the G fifth pattern sequences; Selecting a target pattern sequence from the G fifth pattern sequences and the randomly generated NG sixth pattern sequences, wherein the evaluation incentive degree of the target pattern sequence is greater than or equal to a fourth preset threshold, and the target pattern sequence includes a target pattern, and the target pattern is the same pattern in at least two service rules of the M service rules; Sharing the network nodes corresponding to the target pattern to construct a first Rete network of the target pattern sequence; Wherein, the iterative step comprises: According to the evaluation incentives of the M first pattern sequences, extract a second pattern sequence set from the first pattern sequence set, wherein the second pattern sequence set includes N second pattern sequences screened from the M first pattern sequences, the evaluation incentive of the second pattern sequence is greater than or equal to a first preset threshold, the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set where the pattern sequence is located, and the pattern sequence includes the first pattern sequence; A third pattern sequence is screened from the set of cloned and deformed pattern sequences of the ith second pattern sequence among the N second pattern sequences; the set of cloned and deformed pattern sequences includes the ith second pattern sequence, a cloned pattern sequence of the ith second pattern sequence and a variant pattern sequence of the cloned pattern sequence, and an evaluation incentive degree of the third pattern sequence is greater than or equal to a second preset threshold.
17. A data processing device, comprising: An acquisition module, used to acquire a first pattern sequence set related to a network structure optimization task; The patterns in the M first pattern sequences in the first pattern sequence set are obtained by decomposing the M service rules, the first pattern sequence includes a pattern, the pattern is used to characterize the constraint condition of the service rule, the network structure optimization task is used to indicate that the number of network nodes corresponding to the target pattern is less than or equal to a preset number, and the target pattern is used to characterize the same constraint condition in at least two service rules of the M service rules; A generating module, configured to extract a second pattern sequence set from the first pattern sequence set according to the evaluation excitation degrees of the M first pattern sequences; The second pattern sequence set includes N second pattern sequences, the evaluation incentive of the second pattern sequence is greater than or equal to a first preset threshold, the evaluation incentive is determined by affinity and antibody concentration, the affinity is used to characterize the matching degree between the pattern sequence and the network structure optimization task, the antibody concentration is used to characterize the similarity between the pattern sequence and other pattern sequences in the pattern sequence set, and the pattern sequence includes the first pattern sequence; a screening module, configured to screen a third pattern sequence from a cloned variant pattern sequence set of the ith second pattern sequence among the N second pattern sequences; the cloned variant pattern sequence set includes the ith second pattern sequence, a cloned pattern sequence of the ith second pattern sequence, and a variant pattern sequence of the cloned pattern sequence, and the evaluation incentive degree of the third pattern sequence is greater than or equal to a second preset threshold; A construction module is used to construct a first Rete network through the third pattern sequence, and the first Rete network meets the instructions of the network structure optimization task.
18. A computer device, the device comprising: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the data processing method according to any one of claims 1 to 16 is implemented.
19. A storage medium storing computer program instructions, wherein the computer program instructions, when executed by a processor, implement the data processing method according to any one of claims 1 to 16.
