Business rule determination method, device, readable storage medium and electronic device
By obtaining a preset template library and building a visual interface, and combining data input to determine business rules, the problems of high learning cost and poor reusability of complex business rules in existing technologies are solved, and fast and flexible business rule definition is achieved.
Patent Information
- Application Number
- CN202111347804.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2041-11-15
AI Technical Summary
In existing technologies, complex business rules require complex script descriptions, which have high learning costs and low reusability, and cannot meet the requirements of rapid project implementation.
A business rule determination method is provided, which obtains a preset template library, filters and combines preset templates according to business needs, constructs a visual interface, combines visual editing and script editing interfaces, and uses the first and second data to determine business rules.
It enables rapid determination of complex business rules, improves implementation efficiency, combines ease of use and scalability, and reduces dependence on technical and business personnel.
Smart Images

Figure CN114064022B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to a method, device, readable storage medium and electronic device for determining business rules. Background Art
[0002] In the existing technology, very complex business rules require complex scripts to describe. This approach has a high learning cost, the scripts are not very reusable, and require technical and business personnel to complete them together, which cannot meet the requirements of rapid project implementation. Summary of the Invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0004] To this end, a first aspect of the present invention is to provide a method for determining business rules;
[0005] A second aspect of the present invention is to provide a business rule determination device;
[0006] A third aspect of the present invention is to provide a readable storage medium;
[0007] A fourth aspect of the present invention provides an electronic device.
[0008] In view of this, according to a first aspect of the present invention, a business rule determination method is provided, which includes: obtaining a preset template library, the preset template library including multiple preset templates; screening out at least one preset template from the preset template library according to business needs, determining a visualization template suitable for the business needs based on the at least one preset template, and constructing a visualization interface based on the visualization template, wherein the visualization interface includes a visualization editing interface and a script editing interface, and determining business rules based on first data and / or second data, wherein the first data is data entered by the user in the visualization editing interface, and the second data is data entered by the user in the script editing interface.
[0009] It should be noted that the above business rules refer to the definition and constraints of the business.
[0010] The business rule determination method provided by the present invention obtains a preset template library, which contains multiple preset templates. Specifically, each preset template contains the calculation logic of a business rule.
[0011] Furthermore, based on business needs, preset templates suitable for the business needs are filtered out from the preset template library. Specifically, the above business needs are used to indicate the purpose that the user needs to achieve. For example, if the user needs to convert the data in the annual report, the preset template filtered out at this time is the preset template related to the conversion. Specifically, the preset templates filtered out can be one or more, depending on the complexity of the business rules to be determined.
[0012] Furthermore, based on at least one preset template that has been screened out, a visualization template suitable for the business needs is determined. Specifically, if only one preset template is needed to achieve the above business needs, then the visualization template is the same as the above preset template; if multiple preset templates are required to achieve the above business needs, then multiple preset templates need to be combined to obtain a visualization template.
[0013] Furthermore, a visualization interface is constructed based on the visualization template. Specifically, the visualization interface includes a visualization editing interface and a script editing interface. The visualization editing interface is used for the user to input first data. The first data generally includes one or more of the calculation formula, adopted functions, parameters, etc. of the business rules to be determined, but is not limited to these; the script editing interface is used for the user to input second data, and the script can be directly edited through the second data.
[0014] Furthermore, business rules are determined based on the first data and / or the second data. Specifically, there are three ways to determine business rules based on the first data and the second data. First, business rules are determined based only on the first data, that is, the user only needs to input the first data into the visual editing interface to determine the business rules, thereby realizing the rapid determination of business rules without writing scripts; second, business rules are determined based on the first data and the second data. When the business rules are more complex, the business rules cannot be fully determined based on the input first data alone. At this time, the second data needs to be input into the script editing interface to improve the business rules, so that the present invention can ensure the rapid determination of business rules while also having scalability; third, in some cases where the business rules cannot be determined by the first data, the business rules are determined only based on the second data, that is, the user needs to input the second data into the script editing interface to determine the business rules, so that the present invention can flexibly select an appropriate method to determine business rules according to different business needs.
[0015] The business rule determination method provided by the present invention can derive a wider range and more complex visualization template according to specific business needs, and has both ease of use and scalability. At the same time, new business rules can be customized through the second data entered through the script editing interface, which improves the flexibility of business rule definition and enables business personnel to quickly determine complex business rules, thereby improving implementation efficiency.
[0016] In addition, the business rule determination method provided by the above technical solution of the present invention also has the following additional technical features:
[0017] In the above technical solution, before obtaining the preset template library, the business rule determination method further includes: creating multiple preset templates according to different business needs and the first script, and generating a preset template library based on the multiple preset templates.
[0018] In this technical solution, multiple preset templates are created according to different business needs and the first script, wherein the first script refers to a script pre-written by technical personnel corresponding to the business needs. Specifically, the first script is encapsulated in a preset template, and then a preset template library is generated based on multiple preset templates. When determining business rules, business personnel only need to select appropriate templates from the preset template library and then combine them, thereby realizing the rapid definition of complex business rules without writing complex scripts.
[0019] In the above technical solution, the step of determining a visualization template suitable for business needs based on at least one preset template specifically includes: determining a visualization template suitable for business needs by combining and / or deriving at least one preset template.
[0020] In this technical solution, a visualization template suitable for business needs is determined by combining and / or deriving multiple preset templates. Specifically, the combination method refers to directly combining multiple preset templates to obtain a visualization template; the derivation method refers to extracting partial content from multiple preset templates and then combining them to generate a visualization template. It should be noted that both methods can be used simultaneously to make the determined visualization template more suitable for the needs. This technical solution can determine a visualization template that meets specific business needs without having to write complex scripts.
[0021] Specifically, when the business rules are relatively simple, only one preset template may be needed to determine the business rules. In this case, the preset template is directly used as the visualization template.
[0022] In the above technical solution, the step of generating a visualization interface according to the visualization template specifically includes: parsing the second script encapsulated in the visualization template, and constructing the visualization interface according to the second script.
[0023] In this technical solution, a second script is encapsulated in the visualization template. The visualization template is first parsed to obtain the second script, and then a visualization interface is constructed according to the second script.
[0024] It should be noted that in this technical solution, the second script is generated based on the first script. Specifically, multiple first scripts can be combined together to generate the second script, or partial content of multiple first scripts can be extracted and combined to generate the second script. When a preset template is used as a visualization template, the above-mentioned second script is the same as the first script corresponding to the preset template.
[0025] In the above technical solution, the step of determining the business rules according to the first data and / or the second data specifically includes: updating the second script according to the first data and / or the second data to determine the business rules.
[0026] In this technical solution, the second script is updated according to the first data and / or second data input by the user, and the business rules are determined according to the updated second script.
[0027] In the above technical solution, the second script includes metadata and execution data, the metadata is used to construct a visual interface, and the execution data is used to execute business rules.
[0028] In this technical solution, the second script includes metadata and execution data, wherein the metadata is used to describe the elements in the visual interface to construct the visual interface. Specifically, each metadata corresponds to a special parser, which parses the line comments of the metadata in the script to generate the data model format required for the visual interface, and generates the visual interface according to the data model; the execution data is the data in the second script used to execute business rules, and the determined business rules are executed through the execution data.
[0029] In the above technical solution, the business rule determination method further includes: updating the visualization interface according to the second data.
[0030] In this technical solution, the second data is also used to update the visual interface. Specifically, the user can edit the metadata in the second script by entering the second data in the script editing interface. When the second script is updated, the visual interface can be rebuilt based on the input second data, enabling the user to customize the visual interface according to needs.
[0031] According to a second aspect of the present invention, a business rule determination device is provided, including: an acquisition unit, the acquisition unit is used to obtain a preset template library and receive first data and second data; a screening unit, the screening unit is used to screen out at least one preset template from the preset template library according to business needs; a processing unit, the processing unit is used to determine a visualization template suitable for business needs based on at least one preset template; an interface generation unit, the interface generation unit is used to generate a visualization interface based on the visualization template; and a determination unit, the determination unit is used to determine the business rule based on the first data and / or the second data.
[0032] It should be noted that the above business rules refer to the definition and constraints of the business.
[0033] In the business rule determination device provided by the present invention, the acquisition unit acquires a preset template library, which contains multiple preset templates. Specifically, each preset template contains the calculation logic of a business rule.
[0034] Furthermore, the screening unit screens out preset templates suitable for the business needs from the preset template library based on the business needs. Specifically, the above business needs are used to indicate the purpose that the user needs to achieve. For example, if the user needs to convert the data in the annual report, the preset template screened out at this time is the preset template related to the conversion. Specifically, the preset templates screened out can be one or more, depending on the complexity of the business rules to be determined.
[0035] Furthermore, the processing unit determines a visualization template suitable for the business needs based on at least one preset template that has been screened out. Specifically, if only one preset template is needed to achieve the above business needs, then the visualization template is the same as the above preset template; if multiple preset templates are required to achieve the above business needs, then multiple preset templates need to be combined to obtain a visualization template.
[0036] Specifically, a visualization template suitable for business needs is determined by combining and / or deriving multiple preset templates. The combination method refers to the processing unit directly combining multiple preset templates to obtain a visualization template; the derivation method refers to the processing unit extracting partial content from multiple preset templates and then combining them to generate a visualization template. It should be noted that both methods can be used simultaneously to make the determined visualization template more suitable for needs. The processing unit can determine a visualization template that meets specific business needs based on the needs, without the need to write complex scripts.
[0037] It should be noted that when the business rules are relatively simple, only one preset template may be needed to determine the business rules. In this case, the preset template is directly used as the visualization template.
[0038] Furthermore, the interface generation unit constructs a visualization interface based on the visualization template. Specifically, the visualization interface includes a visualization editing interface and a script editing interface. The visualization editing interface is used for the user to input first data. The first data generally includes one or more of the calculation formula, adopted functions, parameters, etc. of the business rules to be determined, but is not limited to these; the script editing interface is used for the user to input second data, and the script can be directly edited through the second data.
[0039] Furthermore, a second script is encapsulated in the visualization template. The interface generation unit will first parse the visualization template to obtain the second script. The second script includes metadata and execution data, wherein the metadata is used to describe the elements in the visualization interface to construct the visualization interface. Specifically, each metadata corresponds to a special parser. The parser parses the line comments of the metadata in the script to generate the data model format required for the visualization interface, and generates the visualization interface according to the data model.
[0040] It should be noted that in this technical solution, the second script is generated based on the first script. Specifically, multiple first scripts can be combined together to generate the second script, or partial content of multiple first scripts can be extracted and combined to generate the second script. When a preset template is used as a visualization template, the above-mentioned second script is the same as the first script corresponding to the preset template.
[0041] Furthermore, the determination unit determines the business rules based on the first data and / or second data received by the acquisition unit. Specifically, there are three ways to determine the business rules based on the first data and the second data. First, the business rules are determined based only on the first data, that is, the user only needs to input the first data into the visual editing interface to determine the business rules, thereby realizing the rapid determination of the business rules without writing scripts; second, the business rules are determined based on the first data and the second data. When the business rules are more complex, the business rules cannot be fully determined based on the input first data alone. At this time, the second data needs to be input into the script editing interface to improve the business rules, so that the present invention can ensure the rapid determination of business rules while also having scalability; third, in some cases where the business rules cannot be determined by the first data, the business rules are determined based only on the second data, that is, the user only needs to input the second data into the script editing interface to determine the business rules, so that the present invention can flexibly select an appropriate method to determine business rules according to different business needs.
[0042] Specifically, the determining unit updates the second script according to the first data and / or second data input by the user, and determines the business rules according to the updated second script.
[0043] It should be noted that the determination unit is also used to update the visual interface based on the second data. Specifically, the user can edit the metadata in the second script by entering the second data in the script editing interface. When the second script is updated, the visual interface can be rebuilt based on the input second data, so that the user can customize the visual interface according to needs.
[0044] Furthermore, it should be noted that the business rule determination device also includes: a preset unit, which is used to construct a preset template library.
[0045] Specifically, the preset unit encapsulates the corresponding first script in a preset template according to different business needs, and then generates a preset template library based on multiple preset templates. When determining business rules, business personnel only need to select appropriate templates from the preset template library and then combine them, thereby realizing the rapid definition of complex business rules without writing complex scripts.
[0046] The business rule determination device provided by the present invention can derive a wider range of more complex visual templates based on specific business needs, and has both ease of use and scalability. At the same time, new business rules can be customized through the second data entered through the script editing interface, which improves the flexibility of business rule definition and enables business personnel to quickly determine complex business rules, thereby improving implementation efficiency.
[0047] According to a third aspect of the present invention, a readable storage medium is provided. The readable storage medium stores a program or instructions. When executed by a processor, the program or instructions implement the steps of the business rule determination method described in any of the technical solutions described in the first aspect. Therefore, the method has all the beneficial technical effects of the business rule determination method described in any of the technical solutions described in the first aspect, and no further details will be given here.
[0048] According to the fourth aspect of the present invention, an electronic device is proposed, which includes the business rule determination device proposed in the second aspect and the readable storage medium proposed in the third aspect, and thus has all the beneficial technical effects of the second and third aspects, which will not be elaborated here.
[0049] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which:
[0051] Figure 1 shows one of the schematic flow charts of the business rule determination method in the first embodiment of the present invention;
[0052] Figure 2 FIG2 shows a second schematic flow chart of the method for determining business rules in the first embodiment of the present invention;
[0053] Figure 3 FIG3 shows a schematic flow chart of the method for determining business rules in the first embodiment of the present invention;
[0054] Figure 4 FIG4 shows a fourth schematic flow chart of the method for determining business rules in the first embodiment of the present invention;
[0055] Figure 5 FIG5 is a schematic flow chart of the method for determining business rules in the first embodiment of the present invention;
[0056] Figure 6 A schematic block diagram of a business rule determination device in a second embodiment of the present invention is shown;
[0057] Figure 7 shows a schematic block diagram of an electronic device in a fourth embodiment of the present invention;
[0058] Figure 8 The schematic diagram of the design principle of the parser in the first embodiment of the present invention is shown.
[0059] in, Figure 6 and Figure 7 The corresponding relationship between the reference numerals and component names is as follows:
[0060] 600 Business rule determination device, 602 Acquisition unit, 604 Screening unit, 606 Processing unit, 608 Interface generation unit, 610 Determination unit, 612 Preset unit, 700 Electronic device, 702 Readable storage medium. DETAILED DESCRIPTION
[0061] In order to more clearly understand the above aspects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features therein can be combined with each other in the absence of conflict.
[0062] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.
[0063] Refer to the following Figures 1 to 8 , clearly and completely describes the business rule determination methods, devices, readable storage media, and electronic devices of some embodiments of the present invention.
[0064] Example 1
[0065] like Figure 1 As shown, according to a first aspect of the present invention, the present invention provides a method for determining business rules. The method for determining business rules includes:
[0066] Step S102: obtaining a preset template library, which includes a plurality of preset templates;
[0067] Step S104: selecting at least one preset template from the preset template library according to business requirements;
[0068] Step S106: determining a visualization template suitable for business needs based on at least one preset template;
[0069] Step S108, constructing a visualization interface according to the visualization template;
[0070] Step S110: determining a business rule according to the first data and / or the second data.
[0071] It should be noted that the above business rules refer to the definition and constraints of the business.
[0072] The business rule determination method provided in this embodiment obtains a preset template library, which contains multiple preset templates. Specifically, each preset template contains the calculation logic of a business rule.
[0073] Furthermore, based on business needs, preset templates suitable for the business needs are filtered out from the preset template library. Specifically, the above business needs are used to indicate the purpose that the user needs to achieve. For example, if the user needs to convert the data in the annual report, the preset template filtered out at this time is the preset template related to the conversion. Specifically, the preset templates filtered out can be one or more, depending on the complexity of the business rules to be determined.
[0074] Furthermore, based on at least one preset template that has been screened out, a visualization template suitable for the business needs is determined. Specifically, if only one preset template is needed to achieve the above business needs, then the visualization template is the same as the above preset template; if multiple preset templates are required to achieve the above business needs, then multiple preset templates need to be combined to obtain a visualization template.
[0075] Furthermore, a visualization interface is constructed based on the visualization template. Specifically, the visualization interface includes a visualization editing interface and a script editing interface. The visualization editing interface is used for users to input first data, and the first data generally includes the calculation formula, adopted functions, parameters, etc. of the business rules to be determined; the script editing interface is used for users to input second data, and the script can be directly edited through the second data.
[0076] Furthermore, business rules are determined based on the first data and / or the second data. Specifically, there are three ways to determine business rules based on the first data and the second data. First, business rules are determined based only on the first data, that is, the user only needs to input the first data into the visual editing interface to determine the business rules, thereby realizing the rapid determination of business rules without writing scripts; second, business rules are determined based on the first data and the second data. When the business rules are more complex, the business rules cannot be fully determined based on the input first data alone. At this time, the second data needs to be input into the script editing interface to improve the business rules, so that the present invention can ensure the rapid determination of business rules while also having scalability; third, in some cases where the business rules cannot be determined by the first data, the business rules are determined only based on the second data, that is, the user needs to input the second data into the script editing interface to determine the business rules, so that the present invention can flexibly select an appropriate method to determine business rules according to different business needs.
[0077] The business rule determination method provided in this embodiment can derive a wider range and more complex visualization template based on specific business needs, and has both ease of use and scalability. At the same time, new business rules can be customized through the second data entered through the script editing interface, which improves the flexibility of business rule definition and enables business personnel to quickly determine complex business rules, thereby improving implementation efficiency.
[0078] Figure 2 A flow chart showing a method for determining business rules according to another embodiment of the present invention is shown. Figure 1 ,like Figure 2 As shown, after executing the above step S102, the following steps are also executed:
[0079] Step S202: creating multiple preset templates according to different business requirements and the first script;
[0080] Step S204: Generate a preset template library based on multiple preset templates.
[0081] In this embodiment, multiple preset templates are created according to different business needs and a first script, wherein the first script refers to a script pre-written by a technician corresponding to the business needs. Specifically, the first script is encapsulated in a corresponding preset template, and then a preset template library is generated based on multiple preset templates. When determining business rules, business personnel only need to select appropriate templates from the preset template library and then combine them, thereby realizing the rapid definition of complex business rules without writing complex scripts.
[0082] Furthermore, it is preferred that Python language (a computer programming language) programming software be used to write the above-mentioned first script. The rule engine of the Python language programming software can provide a function library related to calculation and business, and can interpret the script and convert it into the target language, so as to facilitate the rapid determination of business rules.
[0083] In this embodiment, when Python language programming software is selected, a first script is written based on the rule engine of the Python language programming software. The rule engine of the Python software includes: a language interpreter, which can convert the Python language into a compiled target language; an EPM management module, which is used to define the API (Application Programming Interface) of the rule engine, and completes the business logic writing by calling the Python native library and the API in the EPM. This module supports the mixing of Python and the target language, and its multi-dimensional dependencies are all written in the target language; a multi-dimensional slicing module, which defines the basic properties of the multi-dimensional slicing and implements the query and calculation API of the multi-dimensional slicing; a multi-dimensional calculation expression parsing module, which parses the multi-dimensional expression into a calculation queue of the multi-dimensional slicing; and a multi-dimensional memory calculation engine, which supports multi-dimensional query and calculation.
[0084] Specifically, the meanings of the functions in the script written by the rule engine are shown in Table 1:
[0085] Table 1
[0086]
[0087]
[0088] Figure 3 A flow chart showing a method for determining business rules according to another embodiment of the present invention is shown. Figure 1 ,like Figure 3 As shown, the above step S106 specifically includes:
[0089] Step S302 : Determine a visualization template suitable for business needs by combining and / or deriving at least one preset template.
[0090] In this embodiment, a visualization template suitable for business needs is determined by combining and / or deriving multiple preset templates. Specifically, the combination method refers to directly combining multiple preset templates to obtain a visualization template; the derivation method refers to extracting partial content from multiple preset templates and then combining them to generate a visualization template. It should be noted that both methods can be used simultaneously to make the determined visualization template more suitable for the needs. This technical solution can determine a visualization template that meets specific business needs based on the needs, without the need to write complex scripts.
[0091] Specifically, when the business rules are relatively simple, only one preset template may be needed to determine the business rules. In this case, the preset template is directly used as the visualization template.
[0092] Figure 4 A flow chart showing a method for determining business rules according to another embodiment of the present invention is shown. Figure 1 ,like Figure 4 As shown, the above step S108 specifically includes:
[0093] Step S402, parsing the second script encapsulated in the visualization template;
[0094] Step S404: construct a visual interface according to the second script.
[0095] In this embodiment, the visualization template encapsulates a second script. The visualization template is first parsed to obtain the second script, and then a visualization interface is constructed according to the second script.
[0096] It should be noted that, in this embodiment, the second script is generated based on the first script. Specifically, multiple first scripts can be combined together to generate the second script, or partial content of multiple first scripts can be extracted and combined to generate the second script. When a preset template is used as a visualization template, the above-mentioned second script is the same as the first script corresponding to the preset template.
[0097] Figure 5 A flow chart showing a method for determining business rules according to another embodiment of the present invention is shown. Figure 1 ,like Figure 5 As shown, the above step S110 specifically includes:
[0098] Step S502: updating the second script according to the first data and / or the second data to determine the business rules;
[0099] In this embodiment, the second script is updated according to the first data and / or second data input by the user, and the business rules are determined according to the updated second script. Specifically, the second script includes metadata and execution data, the metadata is used to construct a visual interface, and the execution data is used to execute the business rules.
[0100] Furthermore, metadata is used to describe the elements in the visual interface to construct the visual interface. Specifically, each metadata corresponds to a special parser. The design principle of the parser is as follows: Figure 8 As shown, the parser parses the line comments of the metadata in the script (such as setting calculation formulas, the first line, etc.) to generate the data model format required for the visualization interface, and generates the visualization interface according to the data model; the execution data is the data used to execute the business rules in the second script, and the determined business rules are executed through the execution data. The meaning of each metadata in the parser design principle is shown in Table 2 below:
[0101] Table 2
[0102]
[0103] It should also be noted that the above-mentioned second data can also be used to update the visual interface. Specifically, the user can edit the metadata in the second script by entering the second data in the script editing interface. When updating the second script, the visual interface can be rebuilt according to the input second data, so that the user can customize the visual interface according to needs.
[0104] Example 2
[0105] like Figure 6 As shown, a second embodiment of the present invention provides a business rule determination device 600, including: an acquisition unit 602, the acquisition unit 602 is used to obtain a preset template library and receive first data and second data; a screening unit 604, the screening unit 604 is used to screen out at least one preset template from the preset template library according to business needs; a processing unit 606, the processing unit 606 is used to determine a visualization template suitable for business needs based on at least one preset template; an interface generation unit 608, the interface generation unit 608 is used to generate a visualization interface based on the visualization template; and a determination unit 610, the determination unit 610 is used to determine the business rule based on the first data and / or the second data.
[0106] It should be noted that the above business rules refer to the definition and constraints of the business.
[0107] In the business rule determination device 600 provided in this embodiment, the acquisition unit 602 acquires a preset template library. The preset template library includes multiple preset templates. Specifically, each preset template includes a calculation logic of a business rule.
[0108] Furthermore, the screening unit 604 screens out preset templates suitable for the business needs from the preset template library according to the business needs. Specifically, the above business needs are used to indicate the purpose that the user needs to achieve. For example, if the user needs to convert the data in the annual report, the preset template screened out at this time is the preset template related to the conversion. Specifically, the preset templates screened out can be one or more, depending on the complexity of the business rules to be determined.
[0109] Furthermore, the processing unit 606 determines a visualization template suitable for the business needs based on at least one preset template that has been screened out. Specifically, if only one preset template is needed to achieve the above business needs, then the visualization template is the same as the above preset template; if multiple preset templates are required to achieve the above business needs, then multiple preset templates need to be combined to obtain a visualization template.
[0110] Specifically, a visualization template suitable for business needs is determined by combining and / or deriving multiple preset templates. The combination method refers to directly combining multiple preset templates through processing unit 606 to obtain a visualization template; the derivation method refers to extracting partial content of multiple preset templates through processing unit 606 and then combining them to generate a visualization template. It should be noted that both methods can be used simultaneously to make the determined visualization template more suitable for needs. Processing unit 606 can determine a visualization template that meets specific business needs based on the needs, without the need to write complex scripts.
[0111] It should be noted that when the business rules are relatively simple, only one preset template may be needed to determine the business rules. In this case, the preset template is directly used as the visualization template.
[0112] Furthermore, the interface generation unit 608 constructs a visualization interface based on the visualization template. Specifically, the visualization interface includes a visualization editing interface and a script editing interface. The visualization editing interface is used for the user to input first data. The first data generally includes one or more of the calculation formula, adopted functions, parameters, etc. of the business rules to be determined, but is not limited thereto; the script editing interface is used for the user to input second data, and the script can be directly edited through the second data.
[0113] Furthermore, a second script is encapsulated in the visualization template. The interface generation unit 608 will first parse the visualization template to obtain the second script. The second script includes metadata and execution data, wherein the metadata is used to describe the elements in the visualization interface to construct a visualization interface. Specifically, each metadata corresponds to a special parser. The parser parses the line comments of the metadata in the script to generate the data model format required for the visualization interface, and generates the visualization interface according to the data model.
[0114] It should be noted that, in this embodiment, the second script is generated based on the first script. Specifically, multiple first scripts can be combined together to generate the second script, or partial content of multiple first scripts can be extracted and combined to generate the second script. When a preset template is used as a visualization template, the above-mentioned second script is the same as the first script corresponding to the preset template.
[0115] Furthermore, the determination unit 610 determines the business rules based on the first data and / or second data received by the acquisition unit 602. Specifically, there are three ways to determine the business rules based on the first data and the second data. First, the business rules are determined based only on the first data, that is, the user only needs to input the first data into the visual editing interface to determine the business rules, so that the business rules can be quickly determined without writing scripts; second, the business rules are determined based on the first data and the second data. When the business rules are more complex, the business rules cannot be completely determined based on the input first data alone. At this time, the second data needs to be input into the script editing interface to improve the business rules, so that the present invention can ensure the rapid determination of business rules while also having scalability; third, in some cases where the business rules cannot be determined by the first data, the business rules are determined based only on the second data, that is, the user only needs to input the second data into the script editing interface to determine the business rules, so that the present invention can flexibly select an appropriate method to determine business rules according to different business needs.
[0116] Specifically, the determining unit 610 updates the second script according to the first data and / or second data input by the user, and determines the business rules according to the updated second script.
[0117] It should be noted that the determination unit 610 is also used to update the visual interface according to the second data. Specifically, the user can edit the metadata in the second script by entering the second data in the script editing interface. When the second script is updated, the visual interface can be reconstructed according to the input second data, so that the user can customize the visual interface according to needs.
[0118] Furthermore, it should be noted that the business rule determination device 600 further includes: a preset unit 612, and the preset unit 612 is used to build a preset template library.
[0119] Specifically, the preset unit 612 encapsulates the corresponding first script in a preset template according to different business needs, and then generates a preset template library based on multiple preset templates. When determining business rules, business personnel only need to select appropriate templates from the preset template library and then combine them, thereby realizing the rapid definition of complex business rules without writing complex scripts.
[0120] The business rule determination device 600 provided in this embodiment can derive a wider range and more complex visual template based on specific business needs, and has both ease of use and scalability. At the same time, new business rules can be customized through the second data entered through the script editing interface, which improves the flexibility of business rule definition and enables business personnel to quickly determine complex business rules, thereby improving implementation efficiency.
[0121] Example 3
[0122] In a third embodiment of the present invention, a readable storage medium is provided. The readable storage medium stores a program or instructions. When executed by a processor, the program or instructions implement the steps of the business rule determination method described in the first embodiment. Therefore, all the beneficial technical effects of the business rule determination method described in the first embodiment are achieved, and further details are omitted here.
[0123] Example 4
[0124] like Figure 7 As shown, in the fourth embodiment of the present invention, an electronic device 700 is proposed, which includes the business rule determination device 600 proposed in the above-mentioned embodiment 2 and the readable storage medium 702 proposed in the embodiment 3, and thus has all the beneficial technical effects of the above-mentioned embodiments 2 and 3, and will not be elaborated on here.
[0125] In the description of the present invention, the term "plurality" refers to two or more than two. Unless otherwise expressly defined, the orientations or positional relationships indicated by the terms "upper" and "lower" are based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description. They do not indicate or imply that the devices or components referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they cannot be understood as limitations on the present invention. The terms "connect," "install," and "fix" should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection or an indirect connection through an intermediate medium. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0126] In the description of the present invention, the terms "one embodiment," "some embodiments," "specific embodiments," etc., mean that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in multiple embodiments or examples of the present invention. In the present invention, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0127] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for determining business rules, characterized in that: include: Acquire a preset template library, wherein the preset template library includes a plurality of preset templates; Filtering at least one preset template from the preset template library according to business needs; Determining a visualization template suitable for the business requirement based on the at least one preset template; Constructing a visualization interface according to the visualization template, wherein the visualization interface includes a visualization editing interface and a script editing interface; Determining a business rule based on first data and / or second data, wherein the first data is data input by the user on the visual editing interface, and the second data is data input by the user on the script editing interface; The step of determining a visualization template applicable to the business requirement based on the at least one preset template specifically includes: Determining a visualization template suitable for the business requirement by combining and / or deriving the at least one preset template; The combination method is to combine multiple preset templates to obtain a visualization template; the derivation method is to extract part of the content of multiple preset templates and then combine them to generate a visualization template.
2. The business rule determination method according to claim 1, characterized in that: Before obtaining the preset template library, the business rule determination method further includes: Creating the plurality of preset templates according to different business requirements and the first script; The preset template library is generated according to the multiple preset templates.
3. The method for determining business rules according to claim 1, wherein: The step of constructing a visualization interface according to the visualization template specifically includes: Parsing a second script encapsulated in the visualization template; The visual interface is constructed according to the second script.
4. The method for determining business rules according to claim 3, wherein: The step of determining the business rules according to the first data and / or the second data specifically includes: The second script is updated according to the first data and / or the second data to determine the business rules.
5. The method for determining business rules according to claim 3, wherein: The second script includes metadata and execution data, the metadata is used to construct a visual interface, and the execution data is used to execute the business rules.
6. The method for determining business rules according to claim 1, wherein: The business rule determination method further includes: The visual interface is updated according to the second data.
7. A business rule determination device, characterized in that: include: an acquisition unit, configured to acquire a preset template library and receive first data and second data; A screening unit, configured to screen out at least one preset template from the preset template library according to business requirements; a processing unit, configured to determine a visualization template suitable for the business requirement based on the at least one preset template; An interface generation unit, configured to generate a visualization interface based on the visualization template; a determining unit, configured to determine the business rule based on the first data and / or the second data; The processing unit is further configured to determine, based on the at least one preset template, a visualization template applicable to the business requirement by combining and / or deriving; The combination method is to combine multiple preset templates to obtain a visual template; The derivation method is to extract part of the content of multiple preset templates and then combine them to generate a visual template.
8. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the business rule determination method according to any one of claims 1 to 6 are implemented.
9. An electronic device, characterized in that: include: The business rule determination device according to claim 7; and / or The readable storage medium according to claim 8.
Citation Information
Patent Citations
FMP model-based visual interface generation method and system
CN108762750A
Visual service platform
CN110543303A