CN111522558B - Method, device, system and readable medium for dynamically configuring rules based on Java - Google Patents

Method, device, system and readable medium for dynamically configuring rules based on Java Download PDF

Info

Publication number
CN111522558B
CN111522558B CN202010638517.9A CN202010638517A CN111522558B CN 111522558 B CN111522558 B CN 111522558B CN 202010638517 A CN202010638517 A CN 202010638517A CN 111522558 B CN111522558 B CN 111522558B
Authority
CN
China
Prior art keywords
java
character string
preset knowledge
byte code
code file
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
CN202010638517.9A
Other languages
Chinese (zh)
Other versions
CN111522558A (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.)
Mobilemd System Jiaxing Co ltd
Original Assignee
Mobilemd System Jiaxing 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 Mobilemd System Jiaxing Co ltd filed Critical Mobilemd System Jiaxing Co ltd
Priority to CN202010638517.9A priority Critical patent/CN111522558B/en
Publication of CN111522558A publication Critical patent/CN111522558A/en
Application granted granted Critical
Publication of CN111522558B publication Critical patent/CN111522558B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Abstract

A method, apparatus, system, and computer readable medium for dynamic configuration of rules based on Java are provided. The method comprises the following steps: receiving a RESTful calling request transmitted by a terminal, wherein the RESTful calling request comprises a character string of a regular expression; analyzing the character string based on a preset knowledge base; resolving the parsed character strings into corresponding tokens and constructing corresponding abstract syntax trees; generating a corresponding byte code file according to the abstract syntax tree; and loading the byte code file into the Java virtual machine and executing. The method can generate and execute the corresponding byte code file according to the call request which is transmitted by the terminal and contains the rule expression, thereby realizing the dynamic configuration of the rule and the instant implementation of the rule by terminal service personnel without the need of the rule configuration by developers in advance.

Description

Method, device, system and readable medium for dynamically configuring rules based on Java
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method, an apparatus, a system, and a computer-readable medium for dynamically configuring rules based on Java.
Background
The rule engine is a technical scheme which is produced in order to deal with a large number of rapidly-changing business logic, and can execute inference logic according to a certain algorithm according to established facts and a knowledge base to obtain a correct result. The rule engine is mainly composed of three parts: knowledge Base (Knowledge Base), established Fact Base (Fact Base), and inference engine.
In the prior art, a hard coding mode, a programming componentized OSGI, a static script (for example, TypeScript enables logic part modification to be effective in real time) and a Rule engine facing a developer (for example, Urule, Drools, Easy-Rule) are all developer-oriented, a developer needs to perform Rule configuration in advance, and a business person cannot dynamically configure or change rules.
Therefore, how to enable business personnel to dynamically configure and implement rules on the fly is a problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The technical problem to be solved by the present application is to provide a method, an apparatus, a system and a computer readable medium for dynamically configuring rules based on Java, which can enable an end user to dynamically configure rules and implement rules instantly.
In order to solve the above technical problem, the present application provides a method for dynamically configuring rules based on Java, including: receiving a RESTful calling request transmitted by a terminal, wherein the RESTful calling request comprises a character string of a regular expression; analyzing the character string based on a preset knowledge base; resolving the parsed character string into corresponding tokens and constructing a corresponding abstract syntax tree; generating a corresponding byte code file according to the abstract syntax tree; and loading the byte code file into a Java virtual machine and executing.
Optionally, the number of the preset knowledge bases is one or more, wherein each preset knowledge base comprises one or more preset knowledge points.
Optionally, the parsing the character string based on a preset knowledge base includes: matching and converting the character string based on the preset knowledge point; and marking the type of each token in the character string according to the conversion result, and obtaining the analyzed character string.
Optionally, the parsing the parsed character string into corresponding tokens and constructing a corresponding abstract syntax tree is based on a context-free grammar, a symbol priority, and a symbol relevance.
Optionally, the generating the corresponding bytecode file according to the abstract syntax tree is performed by using a java parser.
Optionally, the character string of the regular expression is based on a function call and/or a natural language format.
Optionally, when the number of the preset knowledge bases is multiple, the multiple preset knowledge bases are defined according to one or more of the following items: tenants, projects, and business scenarios.
In order to solve the above technical problem, the present application further provides a dynamic configuration rule device based on Java, including: the receiving module is used for receiving a RESTful calling request transmitted by a terminal, wherein the RESTful calling request comprises a character string of a regular expression; the analysis module is used for analyzing the character string based on a preset knowledge base; the grammar tree module is used for disassembling the analyzed character strings into corresponding tokens and constructing corresponding abstract grammar trees; the byte code file module is used for generating a corresponding byte code file according to the abstract syntax tree; and the loading module is used for loading the byte code file into a Java virtual machine and executing the byte code file.
In order to solve the above technical problem, the present application further provides a dynamic configuration rule system based on Java, including: a memory for storing instructions executable by the processor; and a processor for executing the instructions to implement the method as described above.
To solve the above technical problem, the present application also provides a computer readable medium storing computer program code, which when executed by a processor implements the method as described above.
Compared with the prior art, the method, the device, the system and the computer readable medium for dynamically configuring the rules based on the Java can generate and execute the corresponding byte code file according to the call request which is transmitted by the terminal and contains the rule expression, thereby realizing the dynamic configuration of the rules and the immediate implementation of the rules by terminal service personnel without the need of the rule configuration by developers in advance.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the principle of the application. In the drawings:
fig. 1 is a flowchart illustrating a method for dynamically configuring rules based on Java according to an embodiment of the present application.
Fig. 2 is a block diagram illustrating an apparatus for dynamic configuration rules based on Java according to an embodiment of the present application.
FIG. 3 is a system block diagram illustrating a system for dynamic configuration rules based on Java according to one embodiment of the present application.
Detailed Description
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings used in the description of the embodiments will be briefly introduced below. It is obvious that the drawings in the following description are only examples or embodiments of the application, from which the application can also be applied to other similar scenarios without inventive effort for a person skilled in the art. Unless otherwise apparent from the context, or otherwise indicated, like reference numbers in the figures refer to the same structure or operation.
As used in this application and the appended claims, the terms "a," "an," "the," and/or "the" are not intended to be inclusive in the singular, but rather are intended to be inclusive in the plural unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that steps and elements are included which are explicitly identified, that the steps and elements do not form an exclusive list, and that a method or apparatus may include other steps or elements.
The relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise. Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description. Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate. In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Flow charts are used herein to illustrate operations performed by systems according to embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed in the exact order in which they are performed. Rather, various steps may be processed in reverse order or simultaneously. Meanwhile, other operations are added to or removed from these processes.
The application provides a method for dynamically configuring rules based on Java. Fig. 1 is a flowchart illustrating a method for dynamically configuring rules based on Java according to an embodiment of the present application. As shown in fig. 1, the method for dynamically configuring rules based on Java of the present embodiment is applicable to a system for dynamically configuring rules based on Java, and the method includes the following steps:
step 101, receiving a RESTful calling request transmitted by a terminal, wherein the RESTful calling request comprises a character string of a regular expression;
102, analyzing the character string based on a preset knowledge base;
103, resolving the resolved character strings into corresponding tokens and constructing corresponding abstract syntax trees;
104, generating a corresponding byte code file according to the abstract syntax tree; and
and step 105, loading the byte code file into the Java virtual machine and executing.
In step 101, the system receives a RESTful call request incoming from a terminal. The terminal can be used directly by the service personnel and the call request can be sent by the service personnel. The RESTful (Representational State Transfer) request is a design style and development mode of a network application, and can be defined by using an XML format or a JOSN format based on HTTP. The RESTful request is defined in this embodiment using the JSON format. The RequestBody of the RESTful call request received by the system contains an input script, and the input script contains a regular expression in a character string form. A regular expression refers to an expression of a rule that an end user wants to configure.
Alternatively, the string of regular expressions may be based on function calls and/or natural language formats. In one example, when the string of a regular expression is in a function call based format, abs (-9) may be expressed as an absolute value (-9) when there is argument data. In one example, if may be expressed in a logical operation when the string of regular expressions is in natural language format.
In step 102, the system parses the string based on a predetermined knowledge base. The knowledge base is pre-configured by the end user or developer. Optionally, the number of the preset knowledge bases may be one or more, wherein each preset knowledge base may include one or more preset knowledge points. The logical units in the regular expression are Token Type (Token Type) and/or knowledge points. Token type refers to the type of token, such as numbers, assignment operators, addition operators, and the like. Knowledge points can represent a combination of multiple operators in an alias way, such as macros (Macro), but also simple functions, such as recursive functions. Knowledge points can be executed directly by the rules engine. Knowledge points are pre-configured by the end user or developer. A regular expression may be composed of multiple sub-rules, where each sub-rule may correspond to a knowledge point and/or a logical unit. By pre-configuring the knowledge base and the knowledge points, the terminal user can use the knowledge points when compiling the rule expression, so that the terminal user can read and understand the business logic more easily, the rule can be read and compiled without learning a programming language, and the learning cost and difficulty of the terminal user for using the rule engine are greatly reduced. Optionally, when the number of the preset knowledge bases is multiple, the system may define the multiple preset knowledge bases according to one or more of the following items: tenants, projects, and business scenarios. The system can perform isolation of the use range based on three dimensions of tenants, projects and business scenes. Scenes in the same scope or in the scope of a parent-child set may share a knowledge base. The following table 1 is an example when the predetermined knowledge base is plural, and includes 6 knowledge bases in total: serviceMethod, clazzMethod, macro, operator, operAlias and operFunc.
Knowledge base name Description of the invention Precondition for validation Call path
serviceMethod Bean method reference A bean instance exists; the example method has been implemented; the type of entry has been defined /knowledge/funcSerMethod
clazzMethod Class method referencing A class already exists; class methods have been implemented; the type of entry has been defined /knowledge/funcClaMethod
macro Custom macros The expression has been defined /knowledge/macro
operator Custom expression Method for inheriting Operator and rewriting exeutelnner /knowledge/operator
operAlias Expression aliases Is free of /knowledge/operAlias
operFunc Method expression Method for inheriting Operator and rewriting exeutelnner /knowledge/operFunc
TABLE 1
Optionally, the parsing of the character string based on the preset knowledge base in step 102 may include the following two steps:
step 1, matching and converting a character string based on a preset knowledge point by a system; and
and 2, the system marks the type of each Token (Token) in the character string according to the conversion result and obtains the analyzed character string.
The parsing of the character string may be performed by first matching the character string according to a knowledge point in a knowledge base. After the character strings are matched with the knowledge points, the system converts the content corresponding to a single knowledge point in the character strings into one or more tokens according to the matching result, so that the tokens in the whole context character string all meet the standard Java grammar specification. After the conversion is complete, the system tokens the token type for each token in the string.
In one example, the type tokenization process may be defined using a regular expression. The parser reads the input character stream (i.e., string) and then identifies the morphemes from it, and finally performs type tagging. Once an invalid mark is found during the tokenization process, the system may report an error. The following is the string "language =2+ 3; "the labeling process is explained for the example:
"language =2+ 3; "is an initialization variable" language "which is assigned to" 2+3 ". In this assignment statement, "language", "=", "2", "+", "3", and "are included; "these 6 tokens. By presetting the knowledge base, the system can obtain the token-tokenization type correspondence as shown in table 2 below:
token Type of marking
language Identifier symbol
= Assignment operators
3 Number of
+ Addition operator
2 Number of
Sentence end
TABLE 2
Then, the system type-marks the 6 tokens in the string according to the above correspondence.
In one example, the tokenized types of tokens may be classified into the following four categories:
1. Single-Character tokens (Single-Character Token), such as ">", "-", "", "(" etc.;
2. single or double Character tokens (One or Two Character Token), e.g., "=", "< =", etc.;
3. literal (Literal) tokens, which are typically directed to a particular language, require interpretation of the token into the language's corresponding character type;
4. keyword (Keyword) tokens, such as "and", "class", "else", "if", "this", and the like.
In step 103, the system disassembles the parsed character strings into corresponding tokens, and constructs a corresponding Abstract Syntax Tree (AST) according to the tokens. Alternatively, the system may be a parsing system that parses the parsed string based on context free grammar, symbol priority, and symbol relevance. The context-free grammar contains four components: a set of terminal symbols, a set of non-terminal symbols, a starting symbol, and a set of production equations. Symbol priority means setting a corresponding priority for each symbol, e.g. setting the priority of "+" higher. Symbol association refers to setting a symbol to be left associated or right associated. In one example, it may be set to just "! "and" - "are right associations and the other symbols are left associations. For example, "-" in "-3" modifies 3 on its right side, "-3" indicates a negative three; the first "+" of "1 +2+ 3" is associated with a 1 on its left side and the second "+" is associated with a 2 on its left side. The symbol priority and symbol relevance determine that the context-free grammar is a nonsense grammar, so that the abstract syntax tree can be constructed simply and conveniently by scanning the tokens.
In step 104, the system generates a corresponding bytecode file according to the abstract syntax tree. In one example, the system may traverse the AST using a preamble recursive approach. In the process of traversing the AST, the instructions in the token are pushed in sequence and then handed over to the thread for execution. The push order is determined by the trend of TreeWalker, which is determined by the structure of the syntax tree, so that the structure of the syntax tree determines the directionality of traversal. After traversing the AST, the system generates a corresponding bytecode file (also called bytecode instruction set), which is a class file. Alternatively, generating the corresponding bytecode file according to the abstract syntax tree may be performed using a Javaparser parser.
In step 105, the system loads the bytecode file into a Java Virtual Machine (JVM) and executes the rules. The byte code file compiled by the Java program needs to be loaded into the method area of the JVM first, so that the byte code file can run in the JVM. In actual operation, the JVM executes the code loaded into the method area. The JVM partitions the heap and stack in memory to store runtime data.
In summary, the method for dynamically configuring rules based on Java of this embodiment can generate and execute the corresponding bytecode file according to the call request containing the rule expression and transmitted from the terminal, thereby implementing dynamic configuration of rules and implementing rules immediately by the terminal service staff, and without requiring the developer to perform rule configuration in advance. The method of the embodiment can enable business personnel to manage complex business logic without invasion, provides a centralized management structure, and achieves the purposes of one-site configuration, implementation and local response.
The application also provides a dynamic configuration rule device based on Java. Fig. 2 is a block diagram illustrating an apparatus for dynamic configuration rules based on Java according to an embodiment of the present application. As shown in fig. 2, the Java-based dynamic configuration rule apparatus 200 of the present embodiment includes a receiving module 201, a parsing module 202, a syntax tree module 203, a bytecode file module 204, and a loading module 205.
The receiving module 201 is configured to receive a RESTful call request sent by a terminal, where the RESTful call request includes a string of a regular expression. The parsing module 202 is configured to parse the character string based on a preset knowledge base. The syntax tree module 203 is configured to parse the parsed character string into corresponding tokens and construct a corresponding abstract syntax tree. The bytecode file module 204 is configured to generate a corresponding bytecode file according to the abstract syntax tree. The loading module 205 is used for loading the bytecode file into the Java virtual machine and executing.
Optionally, as shown in fig. 2, the parsing module 202 may further include a matching unit 2021 and a type marking unit 2022. The matching unit 2021 is configured to match tokens in the string based on a preset knowledge point and a token type; and the type labeling unit 2022 is configured to perform type labeling on each token in the character string according to the matching result, and obtain the parsed character string.
The steps executed by the module 201-205 can refer to the aforementioned step 101-105 in the embodiment of fig. 1, and will not be described herein.
The application also provides a system for dynamically configuring rules based on Java, which comprises: a memory for storing instructions executable by the processor; and a processor for executing the instructions to implement the method of any of the above embodiments.
FIG. 3 is a system block diagram illustrating a system for dynamic configuration rules based on Java according to one embodiment of the present application. The Java based dynamic configuration rules system 300 may include an internal communication bus 301, a Processor (Processor) 302, a Read Only Memory (ROM) 303, a Random Access Memory (RAM) 304, and a communication port 305. When applied to a personal computer, the Java based system for dynamically configuring rules may further comprise a hard disk 307. Internal communication bus 301 may enable data communication among the components of system 300 based on Java's dynamic configuration rules. Processor 302 may make the determination and issue a prompt. In some embodiments, processor 302 may be comprised of one or more processors. The communication port 305 can enable the Java-based dynamic configuration rules system 300 to communicate data with the outside. In some embodiments, the Java based dynamically configured rules system 300 can send and receive information and data from a network through the communication port 305. The Java based dynamic configuration rules system 300 may also include various forms of program storage units and data storage units, such as a hard disk 307, Read Only Memory (ROM) 303 and Random Access Memory (RAM) 304, capable of storing various data files used for computer processing and/or communications, as well as possibly program instructions executed by the processor 302. The processor executes these instructions to implement the main parts of the method. The results processed by the processor are communicated to the user device through the communication port and displayed on the user interface.
The method for dynamically configuring rules based on Java may be implemented as a computer program, stored in the hard disk 307, and recorded in the processor 302 for execution, so as to implement the method for dynamically configuring rules based on Java in the present application.
The present application also provides a computer readable medium having stored thereon computer program code which, when executed by a processor, implements a method as described in any of the embodiments above.
When the method for dynamically configuring the rules based on Java is implemented as a computer program, it can also be stored in a computer-readable storage medium as an article of manufacture. For example, computer-readable storage media can include but are not limited to magnetic storage devices (e.g., hard disk, floppy disk, magnetic strips), optical disks (e.g., Compact Disk (CD), Digital Versatile Disk (DVD)), smart cards, and flash memory devices (e.g., electrically Erasable Programmable Read Only Memory (EPROM), card, stick, key drive). In addition, various storage media described herein can represent one or more devices and/or other machine-readable media for storing information. The term "machine-readable medium" can include, without being limited to, wireless channels and various other media (and/or storage media) capable of storing, containing, and/or carrying code and/or instructions and/or data.
It should be understood that the above-described embodiments are illustrative only. The embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), processors, controllers, micro-controllers, microprocessors, and/or other electronic units designed to perform the functions described herein, or a combination thereof.
Having thus described the basic concept, it will be apparent to those skilled in the art that the foregoing disclosure is by way of example only, and is not intended to limit the present application. Various modifications, improvements and adaptations to the present application may occur to those skilled in the art, although not explicitly described herein. Such modifications, improvements and adaptations are proposed in the present application and thus fall within the spirit and scope of the exemplary embodiments of the present application.
Also, this application uses specific language to describe embodiments of the application. Reference throughout this specification to "one embodiment," "an embodiment," and/or "some embodiments" means that a particular feature, structure, or characteristic described in connection with at least one embodiment of the present application is included in at least one embodiment of the present application. Therefore, it is emphasized and should be appreciated that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, some features, structures, or characteristics of one or more embodiments of the present application may be combined as appropriate.
Aspects of the present application may be embodied entirely in hardware, entirely in software (including firmware, resident software, micro-code, etc.) or in a combination of hardware and software. The above hardware or software may be referred to as "data block," module, "" engine, "" unit, "" component, "or" system. The processor may be one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), digital signal processing devices (DAPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or a combination thereof. Furthermore, aspects of the present application may be represented as a computer product, including computer readable program code, embodied in one or more computer readable media. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disk, floppy disk, magnetic strips … …), optical disks (e.g., Compact Disk (CD), Digital Versatile Disk (DVD) … …), smart cards, and flash memory devices (e.g., card, stick, key drive … …).
Similarly, it should be noted that in the preceding description of embodiments of the application, various features are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure aiding in the understanding of one or more of the embodiments. This method of disclosure, however, is not intended to require more features than are expressly recited in the claims. Indeed, the embodiments may be characterized as having less than all of the features of a single embodiment disclosed above.
Although the present application has been described with reference to the present specific embodiments, it will be recognized by those skilled in the art that the foregoing embodiments are merely illustrative of the present application and that various changes and substitutions of equivalents may be made without departing from the spirit of the application, and therefore, it is intended that all changes and modifications to the above-described embodiments that come within the spirit of the application fall within the scope of the claims of the application.

Claims (8)

1. A method for dynamically configuring rules based on Java, comprising:
receiving a RESTful calling request transmitted by a terminal, wherein the RESTful calling request comprises a character string of a regular expression;
matching and converting the character strings based on preset knowledge points in preset knowledge bases, wherein the number of the preset knowledge bases is one or more, and each preset knowledge base comprises one or more preset knowledge points;
marking the type of each token in the character string according to the conversion result, and obtaining the analyzed character string;
resolving the parsed character string into corresponding tokens and constructing a corresponding abstract syntax tree;
generating a corresponding byte code file according to the abstract syntax tree; and
and loading the byte code file into a Java virtual machine and executing.
2. The method of claim 1, wherein the parsing the parsed string into corresponding tokens and constructing corresponding abstract syntax trees is based on context free grammar, symbol priority, and symbol relevance.
3. The method of claim 1, wherein generating the corresponding bytecode file according to the abstract syntax tree is performed using a Javaparser parser.
4. The method of claim 1, wherein the string of the regular expression is based on a function call and/or a natural language format.
5. The method of claim 1, wherein when the number of the predetermined knowledge bases is plural, the plural predetermined knowledge bases are defined according to one or more of: tenants, projects, and business scenarios.
6. A Java based dynamic configuration rule apparatus, comprising:
the receiving module is used for receiving a RESTful calling request transmitted by a terminal, wherein the RESTful calling request comprises a character string of a regular expression;
the analysis module is used for matching and converting the character strings based on preset knowledge points in preset knowledge bases, wherein the number of the preset knowledge bases is one or more, and each preset knowledge base comprises one or more preset knowledge points; marking the type of each token in the character string according to the conversion result, and obtaining the analyzed character string;
the grammar tree module is used for disassembling the analyzed character strings into corresponding tokens and constructing corresponding abstract grammar trees;
the byte code file module is used for generating a corresponding byte code file according to the abstract syntax tree; and
and the loading module is used for loading the byte code file into a Java virtual machine and executing the byte code file.
7. A Java based dynamic configuration rule system comprising:
a memory for storing instructions executable by the processor; and a processor for executing the instructions to implement the method of any one of claims 1-5.
8. A computer-readable medium having stored thereon computer program code which, when executed by a processor, implements the method of any of claims 1-5.
CN202010638517.9A 2020-07-06 2020-07-06 Method, device, system and readable medium for dynamically configuring rules based on Java Active CN111522558B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010638517.9A CN111522558B (en) 2020-07-06 2020-07-06 Method, device, system and readable medium for dynamically configuring rules based on Java

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010638517.9A CN111522558B (en) 2020-07-06 2020-07-06 Method, device, system and readable medium for dynamically configuring rules based on Java

Publications (2)

Publication Number Publication Date
CN111522558A CN111522558A (en) 2020-08-11
CN111522558B true CN111522558B (en) 2020-11-06

Family

ID=71910191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010638517.9A Active CN111522558B (en) 2020-07-06 2020-07-06 Method, device, system and readable medium for dynamically configuring rules based on Java

Country Status (1)

Country Link
CN (1) CN111522558B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114398086B (en) * 2020-08-29 2022-11-25 华为技术有限公司 Drive configuration management method, device, medium, equipment and system
CN113849781B (en) * 2021-08-20 2024-01-12 苏州浪潮智能科技有限公司 Go language source code confusion method, system, terminal and storage medium
CN113641414A (en) * 2021-08-30 2021-11-12 平安国际融资租赁有限公司 Internet of things equipment access method and device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558134A (en) * 2017-09-27 2019-04-02 北京京东尚科信息技术有限公司 The method and apparatus of business datum verification
CN109688047A (en) * 2018-12-07 2019-04-26 中国建设银行股份有限公司 Message adaptation method, equipment and storage medium based on XML
CN111198863A (en) * 2019-12-27 2020-05-26 天阳宏业科技股份有限公司 Rule engine and implementation method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558134A (en) * 2017-09-27 2019-04-02 北京京东尚科信息技术有限公司 The method and apparatus of business datum verification
CN109688047A (en) * 2018-12-07 2019-04-26 中国建设银行股份有限公司 Message adaptation method, equipment and storage medium based on XML
CN111198863A (en) * 2019-12-27 2020-05-26 天阳宏业科技股份有限公司 Rule engine and implementation method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
规则引擎框架;晚歌y;《https://www.jianshu.com/p/cdc27a530d7b》;20200312;第1页 *

Also Published As

Publication number Publication date
CN111522558A (en) 2020-08-11

Similar Documents

Publication Publication Date Title
CN111522558B (en) Method, device, system and readable medium for dynamically configuring rules based on Java
US6918107B2 (en) Programming language extensions for processing data representation language objects and related applications
US8843907B2 (en) Compiler with error handling
US7958493B2 (en) Type inference system and method
AU2002318459A1 (en) Programming language extensions for processing data representation language objects and related applications
CN111933227B (en) Method for realizing data butt joint of internal and external systems of hospital based on dynamic configuration rule
CN107924326A (en) The moving method of updated type is covered
US20110239200A1 (en) Method for compiling a computer program
WO2022033229A1 (en) Software code compiling method and system
EP1899859B1 (en) Translating expressions in a computing environment
CN111930364B (en) Method for realizing conditional flow of process nodes through dynamic configuration rule device
Afroozeh et al. One parser to rule them all
Kuramitsu Nez: practical open grammar language
WO2022222586A1 (en) Code conversion method and apparatus
Peyton Jones et al. Unraveling recursion: compiling an IR with recursion to System F
CN113703779A (en) Cross-platform multi-language compiling method and ultra-light Internet of things virtual machine
CN117234517A (en) Interface parameter verification method, device, equipment and storage medium
Murawski et al. A contextual equivalence checker for IMJ
WO2023138078A1 (en) Method and apparatus for parsing programming language, and non-volatile storage medium
CN115268924B (en) Formula calculation engine service method and system based on aPaaS platform
CN114238469B (en) Data extraction interface opening method and device, computer equipment and storage medium
CN117667089A (en) Front-end form generation method and device, storage medium and electronic equipment
CN117519718A (en) Business rule expansion method, device, equipment and medium based on custom language
CN117707518A (en) Universal data query filtering and query result processing method and terminal
Merelo et al. Grammars: One of the Features That Makes Perl 6 Unique, and One of the Most Powerful Ways of Processing Text

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
CP03 "change of name, title or address"
CP03 "change of name, title or address"

Address after: 314000 3 storeys, Building 9, Intelligent Industry Innovation Park, 36 Changshengnan Road, Jiaxing Economic and Technological Development Zone, Zhejiang Province

Patentee after: Zhejiang Taimei Medical Technology Co., Ltd

Address before: 314001 3rd floor, building 9, smart industry innovation park, 36 Changsheng South Road, Jiaxing City, Zhejiang Province

Patentee before: MOBILEMD SYSTEM (JIAXING) Co.,Ltd.