CN109241158B - Data source definition method and device for rule management - Google Patents

Data source definition method and device for rule management Download PDF

Info

Publication number
CN109241158B
CN109241158B CN201810878044.2A CN201810878044A CN109241158B CN 109241158 B CN109241158 B CN 109241158B CN 201810878044 A CN201810878044 A CN 201810878044A CN 109241158 B CN109241158 B CN 109241158B
Authority
CN
China
Prior art keywords
data
rule
data access
information
basic information
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
CN201810878044.2A
Other languages
Chinese (zh)
Other versions
CN109241158A (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.)
Shanghai Chuang Frame Software Co ltd
Original Assignee
Shanghai Jiayin Fin Tech 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 Shanghai Jiayin Fin Tech Co ltd filed Critical Shanghai Jiayin Fin Tech Co ltd
Priority to CN201810878044.2A priority Critical patent/CN109241158B/en
Publication of CN109241158A publication Critical patent/CN109241158A/en
Application granted granted Critical
Publication of CN109241158B publication Critical patent/CN109241158B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a data source definition method and a device for rule management, wherein the data source definition method comprises the following steps: customizing parameter information accessed by a data source in a visual interface; and generating a return value for the configuration rule according to the parameter information. Through the technical scheme, a user can customize a data source, obtain a return value of a data field and apply the return value to a rule; by using a whole-process visual interface, rule managers can quickly customize rules, code development is avoided in the middle, and the safety of the rules is enhanced.

Description

Data self-definition method and device for rule management
Technical Field
The invention relates to the technical field of computers, in particular to a data source definition method and device for rule management.
Background
In a rule management system, the system may define operation rules, use system-defined fields, or user-defined fields whose values are passed to the rules engine for operation with the rules at the time of rule execution. The field values come from two sources, one is that the API caller passes in through API parameters, and the other is that the API caller is hard coded in the code and is obtained from the outside at runtime. The rule management system provides custom rules, but the fields required by the custom rules are also limited to these two acquisition modes. In the mode that the caller passes in through the parameter, the field used by the rule is exposed to the outside, which is not beneficial to the security of the rule. In a hard coding mode, fields used by the rules are associated with code development deployment, so that the development period of the rules is long, and the rules are not beneficial to adjustment and rapid development.
In view of the above problems in the related art, no effective solution has been proposed at present.
Disclosure of Invention
In order to solve the problems in the related art, the invention provides a data source definition method and device for rule management.
The technical scheme of the invention is realized as follows:
according to one aspect of the present invention, there is provided a data origin definition method for rule management, comprising:
customizing parameter information accessed by a data source in a visual interface;
and generating a return value for the configuration rule according to the parameter information.
According to the embodiment of the invention, the parameter information of data source access comprises: basic information of data access, input information of data access and metadata of data access output; wherein the basic information includes: a data access type and parameters required for the type.
According to the embodiment of the invention, the parameter information for customizing data source access in the visual interface comprises the following steps: inputting basic information in a visual interface, and using a template when inputting the basic information; and querying according to the basic information to obtain a return value.
According to an embodiment of the present invention, querying for a return value based on the base information comprises: the template in the basic information is replaced with the input information.
According to an embodiment of the invention, the metadata of the data access output comprises: a field, a resolution of the field, and a field type.
According to an embodiment of the present invention, generating a return value for the configuration rule according to the parameter information includes: generating a key-value pair from the metadata description and returning the key-value pair to the caller.
According to an embodiment of the invention, the data source definition method further comprises: the parameter fields of the rule are checked before the rule is executed and a call for data access is initiated when the parameter fields are not present in the namespace of the context.
According to an embodiment of the invention, wherein the data is collected from the context according to basic information of data access in the parameter information; initiating the call of data access by using the collected data; the returned values in the form of key-value pairs are populated into the namespace of the context.
According to another aspect of the present invention, there is provided a data origin defining apparatus for rule management, comprising:
the visual interface module is used for customizing parameter information accessed by a data source;
and the output module is connected with the rule execution device and used for generating a return value for configuring the rule according to the parameter information.
Through the technical scheme, a user can customize a data source, obtain the return value of a data field and apply the return value to a rule; by using a whole-process visual interface, rule managers can quickly customize rules, code development is avoided in the middle, and the safety of the rules is enhanced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a flow diagram of a data derivation definition method for rule management, according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a visualization interface according to an embodiment of the invention;
fig. 3 is a schematic diagram of a data source definition apparatus for rule management according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
As shown in fig. 1, according to an embodiment of the present invention, a data-derived definition method for rule management is provided, which is applicable to a rule management system or other systems related to rule management. The data source definition method for rule management of the invention comprises the following steps:
s10, customizing parameter information accessed by the data source in a visual interface; and
s20, generating a return value for the configuration rule according to the parameter information.
Through the technical scheme, a user can customize a data source, obtain the return value of a data field and apply the return value to a rule; by using a whole-process visual interface, rule managers can quickly customize rules, code development is avoided in the middle, and the safety of the rules is enhanced.
In one embodiment, the parameter information for data source access includes: basic information of data access, input information of data access and metadata of data access output. Wherein the basic information includes: a data access type and parameters required for the type. Wherein, the metadata of the data access output comprises: a field, a resolution of the field, and a field type.
To support custom data source access, a variety of commonly used data access types may be provided, such as access MYSQL database, ORACLE database, restul API methods, and the like.
As shown in fig. 2, after the user selects the type of data access provided by the system, the necessary parameter information for selecting the mode is input on the visualized page. For example, in the RESTFUL API access type, a user needs to set a URI (Uniform Resource Identifier) of the access and select a format of the returned data. In the MYSQL access type, the user needs to input an SQL statement for query in addition to the SQL URI. Template parameters may be supported in the user's input, and these template parameters may be replaced at run-time by values of the context. When configuring data access, a user needs to define input and output, and the input and output are used as self-description data of the data access and are exposed to a system. The output field of the data access can become a self-defined field which can be selected by the rule, and the user directly selects the field when configuring the rule without paying attention to the data access of the generated field.
In one embodiment, step S10 includes: inputting basic information in a visual interface, and using a template when inputting the basic information; and querying according to the basic information to obtain a return value.
Wherein querying according to the base information to obtain the return value comprises: the template in the basic information is replaced with the input information.
In one embodiment, step S20 includes: generating a key-value pair from the metadata description and returning the key-value pair to the caller.
In one embodiment, the data derivation definition method of the present invention further comprises the steps of: s30, checking the parameter field of the rule before executing the rule, and initiating a call for data access when the parameter field is not present in the namespace of the context. Wherein, data is collected from the context according to the basic information of data access in the parameter information; initiating the call of data access by using the collected data; the returned values in the form of key-value pairs are populated into the namespace of the context.
For a better understanding of the present invention, the data derivation definition method of the present invention is described in detail below with reference to fig. 2. As shown in fig. 2, the data derivation definition method of the present invention includes the following steps in a specific implementation:
s201, the basic information of data access includes a data access type and parameters required by the data access type. The part of information is input by the user through the interactive mode of the interface. The template may be used by the user when entering the basic information. The code of data access will initiate external inquiry according to the part of information to obtain the calling return value.
And S202, inputting information of data access. This information is entered by the user on the interface, in the form of metadata, stored with the basic information of the data access, describing the conditions under which the data access is running. The data access code, when invoked, replaces the template in the basic information parameters with this portion of the input data.
S203, accessing the metadata of the output by the data, wherein the information is input by the user on the interface, and the metadata and the basic information of the data access are stored together to describe the output of the data access. The output definition contains the name of the field, the way the field is parsed from the data access outbound query result (JSONPATH, XMLPATH), and the field type. When saving the data access definition, the system generates custom fields from the output metadata, which are available to all rules. The data access call will generate a key-value pair according to the output description and return the key-value pair to the caller.
S204, the system executes the rule by using an open source DROOLS engine, checks parameter fields of the rule before executing, when the fields come from data access and the value of the fields does not exist in the context namespace, the system initiates the calling of the data access, firstly collects data from the execution context according to the data access input metadata, transmits the data to the data access code in the form of key-value pairs to initiate the calling of the data access, and then fills the key-value pairs of the data access back to the context namespace. The field-values in the namespace are then passed to the DROOLS engine along with the rules to execute the rules.
As shown in fig. 3, according to an embodiment of the present invention, there is also provided a data source definition apparatus for rule management, including:
the visual interface module 10 is used for customizing parameter information accessed by a data source;
and the output module 20 is connected to the rule executing device 30, and the output module 20 is used for generating a return value for configuring the rule according to the parameter information.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (7)

1. A data-derived definition method for rule management, comprising:
customizing parameter information accessed by a data source in a visual interface;
generating a return value for configuring a rule according to the parameter information,
wherein the parameter information of the data source access includes: basic information of data access, input information of data access, metadata of data access output,
inputting the basic information in the visual interface, inquiring according to the basic information to obtain a return value,
wherein, the output field of data access becomes the self-defined field with selectable rule, the output field is directly selected when the rule is configured,
checking parameter fields of the rule before executing the rule, initiating a call for data access when said parameter fields are not present in the namespace of the context, wherein,
data is collected from the context according to basic information of data access in the parameter information,
initiating invocation of data access using the collected data,
populating a namespace for the context with a return value in the form of a key-value pair.
2. The data derivation definition method for rule management according to claim 1, wherein the basic information comprises: a data access type and parameters required for said type.
3. The data derivation definition method for rule management according to claim 2, wherein the parameter information for customizing data source access in the visualization interface comprises:
a template is used when the basic information is input.
4. The data derivation definition method for rule management according to claim 3, wherein querying for a return value based on the base information comprises:
replacing the template in the basic information with the input information.
5. The data derivation definition method for rule management according to claim 2, wherein the metadata of the data access output comprises: a field, a resolution of the field, and a field type.
6. The data derivation definition method for rule management according to claim 5, wherein generating a return value for a configuration rule according to the parameter information comprises:
and generating a key-value pair according to the description of the metadata, and returning the key-value pair to the caller.
7. A data-sourcing definition device for rule management, the data-sourcing definition device comprising:
the visual interface module is used for customizing parameter information accessed by a data source;
an output module connected to the rule executing device for generating a return value for configuring the rule according to the parameter information,
wherein the parameter information of the data source access includes: basic information of data access, input information of data access, metadata of data access output,
inputting the basic information in the visual interface, inquiring according to the basic information to obtain a return value,
wherein, the output field of data access becomes the self-defined field with selectable rule, the output field is directly selected when the rule is configured,
checking parameter fields of the rule before executing the rule, initiating a call for data access when said parameter fields are not present in the namespace of the context, wherein,
data is collected from the context according to basic information of data access in the parameter information,
initiating invocation of data access using the collected data,
populating a namespace for the context with a return value in the form of a key-value pair.
CN201810878044.2A 2018-08-03 2018-08-03 Data source definition method and device for rule management Active CN109241158B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810878044.2A CN109241158B (en) 2018-08-03 2018-08-03 Data source definition method and device for rule management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810878044.2A CN109241158B (en) 2018-08-03 2018-08-03 Data source definition method and device for rule management

Publications (2)

Publication Number Publication Date
CN109241158A CN109241158A (en) 2019-01-18
CN109241158B true CN109241158B (en) 2022-09-16

Family

ID=65070208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810878044.2A Active CN109241158B (en) 2018-08-03 2018-08-03 Data source definition method and device for rule management

Country Status (1)

Country Link
CN (1) CN109241158B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104497A (en) * 2019-11-21 2020-05-05 北京明略软件系统有限公司 Rule matching method and device and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186579A (en) * 2011-12-29 2013-07-03 北京亿阳信通科技有限公司 Database function-based rule implementation and application method and device
CN103942228A (en) * 2013-01-23 2014-07-23 纽海信息技术(上海)有限公司 Rule engine, calculating method, service system and calling method
CN107632842A (en) * 2017-09-26 2018-01-26 携程旅游信息技术(上海)有限公司 Rule configuration and dissemination method, system, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186579A (en) * 2011-12-29 2013-07-03 北京亿阳信通科技有限公司 Database function-based rule implementation and application method and device
CN103942228A (en) * 2013-01-23 2014-07-23 纽海信息技术(上海)有限公司 Rule engine, calculating method, service system and calling method
CN107632842A (en) * 2017-09-26 2018-01-26 携程旅游信息技术(上海)有限公司 Rule configuration and dissemination method, system, equipment and storage medium

Also Published As

Publication number Publication date
CN109241158A (en) 2019-01-18

Similar Documents

Publication Publication Date Title
CN109002362B (en) Service method, device and system and electronic equipment
WO2016123920A1 (en) Method and system for achieving integration interface supporting operations of multiple types of databases
CN108874924B (en) Method and device for creating search service and computer-readable storage medium
US8656056B2 (en) Web-enabled mainframe
CN106951231B (en) Computer software development method and device
CN110489310B (en) Method and device for recording user operation, storage medium and computer equipment
CN111506579B (en) Method, program and equipment for generating intelligent contract code
CN111443901B (en) Java reflection-based service expansion method and device
US11847509B2 (en) Infrastructure base model API
CN104461531A (en) Implementing method for self-defined functions of reporting system
CN102426612A (en) Condition object query method and system
CN112861501A (en) Report generation method and device, electronic equipment and computer readable storage medium
US11366704B2 (en) Configurable analytics for microservices performance analysis
CN109241158B (en) Data source definition method and device for rule management
CN101876969A (en) Report form developing method and device
CN112434037A (en) Data processing method, processing device, data processing apparatus, and storage medium
CN106330519B (en) Method and system for communication of messages between network management systems
CN113342399A (en) Application structure configuration method and device and readable storage medium
CN110990000B (en) Data request processing method, device and equipment of MVC pattern design model layer
CN111966709A (en) Data query method and device and electronic equipment
CN112685435A (en) Table query method and system based on Vue and Mybatis
CN110633459B (en) Automatic generation method and system of data report forms and computer readable storage medium
CN111400396A (en) Method and device for generating data synchronization script and computer readable storage medium
TWI620134B (en) Integration device and integration method thereof
CN116521686B (en) Dynamic data table processing method, device, computer equipment and storage medium

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230406

Address after: Room 314, Zone B, 3rd Floor, No. 452 Daduhe Road, Putuo District, Shanghai, 200000

Patentee after: Shanghai Chuang frame Software Co.,Ltd.

Address before: Room 2257, Building 5, No. 1630, Yecheng Road, Jiading Industrial Zone, Jiading District, Shanghai, 201800

Patentee before: SHANGHAI JIAYIN FIN-TECH Co.,Ltd.