Data rule execution method and device, data rule configuration method and device, equipment and storage medium

By determining the reference rules and directly accessing them during the rule matching process, the problem of computing resource waste caused by repeated access in the existing technology is solved, the matching efficiency and hardware processing speed are improved, and the difficulty of system expansion and maintenance is reduced.

CN120704667APending Publication Date: 2025-09-26SF TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410351109.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

The existing technology requires accessing each rule in a multi-rule matching operation, resulting in excessive consumption of computing resources and affecting the matching efficiency of business scenarios.

Method used

By obtaining the data to be matched and matching it with the first rule, if it matches, the reference rule is determined, and the second rule is directly accessed for further matching until the reference is completed and the corresponding action is executed, avoiding repeated access to each rule.

Benefits of technology

It reduces the consumption of computing resources, improves the matching efficiency of business scenarios and hardware processing speed, and reduces the difficulty of system expansion and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704667A_ABST
    Figure CN120704667A_ABST
Patent Text Reader

Abstract

The invention provides a data rule execution method and device, a data rule configuration method and device, equipment and a storage medium. The data rule execution method comprises the steps of obtaining to-be-matched data and attribute information of a configuration class; wherein the attribute information comprises a first rule and a second rule; performing a first matching operation on the to-be-matched data and the first rule, and if a result of the first matching operation shows that the to-be-matched data is matched with the first rule, determining a reference rule of the first rule; when the reference rule of the first rule is the second rule, performing second matching operation on the to-be-matched data and the second rule, and if the result of the second matching operation shows that the to-be-matched data is matched with the second rule, determining the reference rule of the second rule; and when the reference rule of the second rule indicates that the reference is finished, executing an action corresponding to the second rule. According to the method and the device, consumption of computing resources in the data rule execution process can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of business scenario configuration technology, and in particular to a data rule execution method and device, a data rule configuration method and device, a device, and a storage medium. Background Art

[0002] Currently, the development of computer software often requires business scenarios that require rule matching. For example, a software user may propose multiple rules and data to be matched. The software then performs matching operations based on a certain logical sequence, combining the parameters input by the user, and then returns the matching results to the user and executes the corresponding actions. However, in a business scenario where multiple rules and data need to be matched, existing software products typically need to access each rule during each matching operation to determine whether the rule applies to the current matching operation. This results in additional and unnecessary access operations, consumes more computing resources, and affects the overall matching efficiency of the business scenario. Summary of the Invention

[0003] The present invention provides a data rule execution method and apparatus, a data rule configuration method and apparatus, a device and a storage medium, which can reduce the consumption of computing resources during the data rule execution process.

[0004] In order to solve the above technical problems, an embodiment of the present invention provides a data rule execution method, including:

[0005] Acquire attribute information of the data to be matched and the configuration class; wherein the attribute information includes a first rule and a second rule;

[0006] Performing a first matching operation on the data to be matched and the first rule, and if the result of the first matching operation indicates that the data to be matched matches the first rule, determining a reference rule of the first rule;

[0007] When the reference rule of the first rule is the second rule, performing a second matching operation on the data to be matched and the second rule, and if the result of the second matching operation indicates that the data to be matched matches the second rule, determining the reference rule of the second rule;

[0008] When the reference rule of the second rule indicates that the reference ends, an action corresponding to the second rule is executed.

[0009] As a preferred solution, the attribute information further includes identification information of the first rule, and the reference rule for determining the first rule is specifically:

[0010] Identify the character string of the identification information of the first rule; if the result of the character string identification includes a specific character string, determine the reference rule of the first rule according to the specific character string.

[0011] As a preferred solution, the attribute information further includes initial rules, and the obtaining of the data to be matched includes:

[0012] Get multiple initial data;

[0013] An initial matching operation is performed on the plurality of initial data respectively with the initial rules, and the initial data that matches the initial rules is used as the data to be matched.

[0014] As a preferred solution, the attribute information further includes numerical information of the first rule, and the first matching operation of the to-be-matched data with the first rule is specifically performed as follows:

[0015] Compare the numerical information of the data to be matched with the numerical information of the first rule; and obtain a result of the first matching operation based on a magnitude relationship between the numerical information of the data to be matched and the numerical information of the first rule.

[0016] As a preferred solution, the data rule execution method further includes: when the result of the first matching operation indicates that the to-be-matched data does not match the first rule, executing an action corresponding to the first rule.

[0017] Accordingly, an embodiment of the present invention further provides a data rule configuration method, wherein the data rule configuration method is used to configure the first rule;

[0018] The data rule configuration method includes:

[0019] Obtaining an expression configuration instruction, and determining a matching condition for the first rule according to the expression configuration instruction;

[0020] Obtaining an identification configuration instruction, and determining a reference rule for the first rule according to the identification configuration instruction;

[0021] Obtaining an action configuration instruction, and determining action execution information of the first rule according to the action configuration instruction;

[0022] Rule configuration is performed according to the matching condition, the reference rule of the first rule, and the action execution information to obtain the first rule.

[0023] Accordingly, an embodiment of the present invention further provides a data rule execution device, comprising a data acquisition module, a first matching module, a second matching module and a first execution module; wherein,

[0024] The data acquisition module is used to acquire the attribute information of the data to be matched and the configuration class; wherein the attribute information includes the first rule and the second rule;

[0025] The first matching module is configured to perform a first matching operation on the data to be matched and the first rule, and if the result of the first matching operation indicates that the data to be matched matches the first rule, determine a reference rule of the first rule;

[0026] the second matching module is configured to, when the reference rule of the first rule is the second rule, perform a second matching operation on the data to be matched and the second rule, and determine the reference rule of the second rule if the result of the second matching operation indicates that the data to be matched matches the second rule;

[0027] The first execution module is configured to execute an action corresponding to the second rule when the reference rule of the second rule indicates that the reference ends.

[0028] As a preferred solution, the attribute information further includes identification information of the first rule, and the first matching module determines a reference rule of the first rule, specifically:

[0029] The first matching module identifies the character string of the identification information of the first rule; if the result of the character string identification includes a specific character string, a reference rule of the first rule is determined according to the specific character string.

[0030] As a preferred solution, the attribute information further includes initial rules, and the data acquisition module acquires the data to be matched, including:

[0031] The data acquisition module acquires a plurality of initial data; performs initial matching operations on the plurality of initial data and the initial rules respectively, and uses the initial data that matches the initial rules as the data to be matched.

[0032] As a preferred solution, the attribute information further includes numerical information of the first rule, and the first matching module performs a first matching operation on the to-be-matched data and the first rule, specifically:

[0033] The first matching module compares the numerical information of the data to be matched with the numerical information of the first rule; and obtains a result of the first matching operation according to a size relationship between the numerical information of the data to be matched and the numerical information of the first rule.

[0034] As a preferred solution, the data rule execution configuration device further includes a second execution module: the second execution module is configured to execute an action corresponding to the first rule when the result of the first matching operation indicates that the to-be-matched data does not match the first rule.

[0035] Correspondingly, an embodiment of the present invention further provides a data rule configuration device, characterized in that the data rule configuration device is used to configure the first rule;

[0036] The data rule configuration device includes a condition determination module, a reference determination module, an action determination module and a rule configuration module; wherein,

[0037] The condition determination module is used to obtain an expression configuration instruction and determine a matching condition of the first rule according to the expression configuration instruction;

[0038] The reference determination module is configured to obtain an identification configuration instruction and determine a reference rule of the first rule according to the identification configuration instruction;

[0039] The action determination module is configured to obtain an action configuration instruction and determine action execution information of the first rule according to the action configuration instruction;

[0040] The rule configuration module is used to perform rule configuration according to the matching condition, the reference rule of the first rule and the action execution information to obtain the first rule.

[0041] Correspondingly, an embodiment of the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the data rule execution method or the data rule configuration method when executing the computer program.

[0042] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the data rule execution method or the data rule configuration method.

[0043] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0044] An embodiment of the present invention provides a data rule execution method and apparatus, a data rule configuration method and apparatus, a device and a storage medium. The data rule execution method performs a first matching operation on the data to be matched with the first rule. If the result of the first matching operation indicates that the data to be matched matches the first rule, the reference rule of the first rule is determined. In this way, the second rule can be directly accessed through the reference rule, and then a second matching operation is performed on the data to be matched with the second rule. When the reference rule of the second rule indicates that the reference ends, the action corresponding to the second rule is executed without accessing each rule. At this time, additional and unnecessary access operations can be avoided, the consumption of computing resources can be reduced, and the overall matching efficiency and hardware processing speed of the business scenario can be improved.

[0045] The data rule configuration method configures the matching conditions, reference rules, and action execution information of the first rule through expression configuration instructions, identification configuration instructions, and action configuration instructions, thereby configuring the first rule. Compared to existing personalized development solutions, when faced with multiple rules and data to be matched, this method eliminates the need to develop specific rules for each business scenario. Instead, new rules only need to be configured based on the specific needs. This effectively reduces development workload, improves system scalability, and reduces the difficulty of system expansion and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 : A flow chart of an embodiment of the data rule execution method provided by the present invention.

[0047] Figure 2 : A UML design diagram of an embodiment of the configuration class provided by the present invention.

[0048] Figure 3 : A schematic diagram of the principles of an embodiment of the rule data attributes provided by the present invention.

[0049] Figure 4 : A flow chart of an embodiment of the data rule configuration method provided by the present invention.

[0050] Figure 5 : A structural diagram of an embodiment of the data rule execution device provided by the present invention.

[0051] Figure 6 : A structural diagram of an embodiment of the data rule configuration device provided by the present invention. DETAILED DESCRIPTION

[0052] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0053] Example 1

[0054] It should be understood that the step numbers used herein are only for convenience of description and are not intended to limit the order in which the steps are to be executed.

[0055] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit this application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0056] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0057] The term "and / or" refers to and includes any and all possible combinations of one or more of the associated listed items.

[0058] Any process or method description described in this application may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing a specific logical function or process step, and the scope of the preferred embodiment of the present application includes alternative implementations in which the functions may not be performed in the order shown or discussed, including performing the functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0059] The logic and / or steps described in this application, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions on an instruction execution system, apparatus, or device), or in conjunction with such instruction execution system, apparatus, or device. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by an instruction execution system, apparatus, or device, or in conjunction with such instruction execution system, apparatus, or device.

[0060] Please refer to Figure 1 , Figure 1 A data rule execution method is provided in an embodiment of the present invention. The data rule execution method can be applied to computer devices, including but not limited to smart phones, laptops, tablet computers, desktop computers, and physical servers and cloud servers connected to display units.

[0061] The data rule execution method includes steps S101 to S104; wherein,

[0062] Step S101: Acquire the attribute information of the data to be matched and the configuration class; wherein the attribute information includes a first rule and a second rule.

[0063] In this embodiment, according to the different business scenarios applied, the configuration class can be set before step S101 based on the specific needs of the scenario. For example, the content of the setting is the UML design of the configuration class, such as Figure 2 shown.

[0064] UML stands for Unified Modeling Language, also known as a modeling language. It is primarily used for visual modeling of software systems. For example, during the development phase, software architecture can be constructed hierarchically by describing, visualizing, constructing, and / or writing an object-oriented software system.

[0065] In a possible implementation, the attribute information of the configuration class may include a configuration number attribute, a configuration name attribute, a to-be-matched attribute, and a rule data attribute.

[0066] The configuration number attribute is a string type that can be used to uniquely identify a configuration object (a configuration object is an instance of a configuration class). For example, when the embodiments of the present application are applied to the field of logistics, configuration objects may include objects for express delivery timeliness, objects for express packaging, and the like.

