CN112860398A - Data processing method, device, equipment and medium based on rule engine - Google Patents

Data processing method, device, equipment and medium based on rule engine Download PDF

Info

Publication number
CN112860398A
CN112860398A CN202110145301.3A CN202110145301A CN112860398A CN 112860398 A CN112860398 A CN 112860398A CN 202110145301 A CN202110145301 A CN 202110145301A CN 112860398 A CN112860398 A CN 112860398A
Authority
CN
China
Prior art keywords
rule
service
information
request
instance
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.)
Pending
Application number
CN202110145301.3A
Other languages
Chinese (zh)
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.)
Guangzhou Wangxing Information Technology Co Ltd
Original Assignee
Guangzhou Wangxing Information Technology 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 Guangzhou Wangxing Information Technology Co Ltd filed Critical Guangzhou Wangxing Information Technology Co Ltd
Priority to CN202110145301.3A priority Critical patent/CN112860398A/en
Publication of CN112860398A publication Critical patent/CN112860398A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a data processing method, a device, equipment and a medium based on a rule engine, relating to the technical field of computers, wherein the data processing method based on the rule engine comprises the following steps: determining target rule service cluster information according to the service identification information carried by the rule checking request; searching target rule service instance information through a service registration center according to the target rule service cluster information; constructing a specified verification request according to the target rule service instance information; and calling a rule engine to check according to the specified check request to obtain a rule check result. The embodiment of the invention solves the problems of difficulty in dynamically increasing and decreasing the check rules, difficulty in maintaining the rule set and the like caused by modifying the script to change the check rules through the rule engine in the prior art, facilitates the realization of dynamic capacity expansion and supports higher request quantity.

Description

Data processing method, device, equipment and medium based on rule engine
Technical Field
The invention relates to the technical field of computers, in particular to a data processing method, a data processing device, data processing equipment and a data processing medium based on a rule engine.
Background
In the actual putting and using process of the product, in order to avoid the loss of the system, the wind control, the business rule and other aspects are generally required to be checked, that is, a certain rule processing is required to be carried out on the request event, so that the appeal of the components such as the system safety, black product prevention, directional recommendation and the like can be supported.
To implement rule set handling for request events, a rule engine is typically introduced. However, regardless of whether the implementation is executed based on a script by a script parsing engine or executed by using a Java Virtual Machine (JVM) to generate Java bytecode by using code generation, the implementation details can be categorized into a single-process centralized execution rule judgment, that is, from the event perspective, the Java bytecode is submitted to a certain rule engine process for interpretation and execution, and the rule engine process needs to contain all rules, so that dynamic rules increase and decrease are relatively difficult, and self-research or expansion of some open source implementations is required.
It can be seen that it is difficult to implement dynamic capacity expansion for supporting higher request amount by the conventional rule engine, and it is difficult to perform cooperative work and rule increase and decrease in different departments, for example, if the rules of the wind control department and the rules of the business department need to be mixed together, if the wind control department and the business department directly operate and maintain one set of rules, the responsibilities of the departments are too coupled, and the rule set is difficult to maintain.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a medium for data processing based on a rule engine, so as to introduce a rule engine access layer, so that the rule engines of each system can be uniformly called by a rule scheduling center, and solve the problems in the prior art that it is difficult to dynamically increase or decrease rules and maintain rule sets.
In a first aspect, an embodiment of the present invention provides a data processing method based on a rule engine, including: determining target rule service cluster information according to the service identification information carried by the rule checking request; searching target rule service instance information through a service registration center according to the target rule service cluster information; constructing a specified verification request according to the target rule service instance information; and calling a rule engine to check according to the specified check request to obtain a rule check result.
In a second aspect, an embodiment of the present invention further provides a data processing method based on a rule engine, including: based on the check event, acquiring rule routing agent instance cluster information from a service registration center; carrying out routing selection according to the regular routing agent instance cluster information to obtain routing agent instance information; and generating a rule checking request according to the routing agent instance information and the service identification information corresponding to the checking event, and sending the rule checking request.
In a third aspect, an embodiment of the present invention further provides a data processing apparatus based on a rule engine, including:
the rule service cluster determining module is used for determining target rule service cluster information according to the service identification information carried by the rule verification request;
the rule service instance determining module is used for searching target rule service instance information through a service registration center according to the target rule service cluster information;
the specified checking request constructing module is used for constructing a specified checking request according to the target rule service instance information;
and the rule engine calling module is used for calling a rule engine to check according to the specified check request to obtain a rule check result.
In a fourth aspect, an embodiment of the present invention further provides a data processing apparatus based on a rule engine, including:
the routing agent instance cluster information acquisition module is used for acquiring regular routing agent instance cluster information from the service registration center based on the check event;
the routing agent instance information selection module is used for carrying out routing selection according to the rule routing agent instance cluster information to obtain routing agent instance information;
and the rule checking request generating and sending module is used for generating and sending a rule checking request according to the routing agent instance information and the service identification information corresponding to the checking event.
In a fifth aspect, an embodiment of the present invention further provides a data processing device based on a rule engine, including: a processor and a memory; the memory has stored therein at least one instruction that, when executed by the processor, causes the processing device to perform a method of rules engine based data processing as described in the first or second aspect.
In a sixth aspect, the present invention further provides a computer-readable storage medium, where instructions of the computer-readable storage medium, when executed by a processor of a computer device, enable the computer device to perform the method for processing data based on a rule engine according to the first aspect or the second aspect.
The embodiment of the invention determines the target rule service cluster information according to the business identification information carried by the rule verification request, searches the target rule service instance information through the service registration center according to the target rule service cluster information, namely discovers all rule service instances subscribed with the business identification information to form a rule service instance set, then constructs a specified verification request according to the target rule service instance information, calls the rule engine information to verify, namely requests and verifies the rule service instances one by one, realizes the unified scheduling of the rule engine, ensures that each cooperative system can carry out various rule checks on the same event in a service providing mode, can be uniformly scheduled by a rule engine access layer serving as a rule scheduling center, does not need to modify the verification rules through operations such as modifying scripts and the like of the rule engine, and solves the problems that the dynamic verification rules are difficult to increase and decrease caused by modifying the verification rules by modifying the scripts by the rule engine in the prior art, And the rule set is difficult to maintain, dynamic capacity expansion is convenient to realize, and higher request amount is supported.
Drawings
FIG. 1 is a schematic flow chart illustrating steps of a data processing method based on a rule engine according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating steps of another rule engine-based data processing method according to an embodiment of the present invention;
FIG. 3 is a schematic flow diagram of a rules engine based data handler in one example of the invention;
FIG. 4 is a schematic flow chart illustrating steps of another rule engine-based data processing method according to an embodiment of the present invention;
FIG. 5 is a block diagram of a data processing apparatus based on a rule engine according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of another data processing apparatus based on a rule engine according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures or components relevant to the present invention are shown in the drawings, not all of them.
One of the core ideas of the embodiments of the present invention is to provide a rule engine-based data processing method and related devices based on the idea of distributed cross-team cooperation, so as to introduce a rule engine access layer, so that each cooperation department can perform respective rule check on the same event in a service providing manner, and the events can be uniformly scheduled by a rule scheduling center, so that each department can process the events according to a familiar technical system in a team without learning a set of new rule engine operation, thereby reducing the cost of writing a learning script, and simultaneously solving the problems that the capacity expansion of the system is difficult and the rule set is difficult to maintain because the verification rule is changed by modifying the script and other operations through the rule engine in the prior art.
Specifically, after the rule engine access layer is introduced, the rule engine access layer carries the service identification information in the request parameter of the event, so that the rule engine access layer can discover the rule service instances subscribed with the service identification information after receiving the request to form a rule service instance set, and can perform request verification on the rule service instances in the rule service instance set one by one, so as to determine the rule verification result of the event based on the request verification result fed back by each rule service instance, so that the event can be processed according to the rule verification result in the following process.
Example one
Referring to fig. 1, a schematic flowchart illustrating steps of a data processing method based on a rule engine according to an embodiment of the present invention is shown. The embodiment is applicable to a data processing situation based on a rule engine, and specifically may include the following steps:
and step 110, determining target rule service cluster information according to the service identification information carried by the rule checking request.
In the actual processing, the data processing method based on the rule engine provided by the embodiment of the invention can be applied to the rule engine access layer, so that after the rule engine access layer receives the rule verification request, the target rule service cluster information can be determined according to the service identification information carried in the rule verification request. The target rule service cluster information may be used to represent a target rule service cluster; the target rule service cluster may refer to a rule service instance set that needs to be checked, such as a wind control system cluster, a network security system cluster, a business system cluster, and/or other system clusters that need to be checked. It should be noted that, one system cluster may include one or more systems, for example, the wind control system cluster may include one or more wind control systems, and this embodiment does not specifically limit this.
Further, the determining target rule service cluster information according to the service identification information carried by the rule checking request in the embodiment of the present invention specifically may include: receiving a rule checking request; extracting service identification information carried by the rule checking request; and determining the rule service cluster information associated with the service identification information as target rule service cluster information. Specifically, after receiving the rule checking request, the rule engine access layer in the embodiment of the present invention may extract the service identification information from the rule checking request, and then may determine the rule service cluster information associated with the service identification information as the target rule service cluster information, that is, determine the rule service cluster associated with the service identification information as the target rule cluster, so that rule checking may be performed subsequently according to the rule service instance in each target rule service cluster requested by the service identification information.
And step 120, searching target rule service instance information through a service registration center according to the target rule service cluster information.
Specifically, after the target rule service cluster information is determined, the embodiment of the present invention may find, according to the target rule service cluster information, rule service instance information corresponding to the target rule service cluster information through a service registration center, to find all rule service instances subscribing to the service identification information, and may determine the found rule service instance information as the target rule service instance information, so that the subsequent routing selection and request construction may be performed according to the target rule service instance information to perform specific rule verification. The rule service instance information corresponding to the target rule service cluster information may be used to represent all rule service instances in the target rule service cluster, and specifically may include network address information of each rule service instance in the target rule service cluster, for example, the Uniform Resource Locator (URL) of the rule service instance, an Internet Protocol (IP) address, and the like, which is not limited in this embodiment. It should be noted that, a rule service instance in the target rule service cluster may refer to a rule service instance subscribed to the service identification information.
Step 130, constructing a specified checking request according to the target rule service instance information.
Specifically, after the target rule service instance information is found, the embodiment of the present invention may perform routing selection according to the target rule instance information, so as to construct a request to perform specific rule verification based on the selected routing selection information, that is, construct a rule verification request, so that the rule verification may be performed subsequently based on the rule verification request to request the rule verification service instance. The request parameter of the specified verification request may be kept consistent with the upstream request, for example, may be kept consistent with the request parameter carried by the received rule verification request, and specifically includes the service identifier information, the URL of the rule service instance, and the like, which is not limited in this embodiment.
Step 140, invoking a rule engine to perform verification according to the specified verification request, and obtaining a rule verification result.
Specifically, after the specified verification request is constructed, the rule engine may be called to perform verification according to the specified verification request target rule service instance, that is, request verification is performed on the rule service instances one by one, and a rule verification result corresponding to the rule verification request may be generated based on a result generated after verification, so as to achieve the purpose of rule verification.
To sum up, the embodiment of the present invention determines the target rule service cluster information according to the service identification information carried by the rule verification request, searches the target rule service instance information through the service registration center according to the target rule service cluster information, i.e., finds all rule service instances subscribing the service identification information to form a rule service instance set, then can construct a specified verification request according to the target rule service instance information, invokes the rule engine information to verify, i.e., performs request verification on the rule service instances one by one, thereby implementing unified scheduling of the rule engine, enabling each collaboration system to perform various rule checks on the same event in a service providing manner, and performing unified scheduling by the rule engine access layer serving as the rule scheduling center, without changing the verification rules through operations such as modifying scripts of the rule engine, and solving the problem that the dynamic increase and decrease of the verification rules caused by modifying the verification rules by modifying scripts of the rule engine in the prior art Difficulty, difficulty in maintaining the rule set and the like, dynamic capacity expansion is conveniently realized, and higher request amount is supported.
It should be noted that the service identification information in the embodiment of the present invention may be used to indicate a specific service that needs to be checked, for example, the service identification information may be a globally unique identification allocated to the service, for example, a unique service identification allocated when the service that needs to be checked is created. As an optional example of the present invention, when creating a service to be verified, a service to be verified may be newly added on the rule routing management platform, and a unique service identifier may be allocated to serve as service identifier information corresponding to the newly added service, and may be persisted in a Database (DB), for example, the unique service identifier bizId allocated to the newly added service may be stored in the Database to serve as the persisted service identifier information corresponding to the newly added service, so that a corresponding rule verification request may be subsequently generated according to the unique service identifier. The rule checking request may be used to request rule checking, and specifically may include: a rule check request sent by an Application Program Interface (API) gateway, a rule check request sent by an internal system, and the like, which are not specifically limited in this embodiment of the present invention.
Further, the rule checking request in the embodiment of the present invention may include a first rule checking request sent by an application program interface gateway and/or a second rule checking request sent by an intranet system. Wherein the first rule check request may; the second rule checking request may be a rule checking request actively initiated by the intranet system. The intranet system may refer to an internal system that is in the same housekeeping as the rule engine access layer, such as in the case where the rule engine access layer includes one or more rule routing agent instances, the internal system may be in the same intranet as the rule routing agent instances, and may actively initiate rule checking for traffic.
Example two
Referring to fig. 2, a schematic flowchart illustrating steps of another rule engine-based data processing method according to an embodiment of the present invention is shown. The data processing method based on the rule engine provided by the embodiment of the invention can be applied to a generation scene of a rule verification request, and specifically comprises the following steps:
step 210, based on the check event, obtaining the rule routing agent instance cluster information from the service registration center.
Specifically, when rule verification is required, the embodiment of the present invention may obtain service identification information of a service corresponding to a verification event based on the verification event, to discover a rule routing agent instance through a service registration center according to the service identification information, and may extract address information of the discovered rule routing agent instance to serve as rule routing agent instance cluster information. The rule routing agent instance cluster information may be used to represent a rule routing agent instance cluster, and may specifically include address information of one or more rule routing instances, for example, network protocol address information of each rule routing agent instance, and the like, which is not limited in this embodiment.
The check event may refer to an event that needs to be checked, and may specifically include various business events that need to be checked. For example, in an e-market scene, a user orders through an Application program (App), and needs to perform respective rule check in systems such as a wind control system, a network security system, an order form system, a coupon system, and the like, the App as an external request initiator client may send a user ordering request to an API gateway, so that the API gateway performs operations such as authentication, routing, rule check, and the like on the user ordering request after receiving the user ordering request, and generates a corresponding check event.
Of course, the check event in the embodiment of the present invention may be, in addition to the check event generated by the API gateway based on the external request initiated by the external requester, a check event initiated by other system devices, such as a check event actively initiated by the internal system to the service, and the like, which is not limited in this embodiment.
It should be noted that the API gateway in the embodiment of the present invention may serve as an intermediate layer, receive an external request from a client, and perform operations such as authentication, routing, and rule checking on the external request. The client as an external request initiator may only interact with the API gateway layer, such as App, applet, and the like. The service registry is also called a rule registry and can be used for registering rule service instances and binding the relationship between the rule unique identifier and the rule service instance. The rule service instance may be registered with the service registry and may bind the service identification information to indicate a service provision rule check for the bound service identification information, e.g., after the rule service instance is registered with the rule service registry, may bind the service unique identifier as the service identification information to indicate a service provision rule check for the bound service unique identifier.
Step 220, routing selection is performed according to the rule routing agent instance cluster information to obtain routing agent instance information.
Specifically, after the rule routing agent instance cluster information is acquired, the embodiment of the present invention may perform routing selection according to the rule routing agent instance cluster information, so as to select information of one rule routing agent instance in the rule routing agent instance cluster as routing agent instance information.
Step 230, generating a rule checking request according to the routing agent instance information and the service identification information corresponding to the checking event, and sending the rule checking request.
After the embodiment of the invention obtains the routing agent instance information, the business identification information can be spliced with the routing agent instance information to construct the rule verification request, the key information of the verification event can be carried in the constructed rule verification request, and then the rule verification request can be sent, so that the rule engine access layer can receive the rule verification request, further the rule verification engine can find and request the rule service instance needing to be verified according to the business identification information carried by the rule verification request to verify, the unified scheduling of the rule engine is realized, and each cooperative system can check various rules of the same event in a service providing mode, so that the system only needs to gray/upgrade the service which is responsible for the system when the rule is changed, and the problems that the dynamic verification rule is difficult to increase and decrease due to the fact that the rule is changed by the rule engine in the prior art are solved, And the rule set is difficult to maintain, dynamic capacity expansion is convenient to realize, and higher request amount is supported.
As an example of the present invention, in case that a user places an order through a client such as App, H5, applet, etc. in a shopping mall scene, after the client such as App, H5, applet, etc. initiates a request, as shown in fig. 3, after the client initiates an external request "/e-commerce/addroder", the API gateway may receive the external request "/e-commerce/addroder", and may determine a check event that requires a rule check on the service "addroder" based on the external request "/e-commerce/addroder", and may then discover a rule routing agent cluster through a service registration center based on the check event, i.e., extract rule routing agent instance cluster information from the service registration center, implement rule routing agent instance discovery, such as extracting address information of each rule routing agent instance in the rule routing agent cluster [172.19.87.101:10088,172.19.88.102:10088,172.19.89.103:10088], etc., so that the routing can be performed according to the extracted rule routing agent instance cluster information.
Specifically, after acquiring the cluster information of the rule routing agent instance, the API gateway may perform routing selection according to the cluster information of the rule routing agent instance, for example, select address information "172.19.87.101: 10088" of a rule routing agent instance, so as to construct a rule checking request through the rule routing agent instance corresponding to the selected address information, for example, construct a rule checking request by using a URL of a service instance spliced by a service unique identifier, and may carry key information of a checking event in a load (Playload) of the rule checking request to indicate that rule checking needs to be performed on a service corresponding to the service unique identifier, and then may send the constructed rule checking request to the rule engine access layer, so that the rule engine access layer finds and requests the service instance to be checked to perform rule checking according to the service unique identifier carried by the rule checking request, and realizing the uniform scheduling of the rule engine.
It can be seen that, in the present example, by introducing the rule engine access layer, the unified scheduling of the rule engine is implemented, so that each collaboration department can perform various rule checks on the same event by way of providing services, and can be uniformly scheduled by the rule scheduling center, so that each department can process the event according to the familiar technical system in the team by registering its own rule service in the rule registration center, without changing the verification rules by operations such as modifying scripts by the rule engine, and maintaining various interfaces by each system, the change of the verification rules can be implemented by graying/upgrading the services in charge of itself, without learning how to edit the rule scripts, and the problems of difficulty in dynamically increasing or decreasing the verification rules and difficulty in maintaining the rule sets caused by modifying the verification rules by the rule engine in the prior art are solved, without simultaneously operating the rules in the same rule engine, the specific system modification rule can realize faster iteration through an upgrade interface, thereby facilitating the realization of dynamic capacity expansion and supporting higher request quantity. Furthermore, when the service of the system is upgraded, the rollback is easier, the problem point can be quickly found out by ensuring the normal operation of the rule checking service which is respectively responsible for the system, so that the cross-department cooperation is more convenient, the responsibility is clear, the gray level is upgraded only by being responsible for the system in the department, and the rule gray level is more convenient to upgrade; and fine-grained rule control can be performed through service management modes such as degradation and fusing, and the method is favorable for mastering the execution condition of the global rule engine.
In actual processing, rules belong to logics of different systems, are usually maintained by the different systems, and the used development languages are different; the rule check of each system is called, and a rule check interface can be called for a plurality of systems in an intermediate layer or a specific service system one by one, or a centralized rule engine is used for writing scripts in the rule engine by using the same language of each service system.
In a specific implementation, the rule engine access layer in the embodiment of the present invention may include one or more rule routing agent instances, as shown in fig. 3, the rule engine access layer may include rule routing agent instance 1, rule routing agent instance … … rule routing agent instance N, where N is an integer greater than 0. The rule routing agent instance can be used as a service instance of the rule engine access layer and can be registered in a service registration center, so that the purpose of registering the rule routing agent instance is achieved. Further, on the basis of the first embodiment, the data processing method based on the rule engine provided by the embodiment of the present invention may further include: sending a rule routing agent instance registration request after the rule routing agent instance is started, wherein the rule routing agent instance registration request is used for registering the rule routing agent instance to a service registration center.
EXAMPLE III
Referring to fig. 4, a schematic flowchart illustrating steps of another rule engine-based data processing method according to an embodiment of the present invention is shown. As shown in fig. 4, the data processing method based on the rule engine provided in the embodiment of the present invention may be applied to a rule engine access layer, and specifically may include the following steps:
step 410, after the rule routing agent instance is started, a rule routing agent instance registration request is sent.
Wherein the rule routing agent instance registration request is for registering the rule routing agent instance with a service registry. Specifically, when a rule engine access layer adds a new rule routing agent instance, the new rule routing agent instance may be registered to a service registration component in a service registry, for example, to a service registration discovery component such as Eureka and Cousul, so as to implement registration of the rule routing agent instance. Of course, the data storage of the service registry may include any other technical components available for storage, such as various NoSQL, besides the exemplary listed DB, Zookeeper, Consul, Dns, and the like, and the embodiment of the present invention is not limited in this respect.
In addition, when the rule service instance is registered, the newly registered rule service instance can bind the association relationship between the rule service cluster and the service identification information according to the request parameter by calling the registration request of the rule routing management platform, for example, bind the service unique identification and the URL for providing the rule check by the rule service instance according to the request parameter of the registration request, thereby binding the association relationship between the rule service cluster and the service unique identification, so that the rule service cluster can provide the API of the URL as a rule check provider of the rule check request carrying the service unique identification. The rule routing management platform may manage a relationship between the unique service identifier and the rule service instance, and may provide services such as monitoring a report, for example, accessing report data to a query system, a report system, a data analysis system, and the like for data analysis, which is not limited in this embodiment.
At step 420, a rule check request is received.
Step 430, extracting the service identification information carried by the rule checking request.
Step 440, determining the rule service cluster information associated with the service identification information as target rule service cluster information.
And step 450, searching target rule service instance information through a service registration center according to the target rule service cluster information.
Further, the embodiment of the present invention searches for the target rule service instance information through the service registry according to the target rule service cluster information, and specifically may include: discovering the rule service instance information of each cluster through a service registration center based on the target rule service cluster information; and determining the rule service instance information of each cluster as target rule service instance information.
For example, after receiving a rule check request sent by an API gateway, the rule engine access layer may determine, according to a unique service identifier carried by the rule check request, a rule service instance cluster identifier bound to the unique service identifier to serve as target rule service cluster information, as shown in fig. 3, may find, by using a rule routing management platform, all rule service instance clusters subscribed with a unique service identifier "addOrder", so as to find, by using the unique service identifier, rule service cluster information "[ {" order-rule ": rule/order/add" } ] associated therewith, and may determine, as the target rule service cluster information, the rule service instance cluster set subscribed with the unique service identifier to serve as the target rule service cluster, the purpose of rule service instance set discovery is achieved, then all rule service instances of each cluster can be discovered through the service registration center according to the target rule service cluster set information, and the rule service instance information of each cluster is determined as target rule service instance information, for example, the rule service instance information [ { "order-rule": 168.10.5.138:6888] } is determined as the target rule service instance information.
Of course, the rule engine access layer may receive a rule checking request sent by the API gateway according to the external request, and may also receive a rule checking request sent by the internal system, which is not specifically limited in this embodiment. It should be noted that the internal system may be in the same intranet as the rule routing agent instance, and may actively initiate a rule check on the service, as shown in fig. 3, discovery of the rule routing agent instance may be achieved through a service registration center, routing selection may be performed based on the discovered rule routing agent instance, and a rule check request carrying a unique service identifier may be actively initiated to the rule engine access layer, so that the rule engine access layer may request each rule service instance to perform the rule check according to the unique service identifier carried by the rule check request sent by the internal system.
Step 460, constructing a specified verification request according to the target rule service instance information.
Further, the constructing of the specified verification request according to the target rule service instance information in the embodiment of the present invention may specifically include: carrying out routing selection according to the target rule service instance information to obtain routing selection information; and constructing a specified checking request based on the routing information, wherein the specified checking request carries the request parameters of the rule checking request. Specifically, after the rule engine access layer in the embodiment of the present invention determines the target rule service instance information, as in the above example, based on the target rule instance information, the rule engine access layer may perform routing IP according to the rule service instances in each cluster, construct a request to perform a specific rule check, and achieve the purpose of requesting the rule service instances to perform the rule check. Wherein request parameters of the construction request may remain consistent with the upstream request; the request result may have a fixed format, and in a case that the checkResult indicates the rule checking result, if the value of the checkResult is 0, the rule checking may be passed, and if the value of the checkResult is-1, the rule checking is not passed, which is not specifically limited in this embodiment.
Step 470, invoking a rule engine to perform verification according to the specified verification request, and obtaining a rule verification result.
Further, the embodiment of the present invention calls a rule engine to perform verification according to the specified verification request, and obtains a rule verification result, which specifically includes: sending the specified verification request to a target rule service instance corresponding to routing information, wherein the specified verification request is used for requesting the target rule service instance to call a rule engine to perform specific verification; and generating a rule checking result based on the specific checking result fed back by the target rule service instance.
For example, after a request for requesting the wind control system to perform verification is constructed according to the target rule service instance information, the request can be used as a specified verification request of the wind control system and sent to the wind control system, so that the wind control rule service instance in the wind control system is requested to perform wind control rule verification according to request parameters carried in the specified verification request, for example, whether a user is a black product or not is detected, malicious behaviors exist or not is detected, and/or whether the user is a user who restricts a single behavior or not is detected, and therefore the wind control rule service instance calls a wind control rule engine to perform verification and feeds back a corresponding request result aiming at the request, that is, a specific verification result is fed back, and the rule engine access layer can determine whether a wind control risk exists or not according to the specific verification result fed back by the wind control service instance; similarly, after a request for requesting the network security system to perform verification is constructed according to the target rule service instance information, the request can be sent to the network security system as a specified verification request of the network security system, so that the network security rule service instance in the network security system is requested to perform network security rule verification according to request parameters carried in the specified verification request, for example, whether the user request is a normal user request or not, whether network attack hidden danger exists or not is detected, and thus the network security rule service instance calls a network security rule engine to perform verification and feeds back a corresponding request result according to the request, that is, a specific verification result is fed back, so that a rule engine access layer can determine whether a network security problem exists according to the specific verification result fed back by the network security service instance.
Of course, the rule engine access layer may construct a request for verifying the wind control system and the network security system, and may also construct a predetermined verification request for requesting other systems to perform rule verification, for example, a predetermined verification request for requesting the service system to perform verification may be constructed, which is not limited in this embodiment. The business system may include one or more business systems, such as a user system, an order system, and/or a coupon system, which is not limited in this embodiment.
It should be noted that, the user system may invoke the user rule engine to detect whether the user normally logs in, the available balance of the user account, and the like; the order system can call an engine to detect and check the order system rule so as to determine whether the repeated order placing limit is reached or not; the coupon system may invoke the rule engine to check the coupon system rule, so as to perform coupon validity judgment and/or determine whether the coupon is available, and the like, which is not limited in this example.
It can be seen that, after receiving the rule check request, the rule engine access layer in this example can perform respective rule check according to the unique service identifier request carried by the rule check request, such as the system of the wind control, the network security, the order, the user, the coupon, etc., that is, when receiving the request, the rule engine access layer can discover all the rule service instances subscribing the unique service identifier of the service to form a rule service instance set, and perform request check on the rule service instances one by one, so that each system only needs to register to the rule registration center, and the rule engine access layer can automatically discover, thereby achieving the purpose of dynamically discovering the rule set, and unifying the access layer, thereby uniformly reporting embedded points, performing data analysis, and facilitating to grasp the execution condition of the global rule engine.
Further, on the basis of the above embodiment, the data processing method based on the rule engine provided in the embodiment of the present invention may further include the following steps:
step 480, determining buried point data according to the service rule checking result;
and 490, analyzing according to the buried point data to obtain a service rule analysis result.
The data burying point can be used for representing the data burying point, and can be specifically used for reporting the data burying point to perform data analysis. Specifically, after the rule routing agent instance calls the rule engine for verification, the embodiment of the invention can determine the data of the buried point based on the service rule verification result, and report the data of the buried point to the message queue to realize data buried point reporting, so that data analysis can be carried out according to the reported data of the buried point in the following process to obtain the service rule analysis result.
As an optional example of the present invention, as shown in fig. 3, after the rule engine access layer performs the service rule check through the rule routing agent instance, the rule engine access layer may report the relevant information as the buried point data based on the service rule check result, that is, report the data buried point, and may generate a report using a big data tool after performing consumption/cleaning/storage through the message queue, so as to analyze the scenes such as the service rule hit rate, and provide a unified rule view, as shown in fig. 4, the rule engine access layer may perform big data analysis based on the buried point data after cleaning and storage and the report data accessed by the rule routing management platform, so as to obtain the rule view as the service rule analysis result, so as to analyze the service rule hit rate based on the rule view later, and implement unified data buried point reporting, the method is beneficial to grasping the execution condition of the global rule engine. The message queue may not be limited to the message queue components such as kafka/rabbitmq, but may also be any other message queue components, which is not specifically limited in this example; message queue consumption is not limited to the component Spark/Flink, but may be any other component for consuming a message queue, which is not specifically limited in this example; and, the data storage may not be limited to the storage component Hive, but may also be any other distributed storage component, which is also not specifically limited in this example.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention.
Example four
Referring to fig. 5, a schematic diagram of a structural block of a data processing apparatus based on a rule engine according to an embodiment of the present invention is shown, where the data processing apparatus based on a rule engine specifically includes the following modules:
a rule service cluster determining module 510, configured to determine target rule service cluster information according to the service identification information carried in the rule verification request;
a rule service instance determining module 520, configured to search, according to the target rule service cluster information, target rule service instance information through a service registry;
a rule checking request constructing module 530, configured to construct a rule checking request according to the target rule service instance information;
and the rule engine calling module 540 is configured to call a rule engine according to the specified verification request to perform verification, so as to obtain a rule verification result.
On the basis of the above embodiment, optionally, the rule service cluster determining module 510 may include the following sub-modules:
the rule checking request receiving submodule is used for receiving a rule checking request;
the service identification extraction submodule is used for extracting service identification information carried by the rule verification request;
and the rule service cluster determining submodule is used for determining the rule service cluster information associated with the service identification information as target rule service cluster information.
In an optional embodiment of the present invention, the rule service instance determining module 520 may include the following sub-modules:
the rule service instance discovery sub-module is used for discovering the rule service instance information of each cluster through the service registration center based on the target rule service cluster information;
and the target rule service instance determining submodule is used for determining the rule service instance information of each cluster as target rule service instance information.
In an optional embodiment of the present invention, the predetermined verification request constructing module 530 may include the following sub-modules:
the routing submodule is used for carrying out routing selection according to the target rule service instance information to obtain routing selection information;
and the request construction submodule is used for constructing a specified verification request based on the routing information, and the specified verification request carries the request parameters of the rule verification request.
In an optional embodiment of the present invention, the rule engine invoking module 540 may include the following sub-modules:
the sending submodule is used for sending the specified verification request to a target rule service instance corresponding to the routing information, and the specified verification request is used for requesting the target rule service instance to call a rule engine to perform specific verification;
and the result generation submodule is used for generating a rule verification result based on the specific verification result fed back by the target rule service instance.
Optionally, the data processing apparatus based on the rule engine further includes the following modules:
the buried point determining module is used for determining buried point data according to the service rule checking result;
and the data analysis module is used for analyzing according to the buried point data to obtain a service rule analysis result.
Optionally, the data processing apparatus based on the rule engine further includes: an instance registration module. The example registration module is used for sending a rule routing agent example registration request after the rule routing agent example is started. The rule routing agent instance registration request is for registering the rule routing agent instance with a service registry.
It should be noted that the data processing apparatus based on the rule engine provided above can execute the data processing method based on the rule engine provided in any one of the first embodiment and/or the third embodiment of the present invention, and has the corresponding functions and advantages of the execution method.
EXAMPLE five
Referring to fig. 6, a schematic diagram of a structural block of another data processing apparatus based on a rule engine according to an embodiment of the present invention is shown, where the data processing apparatus based on a rule engine specifically includes the following modules:
a routing agent instance cluster information obtaining module 610, configured to obtain rule routing agent instance cluster information from the service registration center based on the check event;
a routing agent instance information selecting module 620, configured to perform routing selection according to the rule routing agent instance cluster information to obtain routing agent instance information;
and a rule checking request generating and sending module 630, configured to generate and send a rule checking request according to the routing agent instance information and the service identifier information corresponding to the checking event.
In a specific implementation, the data processing apparatus based on a rule engine provided in the embodiment of the present invention may be applied to a scenario of generating a rule verification request, and may specifically be applied to an internal system and/or an API gateway, which is not limited in this embodiment.
It should be noted that the data processing apparatus based on the rule engine provided in the embodiment of the present invention can execute the data processing method based on the rule engine provided in any embodiment of the present invention, and has the corresponding functions and advantages of the execution method.
EXAMPLE six
In a specific implementation, the rule engine based data processing apparatus may be integrated in a rule engine based data processing device. The data processing device based on the rule engine may be configured by two or more physical entities, or may be configured by one physical entity, for example, the electronic device may be a Personal Computer (PC), a Computer, a server, a game console, and the like, which is not limited in this embodiment of the present invention.
Further, an embodiment of the present invention further provides a data processing device based on a rule engine, including: a processor and a memory. At least one instruction is stored in the memory and executed by the processor to cause the rules engine based data processing apparatus to perform the rules engine based data processing method as described in any of the above method embodiments. For example, the instructions, when executed by the processor, cause the rules engine based data processing apparatus to perform a rules engine based data processing method as described in method embodiment one; or, the rule engine based data processing apparatus is caused to perform the rule engine based data processing method as described in method embodiment two, and so on.
EXAMPLE seven
Further, an embodiment of the present invention also provides a computer-readable storage medium, where instructions of the computer-readable storage medium, when executed by a processor of a computer device, enable the computer device to perform the method for data processing based on a rule engine according to any one of the above method embodiments. For example, the instructions in the computer-readable storage medium, when executed by a processor of a computer device, enable the computer device to perform a rules engine-based data processing method as described in method embodiment one; alternatively, the computer device is enabled to perform a rules engine based data processing method as described in method embodiment two.
It should be noted that, as for the embodiments of the apparatus, the device, and the storage medium, since they are basically similar to the embodiments of the method, the description is relatively simple, and in relevant places, reference may be made to the partial description of the embodiments of the method.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or the like) to execute the data processing method based on the rule engine according to any embodiment of the present invention.
It should be noted that, in the data processing apparatus based on the rule engine, the units and modules included in the apparatus are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention. It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by suitable instruction execution devices.
The foregoing is considered as illustrative of the preferred embodiments of the invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in more detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the claims.

Claims (12)

1. A data processing method based on a rule engine is characterized by comprising the following steps:
determining target rule service cluster information according to the service identification information carried by the rule checking request;
searching target rule service instance information through a service registration center according to the target rule service cluster information;
constructing a specified verification request according to the target rule service instance information;
and calling a rule engine to check according to the specified check request to obtain a rule check result.
2. The data processing method based on the rule engine as claimed in claim 1, wherein the determining the target rule service cluster information according to the service identification information carried by the rule checking request comprises:
receiving a rule checking request;
extracting service identification information carried by the rule checking request;
and determining the rule service cluster information associated with the service identification information as target rule service cluster information.
3. The data processing method based on the rule engine as claimed in claim 2, wherein the step of searching the target rule service instance information through the service registry according to the target rule service cluster information comprises:
discovering the rule service instance information of each cluster through a service registration center based on the target rule service cluster information;
and determining the rule service instance information of each cluster as target rule service instance information.
4. The rules engine based data processing method of claim 3, wherein the constructing a specification check request according to the target rule service instance information comprises:
carrying out routing selection according to the target rule service instance information to obtain routing selection information;
and constructing a specified checking request based on the routing information, wherein the specified checking request carries the request parameters of the rule checking request.
5. The data processing method based on the rule engine as claimed in claim 4, wherein the invoking the rule engine to check according to the specified check request to obtain a rule check result comprises:
sending the specified verification request to a target rule service instance corresponding to routing information, wherein the specified verification request is used for requesting the target rule service instance to call a rule engine to perform specific verification;
and generating a rule checking result based on the specific checking result fed back by the target rule service instance.
6. The rules engine based data processing method of claim 5, further comprising:
determining buried point data according to the service rule checking result;
and analyzing according to the buried point data to obtain a service rule analysis result.
7. The rules engine based data processing method of claim 5, further comprising:
sending a rule routing agent instance registration request after the rule routing agent instance is started, wherein the rule routing agent instance registration request is used for registering the rule routing agent instance to a service registration center.
8. A data processing method based on a rule engine is characterized by comprising the following steps:
based on the check event, acquiring rule routing agent instance cluster information from a service registration center;
carrying out routing selection according to the regular routing agent instance cluster information to obtain routing agent instance information;
and generating a rule checking request according to the routing agent instance information and the service identification information corresponding to the checking event, and sending the rule checking request.
9. A rules engine based data processing apparatus, comprising:
the rule service cluster determining module is used for determining target rule service cluster information according to the service identification information carried by the rule verification request;
the rule service instance determining module is used for searching target rule service instance information through a service registration center according to the target rule service cluster information;
the specified checking request constructing module is used for constructing a specified checking request according to the target rule service instance information;
and the rule engine calling module is used for calling a rule engine to check according to the specified check request to obtain a rule check result.
10. A rules engine based data processing apparatus, comprising:
the routing agent instance cluster information acquisition module is used for acquiring regular routing agent instance cluster information from the service registration center based on the check event;
the routing agent instance information selection module is used for carrying out routing selection according to the rule routing agent instance cluster information to obtain routing agent instance information;
and the rule checking request generating and sending module is used for generating and sending a rule checking request according to the routing agent instance information and the service identification information corresponding to the checking event.
11. A rules engine based data processing apparatus comprising: a processor and a memory; the memory has stored therein at least one instruction that, when executed by the processor, causes the processing device to perform the rules engine based data processing method of any of claims 1 to 8.
12. A computer-readable storage medium, wherein instructions in the readable storage medium, when executed by a processor of a computer device, enable the computer device to perform the rules engine-based data processing method of any of claims 1 to 8.
CN202110145301.3A 2021-02-02 2021-02-02 Data processing method, device, equipment and medium based on rule engine Pending CN112860398A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110145301.3A CN112860398A (en) 2021-02-02 2021-02-02 Data processing method, device, equipment and medium based on rule engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110145301.3A CN112860398A (en) 2021-02-02 2021-02-02 Data processing method, device, equipment and medium based on rule engine

Publications (1)

Publication Number Publication Date
CN112860398A true CN112860398A (en) 2021-05-28

Family

ID=75986281

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110145301.3A Pending CN112860398A (en) 2021-02-02 2021-02-02 Data processing method, device, equipment and medium based on rule engine

Country Status (1)

Country Link
CN (1) CN112860398A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722357A (en) * 2021-06-03 2021-11-30 泰康保险集团股份有限公司 Data file checking method and device, electronic equipment and storage medium
CN113779144A (en) * 2021-08-26 2021-12-10 深圳市惟客数据科技有限公司 Big data integration processing method, system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070094199A1 (en) * 2005-08-30 2007-04-26 International Business Machines Corporation System and method for automatically processing dynamic business rules in a content management system
CN102299909A (en) * 2009-09-24 2011-12-28 费希尔-罗斯蒙特系统公司 Integrated unified threat management for a process control system
CN106101090A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 Operational approach and rule engine system for regulation engine
CN107943878A (en) * 2017-11-14 2018-04-20 北京思特奇信息技术股份有限公司 A kind of Business Rule Engine method and system
CN110298601A (en) * 2019-07-05 2019-10-01 上海观安信息技术股份有限公司 A kind of real time business air control system of rule-based engine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070094199A1 (en) * 2005-08-30 2007-04-26 International Business Machines Corporation System and method for automatically processing dynamic business rules in a content management system
CN102299909A (en) * 2009-09-24 2011-12-28 费希尔-罗斯蒙特系统公司 Integrated unified threat management for a process control system
CN106101090A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 Operational approach and rule engine system for regulation engine
CN107943878A (en) * 2017-11-14 2018-04-20 北京思特奇信息技术股份有限公司 A kind of Business Rule Engine method and system
CN110298601A (en) * 2019-07-05 2019-10-01 上海观安信息技术股份有限公司 A kind of real time business air control system of rule-based engine

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722357A (en) * 2021-06-03 2021-11-30 泰康保险集团股份有限公司 Data file checking method and device, electronic equipment and storage medium
CN113722357B (en) * 2021-06-03 2024-04-09 泰康保险集团股份有限公司 Data file verification method and device, electronic equipment and storage medium
CN113779144A (en) * 2021-08-26 2021-12-10 深圳市惟客数据科技有限公司 Big data integration processing method, system and storage medium

Similar Documents

Publication Publication Date Title
CN107431651B (en) Life cycle management method and equipment for network service
CN109618176B (en) Processing method, equipment and storage medium for live broadcast service
CN110781083B (en) H5 client code setting multi-environment testing method and system
CN111858083B (en) Remote service calling method and device, electronic equipment and storage medium
CN110795174B (en) Application program interface calling method, device, equipment and readable storage medium
US7818752B2 (en) Interface for application components
CN112104715A (en) Link tracking method and system based on microservice log
CN110750780A (en) User role permission fusion method, device and equipment based on multi-service system
CN112860398A (en) Data processing method, device, equipment and medium based on rule engine
CN112256351B (en) Method for realizing Feign component, method and device for calling micro-service
CN108345508B (en) Interface call testing method and device
CN109992298B (en) Examination and approval platform expansion method and device, examination and approval platform and readable storage medium
CN106936643B (en) Equipment linkage method and terminal equipment
CN115733666A (en) Password management method and device, electronic equipment and readable storage medium
CN111245634A (en) Virtualization management method and device
CN115495065A (en) Page component arrangement and combination method and device based on business flow control
CN112417402B (en) Authority control method, authority control device, authority control equipment and storage medium
CN114528074A (en) Dynamic baffle implementation method, system and equipment based on micro-service architecture
CN112000313A (en) Request response method, device, equipment and storage medium
CN113868116A (en) Test dependent data generation method and device, server and storage medium
CN111708646A (en) Method, device and system for realizing front-end service platform and storage medium
CN112433821B (en) Method and device for building business model, electronic equipment and medium
CN111078571A (en) Test method for simulation response, terminal device and computer readable storage medium
CN110287265B (en) Login request processing method and device, server and readable storage medium
CN114615176B (en) Message testing method and device and electronic equipment

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