The dynamic approach and system of heterogeneousization business data processing logic
Technical field
The present invention relates to software design and development technical fields, more particularly, to the dynamic of heterogeneousization business data processing logic
State method and system.
Background technique
In Data Stream Processing business, the demand often faced seeks to one processing logic of customization and is injected into
Some link in data flow.There are many such scene, for example, we will in a stream some node to the advanced row of data
Certain conversions, subsequent step all rely on the result after these conversions.For another example it may be desired in a stream certain
A link determines data whether occur with some specific situations of determination, and if whether temperature is more than threshold value, engine turns
Whether speed is exceeded etc..Either conversion or judgement, requiring certain code logic could complete.Conversion determines to patrol
The unlimited diversity and unpredictability collected, cause this problem to become to be not easy to solve.
Summary of the invention
In view of this, the purpose of the present invention is to provide the dynamic approach and system of heterogeneousization business data processing logic,
The influence to current operation business can be reduced, the iteration efficiency of system is greatly improved, improves user experience.
In a first aspect, being applied to clothes the embodiment of the invention provides the dynamic approach of heterogeneousization business data processing logic
Business device, dynamic compiler are arranged on the server, which comprises
Multiple logic rules that client is sent are received, are constructed according to the multiple logic rules and presetting rule class framework
Complete Regularia;
The compiling command information that the client is sent is received, the dynamic compiler will according to the compiling command information
The complete Regularia load is reflected into object instance;
The call instruction information that the client is sent is received, according to the call instruction information from the object instance
Obtain data flow data;
The data flow data is formatted, multiple fields are obtained;
The multiple field executes the multiple logic rules.
With reference to first aspect, the embodiment of the invention provides the first possible embodiments of first aspect, wherein institute
It states and formats the data flow data, obtaining multiple fields includes:
The data flow data is dumped into member variable;
The multiple field is obtained from the member variable.
The possible embodiment of with reference to first aspect the first, the embodiment of the invention provides second of first aspect
Possible embodiment, wherein the member variable is json format.
With reference to first aspect, the embodiment of the invention provides the third possible embodiments of first aspect, wherein institute
It states dynamic compiler the complete Regularia load is reflected by object instance according to the compiling command information and include:
The complete Regularia is compiled into bytecode according to the compiling command information by the dynamic compiler;
The bytecode is loaded, and is reflected into the object instance.
With reference to first aspect, the embodiment of the invention provides the 4th kind of possible embodiments of first aspect, wherein institute
Stating logic rules includes the first logic rules and Second Rule logic, and the multiple field executes the multiple logic rules packet
It includes:
The multiple field executes first logic rules, obtains the first result information;
First result information executes the Second Rule logic, obtains the second result information.
Second aspect, the embodiment of the present invention also provide the dynamical system of heterogeneousization business data processing logic, are applied to clothes
Business device, dynamic compiler are arranged on the server, the system comprises:
Construction unit, for receiving multiple logic rules of client transmission, according to the multiple logic rules and preset
The complete Regularia of Regularia framework establishment;
Loading unit, the compiling command information sent for receiving the client, the dynamic compiler is according to
The complete Regularia load is reflected into object instance by compiling command information;
Acquiring unit, the call instruction information sent for receiving the client, according to the call instruction information from
Data flow data is obtained in the object instance;
Converting unit obtains multiple fields for formatting the data flow data;
Execution unit executes the multiple logic rules for the multiple field.
In conjunction with second aspect, the embodiment of the invention provides the first possible embodiments of second aspect, wherein institute
Stating converting unit includes:
The data flow data is dumped into member variable;
The multiple field is obtained from the member variable.
In conjunction with the first possible embodiment of second aspect, the embodiment of the invention provides second of second aspect
Possible embodiment, wherein the member variable is json format.
In conjunction with second aspect, the embodiment of the invention provides the third possible embodiments of second aspect, wherein institute
Stating loading unit includes:
The complete Regularia is compiled into bytecode according to the compiling command information by the dynamic compiler;
The dynamic compiler loads the bytecode and is reflected into the object instance.
In conjunction with second aspect, the embodiment of the invention provides the 4th kind of possible embodiments of second aspect, wherein institute
Stating logic rules includes the first logic rules and Second Rule logic, and the execution unit includes:
The multiple field executes first logic rules, obtains the first result information;
First result information executes the Second Rule logic, obtains the second result information.
The embodiment of the invention provides the dynamic approaches and system of heterogeneousization business data processing logic, comprising: is applied to
Server, dynamic compiler are arranged on the server, multiple logic rules that client is sent are received, according to multiple logic rules
Complete Regularia is constructed with presetting rule class framework;The compiling command information that client is sent is received, dynamic compiler is according to volume
It translates command information and the load of complete Regularia is reflected into object instance;The call instruction information that client is sent is received, according to tune
Data flow data is obtained from object instance with command information;Data flow data is formatted, multiple fields are obtained;It is more
A field executes multiple logic rules, can reduce the influence to current operation business, greatly improve the iteration efficiency of system,
Improve user experience.
Other features and advantages of the present invention will illustrate in the following description, also, partly become from specification
It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention are in specification, claims
And specifically noted structure is achieved and obtained in attached drawing.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate
Appended attached drawing, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art
Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below
Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor
It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is the dynamic approach flow chart for the heterogeneousization business data processing logic that the embodiment of the present invention one provides;
Fig. 2 is step S102 in the dynamic approach for the heterogeneousization business data processing logic that the embodiment of the present invention one provides
Flow chart;
Fig. 3 is the dynamic approach overall flow figure for the heterogeneousization business data processing logic that the embodiment of the present invention one provides;
Fig. 4 is step S104 in the dynamic approach for the heterogeneousization business data processing logic that the embodiment of the present invention one provides
Flow chart;
Fig. 5 is step S105 in the dynamic approach for the heterogeneousization business data processing logic that the embodiment of the present invention one provides
Flow chart;
Fig. 6 is the dynamical system schematic diagram of heterogeneousization business data processing logic provided by Embodiment 2 of the present invention.
Icon:
10- construction unit;20- loading unit;30- acquiring unit;40- converting unit;50- execution unit.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention
Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than
Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise
Under every other embodiment obtained, shall fall within the protection scope of the present invention.
To be described in detail to the embodiment of the present invention below convenient for understanding the present embodiment.
Embodiment one:
Fig. 1 is the dynamic approach flow chart for the heterogeneousization business data processing logic that the embodiment of the present invention one provides.
Referring to Fig.1, executing subject is server, and dynamic compiler is arranged on the server, method includes the following steps:
Step S101 receives multiple logic rules that client is sent, according to multiple logic rules and presetting rule class frame
Framework builds complete Regularia;
Specifically, one section of code logic is a logic rules, by user on interface definition code logic.Presetting rule
Class framework is then prefixed three kinds of methods in Regularia: pretreatment prepare method, multiple value get methods and execution
Execute method, wherein prepare method is used to obtain data flow data from current operation business, get method be used to from
Each field is extracted in the data flow data that prepare method obtains, execute method holds field contents as order
Row, to return to multiple results.According to multiple logic rules that presetting rule class framework and client are sent, so that building is complete
Regularia.
Step S102, receives the compiling command information that client is sent, and dynamic compiler will be complete according to compiling command information
Whole Regularia load is reflected into object instance;
Further, referring to Fig. 2, step S102 is further comprising the steps of:
Complete Regularia is compiled into bytecode according to compiling command information by step S201, dynamic compiler;
Step S202 loads bytecode, and is reflected into object instance.
Specifically, as shown in figure 3, the compiling command information that is sent according to client of dynamic compiler is first by complete Regularia
On-the-flier compiler is bytecode, and the bytecode after then dynamic compiler load compiles simultaneously is reflected as object instance.
Step S103 receives the call instruction information that client is sent, is obtained from object instance according to call instruction information
Take data flow data;
Specifically, the call instruction information sent according to client, the prepare of presetting rule class framework in object instance
Method obtains data flow data from current operation business.
Step S104, data flow data is formatted, and obtains multiple fields;
Further, referring to Fig. 4, step S104 is further comprising the steps of:
Data flow data is dumped to member variable by step S301;
Specifically, prepare method dumps to data flow data after obtaining data flow data in current operation business
Member variable inside class provides data for the execution of execute method in future, and member variable is json format here.
Step S302 obtains multiple fields from member variable.
Specifically, presetting rule class framework also provides the get method of different types of data in object instance, such as
GetTimestamp method, getLong method, getString method and getDouble method etc., multiple get methods are used here
To obtain multiple fields from the json object of member variable, these are can be used when interface definition logic rules in user
Get method.
Step S105, multiple fields execute multiple logic rules.
Specifically, in object instance in presetting rule class framework execute method obtained according to multiple get methods it is multiple
Field executes user in multiple logic rules of interface definition.When executing multiple logic rules, logic rules include the first rule
Then logic and Second Rule logic.Further, referring to Fig. 5, step S105 is further comprising the steps of:
Step S401, multiple fields execute the first logic rules, obtain the first result information;
Step S402, the first result information execute Second Rule logic, obtain the second result information.
Specifically, multiple logic rules include the first logic rules and Second Rule logic here, but are not limited only to first
Logic rules and Second Rule logic, are configured according to practical situations.For example, if the input of Second Rule logic according to
Rely in the output of the first logic rules, then the logic rules being relied on need to set first carry out, after the logic rules of dependence
It executes, i.e., multiple fields first carry out the first logic rules according to execute method, obtain the first result information, then the first knot
Fruit information executes Second Rule logic, obtains the second result information, here only the first logic rules and Second Rule logic, because
This, the second result information is the result information that data flow data runs multiple logic rules.
Embodiment two:
Fig. 6 is the dynamical system schematic diagram of heterogeneousization business data processing logic provided by Embodiment 2 of the present invention.
Referring to Fig. 6, it is applied to server, dynamic compiler is arranged on the server, which includes:
Construction unit 10, for receiving multiple logic rules of client transmission, according to multiple logic rules and preset rule
Then class framework constructs complete Regularia;
Loading unit 20, for receiving the compiling command information of client transmission, dynamic compiler is according to compiling instruction letter
The load of complete Regularia is reflected into object instance by breath;
Acquiring unit 30, it is real from object according to call instruction information for receiving the call instruction information of client transmission
Data flow data is obtained in example;
Converting unit 40 obtains multiple fields for formatting data flow data;
Execution unit 50 executes multiple logic rules for multiple fields.
Further, converting unit 40 includes:
Data flow data is dumped into member variable;
Multiple fields are obtained from member variable;
Wherein, member variable is json format.
Further, loading unit 20 includes:
Complete Regularia is compiled into bytecode according to compiling command information by dynamic compiler;
Dynamic compiler load bytecode is simultaneously reflected into object instance.
Further, logic rules include the first logic rules and Second Rule logic, execution unit 50 further include:
Multiple fields execute the first logic rules, obtain the first result information;
First result information executes Second Rule logic, obtains the second result information.
The embodiment of the invention provides the dynamic approaches and system of heterogeneousization business data processing logic, comprising: is applied to
Server, dynamic compiler are arranged on the server, multiple logic rules that client is sent are received, according to multiple logic rules
Complete Regularia is constructed with presetting rule class framework;The compiling command information that client is sent is received, dynamic compiler is according to volume
It translates command information and the load of complete Regularia is reflected into object instance;The call instruction information that client is sent is received, according to tune
Data flow data is obtained from object instance with command information;Data flow data is formatted, multiple fields are obtained;It is more
A field executes multiple logic rules, can reduce the influence to current operation business, greatly improve the iteration efficiency of system,
Improve user experience.
The embodiment of the present invention also provides a kind of electronic equipment, including memory, processor and storage are on a memory and can
The computer program run on a processor, processor realize heterogeneousization industry provided by the above embodiment when executing computer program
The step of dynamic approach of business data process method.
The embodiment of the present invention also provides a kind of computer readable storage medium, and meter is stored on computer readable storage medium
Calculation machine program executes the dynamic of the heterogeneousization business data processing logic of above-described embodiment when computer program is run by processor
The step of method.
Computer program product provided by the embodiment of the present invention, the computer-readable storage including storing program code
Medium, the instruction that said program code includes can be used for executing previous methods method as described in the examples, and specific implementation can be joined
See embodiment of the method, details are not described herein.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description
It with the specific work process of device, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In addition, in the description of the embodiment of the present invention unless specifically defined or limited otherwise, term " installation ", " phase
Even ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or be integrally connected;It can
To be mechanical connection, it is also possible to be electrically connected;It can be directly connected, can also can be indirectly connected through an intermediary
Connection inside two elements.For the ordinary skill in the art, above-mentioned term can be understood at this with concrete condition
Concrete meaning in invention.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product
It is stored in the executable non-volatile computer-readable storage medium of a processor.Based on this understanding, of the invention
Technical solution substantially the part of the part that contributes to existing technology or the technical solution can be with software in other words
The form of product embodies, which is stored in a storage medium, including some instructions use so that
One computer equipment (can be personal computer, server or the network equipment etc.) executes each embodiment institute of the present invention
State all or part of the steps of method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (ROM, Read-
Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can be with
Store the medium of program code.
In the description of the present invention, it should be noted that term " center ", "upper", "lower", "left", "right", "vertical",
The orientation or positional relationship of the instructions such as "horizontal", "inner", "outside" be based on the orientation or positional relationship shown in the drawings, merely to
Convenient for description the present invention and simplify description, rather than the device or element of indication or suggestion meaning must have a particular orientation,
It is constructed and operated in a specific orientation, therefore is not considered as limiting the invention.In addition, term " first ", " second ",
" third " is used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance.
Finally, it should be noted that embodiment described above, only a specific embodiment of the invention, to illustrate the present invention
Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair
It is bright to be described in detail, those skilled in the art should understand that: anyone skilled in the art
In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light
It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make
The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention
Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.