CN112989763B - Data acquisition method, device, computer equipment and storage medium - Google Patents

Data acquisition method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN112989763B
CN112989763B CN202110280843.1A CN202110280843A CN112989763B CN 112989763 B CN112989763 B CN 112989763B CN 202110280843 A CN202110280843 A CN 202110280843A CN 112989763 B CN112989763 B CN 112989763B
Authority
CN
China
Prior art keywords
target
rule
dependency
tree
generate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110280843.1A
Other languages
Chinese (zh)
Other versions
CN112989763A (en
Inventor
付春节
倪寅康
张晓通
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Pingan Payment Technology Service Co Ltd
Original Assignee
Pingan Payment Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Pingan Payment Technology Service Co Ltd filed Critical Pingan Payment Technology Service Co Ltd
Priority to CN202110280843.1A priority Critical patent/CN112989763B/en
Publication of CN112989763A publication Critical patent/CN112989763A/en
Application granted granted Critical
Publication of CN112989763B publication Critical patent/CN112989763B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention discloses a data acquisition method, a data acquisition device, computer equipment and a storage medium. The method belongs to the technical field of data processing, and comprises the following steps: acquiring user request information and screening a target rule set from a preset rule set according to the acquired user request information; sequentially resolving a plurality of target rules in the target rule set to generate a plurality of dependency trees corresponding to the plurality of target rules; merging and simplifying the multiple dependency trees to generate a target dependency tree; each node in the target dependency tree is operated to obtain target data from a predefined service configuration. According to the method and the device, the target rule set is firstly screened from the target rule set, then a plurality of dependency trees are generated, the plurality of dependency trees are combined to generate the target dependency tree, finally target data are acquired according to the target dependency tree, multiple acquisitions of the same target data are avoided, and the acquisition time and the memory occupation of the target data are reduced.

Description

Data acquisition method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data acquisition method, a data acquisition device, a computer device, and a storage medium.
Background
The rule engine has wide application in numerous business scenes such as credit investigation, financial anti-fraud, bill swiping anti-cheating, anti-money laundering, credit card credit giving, marketing activities, commodity recommendation, insurance claims and the like, is embedded in an application program, separates business decision rules from application program codes, and expresses business decision logic by using a predefined script language so as to solve the complex problem. Common rule engines in industry include visual rules, fico, ilog jrules, open source drools, etc., which generally have rule expressions, language parsing, and rule engine execution capabilities, but do not have a data acquisition function, i.e., an application program needs to acquire data required by a rule before calling a rule engine component, and then call the rule engine component to execute the rule. In practical application, a request usually matches multiple rules to make business decisions, and different rule scripts usually depend on the same data item, so that multiple rule engines can acquire the same data multiple times, which not only increases the data acquisition time, but also increases the program memory occupation.
Disclosure of Invention
The embodiment of the invention provides a data acquisition method, a data acquisition device, computer equipment and a storage medium, which aim to solve the problem that the existing data acquisition time is relatively long.
In a first aspect, an embodiment of the present invention provides a data acquisition method, including:
acquiring user request information and screening a target rule set from a preset rule set according to the acquired user request information;
sequentially analyzing a plurality of target rules in the target rule set to generate a plurality of dependency relationship trees corresponding to the plurality of target rules;
merging and simplifying the dependency relationship trees to generate a target dependency relationship tree;
and operating each node in the target dependency tree to acquire target data from the predefined service configuration.
In a second aspect, an embodiment of the present invention further provides a data acquisition apparatus, including:
the screening unit is used for acquiring user request information and screening a target rule set from a preset rule set according to the acquired user request information;
the first generation unit is used for sequentially analyzing a plurality of target rules in the target rule set to generate a plurality of dependency relation trees corresponding to the target rules;
the second generation unit is used for merging and simplifying the plurality of dependency relation trees to generate a target dependency relation tree;
and the acquisition unit is used for operating each node in the target dependency relationship tree to acquire target data from the predefined service configuration.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the method when executing the computer program.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
The embodiment of the invention provides a data acquisition method, a data acquisition device, computer equipment and a storage medium. Wherein the method comprises the following steps: acquiring user request information and screening a target rule set from a preset rule set according to the acquired user request information; sequentially analyzing a plurality of target rules in the target rule set to generate a plurality of dependency relationship trees corresponding to the plurality of target rules; merging and simplifying the dependency relationship trees to generate a target dependency relationship tree; and operating each node in the target dependency tree to acquire target data from the predefined service configuration. According to the technical scheme, the target rule set is screened out from the target rule set, then a plurality of dependency trees are generated, the plurality of dependency trees are combined to generate the target dependency tree, finally target data are acquired according to the target dependency tree, multiple acquisitions of the same target data are avoided, and the acquisition time and memory occupation of the target data are reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a data acquisition method according to an embodiment of the present invention;
fig. 2 is a schematic sub-flowchart of a data acquisition method according to an embodiment of the present invention;
FIG. 3 is a schematic sub-flowchart of a data acquisition method according to an embodiment of the present invention;
fig. 4 is a schematic sub-flowchart of a data acquisition method according to an embodiment of the present invention;
FIG. 5 is a schematic sub-flowchart of a data acquisition method according to an embodiment of the present invention;
FIG. 6 is a flowchart of a data acquisition method according to another embodiment of the present invention;
FIG. 7 is a schematic flow chart of a data acquisition method according to another embodiment of the present invention;
FIG. 8 is a schematic block diagram of a data acquisition device according to an embodiment of the present invention;
fig. 9 is a schematic block diagram of a screening unit of the data acquisition device according to the embodiment of the present invention;
FIG. 10 is a schematic block diagram of a first generating unit of the data acquisition device according to an embodiment of the present invention;
FIG. 11 is a schematic block diagram of a second generating unit of the data acquisition device according to an embodiment of the present invention;
FIG. 12 is a schematic block diagram of a third generation subunit of the data acquisition device according to an embodiment of the present invention;
FIG. 13 is a schematic block diagram of a data acquisition device according to another embodiment of the present invention;
FIG. 14 is a schematic block diagram of an alternative unit of a data acquisition device according to another embodiment of the present invention; and
fig. 15 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated 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.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Referring to fig. 1, fig. 1 is a flowchart of a data acquisition method according to an embodiment of the invention. The data acquisition method of the embodiment of the invention can be applied to intelligent terminal equipment such as a portable computer, a notebook computer, a desktop computer and the like, and can be realized through an application program installed on the terminal, so that the target data acquisition time and the memory occupation are reduced. As shown in fig. 1, the method includes the following steps S100 to S130.
S100, acquiring user request information and screening a target rule set from a preset rule set according to the acquired user request information.
In the embodiment of the invention, after the user request information is acquired, a decision service interface is firstly called to input the user request information into a rule engine, and a target rule set is screened out from a preset rule set according to the user request information in the rule engine, wherein the target rule set comprises a plurality of target rules corresponding to the user request information. It is understood that if the user request information is payment information, the payment information includes a payment manner, a payment time, an amount, a payee, a payer, and the like, and the target rule set may be screened from the preset rule set according to the payment information, where the target rule set includes a payment manner rule, an amount rule, and the like. The preset rule set includes a plurality of preset rules, and the plurality of preset rules are preconfigured in the rule engine, such as payment mode rules, collection rules, payment rules and the like. A rules engine is a component nested within an application that enables the separation of business rules from application code.
Referring to fig. 2, in an embodiment, for example, in an embodiment of the present invention, the step S100 includes the following steps S101-S102.
S101, acquiring user request information and converting the acquired user request information into tag information;
s102, screening a target rule set from a preset rule set according to the label information.
In the embodiment of the invention, user request information is acquired and the acquired user request information is converted into tag information; and screening a target rule set from a preset rule set according to the label information. The tag information may be a number, a character string, a section, or the like. For example, when the user request information is WeChat payment in a payment mode, the tag information is a character string WeChat, and a preset rule corresponding to the tag information WeChat is screened out from a preset rule set according to the tag information WeChat, and other target rules corresponding to the user request information can be screened out in the same way, and a plurality of target rules form the target rule set.
S110, sequentially analyzing a plurality of target rules in the target rule set to generate a plurality of dependency relationship trees corresponding to the target rules.
In the embodiment of the invention, after a target rule set is screened out from a preset rule set according to the acquired user request information, a plurality of target rules in the target rule set are sequentially analyzed to generate a plurality of dependency relationship trees corresponding to the plurality of target rules. The dependency tree is a dependency relationship in which a plurality of rule functions are represented by a tree structure. For example, the target rule set screened through the steps includes target rules such as payment mode, payment time, amount, payee, payer, and the like, each target rule corresponds to a dependency tree, each dependency tree corresponds to a rule script, and each rule script has a plurality of rule functions. The rule function is understandably a custom function, for example a func.a function.
Referring to fig. 3, in an embodiment, for example, in the embodiment of the present invention, the step S110 includes the following steps S111-S112.
S111, extracting a plurality of rule functions from a rule script corresponding to each target rule in the target set;
s112, generating a plurality of dependency relation trees corresponding to the target rules based on the extracted rule functions and the nested calling relations of the rule functions.
In the embodiment of the invention, for each target rule in the target set, a plurality of rule functions are extracted from a rule script corresponding to the target rule; generating a plurality of dependency relationship trees corresponding to the target rules based on the extracted rule functions and the nested calling relations of the rule functions. Specifically, each target rule corresponds to a rule script, a plurality of rule functions exist in each rule script, nested calling relations exist among the plurality of rule functions, and a dependency relation tree corresponding to the target rule can be generated according to the nested calling relations among the plurality of rule functions and the plurality of rule functions. Understandably, multiple target rules can generate multiple dependency trees.
S120, merging and simplifying the dependency relationship trees to generate a target dependency relationship tree.
In the embodiment of the invention, after a plurality of target rules in the target set are sequentially analyzed to generate a plurality of dependency trees corresponding to the plurality of target rules, the plurality of dependency trees are combined and simplified to generate the target dependency tree. The target dependency tree is understandably a dependency tree. For example, all target rules in the target rule set generate a dependency tree corresponding to the target rule set after the steps, for example, a plurality of dependency trees such as payment mode, payment time, amount, payee, payer and the like, and the plurality of dependency trees such as payment mode, payment time, amount, payee, payer and the like are combined to generate one dependency tree, namely, the target dependency tree is generated.
Referring to fig. 4, in an embodiment, for example, in the embodiment of the present invention, the step S120 includes the following steps S121-S122.
S121, merging the dependency trees to generate a first dependency tree;
s122, simplifying the first dependency tree according to preset conditions to generate a second dependency tree, wherein the second dependency tree is a target dependency tree.
In the embodiment of the invention, a plurality of dependency trees are combined to generate a first dependency tree; specifically, one dependency tree is selected from the dependency trees as a reference dependency tree A, after the reference dependency tree A is removed, one dependency tree B is selected from the rest of the dependency trees and combined with the reference dependency tree A to generate a dependency tree C, and finally the dependency tree C is used as a new reference dependency tree A, and the steps are repeated until all the dependency trees are combined to generate the reference dependency tree A, wherein the reference dependency tree is the first dependency tree. After the first dependency tree is generated, simplifying the first dependency tree according to preset conditions to generate a second dependency tree, wherein the second dependency tree is a target dependency tree. The preset conditions are that the function names and the function parameters are the same.
Referring to fig. 5, in an embodiment, for example, in an embodiment of the present invention, the step S122 includes the following steps S1221 to S1222.
S1221, traversing all rule functions in the rule script corresponding to the first dependency tree in sequence;
s1222, merging the rule functions with the same function name and function parameter to generate a second dependency tree, wherein the second dependency tree is a target dependency tree.
In the embodiment of the invention, all rule functions in the rule script corresponding to the first dependency tree are traversed in sequence, and the rule functions with the same function names and function parameters are combined to generate a second dependency tree, wherein the second dependency tree is a target dependency tree. It is understood that if the rule functions have the same function name and different function parameters, the merging process is not performed.
S130, each node in the target dependency tree is operated to acquire target data from the predefined service configuration.
In the embodiment of the invention, after merging and simplifying a plurality of dependency trees to generate a target dependency tree, each node in the target dependency tree is operated to acquire target data from a predefined service configuration. Specifically, traversing from leaf nodes of a target dependency tree, and running rule functions corresponding to the leaf nodes, and acquiring data from predefined service configuration through the rule functions, wherein the predefined service configuration is distributed cache and RPC service; after each leaf node in the target dependency relationship tree acquires target data, the target data corresponding to the node of the previous layer can be acquired through the dependency relationship between each leaf node and the node of the previous layer until the root node. For example, if the target dependency tree is generated by combining multiple dependency trees such as payment method, payment time, amount, payee, payer, etc., the obtained target data includes target data such as specific payment method (WeChat payment, credit card payment, etc.), specific payment time, amount, payee name, payer name, etc.
It should be noted that, in the present application, the target dependency tree includes a plurality of leaf nodes, each leaf node corresponds to a path from a root node, and a rule function on each path can acquire data in parallel, so that the time for acquiring data can be shortened compared with serial data acquisition, thereby reducing memory occupation.
Fig. 6 is a flowchart of a data acquisition method according to another embodiment of the present invention, as shown in fig. 6, in this embodiment, the method includes steps S100-S140. That is, in the present embodiment, the method further includes step S140 after step S130 of the above embodiment.
S140, replacing the rule function in the target set with the target data to obtain a decision result.
In the embodiment of the invention, the rule function in the rule script corresponding to the target rule set is replaced by the target data because the function can be prevented from being acquired for multiple times by the same rule function, the time for acquiring the target data can be saved, and the memory occupation can be reduced.
It should be noted that, in the embodiment of the present invention, only the selected target rule has a rule logic relationship, and only the dependency relationship of the rule function is in the target dependency relationship tree.
Referring to fig. 7, in an embodiment, for example, in the embodiment of the present invention, the step S140 includes the following steps S141-S142.
S141, for each target rule in the target rule set, replacing the rule function in the rule script corresponding to the target rule with the target data to obtain a plurality of target rule scripts;
s142, running the target rule scripts to generate decision results corresponding to the user request information.
In the embodiment of the invention, after each node in the target dependency tree is operated to acquire target data from a predefined service configuration, the rule function in the target set is replaced by the target data to obtain a decision result. Specifically, sequentially replacing the rule functions in the rule scripts corresponding to the target rules with the target data to obtain a plurality of target rule scripts; and running the target rule scripts to generate decision results corresponding to the user request information. Understandably, if the user request information is payment information, the target data is data such as a specific payment mode, a specific payment time, an amount of money, a payee name, a payer name, etc., a rule function in a rule script corresponding to the target rule is replaced with the corresponding target data, and then the replaced rule script is operated to obtain a decision result, wherein the decision result is payable or unpalatable. In the actual application scene, the rule engine returns the decision result to the application program, if the decision result is that Y represents payable, otherwise, the payable is indicated.
Fig. 8 is a schematic block diagram of a data acquisition device 200 according to an embodiment of the present invention. As shown in fig. 8, the present invention also provides a data acquisition apparatus 200 corresponding to the above data acquisition method. The data acquisition device 200 includes a unit for performing the above-described data acquisition method, and the device may be configured in a terminal. Specifically, referring to fig. 8, the data acquisition device 200 includes a filtering unit 201, a first generating unit 202, a second generating unit 203, and an acquisition unit 204.
The screening unit 201 is configured to obtain user request information and screen a target rule set from a preset rule set according to the obtained user request information; the first generating unit 202 is configured to sequentially parse a plurality of target rules in the target rule set, so as to generate a plurality of dependency trees corresponding to a plurality of target rules; the second generating unit 203 is configured to combine and simplify the multiple dependency trees to generate a target dependency tree; the obtaining unit 204 is configured to operate each node in the target dependency tree to obtain target data from a predefined service configuration.
In some embodiments, for example, in the present embodiment, as shown in fig. 9, the filtering unit 201 includes a converting unit 2011 and a filtering subunit 2012.
The conversion unit 2011 is configured to obtain user request information and convert the obtained user request information into tag information; the screening subunit 2012 is configured to screen a target rule set from a preset rule set according to the tag information.
In some embodiments, for example, in the present embodiment, as shown in fig. 10, the first generating unit 202 includes an extracting unit 2021 and a first generating subunit 2022.
Wherein the extracting unit 2021 is configured to extract, for each target rule in the target set, a plurality of rule functions from a rule script corresponding to the target rule; the first generating subunit 2022 is configured to generate a plurality of dependency trees corresponding to a plurality of target rules based on the extracted rule functions and nested calling relationships of the rule functions.
In some embodiments, for example, in the present embodiment, as shown in fig. 11, the second generating unit 203 includes a second generating subunit 2031 and a third generating subunit 2032.
Wherein the second generating subunit 2031 is configured to merge dependency trees of the multiple dependency trees to generate a first dependency tree; the third generating subunit 2032 is configured to simplify the first dependency tree according to a preset condition to generate a second dependency tree, where the second dependency tree is a target dependency tree.
In some embodiments, for example, in the present embodiment, as shown in fig. 12, the third generating subunit 2032 includes a traversing unit 20321 and a fourth generating subunit 20322.
The traversing unit 20321 is configured to sequentially traverse all rule functions in the rule script corresponding to the first dependency tree; the fourth generating subunit 20322 is configured to combine the rule functions with the same function name and function parameter to generate a second dependency tree, where the second dependency tree is a target dependency tree.
In some embodiments, for example the present embodiment, as shown in fig. 13, the apparatus 200 further comprises a replacement unit 205.
Wherein the replacing unit 205 is configured to replace the rule function in the target set with the target data to obtain a decision result.
In some embodiments, for example, in the present embodiment, as shown in fig. 14, the replacing unit 205 includes a replacing subunit 2051 and a fifth generating subunit 2052.
The replacing subunit 2051 is configured to replace, for each target rule in the target rule set, the rule function in the rule script corresponding to the target rule with the target data to obtain a plurality of target rule scripts; the fifth generating subunit 2052 is configured to run the plurality of target rule scripts to generate a decision result corresponding to the user request information.
Referring to fig. 15, fig. 15 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 300 is a terminal, and the terminal may be an electronic device with a communication function, such as a tablet computer, a notebook computer, and a desktop computer.
With reference to FIG. 15, the computer device 300 includes a processor 302, a memory, and a network interface 305, which are connected by a system bus 301, wherein the memory may include a storage medium 303 and an internal memory 304.
The storage medium 303 may store an operating system 3031 and a computer program 3032. The computer program 3032, when executed, may cause the processor 302 to perform a data acquisition method.
The processor 302 is used to provide computing and control capabilities to support the operation of the overall computer device 300.
The internal memory 304 provides an environment for the execution of a computer program 3032 in the storage medium 303, which computer program 3032, when executed by the processor 302, causes the processor 302 to perform a data acquisition method.
The network interface 305 is used for network communication with other devices. It will be appreciated by those skilled in the art that the structure shown in fig. 15 is merely a block diagram of a portion of the structure associated with the present application and does not constitute a limitation of the computer device 300 to which the present application is applied, and that a particular computer device 300 may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 302 is configured to execute a computer program 3032 stored in a memory to implement the following steps: acquiring user request information and screening a target rule set from a preset rule set according to the acquired user request information; sequentially analyzing a plurality of target rules in the target rule set to generate a plurality of dependency relationship trees corresponding to the plurality of target rules; merging and simplifying the dependency relationship trees to generate a target dependency relationship tree; and operating each node in the target dependency tree to acquire target data from the predefined service configuration.
In some embodiments, for example, in this embodiment, when implementing the step of acquiring the user request information and screening the target rule set from the preset rule set according to the acquired user request information, the processor 302 specifically implements the following steps: acquiring user request information and converting the acquired user request information into tag information; and screening a target rule set from a preset rule set according to the label information.
In some embodiments, for example, in this embodiment, when implementing the step of parsing the plurality of target rules in the target rule set in turn to generate a plurality of dependency trees corresponding to a plurality of target rules, the processor 302 specifically implements the following steps: extracting a plurality of rule functions from a rule script corresponding to each target rule in the target set; generating a plurality of dependency relationship trees corresponding to the target rules based on the extracted rule functions and the nested calling relations of the rule functions.
In some embodiments, for example, in this embodiment, when implementing the step of merging and simplifying the multiple dependency trees to generate the target dependency tree, the processor 302 specifically implements the following steps: combining the dependency trees to generate a first dependency tree; simplifying the first dependency tree according to preset conditions to generate a second dependency tree, wherein the second dependency tree is a target dependency tree.
In some embodiments, for example, in this embodiment, when the simplifying the first dependency tree according to the preset condition is implemented to generate a second dependency tree, the processor 302 specifically implements the following steps: traversing all rule functions in the rule script corresponding to the first dependency tree in sequence; and merging the rule functions with the same function names and function parameters to generate a second dependency relationship tree, wherein the second dependency relationship tree is a target dependency relationship tree.
In some embodiments, for example, the present embodiment, after implementing the step of running each node in the target dependency tree to obtain target data from a predefined service configuration, the specific implementation further includes the following steps: and replacing the rule function in the target set with the target data to obtain a decision result.
In some embodiments, for example, in this embodiment, when implementing the step of replacing the rule function in the target set with the target data to obtain a decision result, the processor 302 specifically implements the following steps: for each target rule in the target rule set, replacing the rule function in the rule script corresponding to the target rule with the target data to obtain a plurality of target rule scripts; and running the target rule scripts to generate decision results corresponding to the user request information.
It should be appreciated that in embodiments of the present application, the processor 302 may be a central processing unit (Central Processing Unit, CPU), the processor 302 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program may be stored in a storage medium that is a computer readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above. Accordingly, the present invention also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program. The computer program, when executed by a processor, causes the processor to perform the steps of: acquiring user request information and screening a target rule set from a preset rule set according to the acquired user request information; sequentially analyzing a plurality of target rules in the target rule set to generate a plurality of dependency relationship trees corresponding to the plurality of target rules; merging and simplifying the dependency relationship trees to generate a target dependency relationship tree; and operating each node in the target dependency tree to acquire target data from the predefined service configuration.
In some embodiments, for example, when the processor executes the computer program to implement the step of obtaining the user request information and screening the target rule set from the preset rule set according to the obtained user request information, the method specifically includes the following steps: acquiring user request information and converting the acquired user request information into tag information; and screening a target rule set from a preset rule set according to the label information.
In some embodiments, for example, when the processor executes the computer program to implement the step of sequentially parsing the plurality of target rules in the target rule set to generate a plurality of dependency trees corresponding to the plurality of target rules, the method specifically includes the following steps: extracting a plurality of rule functions from a rule script corresponding to each target rule in the target set; generating a plurality of dependency relationship trees corresponding to the target rules based on the extracted rule functions and the nested calling relations of the rule functions.
In some embodiments, for example, the processor, when executing the computer program to implement the step of merging and simplifying the plurality of dependency trees to generate the target dependency tree, specifically implements the following steps: combining the dependency trees to generate a first dependency tree; simplifying the first dependency tree according to preset conditions to generate a second dependency tree, wherein the second dependency tree is a target dependency tree.
In some embodiments, for example, in this embodiment, when the processor executes the computer program to implement the step of simplifying the first dependency tree according to a preset condition to generate a second dependency tree, the step of specifically implementing the following steps is implemented: traversing all rule functions in the rule script corresponding to the first dependency tree in sequence; and merging the rule functions with the same function names and function parameters to generate a second dependency relationship tree, wherein the second dependency relationship tree is a target dependency relationship tree.
In some embodiments, for example, the processor, after executing the computer program to implement the step of running each node in the target dependency tree to obtain target data from a predefined service configuration, further specifically includes the steps of: and replacing the rule function in the target set with the target data to obtain a decision result.
In some embodiments, for example, the processor, when executing the computer program to implement the step of replacing the rule function in the target set with the target data to obtain a decision result, specifically implements the following steps: for each target rule in the target rule set, replacing the rule function in the rule script corresponding to the target rule with the target data to obtain a plurality of target rule scripts; and running the target rule scripts to generate decision results corresponding to the user request information.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and for those portions of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (8)

1. A method of data acquisition, comprising:
acquiring user request information and converting the acquired user request information into tag information, wherein the tag information comprises at least one of numbers, character strings and intervals;
screening a target rule set from a preset rule set according to the label information in a rule engine, wherein the target rule set comprises a plurality of target rules corresponding to the user request information;
sequentially analyzing a plurality of target rules in the target rule set to generate a plurality of dependency relationship trees corresponding to the plurality of target rules;
merging and simplifying the dependency relationship trees to generate a target dependency relationship tree;
operating each node in the target dependency tree to obtain target data from a predefined service configuration;
and replacing the rule function in the target rule set with the target data to obtain a decision result, wherein the rule function is a function extracted from a rule script corresponding to the target rule in the target rule set.
2. The method of claim 1, wherein sequentially parsing the plurality of target rules in the set of target rules to generate a plurality of dependency trees corresponding to the plurality of target rules comprises:
extracting a plurality of rule functions from a rule script corresponding to each target rule in the target rule set;
generating a plurality of dependency relationship trees corresponding to the target rules based on the extracted rule functions and the nested calling relations of the rule functions.
3. The method of claim 1, wherein the merging and simplifying the plurality of dependency trees to generate a target dependency tree comprises:
combining the dependency trees to generate a first dependency tree;
simplifying the first dependency tree according to preset conditions to generate a second dependency tree, wherein the second dependency tree is a target dependency tree.
4. A method according to claim 3, wherein the simplifying the first dependency tree according to the preset condition to generate a second dependency tree, the second dependency tree being a target dependency tree, comprises:
traversing all rule functions in the rule script corresponding to the first dependency tree in sequence;
and merging the rule functions with the same function names and function parameters to generate a second dependency relationship tree, wherein the second dependency relationship tree is a target dependency relationship tree.
5. The method of claim 1, wherein said replacing the rule function in the target rule set with the target data to obtain a decision result comprises:
for each target rule in the target rule set, replacing the rule function in the rule script corresponding to the target rule with the target data to obtain a plurality of target rule scripts;
and running the target rule scripts to generate decision results corresponding to the user request information.
6. A data acquisition device, comprising:
the device comprises a conversion unit, a processing unit and a processing unit, wherein the conversion unit is used for acquiring user request information and converting the acquired user request information into tag information, and the tag information comprises at least one of numbers, character strings and intervals;
a screening subunit, configured to screen, in a rule engine, a target rule set from a preset rule set according to the tag information, where the target rule set includes a plurality of target rules corresponding to the user request information;
the first generation unit is used for sequentially analyzing a plurality of target rules in the target rule set to generate a plurality of dependency relation trees corresponding to the target rules;
the second generation unit is used for merging and simplifying the plurality of dependency relation trees to generate a target dependency relation tree;
an obtaining unit, configured to operate each node in the target dependency tree to obtain target data from a predefined service configuration;
and the replacing unit is used for replacing the rule function in the target rule set with the target data to obtain a decision result, wherein the rule function is a function extracted from a rule script corresponding to the target rule in the target rule set.
7. A computer device, characterized in that it comprises a memory and a processor, on which a computer program is stored, which processor implements the method according to any of claims 1-5 when executing the computer program.
8. A computer readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method according to any of claims 1-5.
CN202110280843.1A 2021-03-16 2021-03-16 Data acquisition method, device, computer equipment and storage medium Active CN112989763B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110280843.1A CN112989763B (en) 2021-03-16 2021-03-16 Data acquisition method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110280843.1A CN112989763B (en) 2021-03-16 2021-03-16 Data acquisition method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112989763A CN112989763A (en) 2021-06-18
CN112989763B true CN112989763B (en) 2023-04-28

Family

ID=76335896

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110280843.1A Active CN112989763B (en) 2021-03-16 2021-03-16 Data acquisition method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112989763B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115862882B (en) * 2022-12-02 2024-02-13 北京百度网讯科技有限公司 Data extraction method, device, equipment and storage medium
CN117038002B (en) * 2023-10-08 2024-02-13 之江实验室 Method and device for generating observation variable in drug evaluation research

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110795455A (en) * 2019-09-06 2020-02-14 中国平安财产保险股份有限公司 Dependency relationship analysis method, electronic device, computer device and readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8909584B2 (en) * 2011-09-29 2014-12-09 International Business Machines Corporation Minimizing rule sets in a rule management system
CN109597606A (en) * 2018-10-24 2019-04-09 中国平安人寿保险股份有限公司 Method, equipment and the storage medium of operational decision making are carried out using regulation engine
US11422917B2 (en) * 2019-07-26 2022-08-23 Red Hat, Inc. Deriving software application dependency trees for white-box testing
CN111209301A (en) * 2019-12-29 2020-05-29 南京云帐房网络科技有限公司 Method and system for improving operation performance based on dependency tree splitting

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110795455A (en) * 2019-09-06 2020-02-14 中国平安财产保险股份有限公司 Dependency relationship analysis method, electronic device, computer device and readable storage medium

Also Published As

Publication number Publication date
CN112989763A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CA3047939C (en) Automated extraction of rules embedded in software application code using machine learning
US20200273570A1 (en) Predictive analysis platform
CN106875078B (en) Transaction risk detection method, device and equipment
US20170024828A1 (en) Systems and methods for identifying information related to payment card testing
US9390176B2 (en) System and method for recursively traversing the internet and other sources to identify, gather, curate, adjudicate, and qualify business identity and related data
AU2019203697A1 (en) Intelligent data extraction
US20210182859A1 (en) System And Method For Modifying An Existing Anti-Money Laundering Rule By Reducing False Alerts
US20120259753A1 (en) System and method for managing collaborative financial fraud detection logic
CN112989763B (en) Data acquisition method, device, computer equipment and storage medium
CN111078880A (en) Risk identification method and device for sub-application
US20220207295A1 (en) Predicting occurrences of temporally separated events using adaptively trained artificial intelligence processes
US20220116348A1 (en) System and Method for Tagging Data
KR102101456B1 (en) Method for reducing false positives for diagnosis of personal information exposure of text files and irregular image files
CN111245815B (en) Data processing method and device, storage medium and electronic equipment
US20210303441A1 (en) Systems and methods for dynamically logging application data
CN111126965B (en) Auditing rule optimization method, auditing rule optimization device, computer equipment and storage medium
CN111553803A (en) Claims processing method and device
CN113515440A (en) Test case distribution method and device, computer equipment and storage medium
US8036921B2 (en) System and method for optimization process repeatability in an on-demand computing environment
GB2604116A (en) An apparatus, method and computer program product for identifying a validation check for a set of numbers
CN111429257A (en) Transaction monitoring method and device
CN114222004B (en) Service data distribution execution method, device, computer equipment and storage medium
US11861732B1 (en) Industry-profile service for fraud detection
US20240005321A1 (en) Digital policy criteria integration for making determinations within an inter-network facilitation system
CN111383071B (en) Method and device for screening conditions of scenes related to real estate transaction system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant