Summary of the invention
Goal of the invention: aiming at the problems existing in the prior art with deficiency, the present invention provides a kind of by human configuration realityThe method of existing complicated process logic, can liberate research staff, directly square through the invention by product personnel or business analystThe software that method generates, so that it may directly configure the additions and deletions for different business table and change and look into and other general utility functions.
Technical solution: a method of complicated process logic being realized by human configuration, by by process, rule, dataThe generic configuration programs of three part compositions realize that the generic configuration program includes several services;Each service is oneA process, the process are mainly to control service to need several stages for passing through, each stage be the sub-process of this service (againClaim child node);Rule is the concrete function that service needs to be implemented, and the function of entire service specific implementation is all by several rulesCome what is realized;Two parts of data that data are divided into the data of parameter transmitting and are stored in medium.
The definition and function of process: for generic configuration program, a service externally provided is exactly a process;Generic configuration program can create multiple external services, and the corresponding process of each external service is right in generic configuration programIndependently unique process identification, this process it should will include N number of sub-process in generic configuration program, each sub-process can be rightThe many rules for answering lower section that will describe.It is relevant between each sub-process and sub-process, it is to be flowed by the father of sub-processThe mark ID attribute of journey is specified, and sub-process can also diverge and recycle by judging.
The definition and function of rule: operation is externally provided and is all realized here.Common rule has the increase to databaseRecord operation, to the modification operation of database, the inquiry operation to database, the delete operation to database, caching is looked intoAsk is also with the operation for increasing operation, calling http interface operation, sending MQ Message Opcode and judge sub-process and recycleRule functional therein.
The definition of data: the data of parameter transmitting are the parameter of input and output;The data value being stored in medium isThe data of database and various media storages;Data are mainly the object to be operated.
Building for a service is completed in integration as follows
One step 1, creation process, and a process identification is named to process, this is identified unique mark as serviceKnow, subsequent external accesses server, it is necessary to transmit this mark, in addition and with natural language (such as Chinese) be named;TogetherShi Dingyi inputs parameter list and output parameter list, to tell caller requirements of process to input what parameter and tell tuneUser's process will return to any parameter;And state that this process (servicing) is synchronous service or asynchronous service;Finally indicate thisThe corresponding sub-process of process.
One step 2, creation sub-process specify the title of its sub-process, then specified sub-process to the rule in requisition for operationThen group;And determine his father's sub-process (if first sub-process, then without specified his father's process);It also needs that this sub-process is specified to transportThe rule judged when row is transported if judgement needs to run for judging whether this sub-process needs to run its corresponding regular groupRow, if otherwise can run it is next be all father's process sub-process;In addition sub-process is also required to specified this sub-process of operationRequired input parameter and the return parameters that can be generated.This step 2 process is repeated if there are multiple sub-processes.
Step 3, creation one regular group, rule group is a regular set, needs the title of specified rule group;It is specifiedInput and output parameter required for rule group is run;The corresponding rule of specified rule group again, and indicate executing ruleSequentially.
Step 4, creation rule, such as the operation rules of the newly-increased table record of creation one.Herein when regular configuration, needThe table name of specified insertion database;It needs to input parameter required for specified insertion table;Need the master generated after specified insertion tableKey is returned as output parameter;Finally to specify the title of this rule.If there are multiple rules, this process is repeated.
The present invention is that the configuration assembling of a service is completed by above 4 steps, so that it may externally provide service.But such asFruit way conventional before using, exactly needs each stage to realize by encoding, more time-consuming, can not be research and developmentPersonnel are really used on the path of " research and development ".
The utility model has the advantages that compared with prior art, the side provided by the invention that complicated process logic is realized by human configurationMethod, including following advantage:
(1) first from work post, in the past to complete the research and development serviced, it is necessary to be write by research staff;Now through the invention, so that it may extend to the clear personnel of logical thinking, drop bottom significantly on the threshold used using difficulty.
(2) say in quality again, with the research and development of previous service, be all write by respective different grades of research staff andAt quality is irregular, and each programmer has its style, is difficult to accomplish to unitize;And through the invention, it is only necessary toConfiguration can realize service function, can accomplish unified higher standard in quality.
(3) again from precision, the research and development of a pervious service function, by being compiled after respective research staff's understanding demandIt writes, but research staff's is in the nature " research and development ", its existing main responsibility is to write program, and the only small part time is used forUnderstanding demand, and so often will cause the practical operation that the program for writing out does not meet party in request;And through the invention, configurationBusiness diagnosis teacher that the personnel of this service can be more proficient in by business, business diagnosis Shi Benshen are well understood by business,Its service function configured can be compared with the actual conditions of close to the need side.
(4) last again from efficiency, since the present invention is by realizing more common rule, so that common functionWithout researching and developing again, and by configuring and can use, it is online to need not move through research and development, test, an online system codeProcess, therefore the time of a large amount of quality management can be saved, accomplish the promotion of efficiency.
To sum up as described above, the present invention can further discharge productivity;And improve the quality of service;And expand the model of applicationIt encloses, can directly be configured by business diagnosis teacher of profession to improve the accuracy of realization demand.
Specific embodiment
Combined with specific embodiments below, the present invention is furture elucidated, it should be understood that these embodiments are merely to illustrate the present inventionRather than limit the scope of the invention, after the present invention has been read, those skilled in the art are to various equivalences of the inventionThe modification of form falls within the application range as defined in the appended claims.
As shown in Figure 1, the method that complicated process logic is realized by human configuration, by by process, rule, data threeThe generic configuration program of part composition realizes that generic configuration program includes several services;Each service is a process, streamJourney is mainly the several stages for controlling service and needing to pass through, and each stage is the sub-process (also known as child node) of this service;RuleIt is then the concrete function that service needs to be implemented, the function of entire service specific implementation is realized by several rules;NumberAccording to two parts of data for being divided into the data of parameter transmitting and being stored in medium.
The definition and function of process: for generic configuration program, a service externally provided is exactly a process;Generic configuration program can create multiple external services, and the corresponding process of each external service is right in generic configuration programIndependently unique process identification, this process it should will include N number of sub-process in generic configuration program, each sub-process can be rightThe many rules for answering lower section that will describe.It is relevant between each sub-process and sub-process, it is to be flowed by the father of sub-processThe mark ID attribute of journey is specified, and sub-process can also diverge and recycle by judging.
The definition and function of rule: operation is externally provided and is all realized here.Common rule has the increase to databaseRecord operation, to the modification operation of database, the inquiry operation to database, the delete operation to database, caching is looked intoAsk is also with the operation for increasing operation, calling http interface operation, sending MQ Message Opcode and judge sub-process and recycleRule functional therein.
The definition of data: the data of parameter transmitting are the parameter of input and output;The data value being stored in medium isThe data of database and various media storages;Data are mainly the object to be operated.
Building for a service is completed in integration as follows
One step 1, creation process, are arranged its configuration information, comprising: name a process identification to process, this markBy the unique identification as service, subsequent external accesses server, it is necessary to this mark is transmitted, in addition and with natural language (exampleSuch as Chinese) it is named;Input parameter list and output parameter list are defined simultaneously, to tell caller requirements of process defeatedEnter any parameter and tells what parameter will be caller process will return to;And state that this process (servicing) is synchronous service or differentStep service;Finally indicate the corresponding sub-process of this process.
One step 2, creation sub-process specify the title of its sub-process, then specified sub-process to the rule in requisition for operationThen group;And determine his father's sub-process (if first sub-process, then without specified his father's process);It also needs that this sub-process is specified to transportThe rule judged when row is transported if judgement needs to run for judging whether this sub-process needs to run its corresponding regular groupRow, if otherwise can run it is next be all father's process sub-process;In addition sub-process is also required to specified this sub-process of operationRequired input parameter and the return parameters that can be generated.This process is repeated if there are multiple sub-processes.
Step 3, creation one regular group, rule group is a regular set, needs the title of specified rule group;It is specifiedInput and output parameter required for rule group is run;The corresponding rule of specified rule group again, and indicate executing ruleSequentially.
Step 4, creation rule, such as the operation rules of the newly-increased table record of creation one.Herein when regular configuration, needThe table name of specified insertion database;It needs to input parameter required for specified insertion table;Need the master generated after specified insertion tableKey is returned as output parameter;Finally to specify the title of this rule.If there are multiple rules, this process is repeated.
The service request of one outside enters from process inlet, is packaged and converts to parameter first, be then passed toSub-process is handled;Sub-process is also required to that parameter required for oneself is packaged and is converted, then is given to and sub-process oneOne corresponding regular group is handled;Rule group equally can be packaged and convert to parameter required for oneself, then pass againIts corresponding multiple rule is passed to be handled;Each rule can have the parameter of oneself distinctive needs, be from front linkThe concrete function in parameter and executing rule is obtained, generally can also be transmitted to next link using implementing result as return parameters.The parameter of return can be passed to regular group after rule operation in Fig. 1, then pass to sub-process, then pass to process,It finally returns to user i.e. called side.A simple service function assembling is completed to this.
It is the relevant processing logic of process in the present invention shown in Fig. 2, request from the beginning enters
201 first determine whether process identification whether be it is empty, be if it is empty then directly returned to requesting party, parameter configuration error, thisProcess terminates;202 are then jumped to if not empty.
202 obtain corresponding process configuration information according to process identification.
203 according to the relevant configuration information of process, determines whether this process is simultaneously operating, and simultaneously operating then executes 205,Asynchronous operation then executes 204.
204 new starting threads execute subsequent related content 205, and main thread is returned the result directly to called side.
205 according to it, up till now process configuration information obtained the corresponding sub-process information of this process, then executed 206.
206 obtain input parameter template list, moreover execute 207.
207 judge whether this sub-process has execution condition, and 208 are executed if having, if without 213.
208 judge whether this execution condition is circulation execution condition, if so then execute 209, if otherwise executing 210.
210 execute judgment rule, return to true or false, then execute 212.
209 execute cycling condition rule, return to the information that previous cycle needs to be implemented, then execute 211.
The information that 211 previous cycles need to be implemented, be put into this sub-process it is corresponding enter ginseng in, then execute 212.
212 determine whether this sub-process continues to execute, and continue to execute then 213, do not continue, process terminates.
213 according to the configuration information of sub-process to determine whether executed with multithreading, if so then execute 214, ifOtherwise 215 are executed.
214 starting thread pools, then execute 215.
215 execute the corresponding regular group of sub-process, then execute 216.
216 take out next pending sub-process, then execute 217.
Whether 217 sub-processes, which are carried out, finishes, and is to execute 218, otherwise executes 205.
218 assembling return parameters return to requesting party, and process terminates.
It is to execute and initially enter from a rule about the relevant processing logic of rule in the present invention shown in Fig. 3
301 obtain its corresponding list of rules according to regular group #.Start to execute first rule 302 therein.
302 obtain this corresponding parameter template of rule according to rule numbers, and execute 303.
303 carry out operation according to parameter template, with incoming parameter, obtain pending parameter, and execute 304.
304 obtain this corresponding configuration information of rule according to rule numbers, and configuration information includes rule service class and ruleIt services class and executes the configuration parameter information needed, and execute 305.
305 configuration informations and parameter information obtained according to 304 and 303, executing rule operation obtain calculated result, execute306。
306 according to 305 calculated result, be packaged into return parameters, and execute 307.
307 are returned ginseng and are combined into ginseng, enter ginseng needs so as to subsequent rule, then execute 308.
308 judge whether that rule has all been finished, if so then execute 309, if otherwise executing 302.
309 require according to the ginseng of returning of rule group, encapsulate return parameters, return up, this rule group, which executes, to be terminated.
It is to be initially entered about the relevant processing logic of data from data processing in the present invention shown in Fig. 4
401 obtain corresponding parameter template list according to the incoming ginseng number that enters, and execute 402.
402 do a incoming parameter and copy to obtain one to enter to join copy, execute 403.
403 according to 401 parameter template and 402 enter to join copy do intersection obtain it is pending enter to join list, and execute404。
404 pairs enter type defined in moduli version and are compared with the type joined in copy is entered, and execute 405.
405 pair 404 of comparison result judges, compares consistent then 406, compares inconsistent, terminates this process.
406 pairs of matchings for entering data format defined in moduli version and entering to join copy progress regular expression, execute 407.
The result of 407 pair 406 of regular expression judges, by then executing 408, not by then terminating this process.
408 judgement obtain carry out enumerating defined in moduli version conversion enter ginseng whether all inspected,Completion then executes 409, does not complete, executes 404.
409 bases, which are specified in moduli version, enters ginseng number, then obtains the enumerated list data for enumerate conversion,410 are executed again.
Number of enumerating in 410 table datas obtained according to 409 goes to obtain corresponding piece deposited in the database of this numberList value is lifted, then executes 411.
The value for entering to join copy is replaced with matched value in the corresponding enumerated list of moduli version by 411, then executes 412.
412, which judge whether that enumerated value is all replaced, finishes, if otherwise executing 409 again, if so then execute 413.
413 take out be not configured nested expression enter moduli version list, then execute 414.
The list of 414 pair of 413 taking-up operates, and configured parameter name (uses primitive name before operation 1, settingClaim or change into alias), configured parameter operator before operation 2, setting, then execute 415.
Whether the list that nested expression is not configured in 415 judgements is disposed, and processing is completed then to execute 416, if otherwise holdingRow 413.
416 are configured with the list of nested expression from the taking-up of moduli version is entered, then execute 417.
The ginseng that enters in 417 pair of 416 list carries out nested resolution process, then executes 418.
418 pair of 417 result decomposed is configured to the new ginseng of entering, then executes 419.
419, which judge whether 416 list is carried out, finishes, if otherwise executing 417 again, if so then execute 420.
The result of 420 above procedure merges the new parameter list of generation and returns away, this process terminates.
Nested expression can take out JSON document according to certain format using open source plug-in unit Jayway JsonPathContent.Such as JSON character string is as follows: { " a ": { " b ": { " c ": 2 } } }, then wanting to take out the value that key name is " c ", it is only necessary to mentionFor expression formula " $ .a.b.c ", more particulars please refer to official document, address: https: //github.com/json-path/JsonPath。
In conclusion the present invention provides can realize external clothes by way of human configuration (without writing code)Business, technique can be widely applied to each major company for having demand to software, no matter which industry can use.EspeciallyThe rapid build of back-stage management function in being suitble to, general enterprises can be made more customization and powerful to the function of client, and internalManagement function it is just more loose, and be all to need to complete the item that system originally can be done directly by adding manpower at this time,If using the present invention, so that it may which the production efficiency for improving software reduces the waste of manpower.Therefore, the present invention has very high push awayWide value.
A citing will be done below: paging query is carried out to user information according to the querying condition of setting
The interface message of this service first is as follows:
This illustrates us for according to service interface information as above, realizes by following configuration, then via the present inventionThis service interface.
There is following configuration item, is enumerated as data table information herein, it can relatively intuitive explanation.
A, required parameter information is needed to configure out:
| Id | InputGroupId | InputName | InputType | inputNameAlias | inputOrder | inputOperator |
| 119 | 51 | jobPosition | Java.lang.String | Null | Null | Null |
| 120 | 51 | pageSize | Java.lang.Integer | Null | Null | Null |
| 121 | 51 | currentPage | Java.lang.Integer | Null | Null | Null |
| jsonPath | dictionaryGroupId | inputRegex |
| Null | Null | Null |
| Null | Null | Null |
| Null | Null | Null |
The explanation of each parameter are as follows:
Id: major key number;InputGroupId: required parameter group #;InputName: parameter name;InputType: ginsengSeveral classes of types;InputNameAlias: parameter alias;InputOrder: reference order;InputOperator: parameter operator;JsonPath:json transduction pathway;DictionaryGroupId: enumerated field number;
InputRegex: parameter canonical inspection
B, it is reconfigured out return parameters information:
| Id | outputGroupId | outputName | outputType | outputOrder | outputNameAlias |
| 61 | 40 | pageData | java.lang.Object | Null | Null |
The explanation of each parameter are as follows:
Id: major key number;OutputGroupId: return parameters group #;OutputName: return parameters name;OutputType: return parameters type;OutputNameAlias: return parameters alias;OutputOrder: return parameters are suitableSequence;
C, configuration flow
| Id | inputGroupId | outputGroupId | flowName | flowIdentification | isSynch | nodeId |
| 20 | 51 | 40 | Paging query user | SERVICE_QUERY_USER_PAGE | 1 | 24 |
Each parameter interpretation are as follows:
Id: major key number;InputGroupId: required parameter group #;OutputGroupId: return parameters group #;FlowName: process name;FlowIdentification: process identification;IsSynch: whether this service is synchronous;NodeId: sub-process number;Topic: if title when MQ is triggered;
D, sub-process is configured
| Id | nodeName | inputGroupId | outputGroupId |
| 24 | Paging query | 51 | 40 |
Each parameter interpretation are as follows:
Id: major key number;NodeName: sub-process title;InputGroupId: required parameter group #;OutputGroupId: return parameters group #;
E, configuration sub-process association
| Id | nodeId | ruleGroupId | parentNodeId | operator | ruleId | threadInfo |
| 25 | 24 | 31 | Null | 0 | Null | Null |
Each parameter interpretation are as follows:
Id: major key number;NodeId: sub-process number;RuleGroupId: regular group #;ParentNodeId: fatherSub-process number;Operator: circulation or comparison condition;RuleId: circulation or comparison rule number;
ThreadInfo: multithreading running configuration information;
F, configuration rule group
| Id | RuleGroupName | InputGroupId | OutputGroupId |
| 31 | Paging query | 51 | 40 |
Each parameter interpretation are as follows:
Id: major key number;RuleGroupName: regular group name;InputGroupId: required parameter group #;OutputGroupId: return parameters group #;
G: configuration rule group is associated with rule
| Id | ruleGroupId | ruleId | ruleOrder |
| 42 | 31 | 50 | Null |
Each parameter interpretation are as follows:
Id: major key number;RuleGroupId: regular group #;RuleId: rule numbers;RuleOrder: rule executesSequentially;
H: configuration specific rules
Each parameter interpretation are as follows:
Id: major key number;RuleName: rule name;InputGroupId: required parameter group #;
OutputGroupId: return parameters group #;ServiceLink: the corresponding method base of rule;Config: this sideFaku County executes required configuration information;
This is arrived, the configuration of this interface is completed.When this service is called, so that it may which the flow chart more than carries out decomposition tuneWith completing corresponding calculation process, return to return information required for it to called side.