CN113296959A - Service processing method and device based on AOP functional component and computer equipment - Google Patents

Service processing method and device based on AOP functional component and computer equipment Download PDF

Info

Publication number
CN113296959A
CN113296959A CN202110692600.9A CN202110692600A CN113296959A CN 113296959 A CN113296959 A CN 113296959A CN 202110692600 A CN202110692600 A CN 202110692600A CN 113296959 A CN113296959 A CN 113296959A
Authority
CN
China
Prior art keywords
component
aop
service
service request
functional
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
Application number
CN202110692600.9A
Other languages
Chinese (zh)
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202110692600.9A priority Critical patent/CN113296959A/en
Publication of CN113296959A publication Critical patent/CN113296959A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The invention discloses a service processing method, a service processing device and computer equipment based on an AOP functional component, relates to the technical field of information, and mainly aims to enable the functional component of service in a distributed operation system to be independent of service codes, facilitate the reuse and maintenance of the functional component and improve the development efficiency of the distributed operation system. The method comprises the following steps: receiving a service request triggered by a client; determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a business code corresponding to the service request; based on the response order, the target AOP functional component responds to the service request. The method is suitable for service processing based on the AOP functional component.

Description

Service processing method and device based on AOP functional component and computer equipment
Technical Field
The present invention relates to the field of information technologies, and in particular, to a service processing method and apparatus based on an AOP functional component, and a computer device.
Background
Under the multi-dimension conditions of a distributed environment, multiple users, micro services, clusters and the like, the distributed operation system can relate to the configuration of complex functions such as current limiting, fusing, locking and the like, so that the distributed operation system has corresponding functional effects.
At present, complex functions of configuration current limiting, fusing, locking and the like of a distributed operation system are generally realized by introducing a great number of frames and function codes into service codes of the distributed operation system. However, this method may cause the function code of the service to be interleaved with the business code, and if other services in the operation system also relate to the function, the code of the function needs to be written again, so that the reuse and maintenance of the function code are not used, and the development efficiency of the operation system is low.
Disclosure of Invention
The invention provides a service processing method, a service processing device and computer equipment based on an AOP functional component, which mainly enable the functional component of service in a distributed operation system to be independent of service codes, facilitate the reuse and maintenance of the functional component and improve the development efficiency of the distributed operation system.
According to a first aspect of the present invention, there is provided a service processing method based on AOP functional components, including:
receiving a service request triggered by a client;
determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a business code corresponding to the service request;
based on the response order, the target AOP functional component responds to the service request.
According to a second aspect of the present invention, there is provided an AOP functional component-based service processing apparatus, comprising:
the receiving unit is used for receiving a service request triggered by a client;
a determining unit, configured to determine a target AOP functional component on a responsibility chain corresponding to the service request and a response order corresponding to the target AOP functional component, where the target AOP functional component is independent of a service code corresponding to the service request;
a responding unit, configured to respond to the service request by the target AOP functional component based on the response sequence.
According to a third aspect of the present invention, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving a service request triggered by a client;
determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a business code corresponding to the service request;
based on the response order, the target AOP functional component responds to the service request.
According to a fourth aspect of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the program:
receiving a service request triggered by a client;
determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a business code corresponding to the service request;
based on the response order, the target AOP functional component responds to the service request.
Compared with the mode that a great number of frames and function codes are introduced into the service codes of the distributed operation system at present, the service processing method, the service processing device and the computer equipment based on the AOP functional component can receive the service request triggered by the client; determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a service code corresponding to the service request; based on the response sequence, the target AOP functional component responds to the service request, so that each AOP functional component related in the distributed operation system is created by adopting a Spring AOP technology, the functional components of the distributed service in the distributed operation system can be independent of the service code, meanwhile, the management terminal is configured with the attribute parameters of the functional components of different distributed services in the distributed operation system, a corresponding responsibility chain can be generated when the service request is received, the service request is responded according to the AOP functional components on the responsibility chain and the corresponding response sequence thereof, the functional components of the distributed service in the distributed operation system can be ensured to be independent of the service code, the multiplexing and maintenance of the functional components can be facilitated, and the development efficiency of the distributed operation system can be improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a service processing method based on AOP functional components according to an embodiment of the present invention;
FIG. 2 is a flow chart of another AOP functional component-based service processing method provided by the embodiment of the present invention;
FIG. 3 is a schematic structural diagram illustrating an AOP functional component-based service processing apparatus according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of another AOP functional component-based service processing apparatus according to an embodiment of the present invention;
fig. 5 shows a physical structure diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Currently, the function code of the distributed service is interleaved with the business code, and if other services in the operation system also relate to the function, the code writing for the function needs to be performed again, so that the reuse and maintenance of the function code are not utilized, and the development efficiency of the operation system is low.
In order to solve the above problem, an embodiment of the present invention provides a method for recalling a telephone, as shown in fig. 1, the method including:
101. a service request triggered by a client is received.
The distributed operation system relates to various distributed services, and a client can trigger a corresponding service request through operation at a client. In order to overcome the defect that the service code and the code for providing the distributed service are coupled together in the prior art, thereby being not beneficial to the multiplexing and the maintenance of the function code, the embodiment of the invention adopts the Spring AOP technology to establish each AOP functional component related in the distributed operation system, thereby making the functional components of the distributed services in the distributed operation system independent of the service codes, and simultaneously configuring the attribute parameters of the functional components of different distributed services at the management end, when a service request is received, a corresponding responsibility chain can be automatically generated according to the attribute parameters of the functional components, and based on the AOP functional components on the responsibility chain and the corresponding response sequence thereof, responding to the service request, thereby ensuring that the functional components of the distributed service are independent and the service code, and further, the reuse and maintenance of the functional components can be facilitated, and the development efficiency of the distributed operation system is improved. The embodiment of the invention is mainly suitable for a scene of processing the service request by adopting the AOP functional component independent of the service code. The execution subject of the embodiment of the present invention is a device or an apparatus capable of performing service processing, and may be specifically set at a client or a server side.
102. And determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component.
The target AOP functional component is independent of the service code corresponding to the service request, and may specifically be a service administration component, an authority center component, a distributed scheduling component, a service monitoring component, and the like, where the service administration component specifically includes: the system comprises a server side current limiting configuration component, a server side degradation configuration component, a server side fusing component, a server side gray list component, a distributed service cluster online and offline component and the like; the rights issuer component specifically includes: a distributed service authority respectively/uniformly configuring component, an authority white list configuring component, a distributed environment authentication configuring component and the like; the distributed scheduling component specifically includes: the system comprises a unified scheduling task component, a multi-environment distinguishing rule configuration component, a batch job configuration component and the like; the service monitoring component specifically comprises: a traffic peak configuration component, a distributed service interface cache configuration component, a distributed lock interface component, and the like. It should be noted that, in the embodiment of the present invention, the target AOP functional component in the responsibility chain may be any one of the above functional components, or may be a combination of multiple AOP functional components, and may be specifically set according to a service requirement, and the number and the type of the target AOP functional components are not limited in the embodiment of the present invention.
For the embodiment of the invention, a user can configure target AOP functional components of different distributed services in an operation system at a management end in advance, set a response sequence among the target AOP functional components at the same time, generate responsibility chains corresponding to different distributed services according to the target AOP functional components configured by the user and the corresponding response sequence thereof, and connect the configured target AOP functional components into the responsibility chains according to the set response sequence when the distributed service is configured with a plurality of target AOP functional components, wherein in order to enable the plurality of target AOP functional components to possibly receive service requests and avoid the coupling of the service requests and service responses, the target AOP functional components at the head in the responsibility chains respond to the service requests firstly; and finally responding to the service request by the target AOP functional component at the tail end, so that the target AOP functional components configured by the user can be sequentially connected according to the set response sequence to generate a responsibility chain, and simultaneously, the corresponding relation between different distributed services and the responsibility chain is established, so that when the service request is received, the responsibility chain corresponding to the service request is selected, and the functional components on the responsibility chain sequentially respond to the service request according to the connection sequence.
For example, for a distributed service a, a user configures a service administration component and an authority center component for the user at a management end, sets a response sequence between the service administration component and the authority center component, and connects the service administration component and the authority center component into a responsibility chain based on the set response sequence, for example, for a distributed service B, the user configures a distributed scheduling component and a service monitoring component for the user at the management end, sets a response sequence between the distributed scheduling component and the service monitoring component, and connects the distributed scheduling component and the service monitoring component into a responsibility chain based on the set response sequence. Therefore, a user can configure corresponding business components for the distributed service in real time at the management end according to business requirements, when the functional components are updated, codes do not need to be modified again, the parameters and rules of the functional components are directly modified at the management end, meanwhile, each functional component is constructed by adopting the Spring AOP technology, the business codes and the functional codes are thoroughly separated, and research and development personnel can concentrate on the development of the business codes.
Further, when the distributed operation system receives the service request, the service request is firstly accessed to the working area of the component according to a preset rule, specifically, whether the distributed service is pre-configured with the AOP functional component or not can be judged according to the service identifier corresponding to the service request, and if the distributed service is pre-configured with the AOP functional component, the service request is introduced to the working area of the AOP functional component; if the distributed service does not configure an AOP functional component, the service request does not enter the working area of the functional component.
Further, after a service request enters a working area of the AOP functional component, according to a service identifier corresponding to the service request, determining a corresponding responsibility chain configured by a user at a management end, wherein target AOP functional components on the responsibility chain are connected end to end according to a certain sequence, and then transmitting the service request along the responsibility chain until all the target AOP functional components on the responsibility chain respond completely. For example, determining the responsibility chain corresponding to the service a according to the service identifier corresponding to the distributed service a includes: the service management component, the authority center component, the distributed scheduling component and the service monitoring component respond to the service request in sequence according to the response sequence.
103. Based on the response order, the target AOP functional component responds to the service request.
For the embodiment of the invention, when each server is started in a distributed environment, the basic data information in the cache redis is initialized to the local, and further, after the service request enters the working area of the service component, the AOP functional components respond to the service request in sequence according to the response sequence among the target AOP functional components on the responsibility chain corresponding to the service request.
For example, the target AOP functional component includes a service administration component, an authority center component, a distributed scheduling component, and a service monitoring component, and the response sequence among the components is the service administration component, the authority center component, the distributed scheduling component, and the service monitoring component in turn, specifically, after a service request enters a working area, the service administration component on a responsibility chain responds to the service request first, and the service administration component specifically includes: the method comprises the steps that a server side current limiting component, a server side degrading component, a server side fusing component, a server side gray list component and a distributed service cluster up-line and down-line component, firstly, the server side current limiting component searches a current limiting rule according to initialized local data information, if the current limiting rule does not exist in the local data information, the current limiting rule is searched in a cache, the current customer visit amount and the preset visit amount are obtained, the ratio of the current customer visit amount to the preset visit amount is calculated, and whether current limiting is needed or not is determined according to the ratio. Then the service side degradation component judges whether the service is degraded according to a preset degradation rule, and if the service is determined to be degraded, the service request is blocked; if it is determined that the service request is not downgraded, the service request is passed. And then the service end fusing component judges whether a fusing method corresponding to the service request is generated, if so, the service request is subjected to a fusing mechanism. In addition, the server side gray list component verifies whether the service request can enter the distributed service instance according to a preset white list, further, the distributed service cluster online and offline component judges whether the current service instance is online, and if the current service instance is not online, the service request is rejected.
Further, after the service administration component completes the response to the service request, according to the response sequence on the responsibility chain, the rights center component responds to the service request, and the rights center component specifically includes: the distributed service authority difference/uniform configuration component searches a preset authority rule according to local data information, if the preset authority rule does not exist in the local data information, the distributed service authority difference/uniform configuration component enters a cache to search the preset authority rule, then the authority white list configuration component verifies whether the client has a white list authority according to the preset authority rule, if so, the service request is continued, and then the distributed environment authentication configuration component identifies whether the client has the authority to enter the current service instance according to the preset uniform authentication configuration.
Further, after the service administration component completes the response to the service request, the distributed scheduling component on the responsibility chain responds to the service request, and the distributed scheduling component specifically includes: the unified scheduling task configuration component searches a preset task configuration rule according to local data information, if the preset task configuration rule does not exist, the unified scheduling task configuration component enters a cache to search the preset task configuration rule, then the multi-environment distinguishing rule configuration component judges whether the service request accords with the current environment according to the preset environment rule, and if the service request accords with the current environment, the service request is continued; and if the current environment is not met, intercepting the service request. Further, the batch job configuration component judges whether the service request accords with batch jobs according to the current job information, and if so, the batch jobs are carried out; if not, the individual jobs are serialized.
Further, after the distributed scheduling component completes the response to the service request, the service monitoring component in the responsibility chain responds to the service request, and the service monitoring component specifically includes: the system comprises a flow peak value configuration component, a service interface cache configuration component and a distributed lock interface configuration component, wherein the flow peak value configuration component judges whether the service request exceeds a flow peak value, and if the service request exceeds the flow peak value, a dynamic sliding window mechanism is adopted for flow limiting. And then the service interface cache configuration component judges whether the cache is opened or not, and if the cache is opened, the data information in the cache is stored to the local. Further, the distributed lock interface configuration component judges whether a lock needs to be acquired, if the lock needs to be acquired, whether the lock is unlocked is searched in the cache, and if the lock is not unlocked, waiting is carried out; if it is already on, the service request is delivered. Therefore, when a service request triggered by a client is received, the service request can be responded according to the functional components on the preset responsibility chain and the corresponding response sequence thereof, and the decoupling of the service code and the function code is thoroughly realized.
Compared with the mode that a great number of frames and function codes are introduced into service codes of a distributed operation system at present, the service processing method based on the AOP functional component provided by the embodiment of the invention can receive service requests triggered by clients; determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a service code corresponding to the service request; based on the response sequence, the target AOP functional component responds to the service request, so that each AOP functional component related in the distributed operation system is created by adopting a Spring AOP technology, the functional components of the distributed service in the distributed operation system can be independent of the service code, meanwhile, the management terminal is configured with the attribute parameters of the functional components of different distributed services in the distributed operation system, a corresponding responsibility chain can be generated when the service request is received, the service request is responded according to the AOP functional components on the responsibility chain and the corresponding response sequence thereof, the functional components of the distributed service in the distributed operation system can be ensured to be independent of the service code, the multiplexing and maintenance of the functional components can be facilitated, and the development efficiency of the distributed operation system can be improved.
Further, in order to better explain the processing procedure of the service request, as a refinement and extension to the above embodiment, an embodiment of the present invention provides another service processing method based on AOP functional components, as shown in fig. 2, where the method includes:
201. and establishing each AOP functional component related to the distributed service by using a preset modular tool, and issuing each established AOP functional component to a warehouse corresponding to the preset modular tool.
The preset modular tool may be a maven tool, or may be another modular tool, and the embodiment of the present invention is not particularly limited. For the embodiment of the invention, in order to realize the separation of the service code and the function code in the distributed operation system, a Spring AOP technology is adopted to create each AOP function component, such as a service administration component, an authority center component, a distributed scheduling component, a service monitoring component and the like, related to the operation system in a real-time distributed environment, specifically, each AOP function component can be created by using a maven modular tool, and after each AOP function component is created, each created AOP function component is issued to a maven warehouse.
In a specific application scenario, in addition to generating a responsibility chain corresponding to the distributed service according to the functional component and the response sequence configured by the user at the management end in advance, during the operation of the distributed operation system, the responsibility chain corresponding to the distributed service may be generated in real time according to the functional component attribute parameter corresponding to the distributed service set by the user at the management end in advance, where the functional component attribute parameter specifically includes: aiming at different distributed services, the importance level corresponding to each AOP functional component is created, and the quantity requirement of the configured functional components is met, and based on the importance level, the method comprises the following steps: setting the importance level of each AOP functional component aiming at different distributed services and the number requirements of the different distributed services on the required AOP functional components; and determining the attribute parameters of the functional components corresponding to the different distributed services based on the importance levels and the quantity requirements.
For example, for the distributed service a, the importance level corresponding to the service administration component is set to be first level, the importance level corresponding to the authority center component is second level, the importance level corresponding to the distributed scheduling component is third level, the importance level corresponding to the service monitoring component is fourth level, and the distribution is set such that the number of the functional components configured by the service a is not more than two; aiming at the distributed service B, setting the importance level corresponding to the service management component as four levels, the importance level corresponding to the authority center component as three levels, the importance level corresponding to the distributed scheduling component as two levels, the importance level corresponding to the service monitoring component as one level, and setting the number of the functional components configured by the service B in the distribution as 1.
202. A service request triggered by a client is received.
For the embodiment of the invention, the distributed operation system relates to various distributed services, and a client can trigger a corresponding service request by operating at a client.
203. And determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component.
Wherein the target AOP functional component is independent of the service code corresponding to the service request. For the embodiment of the present invention, in order to generate the responsibility chain corresponding to the service request in real time according to the attribute parameter of the functional component corresponding to the service request, step 203 specifically includes: determining a functional component attribute parameter corresponding to the service request according to the service identifier corresponding to the service request; determining a target AOP functional component required to be configured by the service request and a corresponding response sequence thereof according to the functional component attribute parameters; and generating a responsibility chain corresponding to the service request based on the target AOP functional component required to be configured by the service request and the corresponding response sequence thereof. Wherein, the function component attribute parameters include the importance level of each created AOP function component to the service request and the number requirement of the service request to the required AOP function components, and based on this, determining the AOP function components required to be configured by the service request and the corresponding response sequence thereof according to the function component attribute parameters includes: sorting the AOP functional components according to the importance levels corresponding to the AOP functional components to obtain sorting results corresponding to the AOP functional components; screening target AOP functional components required to be configured by the service request from the AOP functional components based on the sorting result and the quantity requirement of the service request on the required AOP functional components; and determining a response sequence corresponding to the target AOP functional component according to the importance level corresponding to the target AOP functional component.
For example, for the distributed service a, each AOP functional component is sorted from high to low according to the corresponding importance level, the sorting result is a service administration component, a rights center component, a distributed scheduling component and a service monitoring component, and the number of the functional components configured for the distributed service a is determined to be two, so that two target AOP functional components screened from the 4 sorted AOP functional components are the service administration component and the rights center component, further, according to the importance levels respectively corresponding to the service administration component and the rights center component, the service administration component and the rights center component form a responsibility chain, since the importance level of the service administration component for the distributed service a is higher than the importance level of the rights center component for the distributed service a, the service component arranged at the head in the responsibility chain is administered, and the right center component is arranged behind the right center component, when the service request is responded, the service administration component firstly responds to the service request, and then the right center component responds to the service request.
Further, in the process of generating the responsibility chain, the responsibility chain is equivalent to a set of AOP functional components, a responsibility chain executor is designed, the responsibility chain executor comprises the set of AOP functional components on the responsibility chain, when the AOP functional components on the responsibility chain respond to the service request, a proceded () method for traversing the functional components is arranged in the responsibility chain executor, the invoke () method takes the executor as a parameter, and after the invoke (executor) finishes processing the service, the executor calls the proceded () method to guide the index to the position of the next AOP functional component, so that chain response between different AOP functional components on the responsibility chain can be realized.
204. Based on the response order, the target AOP functional component responds to the service request.
In a specific application scenario, the target AOP functional component may include a service administration component, an authority center component, a distributed scheduling component, and a service monitoring component, where the service administration component may be a distributed cluster offline component, the authority center component may be a distributed environment authentication configuration component, the distributed scheduling component may be a multi-environment differentiation rule configuration component, and the service monitoring component may be a traffic peak configuration component, and based on this, step 204 specifically includes: based on the response sequence among the service administration component, the authority center component, the distributed scheduling component and the service monitoring component, the service administration component, the authority center component, the distributed scheduling component and the service monitoring component respond to the service request in sequence. Further, the step of, based on a response sequence among the service administration component, the authority center component, the distributed scheduling component, and the service monitoring component, the service administration component, the authority center component, the distributed scheduling component, and the service monitoring component sequentially responding to the service request includes: the distributed cluster online and offline component judges whether a service instance corresponding to the service request is online or not; if the service instance is online, the distributed environment authentication configuration component judges whether the client has the authority of entering the service instance; if the client specifically enters the authority of the service instance, the multi-environment distinguishing rule configuration component judges whether the service request conforms to the current environment; if the service request conforms to the current environment, the traffic peak configuration component judges whether the service request exceeds a preset traffic peak value; and if the service request exceeds a preset flow peak value, adopting a dynamic sliding window mechanism to carry out flow limitation.
Specifically, after a service request enters a working area, a distributed cluster offline component on a responsibility chain judges whether a current service instance is online, and if the current service instance is not online, the service request is rejected; if the current service instance is online, the service request is accepted, the distributed environment authentication configuration component can continuously judge whether the client has the authority of entering the current service instance, if the client has the authority of entering the current service instance, the multi-environment distinguishing rule configuration component can judge whether the service request accords with the current environment according to a preset environment rule, and if the client does not accord with the current environment, the service request is intercepted; if the current environment is met, the service request is continued, the flow peak value configuration component can continuously judge whether the service request exceeds the flow peak value, and if the service request exceeds the flow peak value, a dynamic sliding window mechanism is adopted for flow limiting.
Compared with the mode that a great number of frames and function codes are introduced into the service codes of the distributed operation system at present, the service processing method based on the AOP functional component provided by the embodiment of the invention can receive the service request triggered by the client; determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a service code corresponding to the service request; based on the response sequence, the target AOP functional component responds to the service request, so that each AOP functional component related in the distributed operation system is created by adopting a Spring AOP technology, the functional components of the distributed service in the distributed operation system can be independent of the service code, meanwhile, the management terminal is configured with the attribute parameters of the functional components of different distributed services in the distributed operation system, a corresponding responsibility chain can be generated when the service request is received, the service request is responded according to the AOP functional components on the responsibility chain and the corresponding response sequence thereof, the functional components of the distributed service in the distributed operation system can be ensured to be independent of the service code, the multiplexing and maintenance of the functional components can be facilitated, and the development efficiency of the distributed operation system can be improved.
Further, as a specific implementation of fig. 1, an embodiment of the present invention provides a service processing apparatus based on an AOP functional component, as shown in fig. 3, where the apparatus includes: a receiving unit 31, a determining unit 32 and a responding unit 33.
The receiving unit 31 may be configured to receive a service request triggered by a client.
The determining unit 32 may be configured to determine a target AOP functional component on a chain of responsibility corresponding to the service request and a response sequence corresponding to the target AOP functional component, where the target AOP functional component is independent of a service code corresponding to the service request.
The responding unit 33 may be configured to respond to the service request by the target AOP functional component based on the response sequence.
In a specific application scenario, in order to determine a target AOP functional component on a chain of responsibility corresponding to the service request, as shown in fig. 4, the determining unit 32 includes: a determination module 321 and a generation module 322.
The determining module 321 may be configured to determine, according to the service identifier corresponding to the service request, a functional component attribute parameter corresponding to the service request.
The determining module 321 may further be configured to determine, according to the functional component attribute parameter, a target AOP functional component required to be configured by the service request and a corresponding response sequence thereof.
The generating module 322 may be configured to generate a responsibility chain corresponding to the service request based on the target AOP functional component required to be configured by the service request and the corresponding response sequence thereof.
Further, the function component attribute parameters include the importance level of each created AOP function component to the service request and the number requirement of the service request to the required AOP function components, and in order to determine the AOP function components required to be configured for the service request and the corresponding response sequence thereof, the determining module 321 includes: a sorting sub-module, a screening sub-module and a determining sub-module.
The sorting submodule may be configured to sort the AOP functional components according to the importance levels corresponding to the AOP functional components, so as to obtain a sorting result corresponding to each AOP functional component.
The screening sub-module may be configured to screen, from the respective AOP functional components, a target AOP functional component required to be configured by the service request based on the sorting result and a requirement of the service request for the number of required AOP functional components.
The determining sub-module may be configured to determine a response sequence corresponding to the target AOP functional component according to the importance level corresponding to the target AOP functional component.
In a specific application scenario, the target AOP functional component includes a service administration component, a rights center component, a distributed scheduling component, and a service monitoring component, and the response unit 33 may be specifically configured to respond to the service request in sequence by the service administration component, the rights center component, the distributed scheduling component, and the service monitoring component based on a response sequence among the service administration component, the rights center component, the distributed scheduling component, and the service monitoring component.
Further, the service administration component is a distributed cluster offline component, the rights center component is a distributed environment authentication configuration component, the distributed scheduling component is a multi-environment differentiation rule configuration component, the service monitoring component is a traffic peak configuration component, and the response unit 33 includes: a determination module 331 and a current limiting module 332.
The determining module 331 may be configured to determine, by the distributed cluster offline component, whether a service instance corresponding to the service request is online.
The determining module 331 is further configured to determine, if the service instance is online, whether the client has the right to enter the service instance.
The determining module 331 is further configured to determine, if the client specifically enters the right of the service instance, whether the service request conforms to the current environment or not by the multi-environment differentiation rule configuration component.
The determining module 331 is further configured to determine, if the service request meets the current environment, whether the service request exceeds a preset traffic peak by the traffic peak configuration component.
The current limiting module 332 may be configured to limit current by using a dynamic sliding window mechanism if the service request exceeds a preset peak value of the traffic.
In a specific application scenario, in order to create and create each AOP functional component, the apparatus further includes: a creation unit 34 and a publication unit 35.
The creating unit 34 may be configured to create, by using a preset modular tool, each AOP functional component involved in the distributed service.
The issuing unit 35 may be configured to issue each created AOP functional component to a warehouse corresponding to the preset modular tool.
Further, in order to set attribute parameters of functional components corresponding to different distributed services, the apparatus further includes: a setting unit 36.
The setting unit 36 may be configured to set importance levels of the AOP functional components for different distributed services, and number requirements of the different distributed services on the required AOP functional components.
The determining unit 32 may be further configured to determine, based on the importance level and the quantity requirement, a functional component attribute parameter corresponding to the different distributed services.
It should be noted that, for other corresponding descriptions of the functional modules involved in the service processing apparatus based on the AOP functional component according to the embodiment of the present invention, reference may be made to the corresponding description of the method shown in fig. 1, which is not described herein again.
Based on the method shown in fig. 1, correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps: receiving a service request triggered by a client; determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a business code corresponding to the service request; based on the response order, the target AOP functional component responds to the service request.
Based on the above embodiments of the method shown in fig. 1 and the apparatus shown in fig. 3, an embodiment of the present invention further provides an entity structure diagram of a computer device, as shown in fig. 5, where the computer device includes: a processor 41, a memory 42, and a computer program stored on the memory 42 and executable on the processor, wherein the memory 42 and the processor 41 are both arranged on a bus 43 such that when the processor 41 executes the program, the following steps are performed: receiving a service request triggered by a client; determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a business code corresponding to the service request; based on the response order, the target AOP functional component responds to the service request.
Through the technical scheme of the invention, the invention can receive the service request triggered by the client; determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a service code corresponding to the service request; based on the response sequence, the target AOP functional component responds to the service request, so that each AOP functional component related in the distributed operation system is created by adopting a Spring AOP technology, the functional components of the distributed service in the distributed operation system can be independent of the service code, meanwhile, the management terminal is configured with the attribute parameters of the functional components of different distributed services in the distributed operation system, a corresponding responsibility chain can be generated when the service request is received, the service request is responded according to the AOP functional components on the responsibility chain and the corresponding response sequence thereof, the functional components of the distributed service in the distributed operation system can be ensured to be independent of the service code, the multiplexing and maintenance of the functional components can be facilitated, and the development efficiency of the distributed operation system can be improved.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A service processing method based on AOP functional components is characterized by comprising the following steps:
receiving a service request triggered by a client;
determining a target AOP functional component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP functional component, wherein the target AOP functional component is independent of a business code corresponding to the service request;
based on the response order, the target AOP functional component responds to the service request.
2. The method according to claim 1, wherein the determining a target AOP functional component in a chain of responsibility corresponding to the service request and a response order corresponding to the target AOP functional component comprises:
determining a functional component attribute parameter corresponding to the service request according to the service identifier corresponding to the service request;
determining a target AOP functional component required to be configured by the service request and a corresponding response sequence thereof according to the functional component attribute parameters;
and generating a responsibility chain corresponding to the service request based on the target AOP functional component required to be configured by the service request and the corresponding response sequence thereof.
3. The method according to claim 2, wherein the functional component attribute parameters include the importance level of each created AOP functional component to the service request and the number requirement of the service request to the required AOP functional components, and the determining the AOP functional components required to be configured for the service request and the corresponding response sequence according to the functional component attribute parameters includes:
sorting the AOP functional components according to the importance levels corresponding to the AOP functional components to obtain sorting results corresponding to the AOP functional components;
screening target AOP functional components required to be configured by the service request from the AOP functional components based on the sorting result and the quantity requirement of the service request on the required AOP functional components;
and determining a response sequence corresponding to the target AOP functional component according to the importance level corresponding to the target AOP functional component.
4. The method of claim 1, wherein the target AOP functional component comprises a service administration component, a rights issuer component, a distributed scheduling component, and a service monitoring component, and wherein responding to the service request based on the response order comprises:
based on the response sequence among the service administration component, the authority center component, the distributed scheduling component and the service monitoring component, the service administration component, the authority center component, the distributed scheduling component and the service monitoring component respond to the service request in sequence.
5. The method of claim 4, wherein the service administration component is a distributed cluster offline component, the rights hub component is a distributed environment authentication configuration component, the distributed scheduling component is a multi-environment differentiation rule configuration component, the service monitoring component is a traffic peak configuration component, and the service administration component, the rights hub component, the distributed scheduling component, and the service monitoring component sequentially respond to the service request based on a response sequence among the service administration component, the rights hub component, the distributed scheduling component, and the service monitoring component, and the method comprises:
the distributed cluster online and offline component judges whether a service instance corresponding to the service request is online or not;
if the service instance is online, the distributed environment authentication configuration component judges whether the client has the authority of entering the service instance;
if the client specifically enters the authority of the service instance, the multi-environment distinguishing rule configuration component judges whether the service request conforms to the current environment;
if the service request conforms to the current environment, the traffic peak configuration component judges whether the service request exceeds a preset traffic peak value;
and if the service request exceeds a preset flow peak value, adopting a dynamic sliding window mechanism to carry out flow limitation.
6. The method of any of claims 1-5, wherein prior to said receiving a customer-triggered service request, the method further comprises:
establishing all AOP functional components related to the distributed service by using a preset modular tool;
and issuing each created AOP functional component to a warehouse corresponding to the preset modular tool.
7. The method according to claim 6, wherein after the issuing of each created AOP functional component to the corresponding warehouse of the preset modular tool, the method further comprises:
setting the importance level of each AOP functional component aiming at different distributed services and the number requirements of the different distributed services on the required AOP functional components;
and determining the attribute parameters of the functional components corresponding to the different distributed services based on the importance levels and the quantity requirements.
8. An AOP functional component-based service processing apparatus, comprising:
the receiving unit is used for receiving a service request triggered by a client;
a determining unit, configured to determine a target AOP functional component on a responsibility chain corresponding to the service request and a response order corresponding to the target AOP functional component, where the target AOP functional component is independent of a service code corresponding to the service request;
a responding unit, configured to respond to the service request by the target AOP functional component based on the response sequence.
9. A computer arrangement comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 7 when executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110692600.9A 2021-06-22 2021-06-22 Service processing method and device based on AOP functional component and computer equipment Pending CN113296959A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110692600.9A CN113296959A (en) 2021-06-22 2021-06-22 Service processing method and device based on AOP functional component and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110692600.9A CN113296959A (en) 2021-06-22 2021-06-22 Service processing method and device based on AOP functional component and computer equipment

