CN103399786B - A kind of based on run time context go out standing posture service implementing method and system - Google Patents
A kind of based on run time context go out standing posture service implementing method and system Download PDFInfo
- Publication number
- CN103399786B CN103399786B CN201310328848.2A CN201310328848A CN103399786B CN 103399786 B CN103399786 B CN 103399786B CN 201310328848 A CN201310328848 A CN 201310328848A CN 103399786 B CN103399786 B CN 103399786B
- Authority
- CN
- China
- Prior art keywords
- module
- node
- context
- service
- functional module
- 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
Landscapes
- Stored Programmes (AREA)
- Computer And Data Communications (AREA)
Abstract
The present invention is open provide a kind of based on when running context go out standing posture service implementing method, including: calculate node and initiate to connect to controlling end;Control after end carries out authentication, maintain described connection as main connection, and create process context;Control end official under county magistrate who administers lawsuit, etc. breaks to calculate in node existing capability module whether have the functional module not updated;Do not update functional module and control end if having and be updated by the main connection corresponding service function of functional module to not updating;Calculate node and load functional module;Control end to conversate by main connection is connected with calculating node, and carry out data calculating and result passback by session connection indicating gage operator node.The present invention also provide for a kind of based on run time context the standing posture service that goes out realize system.
Description
Technical field
The present invention relates to computer application field, particularly relate to a kind of based on run time context go out standing posture method of servicing and system.
Background technology
In going out standing posture service architecture, being calculated node execution data, services by controlling end instruction, the main process of a kind of typical traffic model is as follows:
Distributed Services program is deployed in respectively in each calculating node, Distributed Services program comprises the service process of necessity;Calculate node and return even control end, after controlling the authentication that end carries out necessity, maintain this to connect as main connection;Control end and differentiate new session connection by main connection, and carry out data calculating and result passback by session connection indicating gage operator node.
In this model, need to solve two problems:
One, calculating node serve upgrading: when calculating node and needing to update service, traditional way is by ROMPaq or manually to be updated by the service routine calculating node, restarts calculating node serve routine, again Hui Lian.Escalation process underaction.
Two, calculate node and control the Resources Management of end: when calculating the session abnormal ending residing for service, such as during network disconnection, needing to process resource release And Spread of Solute.Number of patent application be the document of CN201210521645 disclose a kind of based on BOOST go out standing posture RFI/RMI service implementing method and communication system, it uses remote object as session resource management device, conversational contract (RMI service) is used to manage resource, in such a mode, every kind of service conversation needs to independently define session object and contract interface, when conversation-based type service increases, can increase and control end and calculate the degree of coupling of node.
Summary of the invention
For solving the problems referred to above, the technical scheme that the present invention uses is:
There is provided a kind of and realize system based on the standing posture service that of context when running, including controlling end and at least one the calculating node with control end communication connection, described calculating node includes that main connection initiation module, functional module load-on module, computing module, described control end include authentication module, main link block, enquiry module, judge module, more new module, conversation module;Described main connection initiation module is for controlling end initiation connection;Described authentication module is for carrying out authentication to the calculating node initiating to connect;Described main link block is after being verified calculating node identities when authentication module, maintain described connection as main connection, and create process context, process context comprises service function table, service function table registers with the service function that functional module is corresponding;Described enquiry module for calculating classification and the version number of node existing capability module by main Connection inquiring;Whether described judge module has, for judging according to described classification and version number to calculate in node existing capability module, the functional module not updated, and when judging the functional module not updated, notice calculates node and loads functional module;Described more new module, for when judge module is determined with the functional module not updated, is updated by the main connection corresponding service function of the functional module to not updating, and then notice calculates node and loads functional module;Described functional module load-on module is used for loading functional module;Described conversation module is for being conversated by main connection be connected with calculating node;Described computing module is for carrying out data calculating according to the instruction of session connection and result being returned.
Another technical solution used in the present invention is:
There is provided a kind of based on when running context go out standing posture service implementing method, including: S101, calculate node and initiate to connect to controlling end;S102, control after end carries out authentication to the calculating node initiating to connect, to maintain described connection as main connection, and create process context, process context comprises service function table, service function table registers with the service function that functional module is corresponding;S103, control end calculate classification and the version number of node existing capability module by main Connection inquiring, and judge to calculate in node existing capability module whether have the functional module not updated according to described classification and version number, if so, enter step S104, if it is not, enter step S105;S104, control end and be updated by the main connection corresponding service function of functional module to not updating;S105, calculating node load functional module, subsequently into step S106;S106, control end and conversate by main connection is connected with calculating node, and carry out data calculating and result passback by session connection indicating gage operator node.
The kind of the present invention based on run time context go out standing posture service implementing method and system, based on RFI service model, when use process is run, context realizes automatically updating of service module function, make renewal process automatization, and need not restart service routine under major part occasion, improve the efficiency of upgrade maintenance;Use thread context management Session Resources, eliminate definition and the object interface contract design of session object, improve development efficiency and reduce the degree of coupling of communicating pair.It is true that in other a lot of application scenarios, when appropriate use runs, context can reduce the program degree of coupling, such as realize the thread local storage etc. of single example of process level, enhancing.
Accompanying drawing explanation
Fig. 1 be in an embodiment of the present invention a kind of based on run time context the standing posture service that goes out realize the system architecture diagram of system;
Fig. 2 is the structured flowchart calculating node;
Fig. 3 is the structured flowchart controlling end;
Fig. 4 is the functional block diagram of computing module;
Fig. 5 is the schematic diagram of context class definition;
Fig. 6 is the class definition figure of context carrier;
Fig. 7 is a kind of based on the execution flow chart standing posture service implementing method of context when running in an embodiment of the present invention.
Main element symbol description
System 100 is realized based on the standing posture service that of context when running;Control end 10;Calculate node 20;Main connection initiation module 21;Functional module load-on module 22;Computing module 23;Authentication module 11;Main link block 12;Enquiry module 13;Judge module 14;More new module 15;Conversation module 16;Thread creation submodule 231;Binding submodule 232;Thread exits submodule 233.
Detailed description of the invention
By describing the technology contents of the present invention, structural feature in detail, being realized purpose and effect, below in conjunction with embodiment and coordinate accompanying drawing to be explained in detail.
Refer to Fig. 1, be in an embodiment of the present invention a kind of based on run time context the standing posture service that goes out realize the system architecture diagram of system.It is somebody's turn to do realize, based on the standing posture service that of context when running, at least one calculating node 20 that system 100 includes controlling end 10 and communicating to connect with control end.
Seeing also Fig. 2, Fig. 3, Fig. 2 is the structured flowchart calculating node, and Fig. 3 is the structured flowchart controlling end.Described calculating node 20 includes main connection initiation module 21, functional module load-on module 22, computing module 23.
Described control end 10 includes authentication module 11, main link block 12, enquiry module 13, judge module 14, more new module 15, conversation module 16.
Described main connection initiation module 21 is for controlling end 10 initiation connection.
Described authentication module 11 is for carrying out authentication to the calculating node 20 initiating to connect.
Described main link block 12 is after passing through calculating node 20 authentication when authentication module 11, maintain described connection as main connection, and create process context, process context comprises service function table, service function table registers with the service function that functional module is corresponding.
Wherein, on the basis of RFI calling model, set of service classification is incorporated in different functional modules by the present invention, and each module has version number, classification information.At the porch registration service function of module in service function table, service function table saves the ID of each service function and corresponding service function, and it is defined as follows:
Map<FunctionKey,FunctionAgent>
Described service function table is arranged in process context, so whole process can access.
Described enquiry module 13 for calculating classification and the version number of node 20 existing capability module by main Connection inquiring.
Whether described judge module 14 has, for judging according to described classification and version number to calculate in node 20 existing capability module, the functional module not updated, and when judging the functional module not updated, notice calculates node 20 and loads functional module.
Described more new module 15, for when judge module is determined with the functional module not updated, is updated by the main connection corresponding service function of the functional module to not updating, and then notice calculates node 20 and loads functional module.
Specifically, new service function will replace old service broker's function, and session afterwards will use new service function automatically, it is not necessary to restarts calculating node serve routine.Updating service process itself is also a conversational services, causes access conflict in order to avoid updating service and other conversation request, and updating service process must be completed by main connection.
Described functional module load-on module 22 is used for loading functional module.
Described conversation module 16 is connected for being conversated with calculating node 20 by main connection.
Described computing module 23 is for carrying out data calculating according to the instruction of session connection and result being returned.
Refer to Fig. 4, be the functional block diagram of computing module.Described computing module 23 specifically includes thread creation submodule 231, binding submodule 232, thread exit submodule 233.
Thread creation submodule 231, after receiving, when calculating node 20, the conversational services that control end 10 is initiated, is set up session connection with controlling end, and is created corresponding thread context only with session connection.
Binding submodule 232 for when calculate node 20 receive control that end sends open file instruction after, file handle is bound with thread context, and returns file handle ID to control end 10;
Thread exit submodule 233 for when calculate node 20 detect conversation end condition meet time, exit thread and close file handle.Wherein, the condition of described conversation end includes that fair termination, Network Abnormal exit, service abnormal exiting.
It is automatically switched off handle to be realized by context object or destructed behavior, in windows, handle belongs to kernel objects, can close different types of handle by unified API, and the function policy being therefore automatically switched off handle simplifies the management of handle resources to a certain extent.Operation context, by calling the acquisition context approach of subclass, accesses subclass context object.
No matter session terminates in what manner, and file all can be released.Being presented herein below and opening file is the false code that file handle is tied to thread context.
Wherein ThreadRuntimeContext is thread context, is registered in context carrier by file handle by static function, and therefore file handle can be automatically releasable when thread exits.For other non-handle resources, it is also possible to exit operation by queue_exit_handler is self-defined, the final block being similar in abnormality processing.
Refer to Fig. 5, be the schematic diagram of context class definition.The base class of context when GenericRuntimeContext is to run in figure, encapsulates following operation:
Base class obtains the context carrier of subclass by get_context, and the context carrier of process context subclass is the whole service phase of application program life cycle, and access domain is process territory;The life cycle of the context carrier of thread context subclass is the runtime of each thread, and access domain is thread territory, and the variable that such as thread context is arranged can not be by other thread accesses.
Refer to Fig. 6, be the class definition figure of context carrier.Wherein values be set_value and get_value access argument table, handlers be queue_exit_handler operation function object, handles be context destructed be the handle being automatically switched off, section be limit access competition semaphore.
When context is destructed, all variablees in argument table can be released, and the destructor function of object can be called;Destructed operation can be called successively, and handle can be closed successively.For thread context, semaphore is void type, and semaphore does not exist lock and the operation unlocked, because it is unlikely that access competition in same thread.
During operation, the part of object most critical is when context carrier creates and discharge.In realization, process context creates context carrier when performing context operations for the first time, and thread context then creates context carrier when each thread performs context operations for the first time, and this does not affect use logic.
Process context is different from single example, and single example is usually the single example run in module, is language level.When a process is made up of multiple modules, each module can have respective single example for same type, and in RFI model, service function needs to be registered in the agent list in process territory, and the single example model in module can not meet requirement.In Windows, there is not the process list example of language level, use the environmental variable in document " Modern C++Design Generic Programming and Design Patterns Applied; Andrei Alexandrescu " and single example model realization process context of Feng Huang Model herein, address by environmental variable access context carrier list example, when accessing for the first time, owing to environmental variable does not exists, need to create single example and register the address of single example in environmental variable.
Above-mentioned Conversation Model based on thread context, eliminate object interface contract, but require that each conversational services is corresponding to calculating a thread of node, i.e. when controlling end and initiating a conversational services, require that calculating node creates a new thread and a new connection, this thread and connection process all service requests in conversation procedure, meanwhile, file that service node uses in this thread or other resources, will be tied in thread context by service function.When session connection terminates in any form, thread will automatically exit from, and in conversation procedure, when the exception that service function produces makes thread exit, the vital stage the most simultaneously terminating session connection, thread and session connection is consistent.
Refer to Fig. 7, it is a kind of based on the execution flow chart standing posture service implementing method of context when running in an embodiment of the present invention, the method realizes in system 100 based on the standing posture service that of context when running described in running on, and the method comprises the steps:
Step S101, calculating node initiate to connect to controlling end;
Step S102, control after end carries out authentication to the calculating node initiating to connect, to maintain described connection as main connection, and create process context, process context comprises service function table, service function table registers with the service function that functional module is corresponding;
Wherein, on the basis of RFI calling model, set of service classification is incorporated in different functional modules by the present invention, and each module has version number, classification information.At the porch registration service function of module in service function table, service function table saves the ID of each service function and corresponding service function, and it is defined as follows:
Map<FunctionKey,FunctionAgent>
Described service function table is arranged in process context, so whole process can access.
Step S103, control end calculate classification and the version number of node existing capability module by main Connection inquiring, and judge to calculate in node existing capability module whether have the functional module not updated according to described classification and version number, if so, enter step S104, if it is not, enter step S105;
Step S104, control end and be updated, subsequently into step S105 by the main connection corresponding service function of functional module to not updating;
Step S105, calculating node load functional module, subsequently into step S106;
Specifically, new service function will replace old service broker's function, and session afterwards will use new service function automatically, it is not necessary to restarts calculating node serve routine.Updating service process itself is also a conversational services, causes access conflict in order to avoid updating service and other conversation request, and updating service process must be completed by main connection.
Step S106, control end and conversate by main connection is connected with calculating node, and carry out data calculating and result passback by session connection indicating gage operator node.
Wherein, described step S106 specifically includes:
Step S1061, calculating node, after receiving the conversational services controlling end initiation, are set up session connection with controlling end, and are created corresponding thread context only with session connection;
Step S1062, calculate node when receive control that end sends open file instruction after, by the binding of file handle and thread context, and return file handle ID to controlling end;
Step S1063, when calculate node detect conversation end condition meet time, exit thread and close file handle.The condition of described conversation end includes that fair termination, Network Abnormal exit, service abnormal exiting.
The kind of the present invention based on run time context go out standing posture service implementing method and system, based on RFI service model, when use process is run, context realizes automatically updating of service module function, make renewal process automatization, and need not restart service routine under major part occasion, improve the efficiency of upgrade maintenance;Use thread context management Session Resources, eliminate definition and the object interface contract design of session object, improve development efficiency and reduce the degree of coupling of communicating pair.It is true that in other a lot of application scenarios, when appropriate use runs, context can reduce the program degree of coupling, such as realize the thread local storage etc. of single example of process level, enhancing.
The foregoing is only embodiments of the invention; not thereby the scope of the claims of the present invention is limited; every equivalent structure utilizing description of the invention and accompanying drawing content to be made or equivalence flow process conversion; or directly or indirectly it is used in other relevant technical fields, the most in like manner it is included in the scope of patent protection of the present invention.
Claims (6)
1. one kind realizes system based on the standing posture service that of context when running, it is characterised in that include controlling
End and at least one the calculating node with control end communication connection, described calculating node includes that main connection initiates
Module, functional module load-on module, computing module, described control end include authentication module, main link block,
Enquiry module, judge module, more new module, conversation module;
Described main connection initiation module is for controlling end initiation connection;
Described authentication module is for carrying out authentication to the calculating node initiating to connect;
Described main link block, after being verified calculating node identities when authentication module, maintains described company
Connect as main connection, and create process context, process context comprises service function table, service function
Table registers with the service function that functional module is corresponding;
Described enquiry module for calculating classification and the version of node existing capability module by main Connection inquiring
Number;
Described judge module for judging to calculate in node existing capability module according to described classification and version number is
No have the functional module not updated, and when judging the functional module not updated, notice calculates node and adds
Carry functional module;
Described more new module is for when judge module is determined with the functional module not updated, right by main connection
The corresponding service function of functional module not updated is updated, and then notice calculates node and loads functional module;
Described functional module load-on module is used for loading functional module;
Described conversation module is for being conversated by main connection be connected with calculating node;
Described computing module is for carrying out data calculating according to the instruction of session connection and result being returned.
The most according to claim 1 a kind of based on run time context the standing posture service that goes out realize system,
It is characterized in that, described computing module specifically includes:
Thread creation submodule, after receiving, when calculating node, the conversational services that control end is initiated, with control
End processed sets up session connection, and creates corresponding thread context only with session connection;
Binding submodule, for when calculate node receive control end transmission open file instruction after, by literary composition
Part handle is bound with thread context, and returns file handle ID to controlling end;
Thread exits submodule, for when calculate node detect conversation end condition meet time, exit thread
And close file handle.
The most according to claim 2 a kind of based on run time context the standing posture service that goes out realize system,
It is characterized in that, the condition of described conversation end includes that fair termination, Network Abnormal exit, service abnormal moving back
Go out.
4. one kind based on run time context go out standing posture service implementing method, it is characterised in that including:
S101, calculating node initiate to connect to controlling end;
After S102, control end carry out authentication to the calculating node initiating to connect, maintain described connection conduct
Main connection, and create process context, process context comprises service function table, service function table is noted
Volume has the service function that functional module is corresponding;
S103, control end calculate classification and the version number of node existing capability module by main Connection inquiring, and
Judge to calculate in node existing capability module whether have the function mould not updated according to described classification and version number
Block, if so, enters step S104, if it is not, enter step S105;
S104, control end and be updated by the main connection corresponding service function of functional module to not updating,
Subsequently into step S105;
S105, calculating node load functional module, subsequently into step S106;
S106, control end and conversate by main connection be connected with calculating node, and indicated by session connection
Calculate node and carry out data calculating and result passback.
5. according to claim 4 state a kind of based on run time context go out standing posture service implementing method, its
Being characterised by, described step S106 specifically includes:
S1061, calculating node, after receiving the conversational services controlling end initiation, set up session even with controlling end
Connect, and create corresponding thread context only with session connection;
S1062, calculate node when receive control end transmission open file instruction after, by file handle and line
Journey context bindings, and return file handle ID to controlling end;
S1063, when calculate node detect conversation end condition meet time, exit thread and close file handle.
6. according to claim 5 state a kind of based on run time context go out standing posture service implementing method, its
Being characterised by, the condition of described conversation end includes that fair termination, Network Abnormal exit, service abnormal exiting.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310328848.2A CN103399786B (en) | 2013-07-31 | 2013-07-31 | A kind of based on run time context go out standing posture service implementing method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310328848.2A CN103399786B (en) | 2013-07-31 | 2013-07-31 | A kind of based on run time context go out standing posture service implementing method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103399786A CN103399786A (en) | 2013-11-20 |
CN103399786B true CN103399786B (en) | 2016-12-28 |
Family
ID=49563420
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310328848.2A Active CN103399786B (en) | 2013-07-31 | 2013-07-31 | A kind of based on run time context go out standing posture service implementing method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103399786B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107239313A (en) * | 2017-06-09 | 2017-10-10 | 中国建设银行股份有限公司 | The upgrade method and storage medium of Spring application services |
CN112506955B (en) * | 2020-12-10 | 2021-09-21 | 星环信息科技(上海)股份有限公司 | Query processing method, computer equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001297005A (en) * | 2000-04-14 | 2001-10-26 | Mitsubishi Electric Corp | Client-server system |
EP1178402A1 (en) * | 2000-08-03 | 2002-02-06 | Hsing Tech Enterprises Co., Ltd. | Method and apparatus for actively updating program file(s) of a client computer |
CN1553314A (en) * | 2003-05-30 | 2004-12-08 | 英业达股份有限公司 | Automatic updating method and system for programs of server |
CN101483556A (en) * | 2009-01-06 | 2009-07-15 | 中兴通讯股份有限公司 | Automatic upgrading method and system for switch remote target terminal |
CN102469064A (en) * | 2010-11-03 | 2012-05-23 | 中兴通讯股份有限公司 | Method for implementing communication and communication equipment |
CN102880482A (en) * | 2012-08-06 | 2013-01-16 | 厦门市美亚柏科信息股份有限公司 | System and technical method of automatically updating software in host batch control virtual machine |
-
2013
- 2013-07-31 CN CN201310328848.2A patent/CN103399786B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001297005A (en) * | 2000-04-14 | 2001-10-26 | Mitsubishi Electric Corp | Client-server system |
EP1178402A1 (en) * | 2000-08-03 | 2002-02-06 | Hsing Tech Enterprises Co., Ltd. | Method and apparatus for actively updating program file(s) of a client computer |
CN1553314A (en) * | 2003-05-30 | 2004-12-08 | 英业达股份有限公司 | Automatic updating method and system for programs of server |
CN101483556A (en) * | 2009-01-06 | 2009-07-15 | 中兴通讯股份有限公司 | Automatic upgrading method and system for switch remote target terminal |
CN102469064A (en) * | 2010-11-03 | 2012-05-23 | 中兴通讯股份有限公司 | Method for implementing communication and communication equipment |
CN102880482A (en) * | 2012-08-06 | 2013-01-16 | 厦门市美亚柏科信息股份有限公司 | System and technical method of automatically updating software in host batch control virtual machine |
Also Published As
Publication number | Publication date |
---|---|
CN103399786A (en) | 2013-11-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106156186B (en) | Data model management device, server and data processing method | |
WO2017080391A1 (en) | Network service deployment method and device | |
WO2019062304A1 (en) | Method, device and system for managing computing resources of block chain node | |
AU2021245203B2 (en) | Methods for defining a Network Service Descriptor (NSD) for a Network Service (NS), and Network Functions Virtualization (NFV) Orchestrator (NFVO) using said NSD | |
CN105760180B (en) | A kind of workflow engine expands and develops method | |
CN110661842B (en) | Resource scheduling management method, electronic equipment and storage medium | |
CN101286212A (en) | Business flow path execution method, business flow path engines and its deployment method | |
CN113254174A (en) | RPA robot process automation implementation system and method | |
CN106406836A (en) | Power system analysis-oriented software platform and running and distributed development methods thereof | |
CN105959302A (en) | Terminal management framework and method | |
CN103399786B (en) | A kind of based on run time context go out standing posture service implementing method and system | |
CN104572286A (en) | Task scheduling method based on distributed memory clusters | |
CN111736871A (en) | FPGA chip upgrading method, device and system | |
CN101056210B (en) | An event processing system and method of network central management platform | |
CN108540574A (en) | A kind of diversiform data docking system and method | |
CN111447273B (en) | Cloud processing system and data processing method based on cloud processing system | |
CN113658351A (en) | Product production method and device, electronic equipment and storage medium | |
CN103019819A (en) | Dynamic link library uniform scheduling method based on plug-in mechanism | |
CN110380879A (en) | Track traffic synthetic monitoring dispositions method and system based on docker | |
CN110287089B (en) | Microkernel IPC (inter-processor communication protocol) verification method based on intermediate format and SMT (surface mount technology) | |
CN103971225A (en) | Workflow dynamic expanding method and system | |
CN113342456A (en) | Connection method, device, equipment and storage medium | |
WO2015117458A1 (en) | Fault information collection method, device and system | |
CN105490846A (en) | Server virtualization management system and method | |
CN104484227A (en) | Hardware resource utilization rate management method and hardware resource utilization rate management system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |