[go: up one dir, main page]

CN110888672B - Method and system for implementing expression engine based on metadata architecture - Google Patents

Method and system for implementing expression engine based on metadata architecture Download PDF

Info

Publication number
CN110888672B
CN110888672B CN201911177004.6A CN201911177004A CN110888672B CN 110888672 B CN110888672 B CN 110888672B CN 201911177004 A CN201911177004 A CN 201911177004A CN 110888672 B CN110888672 B CN 110888672B
Authority
CN
China
Prior art keywords
expression engine
expression
data
configuration information
metadata
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
CN201911177004.6A
Other languages
Chinese (zh)
Other versions
CN110888672A (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.)
Beijing Renke Interactive Network Technology Co Ltd
Original Assignee
Beijing Renke Interactive Network 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 Beijing Renke Interactive Network Technology Co Ltd filed Critical Beijing Renke Interactive Network Technology Co Ltd
Priority to CN201911177004.6A priority Critical patent/CN110888672B/en
Publication of CN110888672A publication Critical patent/CN110888672A/en
Application granted granted Critical
Publication of CN110888672B publication Critical patent/CN110888672B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明实施例提供一种基于元数据架构的表达式引擎实现方法及系统。该方法包括:获取用户的配置信息;表达式引擎根据所述配置信息生成对应的规则数据;所述用户对实体的业务数据进行操作时,通过所述表达式引擎获取所述对应的数据。本发明实施例通过采用基于元数据架构的表达式引擎,相比传统引擎系统,具有配置更灵活、扩展性强、结构清晰、功能完善以及优化更方便的特点。

Figure 201911177004

Embodiments of the present invention provide a method and system for implementing an expression engine based on a metadata framework. The method includes: obtaining user configuration information; an expression engine generating corresponding rule data according to the configuration information; when the user operates on entity business data, obtaining the corresponding data through the expression engine. The embodiment of the present invention adopts the expression engine based on the metadata architecture, which has the characteristics of more flexible configuration, strong expansibility, clear structure, perfect function and more convenient optimization compared with the traditional engine system.

Figure 201911177004

Description

一种基于元数据架构的表达式引擎实现方法及系统Method and system for implementing expression engine based on metadata architecture

技术领域technical field

本发明涉及对象开发技术领域,尤其涉及一种基于元数据架构的表达式引擎实现方法及系统。The invention relates to the technical field of object development, in particular to a method and system for realizing an expression engine based on a metadata framework.

背景技术Background technique

在基于表达式引擎开发中,由于引入表达式引擎的引入,实现了规则化的表达式与对象的互相转化。In the development based on the expression engine, due to the introduction of the expression engine, the mutual transformation between the regularized expression and the object is realized.

由于表达式引擎能处理表达式与对象之间的映射关系,这种映射关系是双向的;表达式引擎也能支持丰富多样的表达式语法计算;表达式引擎还能支持必要的数据类型转换。而在应用传统架构的表达式引擎时,由于用户提供的业务场景和业务规则众多,对应的引擎架构就比较复杂,同时还需要对每种业务提供单独的接口,从而形成内部复杂的接口管理模式,正是由于架构的复杂,在后续扩展业务时,需要耗费大量的开发时间和适配工作量,扩展的能力也非常有限。整体来说,传统架构的表达式引擎业务适配能力比较弱,扩展性能差。Since the expression engine can handle the mapping relationship between expressions and objects, this mapping relationship is bidirectional; the expression engine can also support rich and diverse expression syntax calculations; the expression engine can also support necessary data type conversion. When applying the expression engine of the traditional architecture, due to the many business scenarios and business rules provided by the user, the corresponding engine architecture is more complicated, and at the same time, it is necessary to provide a separate interface for each business, thus forming an internal complex interface management mode , precisely because of the complexity of the architecture, it takes a lot of development time and adaptation workload to expand the business in the future, and the ability to expand is also very limited. Generally speaking, the expression engine of the traditional architecture has relatively weak business adaptability and poor scalability.

因此,需要提出新的表达式引擎实现方法,能克服上述缺陷。Therefore, it is necessary to propose a new expression engine implementation method that can overcome the above-mentioned defects.

发明内容Contents of the invention

本发明实施例提供一种基于元数据架构的表达式引擎实现方法及系统,用以解决现有技术中传统架构的表达式引擎具有复杂的结构,不易扩展且优化不方便的缺陷。Embodiments of the present invention provide a method and system for implementing an expression engine based on a metadata architecture to solve the defects in the prior art that the expression engine with a traditional architecture has a complex structure, is not easy to expand, and is inconvenient to optimize.

