CN106250179B - The method that realization system dynamic function intercepts extension is compiled by multilingual cloud - Google Patents
The method that realization system dynamic function intercepts extension is compiled by multilingual cloud Download PDFInfo
- Publication number
- CN106250179B CN106250179B CN201610597848.6A CN201610597848A CN106250179B CN 106250179 B CN106250179 B CN 106250179B CN 201610597848 A CN201610597848 A CN 201610597848A CN 106250179 B CN106250179 B CN 106250179B
- Authority
- CN
- China
- Prior art keywords
- code
- dynamic
- intercepts
- script
- extension
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The method that realization system dynamic function intercepts extension is compiled by multilingual cloud the invention discloses a kind of, the present invention is by intercepting label, realize that service logic intercepts the compiling and execution of code, specifically: detect whether that there is extension intercepts, and determines blocking apparatus code if it exists;Corresponding example is searched from memory using blocking apparatus code, and is called using multilingual dynamic script enforcement engine and run corresponding example;Corresponding example if it does not exist, then it is compiled according to the language form of blocking apparatus code using corresponding script compiler engine, generate corresponding example, so as to be introduced directly into and run after being compiled by the compiling of multilingual cloud to blocking apparatus code in system is run, it has no effect to code before, dynamic script engine system is realized, the extension of system function dynamic interception is then realized, improves flexibility, opening, maintainability and the scalability of expanding of system function.
Description
Technical field
The present invention relates to software dynamic expansion fields, are more particularly to a kind of by multilingual cloud compiling realization system dynamic
The method that function intercepts extension.
Background technique
With the fast development of science and technology, the continuous improvement of social informatization degree, computer application has been penetrated into
The every field of society, competition and diversified customer demand between enterprise, causes enterprise application software system more and more huger
It is big and complicated.Client changes frequently the individual demand of software systems, while requiring the development cycle short, general mark in reality
The product of standardization is difficult to meet the business demand of client's complexity.System development finishes, and has met the needs of users, but works as user
When constantly proposing new requirement, original software architecture can not may be competent at the demand of newly-increased task, need to set again
Meter develops this application system, serious waste manpower and other unnecessary resources.Meet a visitor even if developing again
The application system of the customization demand at family can not guarantee that the demand of user will not change again or have new customer demand simultaneously
It proposes.So if special personalized customization is done in the continuous upgrading of software systems to client, by the quality of software, efficiency,
Management brings serious problems.More codes is added on the basis of original design simultaneously, original code can be by continuous rotten
Erosion, the architecture of system will be also increasingly difficult to safeguard, it is seen that the architecture design at initial stage is to meet the standard of a part
Customer demand is not able to satisfy all demands, if the software systems of enterprise allow this unpredictable variation to start, that is whole
The code of a software systems will not be controlled.
Below by a scene, the variability of customer requirement is illustrated:
Example: in some online recruitment system, logic originally is, is all new addition one when resume enters system
Record thus has a large amount of duplicate resumes and there are (mailbox, mobile phone are different) in systems, is unfavorable for interviewer and checks letter
It goes through;Present client A proposes new demand, and when the information automatic log-on of applicant's resume, system is needed according to applicant
Identification card number, come detect judge this applicant whether before whether there is in systems, and if so, two resumes are believed
Breath is merged and is saved again, if there is no being then added;And the demand of another client B is, when system enters resume
When, judged according to cell-phone number or mailbox, if having existed this resume in system, is no longer added;The demand of client C is, when
This resume is frequently delivered whithin a period of time to be entered system greater than predetermined number of times and meets primary condition set by position, then certainly
It moves and sends an envelope mail to interviewer, show that this applicant has strong registration hope, interviewer should pay close attention;Client D's
Demand is to need to carry out applicant's scoring according to the element in resume when resume enters system, for example 985,211 school adds
10 points, 6 grades of English plus 8 points, 4 grades of English plus 6 points etc., integrated ordered screening operation is carried out convenient for interviewer;The demand of client E
Be need to be selected according to the specific custom rule and specified conditions Automatic sieve of client qualified resume so that automatically into
Enter interview stage or superseded state, if also needing to send short message and mail arrangement interview to interviewer into the interview stage, into
Row prompting etc..It can be seen that client for the operation expanding demand numerous and complicated of system from the above case, it is different, such as
How customers as center, fast custom, which is spread, issues the individualized software system of client of being adapted to, extremely for client and enterprise
It closes important.
It in the prior art, is all in corresponding functional module using soft when adding in systems or extending new function
Part developing instrument directly adds code logic, then carries out manual recompility, packing, deployment, this method is for software
Developer's larger workload to some degree, working efficiency is low, and due to being directly to add in existing system module
Add code, error rate is higher, while may destroy the architectural configurations of original system.Although currently passing through certain technology
Factory/IOC/AOP mechanism, solves this problem in that a certain extent, can be directly injected into during system is in differentiation
New code, the architectural configurations without changing original system, but these modes are also present in various limitations and deficiency, pass through
The patented technology retrieved below is explained.
1, patent " a kind of water analysis calculating service system for supporting on-the-flier compiler of Patent No. CN 102708452A
System ", disclose following technical characteristic: water analysis algorithmic code user can voluntarily input, then by calling on-the-flier compiler
Server carries out on-the-flier compiler to text codes, generates new dynamic link library or updates already present dynamic link library, and is real
Shi Gengxin water analysis algorithms library carrys out the fixed algorithm of dynamic replacement with this, achievees the purpose that expansion system algorithm, improve flexibility
And opening.There are the deficiencies of the following aspects for the invention: be on-the-flier compiler used in the invention being first Microsoft
CodeDOM ICodeCompiler compiles mode, is utilized in .NET Framework comprising an entitled " code document object
The mechanism of model " (CodeDOM), which allows the developer for the program for writing source code at runtime, according to expression
The single model of presented code is compiled with programming language text generation compilation of source code as a result, it is substantially complete
One flight data recorder, result is success or failure after can only providing compiling, compiling;Secondly code is compiled each time
When, it can all restart another new csc.exe or vbc.exe compilation process, ICodeCompiler except current process
Compiling mode is only the packaging to csc.exe and vbc.exe, this old mode, by test, if in multiple script generations
For code simultaneously when compiling, CPU causes certain pressure, steeply rises CPU usage, in addition restart except current process it is new into
Journey removes compilation script code, has one for the stability and performance of a system, and the input and output of compiling result to itself
Fixed influence.
2, patent " the pluggable Web service dynamic call based on DotNet platform of Patent No. CN 101534324A
Method " using on-the-flier compiler generation Client Agent class, it is decided whether to call remote Web services according to configuration file, be held
Row calls the service logic method of remote Web services, the result that method executes finally is returned to software systems, this is in certain journey
The degree of coupling between caller and Web service is reduced on degree, realizing has pluggable property and dynamic call.But it is moved in the invention
State compiling is only applied the service logic for deciding whether to call remote web server with this in client and is generated and calls
The dynamic proxy that remote service is called, remote Web services service logic is fixed, if system needs to extend, it is also necessary to soft
Exploitation, manually compiling, packing, deployment under part developer's line.Secondly, the configuration first read is literary when calling remote Web services
Part, the only message of information and separate unit remote web server whether opened of remote service in this configuration file, if open
Whether configuration decision systems can call remote Web services, and remote web server information determines which platform service is system will call
The Web service of device, configuration here only has a server, rather than has multiple servers, this will can not achieve and patrol business
Volume at the same be deployed on multiple servers, realize that the load balancing of service logic is extending transversely and distributed deployment, thus one
Multi-user, high concurrent request will not be adapted to by determining degree ceiling system;The WSProxy class said in the invention again is basis
Long-range WSDL (Web Services Description Language) description information, generation Client Agent SProxy, and
This proxy class of on-the-flier compiler in memory, that on-the-flier compiler used herein equally uses is also CodeDOM ICodeCompiler
Compiling mode, shortcoming and deficiency are as described above;WebService delivery protocol used in the invention is SOAP (Simple again
Object Access Protocol Simple Object Access Protocol), its internal principle of SOAP is to carry out transmitting data by XML,
Due to XML more it is tediously long parsing it is time-consuming, it is much bigger compared to for binary file, can consume more Internet resources and compared with
More CPU and memory source, therefore a drawback is also become using XML.
3, the patent " one kind is based on bridge architecture cooperation reflection dynamic technique " of Patent No. CN 103823658A provides one kind
Cooperate reflection dynamic technique based on bridge architecture, is convenient to program dynamic expansion flexible configuration, it can be achieved that component is pluggable or even generation
The flexible expansion change of code grade.Step 6 in this invention: dynamic mapping is established in reference dynamic reflective, statement, is read from configuration file
Value and to this assignment, the class to be radiated is read in configuration file, is abstracted the base class of variation.There are 2 aspects herein not
Foot: the invention has used reflection technology first, and reflection technology is actually a kind of operation of explanation, needs inside bottom run mode
Many work: binding procedure, the comparison of metadata character string, parameter verification, type checking, safety check are done, generation is largely faced
When object etc., great burden can be caused to CPU and GC Garbage Collector, and very low in operational efficiency and performance.Secondly, dynamic
The service logic of reflection is relatively-stationary, is to belong to the file of exterior, and these files are to need software developer
Exploitation, manually dispose manually are not real pluggable heat deployment in a sense, are not carried out the flexible expansion of code level yet
Exhibition.
4, a kind of patent " multi-data source mvc model framework that elasticity is expansible " of Patent No. CN 104484182A mentions
For a kind of multi-data source mvc model framework that elasticity is expansible, solve on the interface the same view View in systems, it can be with
Flexible choice calls a variety of different data source business logics simultaneously, and user only needs to increase relevant configuration and data by extension
The problem of existing application dynamic expansion multi-data source and other related services are not easy can be realized in the mapping code of library table.
Its internal principle using be using Spring ioc mode to EB (EntityBean) layer, Service layers (Business Logic),
DAO layers (persistence object additions and deletions, which are looked into, to be changed) and PO (the persistence entity object of the data mapping of Object Relational Database
HibernateORM seamless integration control) is carried out, is realized by configuration file dynamic assembly.There is the following that can change among these
Into the ioc mode of Spring having been used in the invention first, ioc can be added by way of code and configuration, and the invention is
The extension that data source is carried out by way of a large amount of configuration files is very cumbersome, and this is to need manually to be configured,
Additional maintenance cost is caused, coupled relation only a conventional relationship type number library can only obtain data all in configuration file,
Secondly this due to using IOC mode (reflection) that performance issue can be generated, again in Service Business Logic, if necessary
Secondary filter working process is carried out to the data source of taking-up, then needs to develop under boostrap, dispose, configuration.
Comprehensive statement above is it is found that exist in the prior art following disadvantage: (1) extension is complicated: code has direct-coupling
In existing system or by reflection configuration into system, this makes entire expansion process extremely complex cumbersome, and broken reduction
There is the structure of code;(2) reuse of code is low: the code logic newly extended is intended merely to currently developed and is coupled to system
In, it reduce the reuse rates of code;(3) performance is lost: doing extend in systems by reflection or configuration mechanism, will lead to and be
The performance of system declines a rank.(4) when development cycle long low efficiency: extending or adds new demand, developer's line is needed
Under develop again, compile, test, uploading, configuring, being packaged, deployment system, this makes development cycle very long efficiency very low.(5) difficult
To safeguard: the application of system developer and technology is possible to that all iteration has been crossed many times, mutual between code in system
It calls, be mutually coupled also intricate, the people for not quite understanding system dare not act rashly.Summation function is needed to get over system
Come more, team is increasing, and linking up cost, development cost, management cost accordingly can all be multiplied, when system lacks
Fall into when, will also result in problem analysis, orientation problem, repair problem time it is longer;As the increase of size of code is also possible to lead
Cause the vicious circle of " reparation is more, and defect is more ";A small change is with regard to needing to redeploy entire application system in system.
(6) development language limitation: if application system using certain language development, then must also be when demand extends again
This language is extended, and can not attempt new programming language or frame, this is also impossible at present using a technology in reality
Platform or scheme solve all problems.(7) hardware cost is high-leveled and difficult with horizontal extension: all program codes are in the same of server
In one process, horizontal extension difficulty and situation at high cost will lead to, because functions of modules different in system is actually to clothes
The requirement of business device is different, and is had plenty of CPU intensive computer type, is needed the stronger CPU processor of performance, have plenty of needs
Memory I/O intensive type needs to carry out data buffer storage using a large amount of memories, if infrastructure server required by system pressed
Same standard goes to purchase, then hardware cost can be very high.(8) reliability is low: all functions of modules all operate in a process
In, a mistake bug in any one functions of modules, such as RAM leakage/CPU Continued, it will it is possible that do to collapse or
Slow entire process is dragged, to influence the reliability entirely applied.(9) can not distributed deployment support high concurrent: due to can not
Dll or Jar that outside relies on are carried out physical machine with existing system program to efficiently separate, with the continuous upgrading of system
And extension, huge in this way and complicated system, it to stretch and be necessary for the flexible of monoblock type, formula can not be efficiently separated and stretched, system
The core business point often operated required for middle user may only have 30%, and do now by non-core 70% same
Deployment is flexible, cannot reach the maximization intensive use of resource.(10) continuous integrating and delivery are influenced: due to the Pang of operation system
Big complicated, in addition extension upgrading many times, so constructing the primary time also can be very very long, the number of failure also can be significantly
Increase, if building process mistake, investigation problem also can be extremely difficult.In addition the subtle modification in any point made to system is all
It needs to rebuild whole system, redeploy.One system of multiple developer's joint developments, it is also necessary to other be waited to open
Hair personnel could dispose after the completion, this greatly reduces the flexibility of team and function delivery frequency;(11) it is in addition beaten in project
Very slow, system is opened and runs to be difficult to develop, test, continuous integrating difficulty, deployed environment dependence complexity, technology stack binding,
Programming language, frame, the upgrading of database and replacement are extremely difficult etc..
How these problems are coped with, to the flexibility of software systems, opening, maintainability, scalability and software
System made higher requirement the respond of market and client.How rapidly to increase, extend, upgrade current mark
Quasi- system function is that client is customized, and effectively ensures and promote software development quality and development efficiency, is had become
The significant challenge of Software Industry.
Summary of the invention
(1) technical problems to be solved
The technical problem to be solved by the present invention is to how improve the flexibility of expanding of system function, opening, maintainability
And scalability, Remote Dynamic expansion system function on the basis of not impacted to original code.
(2) technical solution
Realization system dynamic function is compiled by multilingual cloud in order to solve the above-mentioned technical problems, the present invention provides a kind of
The method for intercepting extension, the described method comprises the following steps:
S1, according to business demand, identify corresponding interception label on needing the method extended;
S2, label is intercepted for each, the service logic that addition corresponds to the system function of required extension intercepts generation
Code;Wherein the service logic intercepts the system function that code extends for realizing needs;
Compiling blocking apparatus code is added at corresponding position according to the interception label when S3, local compiling, wherein
The blocking apparatus code intercepts code for being woven into corresponding service logic, is compiled according to the blocking apparatus code by cloud
The corresponding service logic stored in the script repository interception code is compiled and is run again, wherein according to following step
Suddenly corresponding service logic is intercepted into code compilation and run:
S31, detect whether that there is extension intercepts, and if it exists, then determine and correspond to according to the identification information that current extensions intercept
Service logic intercept code;
S32, code building identification code is intercepted using the service logic that the step S31 is obtained, and according to the identification code
Search whether that there are corresponding examples from memory;
S33, if it exists corresponding example are then called using multilingual dynamic script enforcement engine and run corresponding reality
Example;Corresponding example if it does not exist, the then language form that code is intercepted according to the service logic are compiled using corresponding script
Engine is compiled, and generates corresponding example, is called later using multilingual dynamic script enforcement engine and is run corresponding reality
Example.
Preferably, it includes following information that the service logic, which intercepts code: category of language that code uses, extension intercept generation
Code, the extension intercept the purposes of code, operation time-out time, error process mode, interception mode, intercept rank, block
Cut the client acted on.
Preferably, the error process mode includes interrupting and continuing to run.
Preferably, the interception mode includes synchronous intercepting and asynchronous interception.
Preferably, generate the identification code in the step S32 the following steps are included:
Code is intercepted to the service logic and carries out virtual class packaging, and carries out uniqueness Hash, generates MD5 character string.
Preferably, it calls using multilingual dynamic script enforcement engine in the step S33 and runs corresponding example packet
Include following steps:
If runing time be more than the operation time-out time or occur it is abnormal, record running log, time-consuming situation and
Exception information;
If running without exception and being less than the operation time-out time, operation result is returned.
Preferably, the method by event is called or call automatically in the way of using multilingual dynamic script enforcement engine
Run corresponding example.
Preferably, the method also includes following steps:
S4, dynamic script counter is established for each example;
S5, example operation are primary, and corresponding dynamic script counter adds 1, and updates last allocating time;
S6, according to the value of the last allocating time and dynamic script counter, judge the institute in predetermined time period
Whether the count value for stating dynamic script counter is less than pre-determined number, if be less than the pre-determined number, by corresponding example from
It is unloaded in memory.
Preferably, the method is further comprising the steps of after step s 5:
S7, according to the last allocating time, search the example of never call within a predetermined period of time, and from memory
Unloading.
Preferably, corresponding example is unloaded from memory in the step S6 specifically includes the following steps:
Corresponding example is added into removal mark;
It is identified according to the removal and unloads corresponding example.
(3) beneficial effect
The method that realization system dynamic function intercepts extension, the present invention are compiled by multilingual cloud the present invention provides a kind of
First according to business demand, corresponding interception label is identified on needing the method extended;Label is intercepted for each later,
The service logic that addition corresponds to the system function of required extension intercepts code;Wherein the service logic intercepts code and is used for
Realize the system function for needing to extend;Compiling is added when local compiling at corresponding position according to the interception label to block
Device code is cut, wherein the blocking apparatus code intercepts code for being woven into corresponding service logic, is filled according to the interception
It sets code and the corresponding service logic stored in the script repository interception code is compiled and is transported again by cloud compiling
Row, wherein corresponding service logic is intercepted code compilation according to the following steps and is run: detect whether that there is extension intercepts, if
In the presence of then determining that corresponding service logic intercepts code according to the identification information that current extensions intercept;It is patrolled using obtained business
It collects and intercepts code building identification code, and search whether that there are corresponding examples from memory according to the identification code;It is right if it exists
The example answered then is called using multilingual dynamic script enforcement engine and runs corresponding example;Corresponding example if it does not exist,
It is then compiled, is generated corresponding using corresponding script compiler engine according to the language form that the service logic intercepts code
Example is called using multilingual dynamic script enforcement engine later and runs corresponding example.The present invention is logical according to business demand
Corresponding service logic interception code can be added by dynamic remote in real time by crossing interception label, so as to pass through in system is run
Multilingual cloud compiling intercepts service logic and is introduced directly into and runs after code is compiled, and has no effect to code before,
Dynamic script engine system is realized, the extension of system function dynamic interception is then realized, improves the spirit of expanding of system function
Activity, open, maintainable and scalability.
The present invention by setting intercept label, blocking apparatus code, service logic intercept code, multilingual cloud compiling and
Dynamic Execution is being that the functions of modules in software development is segmented using dynamic script engine system, developer can be used
Different language is write in line development, Dynamical Deployment, Dynamic Weave, the scheme of dynamic operation with reducing duplicated code, is then being
System runs when compiling, load, running when needing and is woven into the frame of original system, and development efficiency can be improved in this set frame system
Programming idea.The module of online dynamic scalable script can even give third company's exploitation in the present invention, improve row
Cooperation in the industry, achievees the purpose that mutual supplement with each other's advantages.After the completion of exploitation, script module function can also be adjusted by other programming systems
With the reusability of software can be improved.Therefore, it is proposed by the present invention by intercept label realize dynamic scalable structure for
Software architecture development also has extensive Practical significance.
Traditional software development methodology increasingly shows its intrinsic limitation, and requires to change its row at runtime
To support dynamic expansion and upgrading.Different, the energy of the present invention that integrates all functions from a program of traditional software architecture
It is enough that the function of largely extending is placed in outer remote server, due to the convenience and flexibility of this method, can pass through
It is inserted into dynamic script and changes external dynamic script to realize the expansion of software function, improve, this is also that the present invention is logical
It crosses where intercepting the advantage that label realizes the exploitation of dynamic script engine architecture
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is the flow chart that addition intercepts label in the present invention;
Fig. 2 is the flow chart for adding service logic in the present invention and intercepting code;
Fig. 3 is the flow chart of compilation run in the present invention;
Fig. 4 is the structural schematic diagram of script repository in the present invention;
Fig. 5 is to compile to realize that the device of system function dynamic interception extension replacement is illustrated by multilingual cloud in the present invention
Figure;
Fig. 6 is multilingual on-the-flier compiler/execution entire block diagram in the present invention;
Fig. 7 is operation system function local mode of extension structure chart in the present invention;
Fig. 8 is operation system function Remote Expansion model structure chart in the present invention;
Fig. 9 is interception label point of addition schematic diagram in the present invention;
Figure 10 A is the structural schematic diagram of legacy system;
Figure 10 B is expansible system structure diagram in the present invention;
Figure 11 is multilingual dynamic script code listing schematic diagram in the present invention;
Figure 12 is that the service logic added in the present invention intercepts the interface schematic diagram of code Rest;
Figure 13 is the interface schematic diagram added service logic in the present invention and intercept code;
Figure 14 is the interface schematic diagram added service logic in the present invention and intercept the data source code interface of code.
Specific embodiment
Present invention is further described in detail with reference to the accompanying drawings and examples.Following embodiment is for illustrating this hair
It is bright, but cannot be used to limit the scope of the invention.
A method of realization system dynamic function is compiled by multilingual cloud and intercepts extension, the method includes following steps
It is rapid:
S1, according to business demand, identify corresponding interception label on needing the method extended;
S2, label is intercepted for each, the service logic that addition corresponds to the system function of required extension intercepts generation
Code;Wherein the service logic intercepts the system function that code extends for realizing needs;
Compiling blocking apparatus code is added at corresponding position according to the interception label when S3, local compiling, wherein
The blocking apparatus code intercepts code for being woven into corresponding service logic, is compiled according to the blocking apparatus code by cloud
The corresponding service logic stored in the script repository interception code is compiled and is run again, wherein according to following step
Suddenly corresponding service logic is intercepted into code compilation and run:
S31, detect whether that there is extension intercepts, and if it exists, then determine and correspond to according to the identification information that current extensions intercept
Service logic intercept code;
S32, code building identification code is intercepted using the service logic that the step S31 is obtained, and according to the identification code
Search whether that there are corresponding examples from memory;
S33, if it exists corresponding example are then called using multilingual dynamic script enforcement engine and run corresponding reality
Example;It corresponding example or has occurred and that variation if it does not exist, then reads the corresponding service logic from the script repository
Code is intercepted, and the script compiler engine that the service logic intercepts the corresponding language form of code loading is compiled, is generated
Corresponding example is called using multilingual dynamic script enforcement engine later and runs corresponding example.
The present invention adds by intercepting label according to business demand and corresponding service logic can be added to intercept by dynamic remote in real time
Code is introduced directly into so as to compile to intercept after code is compiled service logic by multilingual cloud in system is run
And run, it has no effect to code before, realizes dynamic script engine system, then realize system function dynamic interception
Extension, improves flexibility, opening, maintainability and the scalability of expanding of system function.
Further, it includes following information that the service logic, which intercepts code: category of language that code uses, extension intercept
Code, the extension intercept the purposes of code, operation time-out time, error process mode, interception mode, intercept rank,
Interception function in client.The error process mode includes interrupting and continuing to run.The interception mode includes synchronizing
It intercepts and asynchronous interception.
Further, generate the identification code in the step S32 the following steps are included:
Code is intercepted to the service logic and carries out virtual class packaging, and carries out uniqueness Hash, generates MD5 character string.
Being called in the step S33 using multilingual dynamic script enforcement engine and running corresponding example includes following step
It is rapid:
If runing time be more than the operation time-out time or occur it is abnormal, record running log, time-consuming situation and
Exception information;
If running without exception and being less than the operation time-out time, operation result is returned.
The above method by event call or automatically call in the way of using multilingual dynamic script enforcement engine operation pair
The example answered.
Further, the method also includes following steps:
S4, dynamic script counter is established for each example;
S5, example operation are primary, and corresponding dynamic script counter adds 1, and updates last allocating time;
S6, according to the value of the last allocating time and dynamic script counter, judge the institute in predetermined time period
Whether the count value for stating dynamic script counter is less than pre-determined number, if be less than the pre-determined number, by corresponding example from
It is unloaded in memory.
Further, the method is further comprising the steps of after step s 5:
S7, according to the last allocating time, search the example of never call within a predetermined period of time, and from memory
Unloading.
Further, corresponding example is unloaded from memory in the step S6 specifically includes the following steps:
Corresponding example is added into removal mark;
It is identified according to the removal and unloads corresponding example.
The waste of resource can be reduced by unloading corresponding example, improves the speed of service.
The present invention by setting intercept label, blocking apparatus code, service logic intercept code, multilingual cloud compiling and
Dynamic Execution is being that the functions of modules in software development is segmented using dynamic script engine system, developer can be used
Different language is write in line development, Dynamical Deployment, Dynamic Weave, the scheme of dynamic operation with reducing duplicated code, is then being
System runs when compiling, load, running when needing and is woven into the frame of original system, and development efficiency can be improved in this set frame system
Programming idea.The module of online dynamic scalable script can even give third company's exploitation in the present invention, improve row
Cooperation in the industry, achievees the purpose that mutual supplement with each other's advantages.After the completion of exploitation, script module function can also be adjusted by other programming systems
With the reusability of software can be improved.Therefore, it is proposed by the present invention by intercept label realize dynamic scalable structure for
Software architecture development also has extensive Practical significance.
The above method and other steps are described in detail below by a specific embodiment.
As shown in Figure 1, this implementation addition intercept label method the following steps are included:
(1) it according to the requirement of the needs of operation system or customer personalized customized demand, determines in system function
Attributeintercept is stamped by IDE in the method for required extension and intercepts label, wherein these are intercepted on label
Information mainly has: whether generating blocking apparatus code, interception is enumerated: intercepting before method, intercepts after method, intercepts before and after method.
Intercept the position of label, the place module, function of determining method code, method name space, category information, to needing to extend
The general core business intercepted reserves corresponding interface.
As shown in figure 9, intercepting position can be selected to intercept before specially method according to the actual situation, be intercepted after method or side
It is intercepted before and after method.
It, can also visually will be with by way of tool above is by beating the mode for intercepting label to add intercept point
Upper interception label information, which is added to, to be intercepted in configuration file.The information of addition in addition to there is information above, there are also system item title,
Chinese and English mark, module name Chinese and English mark, function name Chinese and English mark, method name Chinese and English mark.
(2) by the above blocking apparatus information preservation into XML information.
(3) it by IDE plug-in unit, is read before compiling project and intercepts label information or XML file information.
(4) by IDE plug-in unit, judge whether there is interception label information in each class method of project or in XML information.
(5) pass through IDE plug-in unit, the static weaving before and after the method for having mark interception label information, i.e. addition blocking apparatus
Code forms a kind of mixed code.
When using IDE compiling system project, by the IDE plug-in unit of customized exploitation, it will be intercepted according to information above
Label information intercepts configuration file, automatically by the corresponding position of blocking apparatus code insertion.It should be noted this
Attribute intercepts label, is only intended to judge the blocking apparatus code of addition method name position in class before compiling, if
Before needing to add, intercepting or it is rear, using synchronous or asynchronous, with reflection reflection and irrelevant.
(6) each each method of class in detection project again, gos to step four.
The method of above-described embodiment utilizes dynamic script IDE card module, dynamic script code blocking module and dynamic
Scripted code requests communication module to be completed, as shown in figure 5, will intercept the setting information of label after the setting of completion interception label
It notifies dynamic script code blocking module server end, is recorded.
After addition intercepts label and service logic interception code addition, continues service logic and intercept code, compile
Translate the step of operation can be achieved with the extension of system function dynamic interception, intercept code addition, compilation run to service logic below
It is described in detail.
Service logic intercepts code addition and specifically comprises the following steps:
As shown in Fig. 2, including the following steps:
(1) according to operation system functions of modules point Xml file, addition/editor needs to extend the service logic intercepted online
Scripted code, i.e. service logic intercept code.The information of addition has: extension intercepts language;Extension intercepts code;Extension intercepts generation
The effect description of code;Extend interception mode: synchronous intercepting, asynchronous interception;It intercepts code and executes time-out time;Code is intercepted to execute
Error handling method: it interrupts, continue to run;Intercept rank: system-level interception (and acting on all clients in system), client level
It intercepts (acting only on the client using system);It is (a required for each client that this extension intercepts the client Id that code is acted on
Property service logic is different).
(2) service logic scripted code is subjected to virtual class packaging, and carries out uniqueness Hash, generates 36 MD5
Character string, being capable of unique identification this script.Uniqueness Hash information in addition to there is service logic scripted code, there are also system banner,
Customer ID (systems buying person), class method manes mark, language used.
(3) judge whether have existed in NoSql script storage repository (Redis) according to this uniqueness cryptographic Hash.
(4) if be not present in NoSql script storage repository, step (6) is jumped to
(5) if existed in NoSql script storage repository, (eight) are jumped to.
(6) if not compiling syntax error, service logic scripted code is saved in NoSql script storage repository.
(7) if there is compiling syntax error, then step (8) is jumped to
(8) script adder is based on context prompted, presence is already present in NoSql script storage repository or compiles
Syntax error or addition are edited successfully, and step (1) is jumped to, and are operated again newly, for customized extension interception service logic
Behavior allows to be inserted into unlimited and intercepts, intercepts the sequence executed according to the suitable of configuration before and after functions of modules method Method
Sequence successively executes, can also extension after addition at any time intercept execution sequence is adjusted in list at any time or it open or
Deactivate or edit again replacement.
Such as the service logic of addition intercepts code for realizing Rest service, addition interface is as shown in figure 12, can be by step
It is rapid simple and efficient.The interface for adding service logic interception code is as shown in figure 13, and addition service logic intercepts the data source of code
Code interface is as shown in figure 14.
As shown in Figure 10 A, 10B, compared to the implementation of the fixation of traditional application program system, i.e., each function mould
The module that interface provided by block and realization define before being all, cannot be in the operational process of program according to some conditions
Judge to dynamically change the behavior of program or extension and add new function.The present invention can system the time of running according to fortune
Row environmental context is to determine whether need change or the behavior of extender.And in the program of dynamic script engine architecture
In, the division between dynamic script engine management program and dynamic script is very clearly dynamic script engine management program
Dynamic script functional template can be completely independent exploitation or third company exploitation, this is conducive in large-scale software development mistake
Cheng Zhong carry out exploitation can parallel, improve the efficiency and quality of exploitation.And in exploitation and debugging process, when part is dynamic
When problem occurs for state script module, due to relatively independent between each dynamic script card module, it is not interfered with
His module, is beneficial to the development and progress of Experience of Software Testing Work, convenient for solution of finding the problem during test and debugging
Problem.In addition, the modification to partial dynamic script, does not interfere with other dynamic scripts, avoids and draw because of righting a wrong
Out the case where new problem, and system can dynamically replace component at run time, according to the variation of running environment or certain
Condition and cause new behavior, thus dynamically improve software systems adaptivity.
It is to utilize dynamic script adding module and scripted code spreading code processing mould that service logic, which intercepts code addition,
Block is completed, as shown in figure 5, satisfactory code is stored into dynamic script code storage by dynamic script code storage module.
Interception label and service logic, which intercept after code adds, can form multilingual dynamic script code listing, such as scheme
Shown in 11.
It should be noted that blocking apparatus code and service logic intercept code in the presence of difference substantially, service logic
Intercept the function that extend for realizing system of code, can real-time perfoming change, carry out cloud by remote server and compile to realize
Operation;And blocking apparatus code is a shell, only one section of weaving program, is specifically directed to and needs Remote Expansion
In method, local compiling is carried out, the logical code really write, i.e. service logic intercept code and be not included in this interception dress
It sets inside code.Such as blocking apparatus code here is such as: RunDynamicScript (" SendSms ", " 13011199191 ",
" it is short message that you, which get well this, ");But the actual functional capability code (i.e. service logic interception code) for sending short message is in remote server.
Compilation run specifically comprises the following steps, as shown in Figure 3:
1) calling service functions of modules method, system extend interception parameter from high speed according to operation system functions of modules point
Extension is judged whether there is in caching Redis to intercept and (only take System level business logical extension and ought be up till now for initiate mode
The individual business logical extension of client).If not enabled state, operation system functions of modules point calls extended method, passes
Enter contextual information to remotely, an extension interception parameter for kind of transmitting mainly has: service logic scripted code mark, system mark
Know, customer ID (systems buying person), the contextual informations such as class method manes mark and method parameter.
If 2) detection has extension and intercepts, by system banner, customer ID (systems buying person), class method manes mark etc.
Information transmitting reads extension from script NoSql storage repository according to these marks and intercepts the information such as scripted code, and does script generation
Code uniqueness Hash.These information include: that extension intercepts language;Extension intercepts code;Extend interception mode: synchronous intercepting, different
Step intercepts;It intercepts code and executes time-out time;It intercepts code error process mode: interrupting, continues to run;Intercept rank:
System-level interception, client level intercept;
3) scripted code uniqueness Hash is intercepted according to extension, whether compiled the scripted code from detection memory be real
Example (there is no compiled examples, then have two may, first, operation for the first time, only compile it is primary, second, extension intercept script
Code changing, needs to be replaced).Dynamic script is loaded into frame system and creates the principle that example is abided by:
It is loaded into again when operation, is not needed or need to replace just to unload script module, accounting for for memory can be reduced in this way
With.
If 4) extend in memory there are this and intercept scripted code example, 6 are jumped.
5), if there is no this extensions to intercept scripted code example in memory, jumps 11.
6) it is read from memory and positions compiled memory instance.
7) dynamic script enforcement engine is identified according to class method manes and the contexts such as method parameter, used language are believed
Breath runs simultaneously specified function method (if it is asynchronous operation, then by multilingual dynamic script enforcement engine driving running example
Handled and run by other thread queues on backstage), delivery protocol uses thrift.
8) if operation exception occurred or more than the specified time, 9 are jumped to.
9) system asynchronous record running log & performance, time-consuming situation, exception information return.
10) normal operating results return, and jump to 12.
11) counter is added 1 by dynamic script example, and updates last allocating time.
12) system is detected whether to have extension again or be intercepted, and jumps to 1.Multiple extensions intercept the execution of scripted code
As a result the last one is directly returned, and before and intermediate implementing result can be added to what system especially provided
The current execution thread slot data (ApplicationContextDataSlot) of ApplicationContext, can be in process
Or long-range transmitting middle back and forth obtains.
Above-mentioned implementation procedure is extended suitable for teleaction service, while being suitable for local service and being extended, as shown in Figure 7,8, by
Multilingual dynamic script code compilation engine device and enforcement engine device are completed compiling and are executed, and wherein running example is stored in
In memory, operates in script and exist in script warehouse.Blocking apparatus is extended for realizing intercepting label and intercepting code
Addition.
Wherein generate extension intercept scripted code example the following steps are included:
(1) extension is read from NoSql script storage repository and intercept scripted code, wherein the construction in script warehouse such as Fig. 4 institute
Show.
(2) extension is intercepted into scripted code and is loaded into multilingual dynamic script compiler engine.Different language, is loaded onto not
It is compiled in same compiler engine.
(3) load extension intercepts external relating module and resource required for language and is compiled.Complicated service logic,
Usual one section of scripted code is impossible, the common compiling of the resources such as external dll or jar that need to rely on participation.
(4) the memory byte after compiling is placed in memory and instantiated and do corresponding initialization operation.
Above-mentioned compilation run method by dynamic script code blocking module server end, dynamic language management engine module with
And the operation calling module cooperation of dynamic script example is completed, as shown in figure 5, operation time-out time is by the extremely overtime mould of dynamic script
Block performs corresponding processing.
To the calling of dynamic script example, there are two types of modes: event is called and automatic is called.Event calling refers to certain spy
Fixed event message is triggered, and if the mouse of user is when clicking some function point, this is operated the method etc. called below
Extension intercept information passes to system framework, and corresponding dynamic script instance processes operation is called in system judgement.It is automatic to call
Be then system can according to the needs of system itself or the needs of user, when reaching some time point or when some condition or
By certain time interval (per second/minute/hour/week/moon), system framework automatic trigger intercepts scripted code to dynamic expansion
Example is called or automatically in running background.The calling process that system framework intercepts scripted code example to dynamic expansion is:
Dynamic script example is first carried out, then judges whether there is next extension intercept point, if there is extension point in extension again
Or have parallel other extension points, then it continues to execute down, these extension intercept points are formed one and have an opportunity to expand in this way
Chain is opened up, to extend different function required for completion system and client.
The personalized customization service logic of client there may come a time when it is more complicated, utilize extension intercept scripted code service logic
Unloading mechanism, memory source occupancy can be greatly reduced to a certain extent, specific unloading mechanism includes the following steps:
1) counter and last allocating time are set for each dynamic script example.
2) it calls a dynamic script example that counter is added 1, and updates last allocating time.
3) according to timing detection counter and last allocating time within the specified period is configured, specified calling time will be less than
The dynamic script example addition removal mark of several and big never call always at fixed time.
4) system by the dynamic script example for the mark for having removal the dynamic offloading from memory, wherein this step is by dynamic foot
This example Unload module or dynamic script example replacement module are completed, as shown in Figure 5.
As shown in fig. 6, operation system of the invention carries out the definition of operation expanding point, Zhi Hou by intercepting the setting of label
Corresponding extension point addition service logic intercepts code, and stores into script warehouse.At runtime, by multilingual script compiling/
Enforcement engine is from script warehouse Download Script and controls compiling and fortune that relating module outside associated language carries out multilingual code
Row, the online extension of finishing service system function.
What dynamic script engine system represented is the relationship of a transverse direction, if " system " is a hollow cylinder
Body, wherein what is encapsulated is attribute and the behavior of object;So dynamic script engine, just seemingly one sharp sword, by these open circles
Cylinder is splitted, to obtain its internal message.Then the section that it again dexterously splits these restores to the original state.This characteristic mentions
High development efficiency, makes to influence localization caused by variation, code develops to modularization direction, and then reduces coupling, reaches soft
Part exploitation maintenance summary, the target that software iteration simplifies.
Compared with prior art, technical solution of the present invention has the advantage that (1) comes into force immediately: due to being to burst at the seams out
Hair, compiled online directly call so can be immediately generated service after exploitation compiling for application system immediately, all not need out
Hair personnel recompilate, and heat deployment is without restarting system;(2) enhance code maintainability: code line development, on-line debugging,
On-line operation can be repaired online if encountered problems, and quickly upgrading is extended or replaced, enables or deactivates, and realizing can dynamically insert
It pulls out.(3) complexity for reducing business, forces classifying rationally system boundary, rationally designs domain model, makes the period of iteration more
It is short, it can be with multi version, gray scale upgrading, service degradation, service distributed tracking etc..(4) reuse of code is high: dynamic script engine
The realization of each aspect is independent module, is loose couplings between module.The realization of loose couplings is generally meant that more preferably
Code reusability, its shifting value can be called directly into other systems, to reduce the development cost and difficulty of software,
Anywhere primary development can call (long-range/local).(5) performance is high: based on context dynamic script frame calls needs
It wants, is immediately compiled script, the example after compiling is placed in memory, is facilitated just as direct reference object and high
Effect, and have synchronous, asynchronous (the non-obstruction of queue), a variety of calling processing modes of timing.(6) multilingual is supported: being for application
System adds new function if necessary to extension, can not only use existing language development, can also be developed with other Languages,
And it cross-platform can run.(7) be easily managed: each developer can individually develop, integrate, testing, disposing, in completion
Line process effectively reduces O&M cost and management cost, improves development efficiency.(8) technological innovation: being easy to attempt technological innovation,
Even each Function Extension point can be write using different programming languages.(9) stability enhances: system stability enhancing,
The failure individually serviced will not influence other services, can realize service degradation to a certain degree.(10) it is easy to develop: each dynamic
Script extension focus is all handled using minimum coupling, and the module in system further refined, reduce module it
Between the degree of coupling, different experts and team are responsible for developing different modules, are independent of each other to each other.Realize quick agile development.
(11) it should be readily appreciated that in code set.Nonexpondable public code can will be needed to focus on one using dynamic script engine technique
Place realizes that the modification range of such code can be obtained by stringent control, reduces influence of the code revision to system stability,
The redundancy and the degree of coupling of code are reduced, enhancing is readable, improves software quality, solves that Object-Oriented Programming is cross-module to be caused
Code confusion and code the dispersion.(12) system is easy extension.It is easy to be added newly by establishing new dynamic script
Function is come logic rules of activating business.When new functions of modules is added into system, existing dynamic script it is automatic it is crosscutting into
Come, system is made to be easy to extend;It can be under the premise of need not recompilate original system on demand to system function after system publication
Expanded, can thus develop the more dynamic scripts of extension, the customer personalized changes in demand of quick response.(13) it is distributed
Formula: the service logic dynamically extended online can be deployed on multiple servers by realization simultaneously, realize the load of service logic
Balanced extending transversely and distributed deployment, to adapt to multi-user, high concurrent request.
The present invention use a new generation, Microsoft compiling system (Roslyn), this is a more open compiler, with
Different toward opaque compilation process, developer can access and analyze compiling data in compilation process and such as parse code, language
Justice analysis, the present invention encapsulate this and are extended again, carry out parsing compiling source code file by compiler, are dynamically to compile
Cheng Yuyan increases the operations such as function, the movement of customized compilation facility, after extension and is allowed to more convenient easy-to-use.It is adopted by comparison
Roslyn is then from more setting up on the basis of the Managed Code of bottom, and when compiling multiple scripts at the same time, CPU is occupied
Rate can be relatively less, and compilation process is more stable, and efficiently performance is higher, and can do more controls in compilation process and expand
Exhibition operation.
The present invention can be realized more efficiently by way of the dynamically online code compilation code of addition immediately, specific square
Case is the movement Action that can only use Controller, according to the data of transmittance process on view in this Action
Source key parameter goes Dynamic trigger to execute the scripted code of various different relational database/non-relational NoSql data sources, obtains
It fetches according to and can be processed with secondary filter, view presentation then will be returned in final data assignment to entity B ean.
The present invention provides a kind of completely new, more efficiently, immediately, efficiently online programming compilings, dynamic expansion
The pluggable square law device of intercepting system function, when in system some function need to activate business on the original basis logic,
It triggers new movement or newly increases when extending new function, can be with online programming, Just-In-Time, dynamic expansion system function, this
Kind Function Extension and interception not only can be system level, are also possible to levels of clients extension and intercept, are in addition not necessarily to weight under line
Upload newly developed, realizes the quick dynamic expansion and effective use of system function and resource, and is allowed to interconnect, mutually prop up
It supports, cooperate, to provide value for client, in addition the present invention can be with the failure in on-line amending software, debugging, survey
Examination, quickly comes into force, and quickly applies, brings great flexibility, scalability and maintainability to original system.
Dynamic script engine technique in the present invention is each demand (logic relevant or unrelated to business) client
It is mapped as one section of dynamic script code, Mobile state extension is clicked through to the extension in system, in first call, compiler turns over it
It is translated into executable code and is placed in local/remote (Remote Dynamic script micro services) memory that (this section of code can be with common
Programming language C#, VB.NET, JAVA, Python etc. write), solve the problems, such as to couple in code set with this, improve software weight
With property, the problem of reducing the code complexity and duplicated code of nucleus module, and then reduce the development cost and cost of project;It answers
With the software development methodology of dynamic script, can also make system development phase each module function definitely, functional template
Between coupling it is more loose, the system of exploitation has more scalability, maintainability.Online programming Just-In-Time engine is constructed,
The function of increasing original system can dynamically be extended.When finding that current system is not able to satisfy current demand, it is only necessary to
Line increases a corresponding dynamic script, in the case where not stopping existing system operation, carries out function expansion online to existing module
Exhibition or supplement, and do not have to again online lower exploitation, constructing whole system again redeploys, to realize that quick business expands
Expansion hair, meets customer personalized customized demand immediately.
Extension when dynamic script engine system runs software provides good platform, service dynamic script logic
Instruction set common languages (C#/VB.NET/JAVA/Python), CompilerTools can be supported to can be generated by frame low
The object identification code of grade instruction, whole system are disposably woven into bytecode when running for the first time, and the code being woven into dynamically is compiled
It is translated into efficient source code, and is placed among memory, the execution speed of system is substantially increased.
Dynamic script engine system segments the functions of modules in software development, makes developer that different language can be used and exists
Line development, Dynamical Deployment, Dynamic Weave, the scheme of dynamic operation are write with reducing duplicated code, are then run and are needed in system
When compiling, load, running and be woven into the frame of original system, the programming that development efficiency can be improved in this set frame system is thought
Think.Online dynamic scalable script module can even give third company's exploitation, improve the cooperation in industry, reach advantage
Complementary purpose.After the completion of exploitation, script module function can also be called by other programming systems, can improve weighing for software
The property used.Therefore, dynamic scalable structure proposed by the present invention, which develops software architecture, also has extensive Practical significance.
In terms of architecture, traditional software architecture is unfavorable for large-scale clustering exploitation, deployment, to the modern times
The development of software industry causes great limitation.Using the online programming Just-In-Time engine architecture of dynamic scalable,
It can make each functional module that there is bigger independence, improve the testability and maintainability of software.With it is traditional soft
Part architecture is compared, and in dynamic scalable structure, main program is completed mutually coordinated between each dynamic scalable module
Work, and be between the module of each new extension it is relatively independent, this keeps the structure of calling program simple, each section can completely solely
Vertical exploitation, independent deployment, independent operating, is conducive to concurrency and efficiency that exploitation is improved during large-scale software development.
The function of largely extending is placed in outer remote server by dynamic script engine architecture, due to the convenience of this method
And flexibility, the expansion of software function can be realized by insertion dynamic script and change external dynamic script, improve and mention
Height, this is also the advantage place of dynamic script engine architecture development approach.
Invention provides a kind of method for quickling increase expansion system function using dynamic script for developer, it allows certainly
It defines the relationship of program code execution sequence and executes logic, each dynamic scalable script can independent online programming tune
Examination, upgrade maintenance, configuration can according to need on-the-flier compiler, installation, loading, operation, stopping, enabling, deactivating, unloading, neither
The work of its existing functional module is influenced, and there is great flexibility.
The invention is not limited to this kind of language used in application software, may be implemented .Net, VB.NET, Java,
Python compiled online service, does not need as traditional approach, using exploitation software Visual Studio or Eclipse in electricity
Brain is locally developed, but direct-on-line is developed, and online on-the-flier compiler realizes compiling i.e. service and by spare interface dynamic
Current system is cut, realizes the Quick Extended of original function.
The invention is not limited to the dynamic feet of the system-level and client level of the standard module functional method to original system
This extension is possibly even user class, can also be detached from that the long-range RPC service of dynamic script is provided separately is straight for the system of needs
Calling is connect, online Restful service also can be generated, called directly for front and back end developer (system-level to refer to suitable for all
All users of client, client level refer to all users for being only applicable to existing customer, and user class refers to individual or part in client level
Designated user).
The invention is not limited to doing local dynamic expansion on the existing functional method of operation system in standard, if you
Operation system be the forming types based on SOA/ESB/MicroService, such dynamic expansion can also be melted with directly transplanting
It closes teleaction service interface or is added to the place that you need to extend, between different dynamic expansions, can call mutually, it can also
To call external other interfaces to be allowed to more flexible changeable to construct compound dynamic assembly.
The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;Although referring to aforementioned each reality
Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each
Technical solution documented by embodiment is modified, or equivalent substitution of some or all of the technical features;And
These are modified or replaceed, the range for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution,
It should all cover within the scope of the claims and the description of the invention.
Claims (10)
1. a kind of compile the method that realization system dynamic function intercepts extension by multilingual cloud, which is characterized in that the method
The following steps are included:
S1, according to business demand, identify corresponding interception label on needing the method extended;
S2, label is intercepted for each, the service logic that addition corresponds to the system function of required extension intercepts code;Its
Described in service logic intercept code for realizing the system function that extends of needs;
Blocking apparatus code is added at corresponding position according to the interception label when S3, local compiling, wherein the interception
Device code intercepts code for being woven into corresponding service logic, is compiled by cloud again by script according to the blocking apparatus code
The corresponding service logic stored in repository intercepts code and is compiled and runs, wherein according to the following steps by corresponding industry
Business logic intercepts code compilation and runs:
S31, detect whether that there is extension intercepts, and if it exists, corresponding industry is then determined according to the identification information that current extensions intercept
Logic of being engaged in intercepts code;
S32, the service logic obtained using the step S31 intercept code building identification code, and according to the identification code from interior
Search whether that there are corresponding examples in depositing;
S33, if it exists corresponding example are then called using multilingual dynamic script enforcement engine and run corresponding example;If
It there is no corresponding example or has occurred and that variation, then reads the corresponding service logic from the script repository and intercept generation
Code, and the script compiler engine that the service logic intercepts the corresponding language form of code loading is compiled, it generates corresponding
Example is called using multilingual dynamic script enforcement engine later and runs corresponding example;
Wherein, the information intercepted on label includes: whether to generate blocking apparatus code, and interception is enumerated: intercepting before method, side
It intercepts after method, intercepted before and after method, intercept the position of label, place module, function, the method name of determining method code
Space and category information.
2. the method according to claim 1, wherein it includes following information: generation that the service logic, which intercepts code,
Code use category of language, extension intercept code, it is described extension intercept code purposes, operation time-out time, execute mistake at
Reason mode, interception mode, intercept rank, interception function in client.
3. according to the method described in claim 2, it is characterized in that, the error process mode includes interrupting and after reforwarding
Row.
4. according to the method described in claim 2, it is characterized in that, the interception mode includes synchronous intercepting and asynchronous interception.
5. the method according to claim 1, wherein it includes following for generating the identification code in the step S32
Step:
Code is intercepted to the service logic and carries out virtual class packaging, and carries out uniqueness Hash, generates MD5 character string.
6. according to the method described in claim 2, it is characterized in that, being executed in the step S33 using multilingual dynamic script
Engine calling and run corresponding example the following steps are included:
If runing time is more than the operation time-out time or exception occurs, running log, time-consuming situation and exception are recorded
Information;
If running without exception and being less than the operation time-out time, operation result is returned.
7. the method according to claim 1, wherein the method by event call or automatically call in the way of
Corresponding example is run using multilingual dynamic script enforcement engine.
8. the method according to claim 1, wherein the method also includes following steps:
S4, dynamic script counter is established for each example;
S5, example operation are primary, and corresponding dynamic script counter adds 1, and updates last allocating time;
S6, according to the value of the last allocating time and dynamic script counter, judge described dynamic in predetermined time period
Whether the count value of state script counter is less than pre-determined number, if being less than the pre-determined number, by corresponding example from memory
Middle unloading.
9. according to the method described in claim 8, it is characterized in that, the method is further comprising the steps of after step s 5:
S7, according to the last allocating time, search the example of never call within a predetermined period of time, and unload from memory
It carries.
10. according to the method described in claim 8, it is characterized in that, corresponding example is unloaded from memory in the step S6
Carry specifically includes the following steps:
Corresponding example is added into removal mark;
It is identified according to the removal and unloads corresponding example.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610597848.6A CN106250179B (en) | 2016-07-26 | 2016-07-26 | The method that realization system dynamic function intercepts extension is compiled by multilingual cloud |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610597848.6A CN106250179B (en) | 2016-07-26 | 2016-07-26 | The method that realization system dynamic function intercepts extension is compiled by multilingual cloud |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106250179A CN106250179A (en) | 2016-12-21 |
CN106250179B true CN106250179B (en) | 2019-10-25 |
Family
ID=57603739
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610597848.6A Active CN106250179B (en) | 2016-07-26 | 2016-07-26 | The method that realization system dynamic function intercepts extension is compiled by multilingual cloud |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106250179B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108667919B (en) * | 2018-04-25 | 2021-06-15 | 金蝶软件(中国)有限公司 | Data processing method, data processing device, computer equipment and storage medium |
US11106439B2 (en) * | 2018-05-09 | 2021-08-31 | Nippon Telegraph And Telephone Corporation | Offload server and offload program |
CN108804113B (en) * | 2018-06-07 | 2022-03-22 | 东软集团股份有限公司 | Method, device and storage medium for deploying microservice application and electronic equipment |
CN109240662B (en) * | 2018-08-09 | 2022-01-25 | 赛尔网络有限公司 | Software development method based on cloud platform, equipment and medium |
CN109491689A (en) * | 2018-11-20 | 2019-03-19 | 中国建设银行股份有限公司 | Client process method, apparatus and system |
CN112506625B (en) * | 2020-11-16 | 2024-03-12 | 国家卫星气象中心(国家空间天气监测预警中心) | Automatic start-stop control method for business |
CN112363857B (en) * | 2021-01-12 | 2021-04-02 | 恒生电子股份有限公司 | Application system, synchronization method, storage medium and device of micro front-end architecture |
CN113656291B (en) * | 2021-08-04 | 2023-04-28 | 成都中科合迅科技有限公司 | Dynamic calling method for software script engine |
CN116414475A (en) * | 2021-12-29 | 2023-07-11 | 上海甄云信息科技有限公司 | Method for managing and executing runtime script suitable for micro-service application |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1949185A (en) * | 2005-10-13 | 2007-04-18 | 同济大学 | Parallel adjusting and performance analyzing method of supporting multi-language multi-platform under isomerized environment |
CN102004648A (en) * | 2010-12-27 | 2011-04-06 | 用友软件股份有限公司 | Program customization method and device |
-
2016
- 2016-07-26 CN CN201610597848.6A patent/CN106250179B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1949185A (en) * | 2005-10-13 | 2007-04-18 | 同济大学 | Parallel adjusting and performance analyzing method of supporting multi-language multi-platform under isomerized environment |
CN102004648A (en) * | 2010-12-27 | 2011-04-06 | 用友软件股份有限公司 | Program customization method and device |
Non-Patent Citations (1)
Title |
---|
"面向方面程序并行化技术研究";何腾飞;《中国优秀硕士学位论文全文数据库 信息科技辑》;20111215(第S2期);第7-9、16-17页 * |
Also Published As
Publication number | Publication date |
---|---|
CN106250179A (en) | 2016-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106250178B (en) | The method that realization system dynamic function intercepts extension online is compiled by multilingual cloud | |
CN106293808B (en) | The method and system of system function dynamic interception extension are realized in multilingual cloud compiling | |
CN106293863B (en) | The method and system of system function dynamic expansion replacement are realized in multilingual cloud compiling | |
CN106250179B (en) | The method that realization system dynamic function intercepts extension is compiled by multilingual cloud | |
CN106227605B (en) | A kind of the dynamic micro services expansion method and device of multilingual cloud compiling | |
CN106250199B (en) | A kind of the dynamic micro services call method and device of multilingual cloud compiling | |
US20180365008A1 (en) | Automatic generation of microservices based on technical description of legacy code | |
CN105022630B (en) | A kind of assembly management system and assembly management method | |
US8645326B2 (en) | System to plan, execute, store and query automation tests | |
Jayasinghe et al. | Expertus: A generator approach to automate performance testing in iaas clouds | |
CN110321152A (en) | A kind of Software Development Platform | |
CN106227611A (en) | The dynamic micro services call method of a kind of multilingual cloud compiling and device | |
CN109683899A (en) | A kind of software integrating method and device | |
JP2021518619A (en) | Systems and methods for connector development and integrated channel deployment | |
US20030182625A1 (en) | Language and object model for describing MIDlets | |
US20090249284A1 (en) | Automation for virtualized it environments | |
US20050102665A1 (en) | Automatic parallel non-dependent component deployment | |
CN106293704A (en) | Dynamic micro services edit methods, device and the server of multilingual cloud compiling | |
US20030181196A1 (en) | Extensible framework for code generation from XML tags | |
US20190018758A1 (en) | Using Emulation to Disassociate Verification from Stimulus in Functional Test | |
CA2773981C (en) | System and method of substituting parameter sets in self-contained mini-applications | |
JP5396979B2 (en) | Software development support device, system, software development support device function expansion method, and program | |
Chardet et al. | Toward safe and efficient reconfiguration with concerto | |
EP4296861A1 (en) | System and method for cloud infrastructure test automation | |
CN112596779A (en) | Dual-version-compatible dependency package generation method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |