CN110795109A - Function expansion method and device and electronic equipment - Google Patents
Function expansion method and device and electronic equipment Download PDFInfo
- Publication number
- CN110795109A CN110795109A CN201911025546.1A CN201911025546A CN110795109A CN 110795109 A CN110795109 A CN 110795109A CN 201911025546 A CN201911025546 A CN 201911025546A CN 110795109 A CN110795109 A CN 110795109A
- Authority
- CN
- China
- Prior art keywords
- target node
- function
- node
- program
- extended function
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本公开关于一种功能扩展方法、装置及电子设备,用以解决现有技术中对业务系统的服务代码进行功能扩展的效率较低的问题,本公开实施例接收中心节点发送的包含目标节点标识以及扩展功能信息的通知消息;根据扩展功能信息与封装程序之间的对应关系,确定通知消息中包含的扩展功能信息对应的封装程序;将确定出的封装程序发送给目标节点标识对应的目标节点,以使目标节点通过运行所述封装程序执行对应的扩展功能。本公开实施例提供的功能扩展方法,不需要变更本地服务代码,不侵入原服务代码,可以在原服务运行的情况下为业务系统扩展功能,不需要将业务下线,缩短业务系统上线新功能的周期,提高对服务代码进行功能扩展的效率。
The present disclosure relates to a function expansion method, device and electronic device, which are used to solve the problem of low efficiency of function expansion for service codes of business systems in the prior art. and the notification message of the extended function information; according to the correspondence between the extended function information and the packaging program, determine the packaging program corresponding to the extended function information contained in the notification message; send the determined packaging program to the target node corresponding to the target node identifier , so that the target node executes the corresponding extended function by running the encapsulation program. The function extension method provided by the embodiments of the present disclosure does not require changing the local service code, does not invade the original service code, can expand the function of the business system when the original service is running, does not need to take the business offline, and shortens the time required for the business system to launch new functions. Cycle, improve the efficiency of functional expansion of service code.
Description
技术领域technical field
本公开涉及计算机技术领域,特别涉及一种功能扩展方法、装置及电子设备。The present disclosure relates to the field of computer technologies, and in particular, to a function expansion method, apparatus, and electronic device.
背景技术Background technique
随着业务系统的不断发展,业务系统的功能需要更加多样化,则其对应的服务代码规模不断变大。当存在不同业务逻辑耦合复杂或者需要扩展业务功能等各类问题时,传统的单机开发模式存在越来越明显的弊端。With the continuous development of the business system, the functions of the business system need to be more diversified, and the scale of the corresponding service code continues to increase. When there are various problems such as complex coupling of different business logics or the need to expand business functions, the traditional stand-alone development model has more and more obvious drawbacks.
为业务系统扩展功能属于服务治理的范畴,业务开发人员可以对业务系统对应的服务代码进行增强,实现业务系统功能的扩展。在对业务系统进行增强时,需要在业务系统对应的服务代码中侵入相应的代码。目前,在服务代码中侵入代码实现业务系统的功能或者扩展业务系统的功能,需要将业务下线,才能对业务系统对应的服务代码进行代码变更,且若业务系统对应的服务代码打包部署时,对业务代码进行代码更改的周期比较长,导致扩展业务系统功能的周期变长。Extending functions for the business system belongs to the category of service governance. Business developers can enhance the service code corresponding to the business system to expand the functions of the business system. When enhancing the business system, it is necessary to intrude the corresponding code in the service code corresponding to the business system. At present, when invading the code in the service code to realize the function of the business system or expand the function of the business system, the business needs to be offline before the code change can be made to the service code corresponding to the business system, and if the service code corresponding to the business system is packaged and deployed, The cycle of code changes to the business code is relatively long, resulting in a longer cycle for expanding the functions of the business system.
综上所述,现有技术中对业务系统的服务代码进行功能扩展的效率较低。To sum up, the efficiency of extending the function of the service code of the business system in the prior art is low.
发明内容SUMMARY OF THE INVENTION
本公开提供一种功能扩展方法、装置及电子设备,用以解决现有技术中对业务系统的服务代码进行功能扩展的效率较低的问题。本公开的技术方案如下:The present disclosure provides a function expansion method, device and electronic device, which are used to solve the problem of low efficiency of function expansion for service codes of business systems in the prior art. The technical solutions of the present disclosure are as follows:
根据本公开实施例的第一方面,提供一种功能扩展方法,包括:According to a first aspect of the embodiments of the present disclosure, a function extension method is provided, including:
接收中心节点发送的包含目标节点标识以及扩展功能信息的通知消息;其中,所述目标节点标识以及所述扩展功能信息为所述中心节点根据触发的扩展指令确定的;Receive a notification message including a target node identifier and extended function information sent by the central node; wherein, the target node identifier and the extended function information are determined by the central node according to the triggered extended instruction;
根据扩展功能信息与封装程序之间的对应关系,确定所述通知消息中包含的所述扩展功能信息对应的封装程序;According to the correspondence between the extended function information and the encapsulation program, determine the encapsulation program corresponding to the extended function information contained in the notification message;
将确定出的所述封装程序发送给所述目标节点标识对应的目标节点,以使所述目标节点通过运行所述封装程序执行对应的扩展功能。Sending the determined encapsulation program to a target node corresponding to the target node identifier, so that the target node executes the corresponding extended function by running the encapsulation program.
在一种可能的实现方式中,在将确定出的所述封装程序发送给所述目标节点标识对应的目标节点之后,还包括:In a possible implementation manner, after the determined encapsulation program is sent to the target node corresponding to the target node identifier, the method further includes:
获取所述目标节点通过运行所述封装程序执行对应的扩展功能的执行结果,并将获取到的执行结果返回给所述中心节点,以使所述中心节点呈现所述执行结果。Acquiring an execution result of the target node executing the corresponding extended function by running the encapsulation program, and returning the acquired execution result to the central node, so that the central node presents the execution result.
根据本公开实施例的第二方面,提供一种功能扩展方法,包括:According to a second aspect of the embodiments of the present disclosure, a function expansion method is provided, including:
接收代理节点发送的封装程序;其中,所述封装程序为所述代理节点根据中心节点发送的通知消息中包含的扩展功能信息以及扩展功能信息与封装程序之间的对应关系确定的;Receive the encapsulation program sent by the agent node; wherein, the encapsulation program is determined by the agent node according to the extended function information contained in the notification message sent by the central node and the corresponding relationship between the extended function information and the encapsulation program;
通过运行所述封装程序执行对应的扩展功能。The corresponding extended function is executed by running the encapsulation program.
在一种可能的实现方式中,所述通过运行所述封装程序执行对应的扩展功能,包括:In a possible implementation manner, executing the corresponding extended function by running the encapsulation program includes:
通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能。The encapsulation program is loaded by a class loader, and the corresponding extension function is executed by running the encapsulation program.
在一种可能的实现方式中,所述通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能,包括:In a possible implementation manner, the encapsulation program is loaded by a class loader, and the corresponding extension function is executed by running the encapsulation program, including:
若接收到所述封装程序时未执行其他功能,则通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能;或If no other function is performed when the packaged program is received, load the packaged program through a class loader, and execute the corresponding extended function by running the packaged program; or
若接收到所述封装程序时正在执行其他功能,则在所述其他功能执行完成后,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能;或If other functions are being executed when the packaged program is received, after the execution of the other functions is completed, the packaged program is loaded through the class loader, and the corresponding extended function is executed by running the packaged program; or
若接收到所述封装程序时正在执行其他功能,则暂停执行所述其他功能,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能。If other functions are being executed when the packaged program is received, execution of the other functions is suspended, the packaged program is loaded through a class loader, and the corresponding extended function is executed by running the packaged program.
在一种可能的实现方式中,在暂停执行所述其他功能,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能之后,还包括:In a possible implementation manner, after suspending execution of the other functions, loading the encapsulation program through a class loader, and executing the corresponding extension function through running the encapsulation program, the method further includes:
在所述封装程序运行结束后恢复执行所述其他功能。The execution of the other functions is resumed after the execution of the encapsulation program ends.
根据本公开实施例的第三方面,提供一种功能扩展方法,包括:According to a third aspect of the embodiments of the present disclosure, a function expansion method is provided, including:
根据触发的扩展指令确定目标节点标识以及扩展功能信息;Determine the target node identifier and the extended function information according to the triggered extended instruction;
将包含所述目标节点标识以及扩展功能信息的通知消息发送给代理节点,以使所述代理节点将所述扩展功能信息对应的封装程序发送给所述目标节点标识对应的目标节点,便于所述目标节点通过运行所述封装程序执行对应的扩展功能。Send a notification message containing the target node identifier and extended function information to the proxy node, so that the proxy node sends the package program corresponding to the extended function information to the target node corresponding to the target node identifier, so as to facilitate the The target node executes the corresponding extended function by running the encapsulation program.
在一种可能的实现方式中,所述将包含所述目标节点标识以及扩展功能信息的通知消息发送给代理节点之后,还包括:In a possible implementation manner, after the notification message including the target node identifier and the extended function information is sent to the proxy node, the method further includes:
接收所述代理节点返回的所述目标节点运行所述封装程序执行对应的扩展功能的执行结果,并呈现所述执行结果。Receive the execution result of the target node running the encapsulation program to execute the corresponding extended function returned by the proxy node, and present the execution result.
根据本公开实施例的第四方面,提供一种功能扩展装置,包括:According to a fourth aspect of the embodiments of the present disclosure, there is provided a function expansion device, including:
第一接收模块,被配置为执行接收中心节点发送的包含目标节点标识以及扩展功能信息的通知消息;其中,所述目标节点标识以及所述扩展功能信息为所述中心节点根据触发的扩展指令确定的;The first receiving module is configured to receive a notification message including a target node identifier and extended function information sent by a central node; wherein, the target node identifier and the extended function information are determined by the central node according to a triggered extended instruction of;
第一确定模块,被配置为执行根据扩展功能信息与封装程序之间的对应关系,确定所述通知消息中包含的所述扩展功能信息对应的封装程序;a first determining module configured to execute, according to the correspondence between the extended function information and the encapsulation program, determine the encapsulation program corresponding to the extended function information contained in the notification message;
第一发送模块,被配置为执行将确定出的所述封装程序发送给所述目标节点标识对应的目标节点,以使所述目标节点通过运行所述封装程序执行对应的扩展功能。The first sending module is configured to execute sending the determined encapsulation program to the target node corresponding to the target node identifier, so that the target node executes the corresponding extended function by running the encapsulation program.
在一种可能的实现方式中,所述第一发送模块还被配置为执行获取所述目标节点通过运行所述封装程序执行对应的扩展功能的执行结果,并将获取到的执行结果返回给所述中心节点,以使所述中心节点呈现所述执行结果。In a possible implementation manner, the first sending module is further configured to execute and obtain the execution result of the corresponding extended function executed by the target node by running the encapsulation program, and return the obtained execution result to the the central node, so that the central node presents the execution result.
根据本公开实施例的第五方面,提供一种功能扩展装置,包括:According to a fifth aspect of the embodiments of the present disclosure, there is provided a function expansion device, including:
第二接收模块,被配置为执行接收代理节点发送的封装程序;其中,所述封装程序为所述代理节点根据中心节点发送的通知消息中包含的扩展功能信息以及扩展功能信息与封装程序之间的对应关系确定的;The second receiving module is configured to execute the encapsulation program sent by the receiving agent node; wherein, the encapsulation program is the extension function information included in the notification message sent by the agent node according to the central node and the relationship between the extension function information and the encapsulation program The corresponding relationship is determined;
运行模块,被配置为执行通过运行所述封装程序执行对应的扩展功能。The running module is configured to execute the corresponding extended function by running the encapsulation program.
在一种可能的实现方式中,所述运行模块被配置为执行通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能。In a possible implementation manner, the running module is configured to load the encapsulation program through a class loader, and execute the corresponding extension function by running the encapsulation program.
在一种可能的实现方式中,所述运行模块被配置为执行若接收到所述封装程序时未执行其他功能,则通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能;或In a possible implementation manner, the running module is configured to execute, if no other function is performed when the encapsulated program is received, load the encapsulated program through a class loader, and execute the corresponding encapsulated program by running the encapsulated program extended functionality; or
若接收到所述封装程序时正在执行其他功能,则在所述其他功能执行完成后,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能;或If other functions are being executed when the packaged program is received, after the execution of the other functions is completed, the packaged program is loaded through the class loader, and the corresponding extended function is executed by running the packaged program; or
若接收到所述封装程序时正在执行其他功能,则暂停执行所述其他功能,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能。If other functions are being executed when the packaged program is received, execution of the other functions is suspended, the packaged program is loaded through a class loader, and the corresponding extended function is executed by running the packaged program.
在一种可能的实现方式中,所述运行模块被配置为执行在所述封装程序运行结束后恢复执行所述其他功能。In a possible implementation manner, the execution module is configured to resume execution of the other functions after the execution of the encapsulation program ends.
根据本公开实施例的第六方面,提供一种功能扩展装置,包括:According to a sixth aspect of the embodiments of the present disclosure, there is provided a function expansion device, including:
第二确定模块,被配置为执行根据触发的扩展指令确定目标节点标识以及扩展功能信息;a second determining module, configured to perform determining the target node identifier and the extended function information according to the triggered extended instruction;
第二发送模块,被配置为执行将包含所述目标节点标识以及扩展功能信息的通知消息发送给代理节点,以使所述代理节点将所述扩展功能信息对应的封装程序发送给所述目标节点标识对应的目标节点,便于所述目标节点通过运行所述封装程序执行对应的扩展功能。The second sending module is configured to execute sending a notification message including the target node identifier and extended function information to the proxy node, so that the proxy node sends the encapsulation program corresponding to the extended function information to the target node The corresponding target node is identified, so that the target node can execute the corresponding extended function by running the encapsulation program.
在一种可能的实现方式中,还包括:In a possible implementation, it also includes:
第三接收模块,被配置为执行接收所述代理节点返回的所述目标节点运行所述封装程序执行对应的扩展功能的执行结果,并将呈现所述执行结果。The third receiving module is configured to execute and receive the execution result of the target node running the encapsulation program to execute the corresponding extended function returned by the proxy node, and to present the execution result.
根据本公开实施例的第七方面,提供一种电子设备,包括:存储器,用于存储可执行指令;According to a seventh aspect of the embodiments of the present disclosure, there is provided an electronic device, comprising: a memory for storing executable instructions;
处理器,用于读取并执行所述存储器中存储的可执行指令,以实现如本公开实施例第一方面中任一项所述的功能扩展方法。The processor is configured to read and execute the executable instructions stored in the memory, so as to implement the function expansion method according to any one of the first aspect of the embodiments of the present disclosure.
根据本公开实施例的第八方面,提供一种电子设备,包括:存储器,用于存储可执行指令;According to an eighth aspect of the embodiments of the present disclosure, there is provided an electronic device, comprising: a memory for storing executable instructions;
处理器,用于读取并执行所述存储器中存储的可执行指令,以实现如本公开实施例第二方面中任一项所述的功能扩展方法。The processor is configured to read and execute the executable instructions stored in the memory, so as to implement the function expansion method according to any one of the second aspect of the embodiments of the present disclosure.
根据本公开实施例的第九方面,提供一种电子设备,包括:存储器,用于存储可执行指令;According to a ninth aspect of the embodiments of the present disclosure, there is provided an electronic device, comprising: a memory for storing executable instructions;
处理器,用于读取并执行所述存储器中存储的可执行指令,以实现如本公开实施例第三方面中任一项所述的功能扩展方法。The processor is configured to read and execute the executable instructions stored in the memory, so as to implement the function expansion method according to any one of the third aspect of the embodiments of the present disclosure.
根据本公开实施例的第十方面,提供一种非易失性存储介质,当所述存储介质中的指令由功能扩展装置的处理器执行时,使得功能扩展装置能够执行本公开实施例第一方面中所述的功能扩展方法。According to a tenth aspect of an embodiment of the present disclosure, a non-volatile storage medium is provided, when an instruction in the storage medium is executed by a processor of a function expansion device, the function expansion device can execute the first embodiment of the present disclosure. Function extension method as described in Aspects.
根据本公开实施例的第十一方面,提供一种非易失性存储介质,当所述存储介质中的指令由功能扩展装置的处理器执行时,使得功能扩展装置能够执行本公开实施例第二方面中所述的功能扩展方法。According to an eleventh aspect of the embodiments of the present disclosure, a non-volatile storage medium is provided. When an instruction in the storage medium is executed by a processor of a function expansion device, the function expansion device can execute the first embodiment of the present disclosure. The function extension method described in the second aspect.
根据本公开实施例的第十二方面,提供一种非易失性存储介质,当所述存储介质中的指令由功能扩展装置的处理器执行时,使得功能扩展装置能够执行本公开实施例第三方面中所述的功能扩展方法。According to a twelfth aspect of an embodiment of the present disclosure, a non-volatile storage medium is provided, when an instruction in the storage medium is executed by a processor of a function expansion device, the function expansion device can execute the first embodiment of the present disclosure. The function extension method described in the three aspects.
本公开的实施例提供的技术方案至少带来以下有益效果:The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
本公开实施例提供的功能扩展方法,将可运行的封装程序存储在代理节点中,当需要扩展功能时,中心节点响应触发的扩展指令向代理节点发送通知消息,中心节点将可运行的封装程序发送给目标节点即可实现功能的扩展,不需要变更本地服务代码,不侵入原服务代码,可以在原服务运行的情况下为业务系统扩展功能,不需要将业务下线,缩短业务系统上线新功能的周期,提高对服务代码进行功能扩展的效率。本公开实施例中心节点、代理节点和目标节点可以位于同一个服务器或者部署在不同的服务器;中心节点和代理节点之间可以采用有线连接方式通信或者采用无线通信。In the function extension method provided by the embodiment of the present disclosure, the runnable encapsulation program is stored in the proxy node. When the expansion function is required, the central node sends a notification message to the proxy node in response to the triggered expansion instruction, and the central node stores the runnable encapsulation program in the proxy node. Function expansion can be achieved by sending to the target node without changing the local service code or invading the original service code. The function can be extended for the business system while the original service is running, and the business system does not need to be offline, shortening the launch of new functions of the business system. , improve the efficiency of functional expansion of service code. In this embodiment of the present disclosure, the central node, the proxy node, and the target node may be located on the same server or deployed on different servers; wired connection or wireless communication may be used between the central node and the proxy node.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure and do not unduly limit the present disclosure.
图1是根据一示例性实施例示出的功能扩展方法的应用场景示意图;1 is a schematic diagram of an application scenario of a function expansion method according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种功能扩展系统的框架示意图;2 is a schematic diagram of a framework of a function expansion system according to an exemplary embodiment;
图3是根据一示例性实施例示出的一种功能扩展方法的示意图;FIG. 3 is a schematic diagram of a function expansion method according to an exemplary embodiment;
图4是根据一示例性实施例示出的一种功能扩展方法的交互流程图;FIG. 4 is an interaction flow chart of a function expansion method according to an exemplary embodiment;
图5是根据一示例性实施例示出的一种代理节点侧功能扩展方法的流程图;FIG. 5 is a flowchart of a method for extending a function on a proxy node side according to an exemplary embodiment;
图6是根据一示例性实施例示出的一种目标节点侧功能扩展方法的流程图;FIG. 6 is a flowchart of a method for extending a function on a target node side according to an exemplary embodiment;
图7是根据一示例性实施例示出的一种中心节点侧功能扩展方法的流程图;FIG. 7 is a flow chart of a method for extending functions on a central node side according to an exemplary embodiment;
图8是根据一示例性实施例示出的一种功能扩展装置框图;FIG. 8 is a block diagram of a function expansion apparatus according to an exemplary embodiment;
图9是根据一示例性实施例示出的另一种功能扩展装置框图;FIG. 9 is a block diagram of another function expansion apparatus shown according to an exemplary embodiment;
图10是根据一示例性实施例示出的另一种功能扩展装置框图;FIG. 10 is a block diagram of another function expansion apparatus according to an exemplary embodiment;
图11是根据一示例性实施例示出的一种电子设备的框图;11 is a block diagram of an electronic device according to an exemplary embodiment;
图12是根据一示例性实施例示出的另一种电子设备的框图;FIG. 12 is a block diagram of another electronic device according to an exemplary embodiment;
图13是根据一示例性实施例示出的一种电子设备的框图。Fig. 13 is a block diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。It should be noted that the terms "first", "second" and the like in the description and claims of the present disclosure and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used may be interchanged under appropriate circumstances such that the embodiments of the disclosure described herein can be practiced in sequences other than those illustrated or described herein. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as recited in the appended claims.
以下,对本公开实施例中的部分用语进行解释说明,以便于本领域技术人员理解。Hereinafter, some terms in the embodiments of the present disclosure will be explained to facilitate the understanding of those skilled in the art.
(1)本公开实施例中术语“多个”是指两个或两个以上,其它量词与之类似。(1) The term "plurality" in the embodiments of the present disclosure refers to two or more than two, and other quantifiers are similar.
(2)本公开实施例中术语“类加载器”是指主要对类的请求提供服务,当需要某类时,由类加载器返回这个类的对象。类加载器负责载入系统的所有资源(类,文件,来自网络的字节流等),通过类加载器从而将资源载入。(2) In the embodiments of the present disclosure, the term "class loader" refers to mainly providing services for class requests, and when a certain class is required, the class loader returns an object of this class. The class loader is responsible for loading all the resources of the system (classes, files, byte streams from the network, etc.), and the resources are loaded through the class loader.
(3)本公开实施例中术语“端口”是英文port的意译,是设备与外界通讯交流的出口。端口可分为虚拟端口和物理端口,其中虚拟端口指计算机内部或交换机路由器内的端口;物理端口又称为接口,是可见端口。(3) The term "port" in the embodiments of the present disclosure is a free translation of English port, which is an outlet for communication between a device and the outside world. Ports can be divided into virtual ports and physical ports, where virtual ports refer to ports inside a computer or within a switch router; physical ports, also known as interfaces, are visible ports.
(4)本公开实施例中术语“IP”是指IP地址,是IP协议提供的一种统一的地址格式,它为互联网上的每一个网络和每一台主机分配一个逻辑地址,以此来屏蔽物理地址的差异。(4) In the embodiments of the present disclosure, the term "IP" refers to an IP address, which is a unified address format provided by the IP protocol. It assigns a logical address to each network and each host on the Internet, so as to Mask physical address differences.
目前,当需要扩展业务系统的功能时,业务开发人员可以通过服务治理平台为业务系统对应的服务代码中侵入相应的代码,改变原来的服务代码的执行逻辑,使其可以扩展新的功能。例如,一台服务器的本地服务代码没有监控功能,当业务人员想为此服务器扩展监控功能时,需要变更本地服务代码,使变更后的本地服务代码可以实现监控功能。但是更改原服务代码的过程中,需要停止运行该服务器,对服务器的本地服务代码重新编写,且当原服务代码为打包部署时,更改原服务代码所需要的时间会很长,导致新功能上线的周期较长。At present, when the function of the business system needs to be expanded, the business developer can intrude the corresponding code into the service code corresponding to the business system through the service governance platform, and change the execution logic of the original service code, so that it can expand new functions. For example, the local service code of a server has no monitoring function. When business personnel want to extend the monitoring function for this server, they need to change the local service code so that the changed local service code can realize the monitoring function. However, in the process of changing the original service code, the server needs to be stopped and the local service code of the server needs to be rewritten. When the original service code is packaged and deployed, it will take a long time to change the original service code, resulting in the launch of new functions. period is longer.
本公开实施例公开一种功能扩展方法,一种可选的应用场景如图1所示,在用户10需要对目标节点13的功能进行扩展时,在中心节点11触发扩展指令,中心节点11根据用户10触发的扩展指令确定目标节点标识以及扩展功能信息,中心节点11向代理节点12发送包含目标节点标识以及扩展功能信息的通知消息,代理节点12将扩展功能信息对应的封装程序发送给目标节点标识对应的目标节点13,通知目标节点13运行接收到的封装程序实现功能扩展。The embodiment of the present disclosure discloses a function expansion method. An optional application scenario is shown in FIG. 1 . When the user 10 needs to expand the function of the target node 13 , the central node 11 triggers an expansion instruction, and the central node 11 according to The extension instruction triggered by the user 10 determines the target node identifier and the extended function information, the central node 11 sends a notification message containing the target node identifier and the extended function information to the proxy node 12, and the proxy node 12 sends the package program corresponding to the extended function information to the target node. The corresponding target node 13 is identified, and the target node 13 is notified to run the received encapsulation program to realize function expansion.
本公开实施例提供的功能扩展方法,将可运行的封装程序存储在代理节点中,当需要扩展功能时,中心节点响应触发的扩展指令向代理节点发送通知消息,中心节点将可运行的封装程序发送给目标节点即可实现功能的扩展,不需要变更本地服务代码,不侵入原服务代码,可以在原服务运行的情况下为业务系统扩展功能,不需要将业务下线,缩短业务系统上线新功能的周期,提高对服务代码进行功能扩展的效率。In the function extension method provided by the embodiment of the present disclosure, the runnable encapsulation program is stored in the proxy node. When the expansion function is required, the central node sends a notification message to the proxy node in response to the triggered expansion instruction, and the central node stores the runnable encapsulation program in the proxy node. Function expansion can be achieved by sending to the target node without changing the local service code or invading the original service code. The function can be extended for the business system while the original service is running, and the business system does not need to be offline, shortening the launch of new functions of the business system. , improve the efficiency of functional expansion of service code.
本公开实施例中心节点、代理节点和目标节点可以位于同一个服务器或者部署在不同的服务器;中心节点和代理节点之间可以采用有线连接方式通信或者采用无线通信。In this embodiment of the present disclosure, the central node, the proxy node, and the target node may be located on the same server or deployed on different servers; wired connection or wireless communication may be used between the central node and the proxy node.
此外,本公开实施例提供的功能扩展方法,可以通过不同的代理节点为不同的目标节点扩展多个功能,并可以将多个目标节点的功能扩展结果集中呈现在中心节点上,便于业务开发人员对目标节点的集中式管理。In addition, the function expansion method provided by the embodiment of the present disclosure can expand multiple functions for different target nodes through different proxy nodes, and can present the function expansion results of multiple target nodes on the central node in a centralized manner, which is convenient for service developers. Centralized management of target nodes.
为了使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开作进一步地详细描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, but not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present disclosure.
下面对本公开实施例作进一步详细描述。The embodiments of the present disclosure will be described in further detail below.
图2是根据一示例性实施例示出的一种功能扩展系统的框架示意图,如图2所示,包括中心节点20、至少一个代理节点21以及至少一个目标节点22。FIG. 2 is a schematic frame diagram of a function expansion system according to an exemplary embodiment. As shown in FIG. 2 , it includes a
中心节点20,用于根据触发的扩展指令确定目标节点标识以及扩展功能信息;将包含目标节点标识以及扩展功能信息的通知消息发送给代理节点21,以使代理节点21将扩展功能信息对应的封装程序发送给目标节点标识对应的目标节点22,便于目标节点22通过运行封装程序执行对应的扩展功能。The
代理节点21,用于接收中心节点20发送的包含目标节点标识以及扩展功能信息的通知消息;根据扩展功能信息与封装程序之间的对应关系,确定通知消息中包含的扩展功能信息对应的封装程序;将确定出的封装程序发送给目标节点标识对应的目标节点22,以使目标节点22通过运行封装程序执行对应的扩展功能。The proxy node 21 is used to receive the notification message containing the target node identifier and the extended function information sent by the
目标节点22,用于接收代理节点21发送的封装程序;通过运行所述封装程序执行对应的扩展功能。The
需要说明的是,本公开实施例中需要扩展功能的目标节点可以是服务器,也可以是服务器中某个服务进程,即本公开实施例提供的功能扩展方法可以为某个服务器扩展功能,也可以为服务器中的某个服务进程扩展功能。It should be noted that, in the embodiment of the present disclosure, the target node that needs to expand the function may be a server or a service process in the server, that is, the function expansion method provided by the embodiment of the present disclosure may extend the function for a certain server, or Extend functionality for a service process in the server.
在实施中,中心节点20根据触发的扩展指令确定目标节点标识以及扩展功能信息。其中,扩展指令的触发由用户执行,本公开实施例中用户可以是业务开发人员,业务开发人员触发的扩展指令可以是为某一个目标节点扩展功能的扩展指令,也可以是为多个目标节点扩展功能的扩展指令,且为目标节点扩展功能的数目可以为一个或者多个,在本公开实施例中不做限定。In implementation, the
例如,业务开发人员触发的扩展指令可以是为目标节点A扩展功能1;也可以是为目标节点A扩展功能1和功能2;也可以是为目标节点A、目标节点B都扩展功能1;还可以是为目标节点A扩展功能1、为目标节点B扩展功能2。For example, the extension instruction triggered by the service developer may be to extend function 1 for target node A; it may also be to extend function 1 and function 2 for target node A; it may also be to extend function 1 for both target node A and target node B; It can be to extend function 1 for target node A and extend function 2 for target node B.
扩展指令可以是通过中心节点的显示界面触发,扩展指令中可以包含需要进行功能扩展的目标节点标识以及需要对目标节点扩展的扩展功能信息。The extension instruction may be triggered through the display interface of the central node, and the extension instruction may include the identifier of the target node that needs to be extended and the extension function information that needs to be extended to the target node.
中心节点20根据扩展指令确定目标节点标识以及扩展功能信息时,在一种可选的实施方式中,目标节点标识可以为目标节点的IP和端口,扩展功能信息可以为具体的扩展功能的名称或者标识。例如,扩展指令是为目标节点A扩展功能1,假设目标节点A对应的IP为12.345.67.890,端口为8080,则目标节点20根据扩展指令确定目标节点标识为“12.345.67.890+8080”,扩展功能信息为“扩展功能1”。When the
中心节点20在确定目标节点标识以及扩展功能信息之后,向代理节点21发送包含目标节点标识以及扩展功能信息的通知消息;After determining the target node identifier and the extended function information, the
例如,中心节点20向代理节点21发送的通知消息可以是“12.345.67.890+8080+扩展功能1”。For example, the notification message sent by the
其中,中心节点20可以从多个代理节点21中随机选择一个代理节点21发送包含目标节点标识以及扩展功能信息的通知消息;或者中心节点20可以选择与目标节点22在同一台物理机器上的代理节点21发送包含目标节点标识以及扩展功能信息的通知消息。Wherein, the
代理节点21在接收到中心节点20发送的通知消息之后,根据通知消息中的扩展功能信息确定扩展功能信息对应的封装程序。After receiving the notification message sent by the
在一种可选的实施方式中,代理节点21中存储有各种可扩展功能对应的封装程序,当接收到来自中心节点的通知消息后,根据扩展功能信息与封装程序之间的对应关系,确定通知消息中的扩展功能信息对应的封装程序,之后将确定出的封装程序发送给通知消息中携带的目标节点标识对应的目标节点22。In an optional implementation manner, the agent node 21 stores encapsulation programs corresponding to various extensible functions. After receiving the notification message from the central node, according to the correspondence between the extended function information and the encapsulation programs, The encapsulation program corresponding to the extended function information in the notification message is determined, and then the determined encapsulation program is sent to the
例如,代理节点21中存储有扩展功能1对应的封装程序1、扩展功能2对应的封装程序2、扩展功能3对应的封装程序3、扩展功能4对应的封装程序4、扩展功能5对应的封装程序5。假设,代理节点21接收到的通知消息为“12.345.67.890+8080+扩展功能1”,代理节点21可以根据通知消息中的扩展功能信息“扩展功能1”确定出其对应的封装程序1。将确定出的封装程序1发送给IP为12.345.67.890、端口为8080的目标节点,即代理节点将确定出的封装程序1发送给目标节点A。For example, the agent node 21 stores the package program 1 corresponding to the extended function 1, the package program 2 corresponding to the extended function 2, the package program 3 corresponding to the extended function 3, the package program 4 corresponding to the extended function 4, and the package corresponding to the extended function 5. Procedure 5. Assuming that the notification message received by the proxy node 21 is "12.345.67.890+8080+extended function 1", the proxy node 21 can determine its corresponding encapsulation program 1 according to the extended function information "extended function 1" in the notification message. The determined encapsulation program 1 is sent to the target node whose IP is 12.345.67.890 and the port is 8080, that is, the proxy node sends the determined encapsulation program 1 to the target node A.
需要说明的是,在代理节点21在根据目标节点标识将封装程序发送给目标节点22时,可能会出现发送失败的情况;例如代理节点根据目标节点标识未找到目标节点,或者由于通信线路的问题,代理节点向目标节点发送封装程序失败等。若发送失败,则代理节点21向中心节点20反馈发送失败的消息,以使中心节点20呈现功能扩展失败的结果。若发送成功,在一种可能的实施方式中,代理节点21还可以监控目标节点22对封装程序的运行情况。It should be noted that when the proxy node 21 sends the encapsulation program to the
若代理节点21向目标节点22发送封装程序发送成功,目标节点22在接收到封装程序之后,需要运行接收到的封装程序,执行对应的扩展功能。本公开实施例可以利用类加载器运行接收到的封装程序。If the proxy node 21 sends the encapsulation program to the
一种可选的实施方式为,目标节点22根据下列方式运行接收到的封装程序执行对应的扩展功能:An optional implementation manner is that the
目标节点22通过类加载器加载封装程序,并通过运行封装程序执行对应的扩展功能。The
实施中,目标节点22在接收到代理节点21发送的封装程序之后,通过类加载器加载接收到的封装程序,然后运行加载的封装程序,执行封装程序对应的功能。例如,在目标节点A接收到代理节点发送的封装程序1之后,通过类加载器加载封装程序1,然后运行封装程序1完成功能扩展,扩展的功能为封装程序1对应的扩展功能1。In implementation, after receiving the encapsulation program sent by the proxy node 21, the
在实施中,目标节点22在接收到代理节点21发送的封装程序时,目标节点22的运行状态可能不同,针对目标节点22不同的运行状态,运行通过类加载器加载的封装程序的情况可能不同。下面针对目标节点22不同的运行状态说明目标节点22执行扩展功能的方法。In the implementation, when the
情况一:目标节点22在接收到代理节点21发送的封装程序时,未执行其他功能。Case 1: When the
一种可选的实施方式为,目标节点22在接收到代理节点21发送的封装程序后,直接通过类加载器加载封装程序,并通过运行封装程序执行对应的扩展功能。An optional implementation manner is that after receiving the encapsulation program sent by the proxy node 21, the
实施中,在接收到代理节点21发送的封装程序时,若目标节点22并未执行其他功能,则可以立即通过类加载器加载封装程序并运行封装程序执行对应的扩展功能。例如,目标节点A在接收代理节点发送的扩展功能1对应的封装程序1时,并没有运行其他已有的功能,则目标节点A在接收到封装程序1的之后立即通过类加载器加载封装程序1并执行对应的扩展功能1完成功能扩展。In implementation, when receiving the encapsulation program sent by the proxy node 21, if the
情况二:目标节点22在接收到代理节点21发送的封装程序时,正在执行其他功能。Case 2: The
在该情况二下,目标节点22可以根据下列方式执行扩展功能:In this second case, the
方式1、目标节点22在其他功能执行完成后,通过类加载器加载封装程序,并通过运行封装程序执行对应的扩展功能。Manner 1: After completing the execution of other functions, the
实施中,在接收到代理节点21发送的封装程序时,若目标节点22正在执行其他功能,则可以等待正在执行的功能执行完成之后,通过类加载器加载封装程序并运行封装程序执行对应的扩展功能。In the implementation, when receiving the encapsulation program sent by the proxy node 21, if the
例如,目标节点A在接收代理节点发送的扩展功能1对应的封装程序1时,目标节点A正在运行其他已有的功能,假设目标节点A已有的功能为功能a、功能b、功能c,目标节点A在接收到扩展功能1对应的封装程序1时,目标节点A正在运行功能b,则在功能b运行完之后,目标节点A通过类加载器加载封装程序1并执行对应的扩展功能1完成功能扩展。或者,目标节点A在运行完功能b后运行功能c,在运行功能c运行完之后,目标节点A通过类加载器加载封装程序1并执行对应的扩展功能1完成功能扩展。For example, when the target node A receives the encapsulation program 1 corresponding to the extended function 1 sent by the proxy node, the target node A is running other existing functions. Suppose the existing functions of the target node A are function a, function b, and function c. When the target node A receives the encapsulation program 1 corresponding to the extended function 1, the target node A is running the function b. After the function b runs, the target node A loads the encapsulated program 1 through the class loader and executes the corresponding extended function 1. Complete function expansion. Or, target node A runs function c after running function b. After running function c, target node A loads encapsulation program 1 through the class loader and executes the corresponding extension function 1 to complete the function expansion.
方式2、目标节点22暂停执行其他功能,通过类加载器加载封装程序,并通过运行封装程序执行对应的扩展功能。Mode 2: The
实施中,在接收到代理节点21发送的封装程序时,若目标节点22正在执行其他功能,则可以暂停正在执行的功能,通过类加载器加载封装程序并运行封装程序执行对应的扩展功能。In implementation, when receiving the encapsulation program sent by the proxy node 21, if the
需要说明的是,目标节点22在封装程序运行结束后恢复执行其他功能。It should be noted that the
实施中,目标节点在运行扩展功能对应的封装程序后,继续运行之前暂停的功能。In implementation, after running the wrapper program corresponding to the extended function, the target node continues to run the previously suspended function.
例如,目标节点A在接收代理节点发送的扩展功能1对应的封装程序1时,目标节点A正在运行其他已有的功能,假设目标节点A已有的功能为功能a、功能b、功能c,目标节点A在接收到扩展功能1对应的封装程序1时,目标节点A正在运行功能b,则目标节点A暂停运行功能b,通过类加载器加载封装程序1并执行对应的扩展功能1完成功能扩展。在封装程序1运行完之后,目标节点A恢复执行功能b。For example, when the target node A receives the encapsulation program 1 corresponding to the extended function 1 sent by the proxy node, the target node A is running other existing functions. Suppose the existing functions of the target node A are function a, function b, and function c. When the target node A receives the package program 1 corresponding to the extended function 1, the target node A is running the function b, then the target node A suspends the operation of the function b, loads the package program 1 through the class loader and executes the corresponding extended function 1 to complete the function extension. After the encapsulation program 1 finishes running, the target node A resumes executing the function b.
实施中,在代理节点21会监控目标节点22运行封装程序的情况并将其反馈给中心节点20。In implementation, the proxy node 21 will monitor the situation of the
一种可选的实施方式为,代理节点21获取目标节点22通过运行封装程序执行对应的扩展功能的执行结果,并将获取到的执行结果返回给中心节点22。In an optional implementation manner, the proxy node 21 obtains the execution result of the corresponding extended function executed by the
实施中,代理节点21监控目标节点运行封装程序的情况,将目标节点22运行封装程序的结果反馈给中心节点20。具体的,可以是将目标节点运行封装程序成功或者失败的结果反馈给中心节点,例如,目标节点A成功加载并运行封装程序1,则将目标节点A扩展功能1成功的消息反馈给中心节点;或者可以是将目标节点运行封装程序的程序运行结果反馈给中心节点,例如,在目标节点A中扩展诊断功能,使目标节点A可以诊断自身的错误语句,则在目标节点A加载并运行诊断功能对应的封装程序之后,代理节点获取诊断出来的目标节点A中的错误语句,并将诊断出来的错误语句返回给中心节点。In implementation, the agent node 21 monitors the situation of the target node running the encapsulation program, and feeds back the result of the
中心节点20接收代理节点21返回的目标节点运行封装程序执行对应的扩展功能的执行结果,并呈现执行结果。The
其中,中心节点20将执行结果呈现给用户,本公开实施例中用户可以是业务开发人员。The
需要说明的是,本公开实施例中提供的“代理节点”可以是多个,且每个代理节点中存储的可扩展功能对应的封装程序类型可以相同,也可以不同,或者,每个代理节点中存储所有的可扩展功能对应的封装程序。当需要为目标节点扩展代理节点中预先存储的可扩展功能之外的功能时,只需要在代理节点中心增加该功能对应封装程序,即可利用本公开实施例提供的功能扩展方法为目标节点扩展功能。It should be noted that there may be multiple “proxy nodes” provided in the embodiments of the present disclosure, and the types of encapsulation programs corresponding to the extensible functions stored in each proxy node may be the same or different, or, each proxy node Store all the wrappers corresponding to the extensible functions in . When a function other than the pre-stored extensible function in the proxy node needs to be expanded for the target node, it is only necessary to add a package program corresponding to the function in the center of the proxy node, and then the function expansion method provided by the embodiment of the present disclosure can be used to expand the target node Function.
下面通过几种具体的可扩展功能来说明本公开实施例提供的功能扩展方法。The following describes the function expansion method provided by the embodiments of the present disclosure by using several specific expandable functions.
本公开实施例提供的可扩展功能包括:监控、日志采集、诊断、故障模拟、灰度、熔断与恢复。The scalable functions provided by the embodiments of the present disclosure include: monitoring, log collection, diagnosis, fault simulation, grayscale, fusing and recovery.
具体的,对这几种扩展功能进行介绍:Specifically, these extended functions are introduced:
监控功能:用来监控目标节点的内存以及目标节点的CPU使用情况、或者反应用户访问数量、http请求的执行数量、平均执行时间等,可选的目标节点可以是服务器。当目标节点没有监控功能时,可以通过本公开实施例提供的方法为目标节点扩展监控功能。Monitoring function: It is used to monitor the memory of the target node and the CPU usage of the target node, or to reflect the number of user accesses, the execution number of http requests, the average execution time, etc. The optional target node can be a server. When the target node does not have the monitoring function, the monitoring function can be extended for the target node through the method provided by the embodiment of the present disclosure.
日志采集功能:采集目标节点的运行日志用以对日志数据进行分析处理,从而对目标节点进行完善等。当目标节点没有日志采集功能,可以通过本公开实施例提供的方法为目标节点扩展日志采集功能;或者目标节点的日志采集功能只能采集目标节点中部分服务的日志时,可以通过本公开实施例提供的方法使目标节点的日志采集功能可以采集目标节点中全部服务的日志。Log collection function: collect the running log of the target node to analyze and process the log data, so as to improve the target node, etc. When the target node does not have the log collection function, the method provided by the embodiment of the present disclosure can be used to extend the log collection function for the target node; or when the log collection function of the target node can only collect logs of some services in the target node, the method provided by the embodiment of the present disclosure can be used. The provided method enables the log collection function of the target node to collect logs of all services in the target node.
诊断功能:可以用来诊断目标节点所运行的程序中的错误语句用以对错误语句进行修改。可以将用于诊断的程序进行封装,通过本公开实施例提供的方法将封装好的诊断程序加载到目标节点中,诊断目标节点中的错误语句。Diagnosis function: It can be used to diagnose the error statement in the program run by the target node to modify the error statement. The program for diagnosis can be encapsulated, and the encapsulated diagnostic program can be loaded into the target node through the method provided by the embodiment of the present disclosure, and the error statement in the target node can be diagnosed.
故障模拟功能:模拟故障,用于验证目标节点的可靠性。例如,需要在目标节点中设置故障,可以提前编译一段故障程序,通过本公开实施例提供的方法将封装好的故障程序加载到目标节点中去,进行故障模拟。Fault simulation function: simulate faults to verify the reliability of the target node. For example, if a fault needs to be set in the target node, a fault program can be compiled in advance, and the packaged fault program is loaded into the target node by the method provided by the embodiment of the present disclosure to perform fault simulation.
灰度发布功能:是一种能够平滑过渡的发布方式。比如,上线新功能后,先让用户中的一部分使用新功能,再逐步扩大范围,直到让所有用户使用新功能。灰度发布可以保证整体新功能的稳定,在新功能上线初始就可以发现、调整问题,以免造成无法挽回的影响。在需要扩大新功能使用范围时,可以将使用范围扩大后对应的程序进行封装,通过本公开实施例提供的方法将封装好的程序加载到目标节点中去,进行灰度发布。Grayscale publishing function: It is a publishing method that can smoothly transition. For example, after launching a new function, let some users use the new function, and then gradually expand the scope until all users can use the new function. The grayscale release can ensure the stability of the overall new function, and problems can be found and adjusted at the beginning of the launch of the new function, so as to avoid irreversible effects. When the scope of use of the new function needs to be expanded, the program corresponding to the expanded scope of use can be encapsulated, and the encapsulated program can be loaded into the target node by the method provided by the embodiment of the present disclosure for grayscale release.
熔断与恢复:熔断一般是指应用系统中,由于某些原因使得服务出现了过载现象,为防止造成整个系统故障,从而采用的一种保护措施,熔断也称为过载保护,恢复是指对于被熔断的服务的请求,一段时间后允许部分请求通过,逐渐恢复被熔断的服务。本公开实施例可以根据中心节点监控到的目标节点的数据调整目标节点熔断与恢复的条件,以保证目标节点的正常运行;或者将目标节点的兜底程序进行封装,当目标节点发生故障时,通过本公开实施例提供的方法将兜底程序加载到封装程序中,保证目标节点的正常运行。Fusing and recovery: Fusing generally refers to the overloading of services due to some reasons in the application system. In order to prevent the entire system from malfunctioning, a protective measure is adopted. Fusing is also called overload protection. For the requests of the blown service, some requests are allowed to pass after a period of time, and the blown service is gradually restored. The embodiments of the present disclosure can adjust the fusing and recovery conditions of the target node according to the data of the target node monitored by the central node, so as to ensure the normal operation of the target node; The method provided by the embodiment of the present disclosure loads the bottom-line program into the encapsulation program to ensure the normal operation of the target node.
需要说明的是,本公开实施例中提供的可扩展功能包括但不限于上述几种,任何可以通过本公开实施例提供的功能扩展方法扩展的功能都在本公开的保护范围之内。It should be noted that the extensible functions provided in the embodiments of the present disclosure include but are not limited to the above-mentioned types, and any functions that can be expanded by the function expansion methods provided in the embodiments of the present disclosure are within the protection scope of the present disclosure.
每个代理节点可以存储上述六种扩展功能中的至少一种,例如:代理节点1中存储有“监控”、“日志采集”对应的封装程序;代理节点2中存储有“诊断”、“故障模拟”、“灰度”对应的封装程序;代理节点3中存储有“监控”、“日志采集”、“诊断”、“灰度”、“熔断与恢复”对应的封装程序;代理节点4和代理节点5中均存储有“监控”“日志采集”“诊断”“故障模拟”“灰度”“熔断与恢复”对应的封装程序,本公开实施例对此不做限定。Each proxy node can store at least one of the above six extended functions, for example: proxy node 1 stores the encapsulation programs corresponding to "monitoring" and "log collection"; proxy node 2 stores "diagnosis", "fault" The encapsulation programs corresponding to Simulation” and “Grayscale”; the encapsulation programs corresponding to “Monitoring”, “Log Collection”, “Diagnosis”, “Grayscale”, and “Fusing and Recovery” are stored in the agent node 3; the agent node 4 and The encapsulation programs corresponding to "monitoring", "log collection", "diagnosis", "fault simulation", "grayscale", and "fuse and recovery" are stored in the agent node 5, which are not limited in the embodiment of the present disclosure.
为了清楚的描述本公开实施例的功能扩展方法,以两个代理节点为例,分别为代理节点1、代理节点2,两个代理节点中均存储有“监控”“日志采集”“诊断”“故障模拟”“灰度”“熔断与恢复”对应的封装程序。In order to clearly describe the function expansion method of the embodiment of the present disclosure, two proxy nodes are taken as an example, namely, proxy node 1 and proxy node 2, respectively. The package program corresponding to "Fault Simulation", "Grayscale" and "Fusing and Recovery".
图3是根据一示例性实施例示出的一种功能扩展方法的示意图,如图3所示,假设,业务开发人员通过中心节点的显示界面触发扩展指令,扩展指令是:为目标节点1扩展监控功能、日志采集功能;为目标节点2扩展诊断功能、故障模拟;为目标节点3扩展灰度范围以及改变熔断与恢复条件。其中,代理节点1和目标节点1在同一台物理机器上,代理节点2、目标节点2和目标节点3在同一台物理机器上。FIG. 3 is a schematic diagram of a function expansion method according to an exemplary embodiment. As shown in FIG. 3 , it is assumed that a service developer triggers an expansion instruction through the display interface of the central node, and the expansion instruction is: expand the monitoring for the target node 1 function, log collection function; extended diagnosis function and fault simulation for target node 2; extended gray range for target node 3 and changed fusing and recovery conditions. The proxy node 1 and the target node 1 are on the same physical machine, and the proxy node 2, the target node 2, and the target node 3 are on the same physical machine.
中心节点根据扩展指令确定目标节点标识以及扩展功能信息,例如,确定的目标节点标识以及扩展功能信息为“10.305.60.800+8000+监控功能、日志采集功能”、“15.355.60.500+8220+诊断功能、故障模拟”和“15.355.60.500+8330+灰度、熔断与恢复”。其中,“10.305.60.800+8000”为目标节点1的标识,“15.355.60.500+8220”为目标节点2的标识,“15.355.60.500+8330”为目标节点3的标识。The central node determines the target node identifier and extended function information according to the extended instruction. For example, the determined target node identifier and extended function information are "10.305.60.800+8000+ monitoring function, log collection function", "15.355.60.500+8220+ diagnosis function" , Fault Simulation" and "15.355.60.500+8330+ Grayscale, Fusing and Recovery". Among them, "10.305.60.800+8000" is the identifier of the target node 1, "15.355.60.500+8220" is the identifier of the target node 2, and "15.355.60.500+8330" is the identifier of the target node 3.
中心节点将包含目标节点标识以及扩展功能信息的通知消息发送给代理节点,实施中,可以是将“10.305.60.800+8000+监控功能、日志采集功能”发送给代理节点1,将“15.355.60.500+8220+诊断功能、故障模拟”和“15.355.60.500+8330+灰度、熔断与恢复”发送给代理节点2。The central node sends a notification message containing the target node identifier and extended function information to the agent node. In implementation, it can send "10.305.60.800+8000+ monitoring function, log collection function" to the agent node 1, and "15.355.60.500" +8220+Diagnostic function, fault simulation” and “15.355.60.500+8330+Grayscale, fusing and recovery” are sent to proxy node 2.
代理节点1在接收到中心节点发送的通知消息之后,根据通知消息“10.305.60.800+8000+监控功能、日志采集功能”确定将监控功能对应的封装程序以及日志采集功能对应的封装程序发送给IP为10.305.60.800、端口为8000的目标节点1。代理节点2在接收到中心节点发送的通知消息之后,根据通知消息“15.355.60.500+8220+诊断功能、故障模拟”和“15.355.60.500+8330+灰度、熔断与恢复”确定诊断功能对应的封装程序以及故障模拟对应的封装程序发送给IP为15.355.60.500端口为8220的目标节点2;将灰度对应的封装程序以及熔断与恢复对应的封装程序发送给IP为15.355.60.500端口为8330的目标节点3。After receiving the notification message sent by the central node, the agent node 1 determines to send the package program corresponding to the monitoring function and the package program corresponding to the log collection function to the IP according to the notification message "10.305.60.800+8000+ monitoring function, log collection function" The target node 1 is 10.305.60.800 and the port is 8000. After receiving the notification message sent by the central node, the agent node 2 determines the corresponding diagnostic function according to the notification messages "15.355. The encapsulation program and the encapsulation program corresponding to the fault simulation are sent to the target node 2 whose IP is 15.355.60.500 and the port is 8220; target node 3.
需要说明的是,上述实施例仅是示例的,中心节点也可以将为目标节点1进行功能扩展的通知消息发送给代理节点2,通过代理节点2为目标节点1进行功能扩展。It should be noted that the above embodiment is only an example, and the central node may also send a notification message that the target node 1 will perform function expansion to the proxy node 2, and the proxy node 2 can perform function expansion for the target node 1.
假设目标节点1接收到代理节点1发送的监控功能对应的封装程序以及日志采集功能对应的封装程序时,未运行其他功能,则目标节点1立即通过类加载器加载监控功能对应的封装程序以及日志采集功能对应的封装程序,并运行上述封装程序,代理节点1监控目标节点1的执行结果,并将执行结果发送给中心节点。例如,代理节点监控目标节点1成功运行监控功能对应的封装程序以及日志采集功能对应的封装程序,向中心节点返回下列消息:Assuming that when target node 1 receives the package program corresponding to the monitoring function and the package program corresponding to the log collection function sent by agent node 1, other functions are not running, then target node 1 immediately loads the package program and log corresponding to the monitoring function through the class loader. The encapsulation program corresponding to the collection function is collected, and the encapsulation program is run. The agent node 1 monitors the execution result of the target node 1 and sends the execution result to the central node. For example, the agent node monitors the target node 1 to successfully run the package program corresponding to the monitoring function and the package program corresponding to the log collection function, and returns the following messages to the central node:
“10.305.60.800+8000监控功能扩展成功、日志采集功能扩展成功”。"10.305.60.800+8000 monitoring function expanded successfully, log collection function expanded successfully".
假设目标节点2接收到代理节点2发送的诊断功能对应的封装程序以及故障模拟对应的封装程序时,正在运行其他功能,则目标节点2可以在运行完当前正在运行的功能后,通过类加载器加载诊断功能对应的封装程序以及故障模拟对应的封装程序,并运行上述封装程序,代理节点2监控目标节点2的执行结果,并将执行结果发送给中心节点。例如,代理节点监控目标节点2成功运行诊断功能对应的封装程序以及故障模拟对应的封装程序,向中心节点返回下列消息:Assuming that the target node 2 is running other functions when it receives the encapsulation program corresponding to the diagnostic function and the encapsulation program corresponding to the fault simulation sent by the agent node 2, the target node 2 can pass the class loader after running the currently running function. Load the package program corresponding to the diagnosis function and the package program corresponding to the fault simulation, and run the above package program, the proxy node 2 monitors the execution result of the target node 2, and sends the execution result to the central node. For example, the agent node monitors the target node 2 to successfully run the encapsulation program corresponding to the diagnosis function and the encapsulation program corresponding to the fault simulation, and returns the following message to the central node:
“15.355.60.500+8220诊断功能扩展成功,错误语句为:第1行、第186至255行;日志采集功能扩展成功”。"The 15.355.60.500+8220 diagnostic function has been expanded successfully, and the error statement is: line 1, line 186 to 255; the log collection function has been expanded successfully".
目标节点3接收到代理节点2发送的灰度功能对应的封装程序以及熔断与恢复对应的封装程序时,成功接收灰度功能对应的封装程序,熔断与恢复对应的封装程序接收失败,且接收到灰度功能对应的封装程序时正在运行其他功能,则目标节点3暂停正在运行的功能,并通过类加载器加载灰度功能对应的封装程序并运行,在运行结束灰度功能对应的封装程序之后,恢复运行之前暂停的其他功能。代理节点2监控目标节点3的执行结果,并将执行结果发送给中心节点。例如,代理节点监控目标节点3成功运行灰度功能对应的封装程序,向中心节点返回下列消息:When the target node 3 receives the encapsulation program corresponding to the grayscale function and the encapsulation program corresponding to the fusing and recovery sent by the agent node 2, it successfully receives the encapsulation program corresponding to the grayscale function, but fails to receive the encapsulation program corresponding to the fusing and recovery, and receives When the wrapper program corresponding to the grayscale function is running other functions, the target node 3 suspends the running function, and loads the wrapper program corresponding to the grayscale function through the class loader and runs it. After the wrapper program corresponding to the grayscale function is finished running , to resume other functions that were previously suspended. The proxy node 2 monitors the execution result of the target node 3 and sends the execution result to the central node. For example, the agent node monitors the target node 3 to successfully run the encapsulation program corresponding to the grayscale function, and returns the following message to the central node:
“15.355.60.500+8330灰度功能扩展成功、熔断与恢复封装程序发送失败”。"15.355.60.500+8330 grayscale function expansion succeeded, fuse and recovery package program failed to send".
中心节点呈现代理节点1、代理节点2返回的执行结果,本公开实施例中可以将执行结果呈现给业务开发人员。The central node presents the execution results returned by the proxy node 1 and the proxy node 2, and in this embodiment of the present disclosure, the execution results may be presented to service developers.
图4是根据一示例性实施例示出的一种功能扩展方法的交互流程图,本公开实施例以目标节点接收到封装程序时未运行其他功能为例说明本公开实施例提供的功能扩展方法。如图4所示,包括以下步骤:FIG. 4 is an interaction flow chart of a function expansion method according to an exemplary embodiment. The embodiment of the present disclosure uses an example that the target node does not run other functions when receiving the encapsulation program as an example to illustrate the function expansion method provided by the embodiment of the present disclosure. As shown in Figure 4, it includes the following steps:
在步骤S401中,中心节点响应触发的扩展指令,根据扩展指令确定目标节点标识以及扩展功能信息;In step S401, the central node responds to the triggered extension instruction, and determines the target node identifier and extension function information according to the extension instruction;
在步骤S402中,中心节点将包含目标节点标识以及扩展功能信息的通知消息发送给代理节点;In step S402, the central node sends a notification message including the target node identifier and extended function information to the proxy node;
在步骤S403中,代理节点根据扩展功能信息与封装程序之间的对应关系,确定通知消息中的扩展功能信息对应的封装程序;In step S403, the proxy node determines the encapsulation program corresponding to the extended function information in the notification message according to the correspondence between the extended function information and the encapsulation program;
在步骤S404中,代理节点将确定出的封装程序发送给通知消息中目标节点标识对应的目标节点;In step S404, the proxy node sends the determined encapsulation program to the target node corresponding to the target node identifier in the notification message;
在步骤S405中,目标节点通过类加载器加载代理节点发送的封装程序,并运行封装程序执行对应的扩展功能;In step S405, the target node loads the package program sent by the proxy node through the class loader, and runs the package program to execute the corresponding extension function;
在步骤S406中,代理节点获取目标节点运行封装程序执行对应的扩展功能的执行结果;In step S406, the proxy node obtains the execution result of the target node running the encapsulation program to execute the corresponding extended function;
在步骤S407中,代理节点将获取到的执行结果返回给中心节点;In step S407, the proxy node returns the obtained execution result to the central node;
在步骤S408中,中心节点将接收到的代理节点返回的执行结果并呈现。In step S408, the central node presents the received execution result returned by the proxy node.
图5是根据一示例性实施例示出的一种功能扩展装置框图,该装置可应用于代理节点。参照图5,该装置包括第一接收模块500,第一确定模块501,第一发送模块502。Fig. 5 is a block diagram showing a function extension apparatus according to an exemplary embodiment, and the apparatus can be applied to a proxy node. Referring to FIG. 5 , the apparatus includes a first receiving module 500 , a first determining module 501 , and a first sending module 502 .
第一接收模块500,被配置为执行接收中心节点发送的包含目标节点标识以及扩展功能信息的通知消息;其中,所述目标节点标识以及所述扩展功能信息为所述中心节点根据触发的扩展指令确定的;The first receiving module 500 is configured to receive a notification message including a target node identifier and extended function information sent by a central node; wherein, the target node identifier and the extended function information are extended instructions triggered by the central node according to the definite;
第一确定模块501,被配置为执行根据扩展功能信息与封装程序之间的对应关系,确定所述通知消息中包含的所述扩展功能信息对应的封装程序;The first determining module 501 is configured to execute, according to the corresponding relationship between the extended function information and the encapsulation program, to determine the encapsulation program corresponding to the extended function information contained in the notification message;
第一发送模块502,被配置为执行将确定出的所述封装程序发送给所述目标节点标识对应的目标节点,以使所述目标节点通过运行所述封装程序执行对应的扩展功能。The first sending module 502 is configured to execute sending the determined encapsulation program to a target node corresponding to the target node identifier, so that the target node executes the corresponding extended function by running the encapsulation program.
在一种可能的实现方式中,所述第一发送模块502还被配置为执行获取所述目标节点通过运行所述封装程序执行对应的扩展功能的执行结果,并将获取到的执行结果返回给所述中心节点,以使所述中心节点呈现所述执行结果。In a possible implementation manner, the first sending module 502 is further configured to execute and obtain the execution result of the corresponding extended function executed by the target node by running the encapsulation program, and return the obtained execution result to the the central node, so that the central node presents the execution result.
图6是根据一示例性实施例示出的另一种功能扩展装置框图,该装置可应用于目标节点。参照图6,该装置包括第二接收模块600,运行模块601。Fig. 6 is a block diagram showing another function expansion apparatus according to an exemplary embodiment, and the apparatus can be applied to a target node. Referring to FIG. 6 , the apparatus includes a
第二接收模块600,被配置为执行接收代理节点发送的封装程序;其中,所述封装程序为所述代理节点根据中心节点发送的通知消息中包含的扩展功能信息以及扩展功能信息与封装程序之间的对应关系确定的;The
运行模块601,被配置为执行通过运行所述封装程序执行对应的扩展功能。The running
在一种可能的实现方式中,所述运行模块601被配置为执行通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能。In a possible implementation manner, the running
在一种可能的实现方式中,所述运行模块601被配置为执行若接收到所述封装程序时未执行其他功能,则通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能;或In a possible implementation manner, the running
若接收到所述封装程序时正在执行其他功能,则在所述其他功能执行完成后,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能;或If other functions are being executed when the packaged program is received, after the execution of the other functions is completed, the packaged program is loaded through the class loader, and the corresponding extended function is executed by running the packaged program; or
若接收到所述封装程序时正在执行其他功能,则暂停执行所述其他功能,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能。If other functions are being executed when the packaged program is received, execution of the other functions is suspended, the packaged program is loaded through a class loader, and the corresponding extended function is executed by running the packaged program.
在一种可能的实现方式中,所述运行模块601被配置为执行在所述封装程序运行结束后恢复执行所述其他功能。In a possible implementation manner, the running
图7是根据一示例性实施例示出的另一种功能扩展装置框图,该装置可应用于中心节点。参照图7,该装置包括第二确定模块700,第二发送模块701。Fig. 7 is a block diagram showing another function expansion apparatus according to an exemplary embodiment, and the apparatus can be applied to a central node. Referring to FIG. 7 , the apparatus includes a second determining
第二确定模块700,被配置为执行根据触发的扩展指令确定目标节点标识以及扩展功能信息;The second determining
第二发送模块701,被配置为执行将包含所述目标节点标识以及扩展功能信息的通知消息发送给代理节点,以使所述代理节点将所述扩展功能信息对应的封装程序发送给所述目标节点标识对应的目标节点,便于所述目标节点通过运行所述封装程序执行对应的扩展功能。The
在一种可能的实现方式中,还包括:第三接收模块,被配置为执行接收所述代理节点返回的所述目标节点运行所述封装程序执行对应的扩展功能的执行结果,并呈现所述执行结果。In a possible implementation manner, the method further includes: a third receiving module, configured to receive the execution result of the target node running the encapsulation program and executing the corresponding extended function returned by the proxy node, and present the execution result of the corresponding extended function. Results of the.
关于上述实施例中的装置,其中各个模块执行请求的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the foregoing embodiment, the specific manner in which each module executes the request has been described in detail in the embodiment of the method, and will not be described in detail here.
图8是根据一示例性实施例示出的一种电子设备800的框图,该电子设备包括:FIG. 8 is a block diagram of an
处理器810;
用于存储所述处理器810可执行指令的存储器820;a
其中,所述处理器810被配置为执行所述指令,以实现本公开实施例中的代理节点侧功能扩展方法。Wherein, the
图9是根据一示例性实施例示出的另一种电子设备900的框图,该电子设备包括:FIG. 9 is a block diagram of another
处理器910;
用于存储所述处理器910可执行指令的存储器920;a
其中,所述处理器910被配置为执行所述指令,以实现本公开实施例中目标节点侧的功能扩展方法。The
图10是根据一示例性实施例示出的一种电子设备1000的框图,该电子设备包括:FIG. 10 is a block diagram of an
处理器1010;
用于存储所述处理器1010可执行指令的存储器1020;a
其中,所述处理器1010被配置为执行所述指令,以实现本公开实施例中中心节点侧的功能扩展方法。The
在示例性实施例中,还提供了一种包括指令的非易失性存储介质,例如包括指令的存储器820,上述指令可由电子设备800的处理器810执行以完成上述方法。可选地,存储介质可以是非临时性计算机可读存储介质,例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a non-volatile storage medium including instructions, such as a
在示例性实施例中,还提供了一种包括指令的非易失性存储介质,例如包括指令的存储器920,上述指令可由电子设备900的处理器910执行以完成上述方法。可选地,存储介质可以是非临时性计算机可读存储介质,例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a non-volatile storage medium including instructions, such as a
在示例性实施例中,还提供了一种包括指令的非易失性存储介质,例如包括指令的存储器1020,上述指令可由电子设备1000的处理器1010执行以完成上述方法。可选地,存储介质可以是非临时性计算机可读存储介质,例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a non-volatile storage medium including instructions, such as a
基于同一发明构思,本公开实施例中还提供了一种功能扩展方法,由于该方法对应的是本公开实施例功能扩展系统对应的代理节点,并且该方法解决问题的原理与该系统相似,因此该方法的实施可以参见系统的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present disclosure also provides a function expansion method. Since the method corresponds to the proxy node corresponding to the function expansion system of the embodiment of the present disclosure, and the principle of solving the problem of the method is similar to that of the system, therefore For the implementation of the method, reference may be made to the implementation of the system, and the repetition will not be repeated.
图11是根据一示例性实施例示出的一种代理节点侧功能扩展方法的流程图,如图11所示,包括以下步骤:Fig. 11 is a flow chart of a method for extending a function on a proxy node side according to an exemplary embodiment. As shown in Fig. 11 , the method includes the following steps:
在步骤S1101中,接收中心节点发送的包含目标节点标识以及扩展功能信息的通知消息;In step S1101, receive a notification message including the target node identifier and extended function information sent by the central node;
其中,所述目标节点标识以及所述扩展功能信息为所述中心节点根据触发的扩展指令确定的;Wherein, the target node identifier and the extended function information are determined by the central node according to the triggered extended instruction;
在步骤S1102中,根据扩展功能信息与封装程序之间的对应关系,确定所述通知消息中包含的所述扩展功能信息对应的封装程序;In step S1102, according to the correspondence between the extended function information and the encapsulation program, determine the encapsulation program corresponding to the extended function information contained in the notification message;
在步骤S1103中,将确定出的所述封装程序发送给所述目标节点标识对应的目标节点,以使所述目标节点通过运行所述封装程序执行对应的扩展功能。In step S1103, the determined encapsulation program is sent to the target node corresponding to the target node identifier, so that the target node executes the corresponding extended function by running the encapsulation program.
在一种可能的实现方式中,在将确定出的所述封装程序发送给所述目标节点标识对应的目标节点之后,还包括:In a possible implementation manner, after the determined encapsulation program is sent to the target node corresponding to the target node identifier, the method further includes:
获取所述目标节点通过运行所述封装程序执行对应的扩展功能的执行结果,并将获取到的执行结果返回给所述中心节点,以使所述中心节点呈现所述执行结果。Acquiring an execution result of the target node executing the corresponding extended function by running the encapsulation program, and returning the acquired execution result to the central node, so that the central node presents the execution result.
基于同一发明构思,本公开实施例中还提供了一种功能扩展方法,由于该方法对应的是本公开实施例功能扩展系统对应的目标节点,并且该方法解决问题的原理与该系统相似,因此该方法的实施可以参见系统的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present disclosure also provides a function expansion method. Since the method corresponds to the target node corresponding to the function expansion system of the embodiment of the present disclosure, and the principle of solving the problem of the method is similar to that of the system, therefore For the implementation of the method, reference may be made to the implementation of the system, and the repetition will not be repeated.
图12是根据一示例性实施例示出的一种目标节点侧功能扩展方法的流程图,如图12所示,包括以下步骤:Fig. 12 is a flow chart of a method for extending functions on a target node side according to an exemplary embodiment, as shown in Fig. 12, including the following steps:
在步骤S1201中,接收代理节点发送的封装程序;In step S1201, receive the encapsulation program sent by the proxy node;
其中,所述封装程序为所述代理节点根据中心节点发送的通知消息中包含的扩展功能信息以及扩展功能信息与封装程序之间的对应关系确定的;Wherein, the encapsulation program is determined by the proxy node according to the extended function information contained in the notification message sent by the central node and the corresponding relationship between the extended function information and the encapsulation program;
在步骤S1202中,通过运行所述封装程序执行对应的扩展功能。In step S1202, the corresponding extended function is executed by running the encapsulation program.
在一种可能的实现方式中,所述通过运行所述封装程序执行对应的扩展功能,包括:In a possible implementation manner, executing the corresponding extended function by running the encapsulation program includes:
通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能。The encapsulation program is loaded by a class loader, and the corresponding extension function is executed by running the encapsulation program.
在一种可能的实现方式中,所述通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能,包括:In a possible implementation manner, the encapsulation program is loaded by a class loader, and the corresponding extension function is executed by running the encapsulation program, including:
若接收到所述封装程序时未执行其他功能,则通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能;或If no other function is performed when the packaged program is received, load the packaged program through a class loader, and execute the corresponding extended function by running the packaged program; or
若接收到所述封装程序时正在执行其他功能,则在所述其他功能执行完成后,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能;或If other functions are being executed when the packaged program is received, after the execution of the other functions is completed, the packaged program is loaded through the class loader, and the corresponding extended function is executed by running the packaged program; or
若接收到所述封装程序时正在执行其他功能,则暂停执行所述其他功能,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能。If other functions are being executed when the packaged program is received, execution of the other functions is suspended, the packaged program is loaded through a class loader, and the corresponding extended function is executed by running the packaged program.
在一种可能的实现方式中,在暂停执行所述其他功能,通过类加载器加载所述封装程序,并通过运行所述封装程序执行对应的扩展功能之后,还包括:In a possible implementation manner, after suspending execution of the other functions, loading the encapsulation program through a class loader, and executing the corresponding extension function through running the encapsulation program, the method further includes:
在所述封装程序运行结束后恢复执行所述其他功能。The execution of the other functions is resumed after the execution of the encapsulation program ends.
基于同一发明构思,本公开实施例中还提供了一种功能扩展方法,由于该方法对应的是本公开实施例功能扩展系统对应的中心节点,并且该方法解决问题的原理与该系统相似,因此该方法的实施可以参见系统的实施,重复之处不再赘述。Based on the same inventive concept, the embodiment of the present disclosure also provides a function expansion method. Since the method corresponds to the central node corresponding to the function expansion system of the embodiment of the present disclosure, and the principle of solving the problem of the method is similar to that of the system, therefore For the implementation of the method, reference may be made to the implementation of the system, and the repetition will not be repeated.
图13是根据一示例性实施例示出的一种中心节点侧功能扩展方法的流程图,如图13所示,包括以下步骤:Fig. 13 is a flow chart of a method for extending functions on a central node side according to an exemplary embodiment, as shown in Fig. 13 , including the following steps:
在步骤S1301中,根据触发的扩展指令确定目标节点标识以及扩展功能信息;In step S1301, the target node identifier and the extended function information are determined according to the triggered extended instruction;
在步骤S1302中,将包含所述目标节点标识以及扩展功能信息的通知消息发送给代理节点,以使所述代理节点将所述扩展功能信息对应的封装程序发送给所述目标节点标识对应的目标节点,便于所述目标节点通过运行所述封装程序执行对应的扩展功能。In step S1302, a notification message including the target node identifier and extended function information is sent to the proxy node, so that the proxy node sends the encapsulation program corresponding to the extended function information to the target corresponding to the target node identifier node, so that the target node can execute the corresponding extended function by running the encapsulation program.
在一种可能的实现方式中,所述将包含所述目标节点标识以及扩展功能信息的通知消息发送给代理节点之后,还包括:In a possible implementation manner, after the notification message including the target node identifier and the extended function information is sent to the proxy node, the method further includes:
接收所述代理节点返回的所述目标节点运行所述封装程序执行对应的扩展功能的执行结果,并呈现所述执行结果。Receive the execution result of the target node running the encapsulation program to execute the corresponding extended function returned by the proxy node, and present the execution result.
本公开实施例还提供一种计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行实现本公开实施例上述任意一项功能扩展方法或任意一项功能扩展方法任一可能涉及的方法。An embodiment of the present disclosure further provides a computer program product, which, when the computer program product runs on an electronic device, enables the electronic device to execute any one of the above-mentioned function expansion methods or any one of the function expansion methods in the embodiments of the present disclosure any method that may be involved.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common general knowledge or techniques in the technical field not disclosed by this disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911025546.1A CN110795109A (en) | 2019-10-25 | 2019-10-25 | Function expansion method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911025546.1A CN110795109A (en) | 2019-10-25 | 2019-10-25 | Function expansion method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110795109A true CN110795109A (en) | 2020-02-14 |
Family
ID=69441385
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911025546.1A Pending CN110795109A (en) | 2019-10-25 | 2019-10-25 | Function expansion method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110795109A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115514665A (en) * | 2022-08-31 | 2022-12-23 | 北京达佳互联信息技术有限公司 | Service expansion method and device, electronic equipment and storage medium |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040034860A1 (en) * | 2002-08-15 | 2004-02-19 | Microsoft Corporation | Dynamically extensible application program framework including message and notification routing |
CN1976289A (en) * | 2006-12-22 | 2007-06-06 | 中国建设银行股份有限公司 | Program arranging method and system based on distributing network |
CN101499931A (en) * | 2009-03-13 | 2009-08-05 | 中兴通讯股份有限公司 | Function expansion method and system based on distributed environment |
CN104765621A (en) * | 2014-01-02 | 2015-07-08 | 国际商业机器公司 | Method and system for deploying program on cluster node |
CN104834534A (en) * | 2015-06-09 | 2015-08-12 | 北京奇虎科技有限公司 | Application program function extension method, device and system |
WO2017097122A1 (en) * | 2015-12-08 | 2017-06-15 | 阿里巴巴集团控股有限公司 | Information processing method, apparatus and system, and terminal device |
CN107077358A (en) * | 2014-09-25 | 2017-08-18 | 甲骨文国际公司 | For the system and method for the Dynamical Deployment for supporting executable code in a distributed computing environment |
CN107465548A (en) * | 2017-08-17 | 2017-12-12 | 北京云纵信息技术有限公司 | The dispositions method and device of code |
CN107479869A (en) * | 2017-06-28 | 2017-12-15 | 中国建设银行股份有限公司 | Realize the method and system of Function Extension |
CN108334379A (en) * | 2018-01-05 | 2018-07-27 | 北京明略软件系统有限公司 | A kind of implementation method and realization device of page expansion function |
CN109710428A (en) * | 2018-12-27 | 2019-05-03 | 杭州数梦工场科技有限公司 | A kind of dynamic call method and device for realizing class |
-
2019
- 2019-10-25 CN CN201911025546.1A patent/CN110795109A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040034860A1 (en) * | 2002-08-15 | 2004-02-19 | Microsoft Corporation | Dynamically extensible application program framework including message and notification routing |
CN1976289A (en) * | 2006-12-22 | 2007-06-06 | 中国建设银行股份有限公司 | Program arranging method and system based on distributing network |
CN101499931A (en) * | 2009-03-13 | 2009-08-05 | 中兴通讯股份有限公司 | Function expansion method and system based on distributed environment |
CN104765621A (en) * | 2014-01-02 | 2015-07-08 | 国际商业机器公司 | Method and system for deploying program on cluster node |
CN107077358A (en) * | 2014-09-25 | 2017-08-18 | 甲骨文国际公司 | For the system and method for the Dynamical Deployment for supporting executable code in a distributed computing environment |
CN104834534A (en) * | 2015-06-09 | 2015-08-12 | 北京奇虎科技有限公司 | Application program function extension method, device and system |
WO2017097122A1 (en) * | 2015-12-08 | 2017-06-15 | 阿里巴巴集团控股有限公司 | Information processing method, apparatus and system, and terminal device |
CN107479869A (en) * | 2017-06-28 | 2017-12-15 | 中国建设银行股份有限公司 | Realize the method and system of Function Extension |
CN107465548A (en) * | 2017-08-17 | 2017-12-12 | 北京云纵信息技术有限公司 | The dispositions method and device of code |
CN108334379A (en) * | 2018-01-05 | 2018-07-27 | 北京明略软件系统有限公司 | A kind of implementation method and realization device of page expansion function |
CN109710428A (en) * | 2018-12-27 | 2019-05-03 | 杭州数梦工场科技有限公司 | A kind of dynamic call method and device for realizing class |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115514665A (en) * | 2022-08-31 | 2022-12-23 | 北京达佳互联信息技术有限公司 | Service expansion method and device, electronic equipment and storage medium |
CN115514665B (en) * | 2022-08-31 | 2023-11-21 | 北京达佳互联信息技术有限公司 | Service expansion method, device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10831574B2 (en) | Remote procedure call method for network device and network device | |
CN112035228B (en) | Resource scheduling method and device | |
AU2012229110B2 (en) | High-level language for specifying configurations of cloud-based deployments | |
KR101650110B1 (en) | Failsafe mechanism for dynamic instrumentation of software using callbacks | |
US11762763B2 (en) | Orchestration for automated performance testing | |
CN107544783B (en) | Data updating method, device and system | |
CN110162345A (en) | A kind of application program access method, device and storage medium | |
KR20200070085A (en) | Method and apparatus for processing information | |
CN109788068B (en) | Heartbeat state information reporting method, device and equipment and computer storage medium | |
EP3694167B1 (en) | Method and device for managing services in network function virtualization architecture | |
JPWO2016117697A1 (en) | Network function virtualization management and orchestration method, apparatus and program | |
CN104915263A (en) | Process fault processing method and device based on container technology | |
CN108270818A (en) | A kind of micro services architecture system and its access method | |
CN111258913A (en) | Automatic algorithm testing method and device, computer system and readable storage medium | |
CN112199178B (en) | Cloud service dynamic scheduling method and system based on lightweight container | |
CN109739527A (en) | A kind of method, apparatus, server and the storage medium of the publication of client gray scale | |
CN103152327A (en) | Configuration method, client and system for plug-in unit compressing and uncompressing | |
CN108964993A (en) | Failure simulation method, device, equipment and readable storage medium storing program for executing based on dynamic proxy | |
CN111651352A (en) | Warehouse code merging method and device | |
US11539612B2 (en) | Testing virtualized network functions | |
CN113535532B (en) | Fault injection system, method and device | |
US11108638B1 (en) | Health monitoring of automatically deployed and managed network pipelines | |
CN110795109A (en) | Function expansion method and device and electronic equipment | |
CN111400162A (en) | Test method and test system | |
CN116931965B (en) | Integrated stream processing method, device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200214 |
|
RJ01 | Rejection of invention patent application after publication |