Publications (1)

Publication Number Publication Date
CN113296959A true CN113296959A (en) 2021-08-24

Family

ID=77329106

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110692600.9A Pending CN113296959A (en) 2021-06-22 2021-06-22 Service processing method and device based on AOP functional component and computer equipment

Country Status (1)

Country Link
CN (1) CN113296959A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443169A (en) * 2022-01-28 2022-05-06 中国民生银行股份有限公司 Method and device for realizing technical component platformization
CN115291850A (en) * 2022-08-11 2022-11-04 广州芯德通信科技股份有限公司 Method, system and storage medium for managing customized interactive data based on java language

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114443169A (en) * 2022-01-28 2022-05-06 中国民生银行股份有限公司 Method and device for realizing technical component platformization
CN115291850A (en) * 2022-08-11 2022-11-04 广州芯德通信科技股份有限公司 Method, system and storage medium for managing customized interactive data based on java language

Similar Documents

Publication Publication Date Title
CN110545260B (en) Cloud management platform construction method based on mimicry structure
US6728727B2 (en) Data management apparatus storing uncomplex data and data elements of complex data in different tables in data storing system
CN110516007B (en) Deployment control method, device, equipment and medium of block chain network
US8713177B2 (en) Remote management of networked systems using secure modular platform
CN112214338A (en) Internet of things cloud platform based on flexible deployment of micro-services
CN109995859A (en) A kind of dispatching method, dispatch server and computer readable storage medium
CN113296959A (en) Service processing method and device based on AOP functional component and computer equipment
KR100945282B1 (en) Verifying method for implementing management software
CN110119292A (en) System operational parameters querying method, matching process, device and node device
CN109995842A (en) A kind of group technology and device for distributed server cluster
CN101548263B (en) Method and system for modeling options for opaque management data for a user and/or an owner
CN114362983A (en) Firewall policy management method and device, computer equipment and storage medium
CN106445709A (en) Method and system for invoking servers in distributed manner
CN109327499A (en) Management method and device, storage medium, the terminal of business interface
CN113177179A (en) Data request connection management method, device, equipment and storage medium
CN110704196B (en) Resource data transfer method, device and block chain system
CN111935195A (en) Distributed system management method, device, storage medium and distributed management system
CN116886286A (en) Big data authentication service self-adaption method, device and equipment
CN108076092A (en) Web server resources balance method and device
CN106936643B (en) Equipment linkage method and terminal equipment
CN111401837B (en) Event processing method and system, and computer readable storage medium
JP4481604B2 (en) Network system transmission device and management device
CN105187244A (en) Access management system of digital communication equipment supporting multiple management modes
CN112181599A (en) Model training method, device and storage medium
CN111782363A (en) Method and flow system for supporting multi-service scene calling

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