CN109286610B - Service interception device, method, equipment and storage medium - Google Patents

Service interception device, method, equipment and storage medium Download PDF

Info

Publication number
CN109286610B
CN109286610B CN201810967801.3A CN201810967801A CN109286610B CN 109286610 B CN109286610 B CN 109286610B CN 201810967801 A CN201810967801 A CN 201810967801A CN 109286610 B CN109286610 B CN 109286610B
Authority
CN
China
Prior art keywords
interceptor
service
path
module
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.)
Active
Application number
CN201810967801.3A
Other languages
Chinese (zh)
Other versions
CN109286610A (en
Inventor
孔德刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chengshi Wanglin Information Technology Co Ltd
Original Assignee
Beijing Chengshi Wanglin Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Chengshi Wanglin Information Technology Co Ltd filed Critical Beijing Chengshi Wanglin Information Technology Co Ltd
Priority to CN201810967801.3A priority Critical patent/CN109286610B/en
Publication of CN109286610A publication Critical patent/CN109286610A/en
Application granted granted Critical
Publication of CN109286610B publication Critical patent/CN109286610B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/30Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information
    • H04L63/306Network architectures or network communication protocols for network security for supporting lawful interception, monitoring or retaining of communications or communication related information intercepting packet switched data communications, e.g. Web, Internet or IMS communications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/62Uninstallation

Abstract

The invention discloses a service interception device, a method, equipment and a storage medium. The device comprises: the interceptor management unit is used for loading the interceptor; the path management unit is used for starting the service intercepting function of the path; the coordination management unit is used for acquiring a service request and determining a target path corresponding to the service request; when the path management unit is judged to start the service intercepting function of the target path, acquiring an interceptor corresponding to the target path from the interceptors loaded by the interceptor management unit, and calling the service intercepting function of the interceptor corresponding to the target path. The invention at least realizes that the service interception function of the interceptor can be changed under the condition of not stopping the service.

Description

Service interception device, method, equipment and storage medium
Technical Field
The present invention relates to the field of computer application technologies, and in particular, to a service interception apparatus, a service interception method, a service interception device, a service interception apparatus, and a storage medium.
Background
At present, in the prior art, the setting of the interception path and the rules is performed by a configuration file or annotation manner, and the intercepted service logic is encapsulated in a fixed class. Since the intercepted business logic is encapsulated in a fixed class, changing the intercepted business logic requires stopping the service and redeploying, which may result in the user being unable to use within a short time and a reduction in user experience. In addition, service stopping and system online are complex and time-consuming processes, and accidents are easily caused by negligence and omission in the processes.
Disclosure of Invention
In order to overcome the above-mentioned drawbacks, the technical problem to be solved by the present invention is to provide a service interception apparatus, method, device and storage medium, so as to solve the problem that service needs to be stopped when the service interception function is changed in the prior art.
To solve the above technical problem, a service interception apparatus in an embodiment of the present invention includes:
the interceptor management unit is used for loading the interceptor;
the path management unit is used for starting the service intercepting function of the path;
the coordination management unit is used for acquiring a service request and determining a target path corresponding to the service request; when the path management unit is judged to start the service intercepting function of the target path, acquiring an interceptor corresponding to the target path from the interceptors loaded by the interceptor management unit, and calling the service intercepting function of the interceptor corresponding to the target path.
Optionally, the interceptor management unit comprises:
the loading module is used for loading the interceptor;
and the unloading module is used for unloading the loaded interceptors.
Optionally, the loading module is further configured to set an execution priority for the loaded interceptor.
Optionally, the interceptor management unit further comprises an upload module;
the uploading module is used for sending the acquired program code of the service intercepting function of the interceptor to the loading module, and converting the program code into the interceptor which can be loaded after the sending is finished;
the loading module is specifically configured to load the loadable interceptor to a preset loading area.
Optionally, the path management unit includes:
the editing module is used for setting the adaptation relation between the path and the adapted interceptor in the interceptor loaded by the interceptor management unit;
the starting module is used for starting the interception business function of the path;
and the disabling module is used for disabling the service intercepting function enabled by the enabling module.
Optionally, the path management unit further includes a collection module;
the collection module is used for scanning the path and storing the scanned path into a path library;
the editing module is specifically configured to set an adaptation relationship between each path in the path library and an adapted interceptor in the interceptor loaded by the interceptor management unit.
Optionally, the coordination management unit includes:
the mapping module is used for determining a corresponding target path according to the received service request; when the path management unit is judged to start the service intercepting function of the target path, acquiring an interceptor corresponding to the target path from the interceptors started by the path management unit, and calling the service intercepting function of the interceptor corresponding to the target path;
the monitoring module is used for monitoring the service intercepting function of the interceptor called by the mapping module;
and the early warning module is used for setting early warning information according to the monitoring result of the monitoring module.
Optionally, the mapping module is further configured to, when calling the service intercepting function of the interceptor corresponding to the target path, call the service intercepting function of the interceptor corresponding to the target path according to a preset execution priority.
To solve the above technical problem, a service interception method in an embodiment of the present invention includes:
loading an interceptor;
starting the path interception service function;
acquiring a service request, and determining a target path corresponding to the service request;
and when the service intercepting function of the target path is judged to be started, acquiring an interceptor corresponding to the target path from the loaded interceptors, and calling the service intercepting function of the interceptor corresponding to the target path.
Optionally, after the loading the interceptor, the method includes:
and unloading the loaded interceptor.
Optionally, after the loading the interceptor, the method includes:
setting execution priority to the loaded interceptors.
Optionally, the load interceptor includes:
program codes of the service intercepting function of the interceptor are received;
converting the program code into an interceptor that can be loaded;
and loading the loadable interceptor to a preset loading area.
Optionally, the path-enabled interception service function includes:
setting an adaptation relation between the path and an adapted interceptor in the loaded interceptor;
and starting the service intercepting function of the path.
Optionally, after the service interception function corresponding to the path is enabled, the method includes:
the enabled interception traffic function is deactivated.
Optionally, the setting, in the loaded interceptor, an adaptation relationship between the path and the adapted interceptor includes:
scanning the path, and storing the scanned path into a path library;
and in the loaded interceptors, setting an adaptation relation between each path in the path library and the adapted interceptor.
Optionally, after the calling of the service intercepting function of the interceptor corresponding to the target path, the method includes:
monitoring the service intercepting function of the called interceptor;
and setting early warning information according to the monitoring result of the monitoring module.
Optionally, the invoking an interception service function of an interceptor corresponding to the target path includes:
and calling the service interception function of the interceptor corresponding to the target path according to the preset execution priority.
To solve the above technical problem, an apparatus in an embodiment of the present invention includes a memory storing a service interception computer program and a processor executing the computer program to implement the steps of the method according to any one of the above.
To solve the above technical problem, a computer-readable storage medium in an embodiment of the present invention stores a service interception computer program, which is executable by at least one processor to implement the steps of the method as described in any one of the above.
The invention has the following beneficial effects:
the embodiments of the invention at least realize that the service interception function of the interceptor can be changed under the condition of not stopping the service.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic structural diagram of a service intercepting apparatus according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an optional service intercepting apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of another alternative service intercepting apparatus in the embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another alternative service intercepting apparatus in the embodiment of the present invention;
FIG. 5 is a schematic structural diagram of yet another alternative service intercepting apparatus in an embodiment of the present invention;
FIG. 6 is a flowchart illustrating the operation of the service intercepting apparatus according to an embodiment of the present invention;
fig. 7 is a main flow chart of a service interception method according to an embodiment of the present invention;
FIG. 8 is a flow chart of an alternative service interception method in an embodiment of the present invention;
FIG. 9 is a flow chart of another alternative service interception method in an embodiment of the present invention;
FIG. 10 is a flow chart of yet another alternative service interception method in an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an apparatus in an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The use of prefixes such as "first," "second," etc. to distinguish between elements is merely intended to facilitate the description of the invention and has no particular meaning in and of themselves.
Example one
An embodiment of the present invention provides a service interception apparatus, as shown in fig. 1, the apparatus includes:
an interceptor management unit 10 for loading interceptors;
a path management unit 12, configured to enable a path interception service function;
a coordination management unit 14, configured to obtain a service request, and determine a target path corresponding to the service request; when it is determined that the path management unit 12 has enabled the service intercepting function of the target path, acquiring an interceptor corresponding to the target path from the interceptors loaded by the interceptor management unit 10, and calling the service intercepting function of the interceptor corresponding to the target path.
In the embodiment of the present invention, the interceptor managing unit 10, the path managing unit 12, and the coordination managing unit 14 are connected to each other, for example, the connections between the units are established through a communication bus.
The device in the embodiment of the present invention may be used in some systems that provide services to the outside, for example, a CRM (Customer Relationship Management) system, an ERP (Enterprise Resource Planning) system, an OA (Office Automation) system, and the like.
The path in the embodiment of the present invention may be a service path or an access path.
In the embodiment of the invention, the configuration and the hot loading of the service intercepting function are realized through the interceptor management unit 10 and the path management unit, so that the service intercepting function can be switched without stopping service when the service intercepting function of the interceptor is changed, thereby improving the user experience, reducing the deployment risk and prolonging the effective service time of the system; the influence caused by service stop caused by changing the service interception function and the risk caused by the system being on line again can be avoided; meanwhile, the dynamic adjustment of the intercepted traffic function can be realized through the interceptor managing unit 10 and the path managing unit 12.
In some embodiments, as shown in fig. 2, the interceptor management unit 10 may include at least one of the following modules:
a loading module 1001 for loading an interceptor; the interceptor is specifically used for loading the interceptor into a preset loading area;
an unloading module 1002, configured to unload the loaded interceptor; in particular for unloading a loaded interceptor from the loading area;
and the uploading module 1000 is configured to send the acquired program code of the service intercepting function of the interceptor to the loading module, and convert the program code into the interceptor that can be loaded after the sending is completed.
That is, in some embodiments, hot loading of the interceptor's traffic intercepting function may be implemented according to the loading module 1001, the unloading module 1002, and the uploading module 1000, and system resources may be released by the unloading module 1002. The unloading module 1002 may be specifically configured to receive an unloading instruction, and unload the loaded interceptor from the loading area according to the unloading instruction.
In some embodiments, as shown in fig. 2, the path management unit 12 may include at least one of the following modules:
an editing module 1201, configured to set an adaptation relationship between the path and an adapted interceptor in the interceptor loaded by the interceptor management unit;
an enabling module 1202, configured to enable an interception service function of the path;
a disabling module 1203, configured to disable the service intercepting function enabled by the enabling module.
That is, in some embodiments, the configuration of the intercepting traffic function of the path may be implemented according to the editing module 1201, the enabling module 1202, and the uploading module 1203. The enabling module 1202 is specifically configured to receive an enabling instruction, and enable the service intercepting function of the path according to the enabling instruction; the disabling module 1203 is specifically configured to receive a disabling indication, and disable the service intercepting function enabled by the enabling module according to the disabling indication.
In some embodiments, as shown in fig. 2, the coordination management unit 14 may include at least one of the following modules:
a mapping module 1401, configured to obtain a service request, and determine a target path corresponding to the service request; when the path management unit is judged to start the service intercepting function of the target path, acquiring an interceptor corresponding to the target path from the interceptors loaded by the interceptor management unit, and calling the service intercepting function of the interceptor corresponding to the target path;
a monitoring module 1402, configured to monitor a service intercepting function of the interceptor called by the mapping module;
and an early warning module 1403, configured to set early warning information according to the monitoring result of the monitoring module.
That is to say, in some embodiments, the mapping module 1401, the monitoring module 1402 and the early warning module 1403 may be used to monitor and early warn the service interception function, so that the service interception function can be better maintained in a running period.
Example two
An embodiment of the present invention provides a service intercepting apparatus, as shown in fig. 3, the apparatus includes an interceptor management unit 10, a path management unit 12, and a coordination management unit 14; the interceptor managing unit 10 may include a loading module 1001 and an unloading module 1002; wherein the content of the first and second substances,
a loading module 1001, configured to load an interceptor to a preset loading area;
an unloading module 1002, configured to unload the loaded interceptor from the loading area;
a path management unit 12, configured to enable a path interception service function;
a coordination management unit 14, configured to determine a corresponding target path according to the received service request; when it is determined that the path management unit 12 has enabled the service intercepting function of the target path, an interceptor corresponding to the target path is obtained from the interceptors loaded by the loading module 1001, and the service intercepting function of the interceptor corresponding to the target path is called.
The loading area may be a JVM (Java Virtual Machine), and Java is an object-oriented programming language.
For example, in the embodiment of the present invention, the loading module 1001 may load an uploaded interceptor into the JVM, so as to facilitate subsequent related interception traffic. Each interceptor has a set execution priority to ensure that the related interception is performed in sequence. When a particular interceptor is no longer in use, the uninstall module 1002 may uninstall the interceptor that has been loaded into the JVM to free up system resources. The unloading mode can include manual unloading and automatic unloading according to rules, such as: if the interceptor is not adapted by any path for a certain time, the interceptor is automatically unloaded.
That is to say, in the embodiment of the present invention, the loading module 1001 and the unloading module 1002 may implement loading and unloading of the interceptor, so that hot loading and updating of the service intercepting function of the interceptor may be implemented without stopping the service, thereby avoiding the influence caused by stopping the service and the risk caused by the system being online again; and the system resources are released through the uninstalling module 1002, so that the resource occupancy of the interceptor is effectively reduced.
In some embodiments, the loading module 1002 is further configured to set an execution priority for the loaded interceptor; so that the coordination management unit 14 can invoke the interception traffic function of the interceptor corresponding to the target path according to the execution priority.
In some embodiments, the interceptor management unit 10 may further include an upload module 1000; the uploading module 1000 is configured to send the acquired program code of the service intercepting function of the interceptor to the loading module, and convert the program code into the interceptor that can be loaded after the sending is completed. For example, the upload module 1000 provides an upload function of the interceptor traffic code. The interceptors can be packaged (formats such as jar, zip and the like are not limited in the specification) and uploaded, and then the interceptors are automatically converted into a form which can be loaded (classes, jar and the like are not limited in the specification);
the loading module 1001 is specifically configured to load the interceptor that can be loaded into a preset loading area.
EXAMPLE III
An embodiment of the present invention provides a service intercepting apparatus, as shown in fig. 4, the apparatus includes an interceptor management unit 10, a path management unit 12, and a coordination management unit 14; wherein, the path management unit 12 comprises an editing module 1201, an enabling module 1202 and a disabling module 1203; wherein the content of the first and second substances,
an interceptor management unit 10 for loading interceptors;
an editing module 1201, configured to set an adaptation relationship between the path and an adapted interceptor in the interceptor loaded by the interceptor management unit;
an enabling module 1202, configured to enable an interception service function of the path;
a disabling module 1203, configured to disable the service intercepting function enabled by the enabling module.
A coordination management unit 14, configured to determine a corresponding target path according to the received service request; when it is determined that the enabling module 1202 has enabled the interception service function of the target path, acquiring an interceptor corresponding to the target path from the interceptors loaded by the interceptor management unit 10, and calling the interception service function of the interceptor corresponding to the target path.
In the embodiment of the invention, the interceptors can be configured through the editing module 1201, the enabling module 1202 and the disabling module 1203, so that the interceptors can be used at any time as required, dynamic interception can be realized, for example, more detailed log information is needed in daily situations, interception is not needed in certain specific moments, the current detailed log is expected to be checked, the related interceptors can be immediately started to obtain the log information, and the interceptors can be immediately disabled/closed after being used, so that the resource utilization is more reasonable.
In some embodiments, the path management unit 12 may further include:
a collecting module 1200, configured to scan a path and store the scanned path in a path library;
the editing module 1201 is specifically configured to set an adaptation relationship between each path in the path library and an adapted interceptor in the interceptor loaded by the interceptor management unit.
For example, when the system is started, the collection module 1200 automatically scans the paths provided by the system to the outside, and stores all the paths in the path library. The newly collected path is in a default starting state, and the corresponding interceptor is a default interceptor, wherein the default interceptor does not have any service logic, or the required default interceptor can be set according to the service requirement, which is not limited herein.
The editing module 1201 may be used to edit which interceptors a path needs to be adapted to. For example, the path may be set as a whole or as an overlay according to latitude such as grouping and category, or may be set according to a mixture of grouping and category. Wherein the overall setup can be understood as completing the setup for all paths in the group at once. The superposition arrangement is to be understood as meaning that the arrangement of the individual paths and the arrangement of the packets are simultaneously effective. Wherein each path has at least a default interceptor that can be adapted.
The enabling module 1202 is mainly used for enabling a path interception service function, and can also be enabled according to latitudes such as groups, categories and the like; it should be noted that here, the interception service function corresponding to the path is enabled, and the path is not enabled to provide the external service.
The disabling module 1203 is mainly used for disabling the service intercepting function corresponding to the path; deactivation may also be done according to latitude, grouping, category, etc.
Example four
An embodiment of the present invention provides a service intercepting apparatus, as shown in fig. 5, the apparatus includes an interceptor management unit 10, a path management unit 12, and a coordination management unit 14; the coordination management unit 14 may include a mapping module 1401, a monitoring module 1402, and an early warning module 1403; wherein the content of the first and second substances,
an interceptor management unit 10 for loading interceptors;
a path management unit 12, configured to enable a path interception service function;
a mapping module 1401, configured to obtain a service request, and determine a target path corresponding to the service request; when it is determined that the path management unit 12 has enabled the service intercepting function of the target path, acquiring an interceptor corresponding to the target path from the interceptors loaded by the interceptor management unit 10, and calling the service intercepting function of the interceptor corresponding to the target path;
a monitoring module 1402, configured to monitor a service intercepting function of the interceptor called by the mapping module; for example, the monitoring module 1402 is configured to monitor service intercepting functions of each path and interceptor, and obtain a monitoring result. The monitoring result can include that interception is passed, interception is not passed, interception is abnormal and the like, and can also include data statistics monitoring and log recording of the monitoring result;
an early warning module 1403, configured to set early warning information according to a monitoring result of the monitoring module; for example, a threshold value and an early-warning person are set for a monitoring result and the like, and early-warning information is sent to the early-warning person when the corresponding threshold value is exceeded. The method for sending out the early warning information may include: and when threshold values and early-warning people are set for monitoring results and the like, the early-warning modes such as WeChat, mail, short message and the like can be set in batches through latitudes such as grouping, classification and the like.
In the embodiment of the invention, the mapping module 1401 can effectively call the service intercepting function of the corresponding interceptor, and the monitoring module 1402 and the early warning module 1403 can monitor and early warn the service intercepting function in real time, so that the service intercepting function can be better maintained in the operation period.
In some embodiments, the mapping module 1401, when invoking the service intercepting function of the interceptor corresponding to the target path, is further configured to invoke the service intercepting function of the interceptor corresponding to the target path according to a preset execution priority.
EXAMPLE five
An embodiment of the present invention provides a service intercepting apparatus, as shown in fig. 2, the apparatus includes an interceptor management unit 10, a path management unit 12, and a coordination management unit 14; the interceptor management unit 10 is mainly configured to manage related service function modules of an interceptor, and may include an uploading module 1000, a loading module 1001, and an unloading module 1002. The path management unit 12 is mainly used for managing all paths providing services to the outside in the system, and may include a collection module 1200, an editing module 1201, an enabling module 1202, and a disabling module 1203. The coordination management unit 14 is mainly configured to invoke, according to the adaptation relationship between all paths and interceptors, corresponding interceptors to process relevant service intercepting functions and monitor and perform early warning when a service request is initiated from the outside, and may include: a mapping module 1401, a monitoring module 1402, and an early warning module 1403.
When the modules of the device of the embodiment of the present invention are implemented specifically, reference may be made to the above embodiments; the working flow of the device of the embodiment of the present invention is shown in fig. 6, and may include:
s101, acquiring a service request;
s102, determining a target path corresponding to the service request;
s103, judging whether the target path starts an interceptor or not; if not, executing S104, if so, executing S105;
s104, passing through a default interceptor, wherein the default interceptor does not have any service logic and does not execute a service intercepting function; then, S112 is executed;
s105, determining an interceptor corresponding to a target path according to the target path;
s106, judging whether to acquire the interceptors corresponding to the target path, wherein the number of the corresponding interceptors can be 1 or more; if yes, executing S107, if no, executing S104;
s107, sequentially executing all interceptors corresponding to the target path according to the execution priority;
s108, judging whether the monitoring result of the interceptor is that interception is failed; if not, executing S109, if so, executing S110;
s109, judging whether interception is abnormal or not; if yes, executing S110, if no, executing S114;
s110, updating the monitoring result;
s111, judging whether the failed monitoring result exceeds a preset early warning threshold value or not; if yes, executing S112, if no, executing S114;
s112, sending early warning information to the set early warning user; then, S114 is executed;
and S113, finishing the execution.
EXAMPLE six
An embodiment of the present invention provides a service interception method, as shown in fig. 7, where the method includes:
s201, loading an interceptor; for example, loading the interceptor to a preset loading area;
s202, starting a path service interception function;
s203, acquiring a service request, and determining a target path corresponding to the service request;
s204, when the service intercepting function of the target path is judged to be started, acquiring the interceptor corresponding to the target path from the loaded interceptors, and calling the service intercepting function of the interceptor corresponding to the target path.
The method in the embodiment of the invention can be used in some systems for providing services to the outside, such as CRM systems, ERP systems, OA systems and the like.
The path in the embodiment of the present invention may be a service path or an access path.
The method of the embodiment of the invention realizes the configuration and the hot loading of the service intercepting function, thereby switching the service intercepting function without stopping the service when the service intercepting function of the interceptor is changed, improving the user experience, reducing the deployment risk and prolonging the effective service time of the system; the influence caused by service stop caused by changing the service interception function and the risk caused by the system being on line again can be avoided; meanwhile, the dynamic adjustment of the service interception function can be realized by starting the path management unit.
In some embodiments, the loading interceptor may thereafter comprise: unloading the loaded interceptor; for example, the loaded interceptors are unloaded from the loading area. That is, in some embodiments, hot loading may be implemented by loading, resources occupied by the interceptor may be released by unloading, and the interceptor may be changed by loading and unloading, so that service does not need to be stopped when the service interception function is changed.
In some embodiments, the path-enabled interception traffic function may include:
setting an adaptation relation between the path and an adapted interceptor in the loaded interceptor;
and starting the service intercepting function of the path.
That is, in some embodiments, the adaptation relationship may be configured, and the service intercepting function of the path may be configured in an enabled manner, so that the interceptor may perform service interception on the path immediately.
In some embodiments, after the calling the traffic intercepting function of the interceptor corresponding to the target path, the calling may include:
monitoring the service intercepting function of the called interceptor;
and setting early warning information according to the monitoring result of the monitoring module.
That is to say, in some embodiments, the service interception function may be monitored and early warned, so that the service interception function can be better maintained in the operation period.
EXAMPLE seven
An embodiment of the present invention provides a service interception method, as shown in fig. 8, where the method includes:
s301, loading the interceptor to a preset loading area;
s302, starting a path interception service function;
s303, acquiring a service request, and determining a target path corresponding to the service request;
s304, when the service intercepting function of the target path is judged to be started, acquiring an interceptor corresponding to the target path from the loaded interceptors, and calling the service intercepting function of the interceptor corresponding to the target path;
s305, unloading the loaded interceptors from the loading area; wherein the loaded interceptors may be unloaded from the loading region according to a shutdown indication.
The embodiment of the invention realizes the hot loading mode through the loading interceptor and the unloading interceptor, thereby not stopping the service when the service intercepting function of the interceptor is changed; and dynamic change of the intercepted service is realized based on the loading interceptor and the unloading interceptor.
In some embodiments, before the unloading the loaded interceptor, the unloading may include: setting execution priority to the loaded interceptors. By executing the priority it is ensured that the relevant interception traffic functions are executed in order.
In some embodiments, the load interceptor may include:
program codes of the service intercepting function of the interceptor are received;
converting the program code into an interceptor that can be loaded;
and loading the loadable interceptor to a preset loading area.
That is, in some embodiments, hot loading of the interceptor is further achieved by converting program code of the interceptor's intercept traffic function into an interceptor that can be loaded.
Example eight
An embodiment of the present invention provides a service interception method, as shown in fig. 9, where the method includes:
s401, loading an interceptor;
s402, setting an adaptation relation between the path and an adapted interceptor in the loaded interceptor;
s403, starting the service intercepting function of the path;
s404, acquiring a service request, and determining a target path corresponding to the service request;
s405, when the service intercepting function of the target path is started, acquiring an interceptor corresponding to the target path from the loaded interceptors, and calling the service intercepting function of the interceptor corresponding to the target path;
s406, the activated service intercepting function is deactivated.
In some embodiments, the setting, in the loaded interceptor, an adaptation relationship between the path and the adapted interceptor may include:
scanning the path, and storing the scanned path into a path library;
and in the loaded interceptors, setting an adaptation relation between each path in the path library and the adapted interceptor.
The embodiment of the invention realizes that the service interception function of the interceptor is changed on the basis of not stopping service, and further sets the adaptation relation between the path and the adapted interceptor in the loaded interceptor, and starts the interceptor corresponding to the path according to the adaptation relation, thereby instantly configuring the interceptor and using the interceptor as required at any time; and dynamic interception can be achieved by enabling and disabling.
Example nine
An embodiment of the present invention provides a service interception method, as shown in fig. 10, where the method includes:
s501, loading an interceptor;
s502, starting the path interception service function;
s503, acquiring a service request, and determining a target path corresponding to the service request;
s504, when the service intercepting function of the target path is judged to be started, acquiring an interceptor corresponding to the target path from the started interceptors, and calling the service intercepting function of the interceptor corresponding to the target path;
s505, monitoring the service intercepting function of the called interceptor;
s506, setting early warning information according to the monitoring result of the monitoring module.
The invoking of the service intercepting function of the interceptor corresponding to the target path may include:
and calling the service interception function of the interceptor corresponding to the target path according to the preset execution priority.
The embodiment of the invention can realize the change of the service intercepting function of the interceptor on the basis of not stopping the service, and further can carry out real-time monitoring and early warning on the service intercepting function, thereby better carrying out operation period maintenance on the service intercepting function.
Example ten
An apparatus according to an embodiment of the present invention is provided, as shown in fig. 11, where the apparatus includes a memory 20 and a processor 22, the memory 20 stores a service interception computer program, and the processor 22 executes the computer program to implement the steps of the method according to any one of the six embodiments to the nine embodiments. Wherein the device may be a service interception device.
EXAMPLE eleven
An embodiment of the present invention provides a computer-readable storage medium, wherein the storage medium stores a service interception computer program, and the computer program is executable by at least one processor to implement the steps of the method according to any one of the sixth to ninth embodiments.
When the sixth embodiment to the eleventh embodiment are specifically implemented, reference may be made to the first embodiment to the fifth embodiment, and corresponding technical effects are achieved.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (16)

1. A service interception apparatus, characterized in that said apparatus comprises:
the interceptor management unit is used for loading the interceptor;
the path management unit is used for starting the service intercepting function of the path;
the path management unit includes:
the editing module is used for setting the adaptation relation between the path and the adapted interceptor in the interceptor loaded by the interceptor management unit;
the starting module is used for starting the interception business function of the path;
the disabling module is used for disabling the service intercepting function enabled by the enabling module;
dynamic interception is realized by starting and stopping the interception service function;
the coordination management unit is used for acquiring a service request and determining a target path corresponding to the service request; when the path management unit is judged to start the service intercepting function of the target path, acquiring an interceptor corresponding to the target path from the interceptors loaded by the interceptor management unit, and calling the service intercepting function of the interceptor corresponding to the target path.
2. The apparatus of claim 1, wherein the interceptor management unit comprises:
the loading module is used for loading the interceptor;
and the unloading module is used for unloading the loaded interceptors.
3. The apparatus of claim 2, wherein the loading module is further to set an execution priority for a loaded interceptor.
4. The apparatus of claim 2, wherein the interceptor management unit further comprises an upload module;
the uploading module is used for sending the acquired program code of the service intercepting function of the interceptor to the loading module, and converting the program code into the interceptor which can be loaded after the sending is finished;
the loading module is specifically configured to load the loadable interceptor to a preset loading area.
5. The apparatus of claim 1, wherein the path management unit further comprises a collection module;
the collection module is used for scanning the path and storing the scanned path into a path library;
the editing module is specifically configured to set an adaptation relationship between each path in the path library and an adapted interceptor in the interceptor loaded by the interceptor management unit.
6. The apparatus of any of claims 1-4, wherein the coordination management unit comprises:
the mapping module is used for determining a corresponding target path according to the received service request; when the path management unit is judged to start the service intercepting function of the target path, acquiring an interceptor corresponding to the target path from the loaded interceptors of the interceptor management unit, and calling the service intercepting function of the interceptor corresponding to the target path;
the monitoring module is used for monitoring the service intercepting function of the interceptor called by the mapping module;
and the early warning module is used for setting early warning information according to the monitoring result of the monitoring module.
7. The apparatus of claim 6, wherein the mapping module, when invoking the service intercepting function of the interceptor corresponding to the target path, is further configured to invoke the service intercepting function of the interceptor corresponding to the target path according to a preset execution priority.
8. A method for service interception, the method comprising:
loading an interceptor;
starting the path interception service function;
the path-enabled interception service function includes:
setting an adaptation relation between the path and an adapted interceptor in the loaded interceptor;
starting the service intercepting function of the path;
after the service intercepting function corresponding to the path is started, the method includes:
deactivating the activated interception service function;
dynamic interception is realized by starting and stopping the interception service function;
acquiring a service request, and determining a target path corresponding to the service request;
and when the service intercepting function of the target path is judged to be started, acquiring an interceptor corresponding to the target path from the loaded interceptors, and calling the service intercepting function of the interceptor corresponding to the target path.
9. The method of claim 8, wherein after the loading the interceptor, comprising:
and unloading the loaded interceptor.
10. The method of claim 8, wherein after the loading the interceptor, comprising:
setting execution priority to the loaded interceptors.
11. The method of claim 8, wherein the load interceptor comprises:
program codes of the service intercepting function of the interceptor are received;
converting the program code into an interceptor that can be loaded;
and loading the loadable interceptor to a preset loading area.
12. The method of claim 8, wherein setting, in the loaded interceptor, an adaptation relationship between the path and the adapted interceptor comprises:
scanning the path, and storing the scanned path into a path library;
and in the loaded interceptors, setting an adaptation relation between each path in the path library and the adapted interceptor.
13. The method according to any one of claims 8 to 12, wherein the calling the traffic intercepting function of the interceptor corresponding to the target path comprises:
monitoring the service intercepting function of the called interceptor;
and setting early warning information according to the monitoring result of the monitoring module.
14. The method according to any one of claims 8-12, wherein said invoking an intercept traffic function of an interceptor corresponding to the target path comprises:
and calling the service interception function of the interceptor corresponding to the target path according to the preset execution priority.
15. An apparatus, characterized in that the apparatus comprises a memory storing a service interception computer program and a processor executing the computer program to implement the steps of the method according to any of claims 8-14.
16. A computer-readable storage medium, characterized in that the storage medium stores a service interception computer program executable by at least one processor for implementing the steps of the method according to any of claims 8-14.
CN201810967801.3A 2018-08-23 2018-08-23 Service interception device, method, equipment and storage medium Active CN109286610B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810967801.3A CN109286610B (en) 2018-08-23 2018-08-23 Service interception device, method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810967801.3A CN109286610B (en) 2018-08-23 2018-08-23 Service interception device, method, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109286610A CN109286610A (en) 2019-01-29
CN109286610B true CN109286610B (en) 2022-02-25

Family

ID=65183443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810967801.3A Active CN109286610B (en) 2018-08-23 2018-08-23 Service interception device, method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109286610B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112925591A (en) * 2021-01-25 2021-06-08 北京房江湖科技有限公司 Method and device for intercepting call routing method
CN113269460B (en) * 2021-06-08 2023-09-01 巨石集团有限公司 Collaborative system and collaborative architecture for multiple management systems

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250178A (en) * 2016-07-26 2016-12-21 北京北森云计算股份有限公司 The method that system dynamics function intercepts extension online is realized by the compiling of multilingual cloud

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101276271A (en) * 2007-03-29 2008-10-01 北京邮电大学 Method and interceptor system facing to tangent plane programming
US7984456B2 (en) * 2007-11-23 2011-07-19 Ketera Technologies Inc. Interceptor framework using java dynamic proxies
CN103150155B (en) * 2011-12-07 2016-08-03 金蝶软件(中国)有限公司 Data interception method and device
CN106599156B (en) * 2016-12-07 2019-05-21 国云科技股份有限公司 A kind of dynamic interceptor management method based on struts2 blocker
CN106649766B (en) * 2016-12-27 2020-12-29 北京锐安科技有限公司 Message processing method based on kafka
US20180191525A1 (en) * 2016-12-30 2018-07-05 IoT Defense, Inc. Network device using ip address and method thereof

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250178A (en) * 2016-07-26 2016-12-21 北京北森云计算股份有限公司 The method that system dynamics function intercepts extension online is realized by the compiling of multilingual cloud

Also Published As

Publication number Publication date
CN109286610A (en) 2019-01-29

Similar Documents

Publication Publication Date Title
EP3840296A1 (en) Data processing method, device and computing node
CN109286610B (en) Service interception device, method, equipment and storage medium
EP2052323B1 (en) Event sharing
CN111818132A (en) Control method and device of Internet of things equipment, computer equipment and storage medium
CN109348434B (en) Scene information sending method, sending device and terminal equipment
CN112784992A (en) Network data analysis method, functional entity and electronic equipment
CN110618853B (en) Detection method, device and equipment for zombie container
CN110795202B (en) Resource allocation method and device of virtualized cluster resource management system
US10033807B2 (en) Method and M2M gateway for managing data of terminal peripheral
CN112202879B (en) Middleware management method and device, electronic equipment and storage medium
CN111949421B (en) SDK calling method, device, electronic equipment and computer readable storage medium
CN111752675B (en) Internet of things platform based on containerization technology
KR19990085557A (en) Automated Base Station Tests for Mobile Communication Systems
CN105491253A (en) Resource distribution method and system for call center
US20110280392A1 (en) Apparatus and method for controlling an amount of concurrent calls
CN107025126B (en) Resource scheduling method, NFVO and system
CN116567094A (en) Service information processing method based on micro service system
US20160309333A1 (en) Cell Activation Method and Apparatus
CN112748990A (en) Quartz-based data quality task execution method and device and computer equipment
CN109462423B (en) Method, device, equipment and medium for checking data transmission unit
US20230246911A1 (en) Control device, control method, control program and control system
CN104092794A (en) Batch course processing method and system
CN111786846B (en) Method, device, equipment and storage medium for determining monitoring machine
CN105656855A (en) Resource access control method and device
WO2017193798A1 (en) Junk information monitoring method and apparatus and communication system

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
GR01 Patent grant
GR01 Patent grant