第一方面,本发明实施例提供一种基于元数据架构的表达式引擎实现方法,包括:In the first aspect, an embodiment of the present invention provides a method for implementing an expression engine based on a metadata architecture, including:

获取用户的配置信息;Obtain user configuration information;

表达式引擎根据所述配置信息生成对应的规则数据;The expression engine generates corresponding rule data according to the configuration information;

所述用户对实体的业务数据进行操作时,通过所述表达式引擎获取对应的数据。When the user operates on the business data of the entity, the corresponding data is acquired through the expression engine.

其中,所述用户对实体的业务数据进行操作时,通过所述表达式引擎获取对应的数据,之前还包括:Wherein, when the user operates the business data of the entity, the corresponding data is obtained through the expression engine, which also includes:

所述用户在预设字段设置默认值,通过调用所述表达式引擎获取所述默认值,并基于所述默认值对所述业务数据进行预设操作。The user sets a default value in the preset field, obtains the default value by calling the expression engine, and performs preset operations on the business data based on the default value.

其中,所述表达式引擎根据所述配置信息生成对应的规则数据,具体包括:Wherein, the expression engine generates corresponding rule data according to the configuration information, specifically including:

所述表达式引擎的下端路由层进行数据的查询;The lower-end routing layer of the expression engine performs data query;

所述表达式引擎的上端分析层使用基于元数据描述的表达式,输出所述对应的规则数据。The upper-end analysis layer of the expression engine uses expressions described by metadata to output the corresponding rule data.

其中,所述表达式引擎的下端路由层进行数据的查询,具体包括:Wherein, the lower-end routing layer of the expression engine performs data query, specifically including:

所述下端路由层中,由若干数据库组合构成数据库组;In the lower routing layer, a database group is composed of several databases;

所述数据库组基于元数据架构进行数据之间的路由与合并。The database group performs routing and merging between data based on the metadata framework.

其中,所述表达式引擎的上端分析层使用基于元数据描述的表达式,输出所述对应的规则数据,具体包括:Wherein, the upper-end analysis layer of the expression engine uses an expression based on metadata description to output the corresponding rule data, specifically including:

所述上端分析层获取所述配置信息,基于元数据架构对所述配置信息进行词法分析和语法分析,并返回优化结果,向所述路由层输出所述对应的规则数据。The upper-end analysis layer obtains the configuration information, performs lexical analysis and syntax analysis on the configuration information based on the metadata framework, returns an optimization result, and outputs the corresponding rule data to the routing layer.

其中,所述获取用户的配置信息,具体包括:Wherein, the acquisition of user configuration information specifically includes:

所述用户根据预设业务规则,提供预设的表达规则,形成所述配置信息。The user provides preset expression rules according to preset business rules to form the configuration information.

其中,所述表达式引擎对外提供统一接口,所述统一接口用于获取表达式对应的值。Wherein, the expression engine provides a unified interface externally, and the unified interface is used to obtain the value corresponding to the expression.

第二方面,本发明实施例提供一种基于元数据架构的表达式引擎实现系统,包括:In the second aspect, the embodiment of the present invention provides an expression engine implementation system based on metadata architecture, including:

获取模块,用于获取用户的配置信息;The acquisition module is used to obtain the configuration information of the user;

生成模块,用于表达式引擎根据所述配置信息生成对应的规则数据;A generation module, used for the expression engine to generate corresponding rule data according to the configuration information;

返回模块,用于所述用户对实体的业务数据进行操作时,通过所述表达式引擎获取对应的数据。The return module is used to obtain corresponding data through the expression engine when the user operates on the business data of the entity.

第三方面,本发明实施例提供一种电子设备,包括:In a third aspect, an embodiment of the present invention provides an electronic device, including:

存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现任一项所述基于元数据架构的表达式引擎实现方法的步骤。A memory, a processor, and a computer program stored on the memory and operable on the processor, when the processor executes the program, implements any one of the steps of the expression engine implementation method based on the metadata architecture.

第四方面,本发明实施例提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现任一项所述基于元数据架构的表达式引擎实现方法的步骤。In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the metadata-based architecture-based expression engines can be implemented. method steps.

本发明实施例提供的基于元数据架构的表达式引擎实现方法及系统,通过采用基于元数据架构的表达式引擎,相比传统引擎系统,具有配置更灵活、扩展性强、结构清晰、功能完善以及优化更方便的特点。The implementation method and system of the expression engine based on the metadata architecture provided by the embodiments of the present invention, by adopting the expression engine based on the metadata architecture, compared with the traditional engine system, has more flexible configuration, strong scalability, clear structure, and complete functions And optimize more convenient features.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are For some embodiments of the present invention, those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本发明实施例提供的一种基于元数据架构的表达式引擎实现方法流程图;FIG. 1 is a flowchart of a method for implementing an expression engine based on a metadata architecture provided by an embodiment of the present invention;

图2为本发明基于元数据架构的表达式引擎的整体架构图;Fig. 2 is the overall architecture diagram of the expression engine based on the metadata architecture of the present invention;

图3为本发明实施例提供的一种基于元数据架构的表达式引擎实现系统结构图;FIG. 3 is a structural diagram of an expression engine implementation system based on a metadata architecture provided by an embodiment of the present invention;

图4为本发明实施例提供的电子设备的结构框图。Fig. 4 is a structural block diagram of an electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

为了解决采用传统架构的表达式引擎存在的一系列问题,本发明实施例提出一种基于元数据架构的表达式引擎实行方法。对于元数据中的部分名词,做了如下定义:In order to solve a series of problems existing in the expression engine using the traditional architecture, the embodiment of the present invention proposes an expression engine implementation method based on the metadata architecture. For some nouns in metadata, the following definitions are made:

元数据:描述数据的数据;Metadata: data describing data;

实体:由元数据描述的一类数据或者称之为模型,例如:这个实体有哪些字段,哪些类型的字段(文本字段、计算型字段、单选字段等等);Entity: A type of data described by metadata or called a model, for example: what fields does this entity have, and what types of fields (text fields, calculated fields, radio fields, etc.);

数据,由终端用户创建的某个指定实体的业务数据,例如:用户在表单中输入的文本字段内容、单选字段中选择哪个值等等;Data, the business data of a specified entity created by the end user, for example: the content of the text field entered by the user in the form, which value is selected in the radio field, etc.;

表达式,由用户基于自己业务需要配置的具有特定业务规则的一组文本,例如:订单.客户.收货地址。Expression, a set of texts with specific business rules configured by users based on their own business needs, for example: order.customer.delivery address.

图1为本发明实施例提供的一种基于元数据架构的表达式引擎实现方法流程图,如图1所示,包括:Fig. 1 is a flowchart of a method for implementing an expression engine based on a metadata architecture provided by an embodiment of the present invention, as shown in Fig. 1 , including:

S1,获取用户的配置信息;S1, acquiring user configuration information;

S2,表达式引擎根据所述配置信息生成对应的规则数据;S2. The expression engine generates corresponding rule data according to the configuration information;

S3,所述用户对实体的业务数据进行操作时,通过所述表达式引擎获取对应的数据。S3. When the user operates on the business data of the entity, the corresponding data is acquired through the expression engine.

具体地,构建表达式引擎,在步骤S1中,用户根据需求提供配置信息;Specifically, an expression engine is constructed, and in step S1, the user provides configuration information according to requirements;

步骤S2中,表达式引擎根据用户的配置信息生成相关的规则数据;In step S2, the expression engine generates relevant rule data according to the configuration information of the user;

步骤S3中,当用户对实体的业务数据进行操作时,会通过表达式引擎获取相应的数据。In step S3, when the user operates on the business data of the entity, the corresponding data will be obtained through the expression engine.

本发明实施例通过采用基于元数据架构的表达式引擎,相比传统引擎系统,具有配置更灵活、扩展性强、结构清晰、功能完善以及优化更方便的特点。The embodiment of the present invention adopts the expression engine based on the metadata architecture, which has the characteristics of more flexible configuration, strong expansibility, clear structure, perfect function and more convenient optimization compared with the traditional engine system.

基于上述实施例,该方法中步骤S3之前还包括:Based on the foregoing embodiments, the method also includes before step S3:

所述用户在预设字段设置默认值,通过调用所述表达式引擎获取所述默认值,并基于所述默认值对所述业务数据进行预设操作。The user sets a default value in the preset field, obtains the default value by calling the expression engine, and performs preset operations on the business data based on the default value.

具体地,用户在新建数据时,对于某些字段期望能够自动设置上默认值,此时,用户根据业务给指定的字段设置动态默认值,新建数据时,调用表达式引擎获取字段上的默认值,然后自动设置值,省去用户的操作。Specifically, when users create new data, they expect to automatically set default values for some fields. At this time, users set dynamic default values for the specified fields according to the business. When creating new data, call the expression engine to obtain the default values on the fields. , and then automatically set the value, saving the user's operation.

例如在创建邮件模板时,系统基于某个事件需要给一批用户发送邮件,邮件均有模板,同一类用户使用相同模板,模板中会存在很多不同的变量;发送邮件前,需要将模板的变量(表达式)替换为实际的值(如:订单.收货人),调用表达式引擎获取表达式的值,替换模板中的值,然后再发送邮件。For example, when creating an email template, the system needs to send emails to a group of users based on a certain event. All emails have templates. The same type of users use the same template, and there will be many different variables in the template; before sending emails, the template variables need to be (Expression) is replaced with the actual value (such as: order.Consignee), call the expression engine to obtain the value of the expression, replace the value in the template, and then send the email.

除上述应用场景外,还可涵盖其他业务场景,如报价规则、触发规则、审批流、CreekFlow、计算字段、关联筛选器和销售线索转换等等。In addition to the above application scenarios, other business scenarios can also be covered, such as quotation rules, trigger rules, approval flow, CreekFlow, calculated fields, association filters, and lead conversion, etc.

本发明实施例通过在某些特定应用场景中,由客户通过设置默认值,通过引擎表达式实现对业务数据的批量操作,提高了操作效率,避免由用户进行反复繁琐的操作。In some specific application scenarios, the embodiment of the present invention realizes batch operations on business data by setting default values and engine expressions by customers, thereby improving operation efficiency and avoiding repeated and cumbersome operations by users.

基于上述任一实施例,所述表达式引擎根据所述配置信息生成对应的规则数据,具体包括:Based on any of the above embodiments, the expression engine generates corresponding rule data according to the configuration information, specifically including:

所述表达式引擎的下端路由层进行数据的查询;The lower-end routing layer of the expression engine performs data query;

所述表达式引擎的上端分析层使用基于元数据描述的表达式,输出所述对应的规则数据。The upper-end analysis layer of the expression engine uses expressions described by metadata to output the corresponding rule data.

其中,所述表达式引擎的下端路由层进行数据的查询,具体包括:Wherein, the lower-end routing layer of the expression engine performs data query, specifically including:

所述下端路由层中,由若干数据库组合构成数据库组;In the lower routing layer, a database group is composed of several databases;

所述数据库组基于元数据架构进行数据之间的路由与合并。The database group performs routing and merging between data based on the metadata framework.

其中,所述表达式引擎的上端分析层使用基于元数据描述的表达式,输出所述对应的规则数据,具体包括:Wherein, the upper-end analysis layer of the expression engine uses an expression based on metadata description to output the corresponding rule data, specifically including:

所述上端分析层获取所述配置信息,基于元数据架构对所述配置信息进行词法分析和语法分析,并返回优化结果,向所述路由层输出所述对应的规则数据。The upper-end analysis layer obtains the configuration information, performs lexical analysis and syntax analysis on the configuration information based on the metadata framework, returns an optimization result, and outputs the corresponding rule data to the routing layer.

具体地,图2为本发明基于元数据架构的表达式引擎的整体架构图,如图2所示,由于引入元数据架构,使得表达式规则能统一,上层(分析层)使用基于元数据描述的表达式,下层(路由层)的存储结构保持稳定不变的,并可针对该架构进行持续优化。Specifically, Fig. 2 is an overall architecture diagram of the expression engine based on the metadata architecture of the present invention. As shown in Fig. 2, due to the introduction of the metadata architecture, the expression rules can be unified, and the upper layer (analysis layer) uses metadata-based description The storage structure of the lower layer (routing layer) remains stable and can be continuously optimized for this architecture.

图2中的路由层储存的数据放置在若干个数据库中,组成的数据库组能基于元数据架构进行数据之间的路由及合并处理,分析层通过对外接口,获取用户提供的配置信息,同样是基于元数据架构对配置信息分别从词法分析和语法分析两个角度进行全面解析,同时在分析完成后返回优化结果,最后向用户输出对应的数据。The data stored in the routing layer in Figure 2 is placed in several databases. The database group formed can perform routing and merging processing between data based on the metadata architecture. The analysis layer obtains the configuration information provided by the user through the external interface, which is also Based on the metadata structure, the configuration information is comprehensively analyzed from the perspectives of lexical analysis and syntax analysis, and at the same time, after the analysis is completed, the optimization result is returned, and the corresponding data is finally output to the user.

本发明实施例通过由表达式引擎的分层结构实现对用户需求的响应,该架构清晰完整,功能和各个业务模块界限明确,同时表达式引擎使用统一的出口,使得用户无需关心数据从哪里获取。The embodiment of the present invention realizes the response to user needs through the layered structure of the expression engine. The structure is clear and complete, and the functions and business modules are clearly defined. At the same time, the expression engine uses a unified exit, so that users do not need to care about where the data is obtained. .

基于上述任一实施例,所述获取用户的配置信息,具体包括:Based on any of the above-mentioned embodiments, the acquiring user configuration information specifically includes:

所述用户根据预设业务规则,提供预设的表达规则,形成所述配置信息。The user provides preset expression rules according to preset business rules to form the configuration information.

具体地,如图2所示,在表达式引擎获取用户的配置信息前,用户根据自己的实际业务需求,包含多个业务场景,制定对应的多个配置信息,输入给表达式引擎,通过元数据配置即可快速生成符合业务场景的表达式,可以配置到任意自己创建的实体字段,进一步地,在元数据上新增实体字段,即可在相应的业务场景中实时配置表达式;同时根据需求,也可进行业务场景的扩展,而表达式底层的存储结构仍是稳定不变的,可针对该结构进行持续优化。Specifically, as shown in Figure 2, before the expression engine obtains the user's configuration information, the user formulates multiple corresponding configuration information according to his actual business needs, including multiple business scenarios, and inputs them to the expression engine. Data configuration can quickly generate expressions that meet business scenarios, and can be configured to any entity field created by oneself. Further, by adding entity fields to metadata, expressions can be configured in real time in corresponding business scenarios; at the same time, according to Business scenarios can also be expanded according to requirements, while the underlying storage structure of expressions is still stable and can be continuously optimized for this structure.

本发明实施例通过元数据配置即可快速生成符合业务场景的表达式,同时可以灵活配置到任意自己创建的实体字段。The embodiment of the present invention can quickly generate an expression conforming to a business scenario through metadata configuration, and can flexibly configure any self-created entity field.

基于上述任一实施例,所述表达式引擎对外提供统一接口,所述统一接口用于获取表达式对应的值。Based on any of the above embodiments, the expression engine provides a unified interface externally, and the unified interface is used to obtain a value corresponding to an expression.

具体地,由于采用了元数据的结构描述,能屏蔽引擎内部复杂实现,接口统一,而表达式引擎只提供最基本的接口,获取表达式对应的值。Specifically, due to the use of metadata structure description, it can shield the internal complex implementation of the engine, and the interface is unified, while the expression engine only provides the most basic interface to obtain the value corresponding to the expression.

本发明实施例通过统一表达式引擎的对外接口,简化了接口结构,便于用户快速进行配置信息的传递。The embodiment of the present invention simplifies the interface structure by unifying the external interface of the expression engine, so that the user can quickly transfer configuration information.

图3为本发明实施例提供的一种基于元数据架构的表达式引擎实现系统结构图,如图3所示,包括:获取模块31、生成模块32和返回模块33;其中:Fig. 3 is a structural diagram of an expression engine implementation system based on a metadata architecture provided by an embodiment of the present invention, as shown in Fig. 3 , including: an acquisition module 31, a generation module 32 and a return module 33; wherein:

获取模块31用于获取用户的配置信息;生成模块32用于表达式引擎根据所述配置信息生成对应的规则数据;返回模块33用于所述用户对实体的业务数据进行操作时,通过所述表达式引擎获取对应的数据。The obtaining module 31 is used to obtain the configuration information of the user; the generating module 32 is used for the expression engine to generate corresponding rule data according to the configuration information; the returning module 33 is used for when the user operates the business data of the entity, through the The expression engine obtains the corresponding data.

本发明实施例通过采用基于元数据架构的表达式引擎,相比传统引擎系统,具有配置更灵活、扩展性强、结构清晰、功能完善以及优化更方便的特点。The embodiment of the present invention adopts the expression engine based on the metadata architecture, which has the characteristics of more flexible configuration, strong expansibility, clear structure, perfect function and more convenient optimization compared with the traditional engine system.

基于上述任一实施例,所述系统还包括预设模块34,所述预设模块34用于所述用户在预设字段设置默认值,通过调用所述表达式引擎获取所述默认值,并基于所述默认值对所述业务数据进行预设操作。Based on any of the above embodiments, the system further includes a preset module 34, the preset module 34 is used for the user to set a default value in the preset field, obtain the default value by calling the expression engine, and Preset operations are performed on the service data based on the default value.

本发明实施例通过在某些特定应用场景中,由客户通过设置默认值,通过引擎表达式实现对业务数据的批量操作,提高了操作效率,避免由用户进行反复繁琐的操作。In some specific application scenarios, the embodiment of the present invention realizes batch operations on business data by setting default values and engine expressions by customers, thereby improving operation efficiency and avoiding repeated and cumbersome operations by users.

基于上述任一实施例,生成模块32包括路由子模块321和分析子模块322;其中:Based on any of the above-mentioned embodiments, the generation module 32 includes a routing submodule 321 and an analysis submodule 322; wherein:

路由子模块321用于所述表达式引擎的下端路由层进行数据的查询,分析子模块322用于所述表达式引擎的上端分析层使用基于元数据描述的表达式,输出所述对应的规则数据;The routing sub-module 321 is used for the lower-end routing layer of the expression engine to query data, and the analysis sub-module 322 is used for the upper-end analysis layer of the expression engine to use expressions based on metadata descriptions to output the corresponding rules data;

其中所述路由子模块321具体用于所述下端路由层中,由若干数据库组合构成数据库组;所述数据库组基于元数据架构进行数据之间的路由与合并;所述分析子模块322具体用于所述上端分析层获取所述配置信息,基于元数据架构对所述配置信息进行词法分析和语法分析,并返回优化结果,向所述路由层输出所述对应的规则数据。Wherein the routing sub-module 321 is specifically used in the lower-end routing layer, and is composed of several databases to form a database group; the database group performs routing and merging between data based on the metadata architecture; the analysis sub-module 322 is specifically used Obtain the configuration information at the upper-end analysis layer, perform lexical analysis and syntax analysis on the configuration information based on the metadata framework, return an optimization result, and output the corresponding rule data to the routing layer.

本发明实施例通过由表达式引擎的分层结构实现对用户需求的响应,该架构清晰完整,功能和各个业务模块界限明确,同时表达式引擎使用统一的出口,使得用户无需关心数据从哪里获取。The embodiment of the present invention realizes the response to user needs through the layered structure of the expression engine. The structure is clear and complete, and the functions and business modules are clearly defined. At the same time, the expression engine uses a unified exit, so that users do not need to care about where the data is obtained. .

基于上述任一实施例,所述获取模块31具体用于所述用户根据预设业务规则,提供预设的表达规则,形成所述配置信息。Based on any of the above embodiments, the obtaining module 31 is specifically configured for the user to provide preset expression rules according to preset business rules to form the configuration information.

本发明实施例通过元数据配置即可快速生成符合业务场景的表达式,同时可以灵活配置到任意自己创建的实体字段。The embodiment of the present invention can quickly generate an expression conforming to a business scenario through metadata configuration, and can flexibly configure any self-created entity field.

基于上述任一实施例,所述各模块中的表达式引擎对外提供统一接口,所述统一接口用于获取表达式对应的值。Based on any of the above embodiments, the expression engine in each module provides a unified interface to the outside, and the unified interface is used to obtain the value corresponding to the expression.

本发明实施例通过统一表达式引擎的对外接口,简化了接口结构,便于用户快速进行配置信息的传递。The embodiment of the present invention simplifies the interface structure by unifying the external interface of the expression engine, so that the user can quickly transfer configuration information.

图4示例了一种电子设备的实体结构示意图,如图4所示,该电子设备可以包括:处理器(processor)410、通信接口(Communications Interface)420、存储器(memory)430和通信总线440,其中,处理器410,通信接口420,存储器430通过通信总线440完成相互间的通信。处理器410可以调用存储器430中的逻辑指令,以执行如下方法:获取用户的配置信息;表达式引擎根据所述配置信息生成对应的规则数据;所述用户对实体的业务数据进行操作时,通过所述表达式引擎获取对应的数据。FIG. 4 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 4, the electronic device may include: a processor (processor) 410, a communication interface (Communications Interface) 420, a memory (memory) 430 and a communication bus 440, Wherein, the processor 410 , the communication interface 420 , and the memory 430 communicate with each other through the communication bus 440 . The processor 410 can call the logical instructions in the memory 430 to execute the following method: obtain the configuration information of the user; the expression engine generates corresponding rule data according to the configuration information; when the user operates the business data of the entity, through The expression engine obtains corresponding data.

此外,上述的存储器430中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above logic instructions in the memory 430 may be implemented in the form of software function units and be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

另一方面,本发明实施例还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各实施例提供的传输方法,例如包括:获取用户的配置信息;表达式引擎根据所述配置信息生成对应的规则数据;所述用户对实体的业务数据进行操作时,通过所述表达式引擎获取对应的数据。On the other hand, an embodiment of the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the transmission method provided by the above-mentioned embodiments is implemented, for example, including : Obtain configuration information of the user; the expression engine generates corresponding rule data according to the configuration information; when the user operates on the business data of the entity, the corresponding data is obtained through the expression engine.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (8)

1. An expression engine implementation method based on a metadata architecture, which is characterized by comprising the following steps:
acquiring configuration information of a user;
the expression engine generates corresponding rule data according to the configuration information;
when the user operates the business data of the entity, the corresponding data is obtained through the expression engine;
the expression engine generates corresponding rule data according to the configuration information, and specifically comprises the following steps:
the lower end routing layer of the expression engine performs data query;
the upper analysis layer of the expression engine outputs the corresponding rule data by using an expression based on metadata description;
the upper analysis layer of the expression engine outputs the corresponding rule data by using an expression based on metadata description, and specifically comprises the following steps:
the upper analysis layer acquires the configuration information, performs lexical analysis and grammar analysis on the configuration information based on a metadata architecture, returns an optimization result, and outputs the corresponding rule data to the routing layer.
2. The method for implementing an expression engine based on a metadata architecture according to claim 1, wherein when the user operates on service data of an entity, obtaining corresponding data by the expression engine, further includes:
and the user sets a default value in a preset field, acquires the default value by calling the expression engine, and performs preset operation on the service data based on the default value.
3. The method for implementing an expression engine based on metadata architecture according to claim 1, wherein the lower routing layer of the expression engine performs data query, specifically comprising:
in the lower-end routing layer, a plurality of databases are combined to form a database group;
the database group performs routing and merging between data based on a metadata architecture.
4. The method for implementing an expression engine based on a metadata architecture according to claim 1, wherein the obtaining configuration information of a user specifically includes:
and the user provides a preset expression rule according to a preset service rule to form the configuration information.
5. The method according to any one of claims 1 to 4, wherein the expression engine provides a unified interface to the outside, and the unified interface is used for obtaining a value corresponding to an expression.
6. An expression engine implementation system based on a metadata architecture, comprising:
the acquisition module is used for acquiring configuration information of a user;
the generation module is used for generating corresponding rule data according to the configuration information by the expression engine;
the return module is used for acquiring corresponding data through the expression engine when the user operates the business data of the entity;
the expression engine generates corresponding rule data according to the configuration information, and specifically comprises the following steps:
the lower end routing layer of the expression engine performs data query;
the upper analysis layer of the expression engine outputs the corresponding rule data by using an expression based on metadata description;
the upper analysis layer of the expression engine outputs the corresponding rule data by using an expression based on metadata description, and specifically comprises the following steps:
the upper analysis layer acquires the configuration information, performs lexical analysis and grammar analysis on the configuration information based on a metadata architecture, returns an optimization result, and outputs the corresponding rule data to the routing layer.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the metadata architecture based expression engine implementation method of any one of claims 1 to 5 when the program is executed.
8. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of a metadata architecture based expression engine implementation method according to any of claims 1 to 5.
CN201911177004.6A 2019-11-26 2019-11-26 Method and system for implementing expression engine based on metadata architecture Active CN110888672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911177004.6A CN110888672B (en) 2019-11-26 2019-11-26 Method and system for implementing expression engine based on metadata architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911177004.6A CN110888672B (en) 2019-11-26 2019-11-26 Method and system for implementing expression engine based on metadata architecture

Publications (2)

Publication Number Publication Date
CN110888672A CN110888672A (en) 2020-03-17
CN110888672B true CN110888672B (en) 2023-05-02

Family

ID=69748865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911177004.6A Active CN110888672B (en) 2019-11-26 2019-11-26 Method and system for implementing expression engine based on metadata architecture

Country Status (1)

Country Link
CN (1) CN110888672B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256710B (en) * 2020-09-30 2022-12-06 中孚安全技术有限公司 Metadata-based data statistical analysis chart generation system, method and equipment
CN113726868A (en) * 2021-08-26 2021-11-30 上海微盟企业发展有限公司 Distributed service configuration device method and device based on business identity
CN114996319B (en) * 2022-08-01 2022-11-04 税友软件集团股份有限公司 Data processing method, device and equipment based on rule engine and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335479A (en) * 2015-10-12 2016-02-17 国家计算机网络与信息安全管理中心 Text data statistics realization method based on SQL
CN109597606A (en) * 2018-10-24 2019-04-09 中国平安人寿保险股份有限公司 Method, equipment and the storage medium of operational decision making are carried out using regulation engine
CN109614413A (en) * 2018-12-12 2019-04-12 上海金融期货信息技术有限公司 An in-memory streaming computing platform system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070078823A1 (en) * 2005-09-30 2007-04-05 Microsoft Corporation Expression templates and object classes for multidimensional analytics expressions
US8104080B2 (en) * 2007-01-26 2012-01-24 Microsoft Corporation Universal schema for representing management policy
CN106844643A (en) * 2017-01-13 2017-06-13 王洋 A kind of Database Dynamic generation method based on template engine
CN108229907B (en) * 2017-12-06 2021-07-13 链家网(北京)科技有限公司 Rule changing method and system based on expression engine
CN108021809A (en) * 2017-12-19 2018-05-11 北京明朝万达科技股份有限公司 A kind of data processing method and system
CN109325069B (en) * 2018-09-07 2022-03-15 腾讯科技(深圳)有限公司 Service processing method, device and network equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105335479A (en) * 2015-10-12 2016-02-17 国家计算机网络与信息安全管理中心 Text data statistics realization method based on SQL
CN109597606A (en) * 2018-10-24 2019-04-09 中国平安人寿保险股份有限公司 Method, equipment and the storage medium of operational decision making are carried out using regulation engine
CN109614413A (en) * 2018-12-12 2019-04-12 上海金融期货信息技术有限公司 An in-memory streaming computing platform system

Also Published As

Publication number Publication date
CN110888672A (en) 2020-03-17

Similar Documents

Publication Publication Date Title
US9959311B2 (en) Natural language interface to databases
CN107391142B (en) Application splitting method and device
US10453165B1 (en) Computer vision machine learning model execution service
CN110888672B (en) Method and system for implementing expression engine based on metadata architecture
CN107943945A (en) Isomery operator management method in a kind of big data analysis development platform
WO2016101811A1 (en) Information arrangement method and apparatus
CN109597825B (en) Rule engine calling method, device, equipment and computer readable storage medium
CN113535749A (en) Query statement generation method and device
CA3188880A1 (en) Conversational syntax using constrained natural language processing for accessing datasets
CN110633959A (en) Method, device, equipment and medium for creating approval task based on graph structure
CN110263104A (en) JSON character string processing method and device
US11971886B2 (en) Active learning for natural language question answering
US10679003B2 (en) Assisting with written communication style based on recipient dress style
CN107871055A (en) A data analysis method and device
CN111522840A (en) Label configuration method, device, equipment and computer readable storage medium
CN115033233A (en) Interface calling method and device, electronic equipment and storage medium
WO2025097886A1 (en) Dialogue method and apparatus, computer device, storage medium, and computer program product
CN111680337B (en) PDM system product design requirement information acquisition method and system
CN112883088B (en) Data processing method, device, equipment and storage medium
CN114064862A (en) Question answering method, device and equipment
CN111913695A (en) Code conversion method, device and storage medium
TWI873453B (en) Automated few-shot learning techniques for artificial intelligence-based query answering systems
CN116881276A (en) Data synchronization and desensitization integrated method, device, electronic equipment and storage medium
CN110807171A (en) Method and device for analyzing adequacy of seat personnel in business based on weight division
CN117055851A (en) Software architecture recovery method and device, electronic 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
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A method and system for implementing an expression engine based on metadata architecture

Granted publication date: 20230502

Pledgee: Guangxi Tencent Venture Capital Co.,Ltd.

Pledgor: BEIJING RENKE INTERACTIVE NETWORK TECHNOLOGY Co.,Ltd.

Registration number: Y2025990000081