[0067] The configuration name attribute is of string type and can also be used to uniquely identify a configuration object. In this embodiment, it is convenient to use the object to give the instantiated configuration object an easy-to-remember name.

[0068] The attribute to be matched is of set type, and is used to store all data sets to be matched. In the subsequent data matching process of step S102, all the above data sets are used for screening and performing a first matching operation with the first rule.

[0069] The rule data attribute is of collection type, which is mainly used to store a number of rule information, such as the rule information of the first rule and the rule information of the second rule. The above rule information may include the actions executed by the rules, referenced rules or corresponding business logic, etc.

[0070] In some embodiments, the attribute information includes not only the first rule and the second rule, but also the initial rule. The obtaining of the data to be matched includes:

[0071] Acquire multiple initial data; perform initial matching operations on each of the multiple initial data against the initial rules, and use the initial data that matches the initial rules as the data to be matched. This initial matching operation is primarily used to perform a preliminary screening of the initial data, thereby transferring the initial data that passes the preliminary screening to the data set to be matched, obtaining the data to be matched, and then further screening through the matching operation.

[0072] S102: Perform a first matching operation on the data to be matched and the first rule. If the result of the first matching operation indicates that the data to be matched matches the first rule, determine a reference rule of the first rule.

[0073] In this step, the first matching operation may be performed using numerical information of the data to be matched and numerical information of the first rule, or may be an expression, a function, or a character string, in addition to numerical information.

[0074] In a possible preferred implementation, the attribute information further includes numerical information of the first rule, and the first matching operation of the to-be-matched data with the first rule is specifically performed as follows:

[0075] Compare the numerical information of the data to be matched with the numerical information of the first rule; and obtain a result of the first matching operation based on a magnitude relationship between the numerical information of the data to be matched and the numerical information of the first rule.

[0076] For example, the result of the first matching operation can be represented by the binary expression x>20. When the value of the data to be matched is 50, the value of the data to be matched is greater than the value of the first rule, that is, the value of the data to be matched is x=50>20. The result of the first matching operation indicates that the data to be matched matches the first rule; otherwise, the data to be matched does not match the first rule.

[0077] Furthermore, if Figure 3As shown, each rule within the attribute information is configured with a corresponding reference rule and action through a preset mapping relationship. Furthermore, in this embodiment, when the result of the first matching operation indicates that the to-be-matched data matches the first rule, the reference rule corresponding to the first rule is determined based on the preset mapping relationship. In this step, the reference rule of the first rule includes the second rule, or the reference rule of the first rule indicates the end of the reference.

[0078] In some embodiments, the attribute information further includes identification information of the first rule, and the reference rule for determining the first rule is specifically:

[0079] Identify the string of the identification information of the first rule; if the result of the string identification contains a specific string, determine the reference rule of the first rule according to the specific string. In other words, the preset mapping relationship can be about the content of the string.

[0080] In some embodiments, when the reference rule of the first rule is reference end, the action corresponding to the first rule is executed.

[0081] In some embodiments, for example, when the to-be-matched data x=10<20, the to-be-matched data does not match the first rule. At this point, based on the preset mapping relationship, the action corresponding to the first rule may be executed or not executed, specifically determined based on the configuration of the mapping relationship. The process of the data rule execution method ends.

[0082] Step S103: When the reference rule of the first rule is the second rule, a second matching operation is performed on the data to be matched and the second rule. If the result of the second matching operation indicates that the data to be matched matches the second rule, the reference rule of the second rule is determined.

[0083] In this step, when performing the second matching operation, the result of the second matching operation can also be determined based on the numerical information. For example, the numerical information of the data to be matched is compared with the numerical information of the second rule; the result of the second matching operation is determined based on the magnitude relationship between the numerical information of the data to be matched and the numerical information of the second rule. The result of the second matching operation indicates that the data to be matched matches the second rule; otherwise, the data to be matched does not match the second rule.

[0084] When the result of the second matching operation indicates that the to-be-matched data matches the second rule, the reference rule corresponding to the second rule is determined according to the preset mapping relationship. In this step, the reference rule of the second rule includes the third rule, or the reference rule of the second rule indicates the end of reference.

[0085] In some embodiments, the attribute information also includes identification information of the second rule, and determining the reference rule of the second rule is specifically: identifying the string of the identification information of the second rule; if the result of the string identification contains a specific string, determining the reference rule of the second rule based on the specific string.

[0086] Step S104: When the reference rule of the second rule indicates that the reference is completed, an action corresponding to the second rule is executed.

[0087] In this step, the action can represent a business logic, specifically a piece of code. It is understood that in the above step S103, when the reference rule of the first rule is the second rule, the action corresponding to the first rule can also be executed or not, which is determined by the content of the pre-configured mapping relationship between the rule and the action.

[0088] Preferably, as an example of this embodiment, the data rule execution method further includes: when the result of the first matching operation indicates that the to-be-matched data does not match the first rule, executing an action corresponding to the first rule.

[0089] As another example of this embodiment, the data rule execution method further includes: if the result of the second matching operation indicates that the data to be matched does not match the second rule, executing the action corresponding to the second rule. Alternatively, as another example of this embodiment, if the result of the second matching operation indicates that the data to be matched does not match the second rule, executing the action corresponding to the first rule and the action corresponding to the second rule. Alternatively, as another example of this embodiment, if the result of the second matching operation indicates that the data to be matched does not match the second rule, executing the action corresponding to the first rule.

[0090] As an example of this embodiment, the basic information of the express delivery, such as the waybill number, sender, recipient, type of mailed item, and product type, is input into the data rule execution method of this embodiment. The configuration class can be an object about the express delivery time limit. According to the operation on the data to be matched, it can be determined whether the express delivery corresponding to the data to be matched needs to be transported normally, delivered on the next day, delivered on the same day, and so on. For example, the initial rule can be a rule about the mailing place. According to the initial rule, the data to be matched A = [enterprise, file], the data to be matched B = [enterprise, mobile phone], and the data to be matched C = [individual, fruit] can be filtered to obtain. The attribute information includes a first rule and a second rule. The first rule can be a rule about the sender type, such as the first rule indicates that the sender = individual. The second rule can be a rule about the type of mail item, such as the second rule indicates that the mail item = fruit.

[0091] When executing the data rule execution method, a first matching operation is first performed on the to-be-matched data A, B, and C, respectively, against the first rule. The result of the first matching operation indicates that the to-be-matched data C matches the first rule. At this point, the reference rule of the first rule can be determined. For example, the identification information of the first rule is X2K-Y67. It can be understood that when the symbol "-" in the identification information includes a character string, it can be considered that the identification information of the first rule includes a specific character string. Based on the preset mapping relationship and the character string "Y67", the reference rule of the first rule can be determined to be the second rule. The character string "X2K" can be used to uniquely identify the first rule, and the character string "Y67" can be used to uniquely identify the second rule. A second matching operation is performed on the to-be-matched data C = [person, fruit] against the second rule, resulting in a matching result indicating that the to-be-matched data C = [person, fruit] matches the second rule. If the identification information of the second rule is determined to be Y67-123, it can be determined that the identification information of the second rule includes the specific character string "123" indicating the end of the reference. At this time, the express delivery corresponding to the matching data C can be transported according to the action "same-day delivery" corresponding to the second rule, which reduces the matching amount of the hardware during data matching, improves the processing speed of the hardware, and thus improves the matching speed of the express delivery.

[0092] Accordingly, refer to Figure 4 , an embodiment of the present invention further provides a data rule configuration method, which is used to configure the first rule described in any of the above implementation methods.

[0093] The data rule configuration method includes steps S401 to S404; wherein,

[0094] Step S401: Obtain an expression configuration instruction, and determine a matching condition of the first rule according to the expression configuration instruction.

[0095] Step S402: Acquire an identification configuration instruction, and determine a reference rule for the first rule according to the identification configuration instruction.

[0096] Step S403: Acquire an action configuration instruction, and determine action execution information of the first rule according to the action configuration instruction.

[0097] Step S404: performing rule configuration according to the matching condition of the first rule, the referenced rule of the first rule, and the action execution information to obtain the first rule.

[0098] Similarly, the data rule configuration method is used to configure the second rule described in any of the above-mentioned embodiments. Specifically, the corresponding steps are: obtaining an expression configuration instruction, and determining the matching condition of the second rule according to the expression configuration instruction; obtaining an identification configuration instruction, and determining the reference rule of the second rule according to the identification configuration instruction; obtaining an action configuration instruction, and determining the action execution information of the second rule according to the action configuration instruction; and performing rule configuration according to the matching condition of the second rule, the reference rule of the second rule, and the action execution information to obtain the first rule.

[0099] The expression configuration instructions, identifier configuration instructions, and action configuration instructions described above may be instructions generated by performing corresponding operations on a UML operation terminal using an object. The UML operation terminal includes, but is not limited to, smartphones, laptops, tablets, desktop computers, and physical and cloud servers connected to a display unit.

[0100] Take expression configuration instructions as an example. Expression configuration instructions can refer to instructions generated by using objects to drag, select, type, etc. on preset templates in the UML operation terminal. For example, the preset templates include Template 1 and Template 2, and Template 1 includes options such as sender, recipient, and type of mailed items. The options in Template 2 have a mapping relationship with the options in Template 1. For example, for the sender option in Template 1, Template 2 can include mapping options such as enterprise and individual. By using the expression configuration instructions generated by the object selection operation, it can be determined that the object selected the sender in Template 1 and selected the individual in Template 2, so that the first rule representing sender = individual can be obtained.

[0101] It is understood that "Sender = Individual" represents the matching condition of the first rule, which may also include reference rules and action execution information. The identification configuration instructions for determining the reference rules and the action configuration instructions for determining the action execution information are similar to the expression configuration instructions and will not be further described in this embodiment of the application.

[0102] In implementing the implementation mode of the present application, when the configuration class needs to add new instances, the user object can configure the new rules in the operation terminal of the data rule configuration method, and reference and associate the new rules with the existing rules. At this time, it is only necessary to configure the new rules and reference the associated workload, so compared with the technical solution of personalized development in the prior art, repetitive code development can be avoided, and the difficulty of expansion and maintenance is further reduced. For example, business scenario A has rules a, b and c, and the new business scenario B has rules a, b, c and d compared to scenario A. In the prior art solution, the user object needs to develop rules a, b, c and d when facing the new business scenario B. When implementing the data rule configuration method of the present application, it is only necessary to determine the d rule, the reference relationship of the d rule and the action corresponding to the d rule according to the corresponding instruction. At this time, compared with the prior art, the workload of developing a, b and c is reduced, so the overall flexibility of the software system can be further improved compared with the prior art.

[0103] Please refer to Figure 5 The embodiment of the present invention further provides a data rule execution device, comprising a data acquisition module 501, a first matching module 502, a second matching module 503 and a first execution module 504; wherein,

[0104] The data acquisition module 501 is used to acquire the attribute information of the data to be matched and the configuration class; wherein the attribute information includes the first rule and the second rule;

[0105] The first matching module 502 is configured to perform a first matching operation on the data to be matched and the first rule, and if the result of the first matching operation indicates that the data to be matched matches the first rule, determine a reference rule of the first rule;

[0106] The second matching module 503 is configured to, when the reference rule of the first rule is the second rule, perform a second matching operation on the data to be matched and the second rule, and determine the reference rule of the second rule if the result of the second matching operation indicates that the data to be matched matches the second rule;

[0107] The first execution module 504 is configured to execute an action corresponding to the second rule when the reference rule of the second rule indicates that the reference ends.

[0108] As a preferred solution, the attribute information further includes identification information of the first rule, and the first matching module 502 determines the reference rule of the first rule, specifically:

[0109] The first matching module 502 identifies the character string of the identification information of the first rule; if the result of the character string identification includes a specific character string, a reference rule of the first rule is determined according to the specific character string.

[0110] As a preferred solution, the attribute information further includes initial rules, and the data acquisition module 501 acquires the data to be matched, including:

[0111] The data acquisition module 501 acquires a plurality of initial data; performs initial matching operations on the plurality of initial data and the initial rules respectively, and uses the initial data that matches the initial rules as the data to be matched.

[0112] As a preferred solution, the attribute information further includes the numerical information of the first rule. The first matching module 502 performs a first matching operation on the to-be-matched data and the first rule, specifically:

[0113] The first matching module 502 compares the numerical information of the data to be matched with the numerical information of the first rule; and obtains a result of the first matching operation according to the magnitude relationship between the numerical information of the data to be matched and the numerical information of the first rule.

[0114] As a preferred solution, the data rule execution configuration device further includes a second execution module: the second execution module is configured to execute an action corresponding to the first rule when the result of the first matching operation indicates that the to-be-matched data does not match the first rule.

[0115] Accordingly, refer to Figure 6 , an embodiment of the present invention further provides a data rule configuration device, characterized in that the data rule configuration device is used to configure the first rule;

[0116] The data rule configuration device includes a condition determination module 601, a reference determination module 602, an action determination module 603 and a rule configuration module 604; wherein,

[0117] The condition determination module 601 is used to obtain an expression configuration instruction and determine a matching condition of the first rule according to the expression configuration instruction;

[0118] The reference determination module 602 is configured to obtain an identification configuration instruction and determine a reference rule of the first rule according to the identification configuration instruction;

[0119] The action determination module 603 is configured to obtain an action configuration instruction and determine action execution information of the first rule according to the action configuration instruction;

[0120] The rule configuration module 604 is configured to perform rule configuration according to the matching condition, the reference rule of the first rule and the action execution information to obtain the first rule.

[0121] Correspondingly, an embodiment of the present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the data rule execution method or the data rule configuration method when executing the computer program.

[0122] The processor may be a central processing unit (CPU), other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal, connecting various parts of the entire terminal using various interfaces and lines.

[0123] The memory can be used to store the computer program, and the processor realizes various functions of the terminal by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0124] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the data rule execution method or the data rule configuration method.

[0125] Wherein, if the module integrated by the data rule execution device or the data rule configuration device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0126] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0127] An embodiment of the present invention provides a data rule execution method and apparatus, a data rule configuration method and apparatus, a device and a storage medium. The data rule execution method performs a first matching operation on the data to be matched with the first rule. If the result of the first matching operation indicates that the data to be matched matches the first rule, the reference rule of the first rule is determined. In this way, the second rule can be directly accessed through the reference rule, and then a second matching operation is performed on the data to be matched with the second rule. When the reference rule of the second rule indicates that the reference ends, the action corresponding to the second rule is executed without accessing each rule. At this time, additional and unnecessary access operations can be avoided, the consumption of computing resources can be reduced, and the overall matching efficiency and hardware processing speed of the business scenario can be improved.

[0128] The data rule configuration method configures the matching conditions, reference rules, and action execution information of the first rule through expression configuration instructions, identification configuration instructions, and action configuration instructions, thereby configuring the first rule. Compared to existing personalized development solutions, when faced with multiple rules and data to be matched, this method eliminates the need to develop specific rules for each business scenario. Instead, new rules only need to be configured based on the specific needs. This effectively reduces development workload, improves system scalability, and reduces the difficulty of system expansion and maintenance.

[0129] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A data rule execution method, characterized in that: include: Acquire attribute information of the data to be matched and the configuration class; wherein the attribute information includes a first rule and a second rule; Performing a first matching operation on the data to be matched and the first rule, and if the result of the first matching operation indicates that the data to be matched matches the first rule, determining a reference rule of the first rule; When the reference rule of the first rule is the second rule, performing a second matching operation on the data to be matched and the second rule, and if the result of the second matching operation indicates that the data to be matched matches the second rule, determining the reference rule of the second rule; When the reference rule of the second rule indicates that the reference ends, an action corresponding to the second rule is executed.

2. A data rule execution method according to claim 1, characterized in that: The attribute information also includes identification information of the first rule. The reference rule for determining the first rule is specifically: Identify the character string of the identification information of the first rule; if the result of the character string identification includes a specific character string, determine the reference rule of the first rule according to the specific character string.

3. A data rule execution method according to claim 1, characterized in that: The attribute information also includes initial rules, and obtaining the data to be matched includes: Get multiple initial data; An initial matching operation is performed on the plurality of initial data respectively with the initial rules, and the initial data that matches the initial rules is used as the data to be matched.

4. A data rule execution method according to claim 1, characterized in that: The attribute information also includes the value information of the first rule, and the first matching operation of the to-be-matched data with the first rule is specifically: Compare the numerical information of the data to be matched with the numerical information of the first rule; and obtain a result of the first matching operation based on a magnitude relationship between the numerical information of the data to be matched and the numerical information of the first rule.

5. A data rule execution method according to claim 1, characterized in that: The data rule execution method further includes: when the result of the first matching operation indicates that the to-be-matched data does not match the first rule, executing an action corresponding to the first rule.

6. A data rule configuration method, characterized in that: The data rule configuration method is used to configure the first rule according to any one of claims 1 to 5; The data rule configuration method includes: Obtaining an expression configuration instruction, and determining a matching condition for the first rule according to the expression configuration instruction; Obtaining an identification configuration instruction, and determining a reference rule for the first rule according to the identification configuration instruction; Obtaining an action configuration instruction, and determining action execution information of the first rule according to the action configuration instruction; Rule configuration is performed according to the matching condition, the reference rule of the first rule, and the action execution information to obtain the first rule.

7. A data rule execution device, characterized in that: It includes a data acquisition module, a first matching module, a second matching module and a first execution module; wherein, The data acquisition module is used to acquire the attribute information of the data to be matched and the configuration class; wherein the attribute information includes the first rule and the second rule; The first matching module is configured to perform a first matching operation on the data to be matched and the first rule, and if the result of the first matching operation indicates that the data to be matched matches the first rule, determine a reference rule of the first rule; the second matching module is configured to, when the reference rule of the first rule is the second rule, perform a second matching operation on the data to be matched and the second rule, and determine the reference rule of the second rule if the result of the second matching operation indicates that the data to be matched matches the second rule; The first execution module is configured to execute an action corresponding to the second rule when the reference rule of the second rule indicates that the reference ends.

8. A data rule configuration device, characterized in that: The data rule configuration device is used to configure the first rule according to any one of claims 1 to 7; The data rule configuration device includes a condition determination module, a reference determination module, an action determination module and a rule configuration module; wherein, The condition determination module is used to obtain an expression configuration instruction and determine a matching condition of the first rule according to the expression configuration instruction; The reference determination module is configured to obtain an identification configuration instruction and determine a reference rule of the first rule according to the identification configuration instruction; The action determination module is configured to obtain an action configuration instruction and determine action execution information of the first rule according to the action configuration instruction; The rule configuration module is used to perform rule configuration according to the matching condition, the reference rule of the first rule and the action execution information to obtain the first rule.

9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method implements the data rule execution method according to any one of claims 1 to 5, or the data rule configuration method according to claim 6.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the data rule execution method according to any one of claims 1 to 5, or the data rule configuration method according to claim 6.