[go: up one dir, main page]

CN113296959B - 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
CN113296959B
CN113296959B CN202110692600.9A CN202110692600A CN113296959B CN 113296959 B CN113296959 B CN 113296959B CN 202110692600 A CN202110692600 A CN 202110692600A CN 113296959 B CN113296959 B CN 113296959B
Authority
CN
China
Prior art keywords
component
aop
service
service request
target
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
CN202110692600.9A
Other languages
Chinese (zh)
Other versions
CN113296959A (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.)
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/CN113296959B/en
Publication of CN113296959A publication Critical patent/CN113296959A/en
Application granted granted Critical
Publication of CN113296959B publication Critical patent/CN113296959B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Stored Programmes (AREA)
  • Multi Processors (AREA)

Abstract

The invention discloses a service processing method, a device and computer equipment based on an AOP functional component, which relate to the technical field of information and mainly aim at enabling the functional component served in a distributed operation system to be independent of service codes, facilitating multiplexing and maintenance of the functional component and improving 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 service code corresponding to the service request; based on the response order, the target AOP functional component responds to the service request. The method and the device are 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 function component, and a computer device.
Background
Under the multi-dimension of distributed environment, multi-user, micro-service, cluster and the like, the distributed operation system can be involved in configuring 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 such as configuration current limiting, fusing, locking and the like of a distributed operation system are generally realized by introducing a great number of frames and functional codes into service codes of the distributed operation system. However, this approach may result in interleaving of the function code of the service with the service code, and if other services in the operating system also refer to the function, the function needs to be re-written with code, so that multiplexing and maintenance of the function code are not utilized, resulting in lower development efficiency of the operating system.
Disclosure of Invention
The invention provides a service processing method, a device and computer equipment based on an AOP functional component, which mainly aims to enable the functional component of service in a distributed operation system to be independent of service codes, facilitate multiplexing 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 an AOP function component, 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 service 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 function based service processing device, comprising:
the receiving unit is used for receiving a service request triggered by a client;
The determining unit is used for 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;
and the response unit is used for responding 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 service 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 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 service code corresponding to the service request;
Based on the response order, the target AOP functional component responds to the service request.
Compared with the prior art that a great number of frames and function codes are introduced into service codes of a distributed operation system, the service processing method, device and computer equipment based on the AOP function component 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 service codes, meanwhile, the functional component attribute parameters of different distributed services in the distributed operation system are configured at a management end, when the service request is received, a corresponding responsibility chain can be generated, and the service request is responded according to the AOP functional components and the corresponding response sequence of the AOP functional components on the responsibility chain, so that the functional components of the distributed service in the distributed operation system can be ensured to be independent of the service codes, multiplexing and maintenance of the functional components can be facilitated, and the development efficiency of the distributed operation system is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 shows a flowchart of a service processing method based on an AOP functional component according to an embodiment of the present invention;
FIG. 2 is a flowchart of another service processing method based on an AOP functional component according to an embodiment of the present invention;
Fig. 3 is a schematic structural diagram of a service processing device based on an AOP functional component according to an embodiment of the present invention;
Fig. 4 is a schematic structural diagram of another service processing device based on an AOP function component according to an embodiment of the present invention;
Fig. 5 shows a schematic physical structure of a computer device according to an embodiment of the present invention.
Detailed Description
The application will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
At present, the function codes of the distributed service are interwoven with the service codes, and if other services in the operation system also relate to the function, the function needs to be rewritten, so that multiplexing and maintenance of the function codes 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 re-calling a phone, as shown in fig. 1, including:
101. and receiving a service request triggered by the client.
The distributed operation system relates to various distributed services, and a client can trigger corresponding service requests by operating at a client. In order to overcome the defect that service codes and service supply codes of distributed services are coupled together in the prior art so as to be unfavorable for multiplexing and maintaining of the function codes, the embodiment of the invention adopts Spring AOP technology to create all AOP function components related in a distributed operation system, so that the function components of the distributed services in the distributed operation system are independent of the service codes, and meanwhile, through configuring the attribute parameters of the function components of different distributed services at a management end, when a service request is received, a corresponding responsibility chain can be automatically generated according to the attribute parameters of the function components, and the service request is responded based on the AOP function components and the corresponding response sequence of the AOP function components on the responsibility chain, thereby ensuring that the function components of the distributed services are independent of the service codes, further facilitating multiplexing and maintaining of the function components, and improving the development efficiency of the distributed operation system. The embodiment of the invention is mainly applicable to the scene of processing the service request by adopting the AOP functional component independent of the service code. The execution body of the embodiment of the invention is a device or equipment capable of performing service processing, and can be specifically arranged at a client side 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 a service code corresponding to the service request, and can be specifically a service management component, a rights center component, a distributed scheduling component, a service monitoring component and the like, wherein the service management component specifically comprises: 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 center component specifically includes: a distributed service authority separate/unified configuration component, an authority white list configuration component, a distributed environment authentication configuration component and the like; the distributed scheduling component specifically 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 on the responsibility chain may be any one of the foregoing functional components, or may be a combination of multiple AOP functional components, and specifically may be set according to a service requirement, and the number and types 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 in advance at a management end, meanwhile, set response sequences among the target AOP functional components, generate responsibility chains corresponding to different distributed services according to the target AOP functional components configured by the user and the response sequences corresponding to the target AOP functional components, and when the distributed services are configured with a plurality of target AOP functional components, in order to enable the plurality of target AOP functional components to possibly receive service requests, the service requests and service responses are prevented from being coupled together, the configured target AOP functional components are connected into responsibility chains according to the set response sequences, and in the responsibility chains, the target AOP functional components at the first position respond to the service requests first; and finally, responding to the service request by the target AOP functional component at the tail, thereby being capable of sequentially connecting the target AOP functional components configured by the user according to a set response sequence to generate a responsibility chain, and simultaneously establishing corresponding relations between different distributed services and the responsibility chains so as to select the responsibility chain corresponding to the service request when the service request is received, and sequentially responding to the service request by the functional components on the responsibility chain according to the connection sequence.
For example, for the distributed service a, the user configures a service administration component and a rights center component for the user at the management end, sets a response sequence between the service administration component and the rights center component, connects the service administration component and the rights center component into a responsibility chain based on the set response sequence, and for the 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 service components for distributed services in real time at a management end according to service requirements, when the functional components are updated, the parameters and rules of the functional components are directly modified at the management end without modifying the codes, and meanwhile, through constructing each functional component by adopting Spring AOP technology, the thorough separation of service codes and the functional codes is realized, so that research and development personnel can concentrate on the development of the service codes.
Further, when the distributed operation system receives the service request, the service request is firstly accessed into the working area of the component according to a preset rule, specifically, whether the distributed service is preconfigured 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 preconfigured with the AOP functional component, the service request is introduced into the working area of the AOP functional component; if the distributed service does not configure an AOP feature, the service request does not enter the working area of the feature.
Further, after the service request enters the working area of the AOP functional component, a corresponding responsibility chain configured by the user at the management end is determined according to the service identifier corresponding to the service request, the target AOP functional components on the responsibility chain are connected end to end according to a certain sequence, and then the service request is transmitted along the responsibility chain until all the target AOP functional components on the responsibility chain are responded. For example, according to the service identifier corresponding to the distributed service a, determining the responsibility chain corresponding to the service a includes: the service management component, the authority center component, the distributed scheduling component and the service monitoring component are sequentially arranged in the response sequence on the responsibility chain, and the service management component, the authority center component, the distributed scheduling component and the service monitoring component can sequentially respond to the service request 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 a service request enters a working area of a service component, the AOP functional components respond to the service request in sequence according to the response sequence among target AOP functional components on a responsibility chain corresponding to the service request.
For example, the target AOP functional component includes a service administration component, a rights center component, a distributed scheduling component, and a service monitoring component, where the response sequence between the components is the service administration component, the rights center component, the distributed scheduling component, and the service monitoring component in sequence, specifically, when a service request enters a working area, the service administration component on the responsibility chain responds to the service request first, and the service administration component specifically includes: the server-side current limiting component, the server-side degradation component, the server-side fusing component, the server-side gray list component and the distributed service cluster online-offline component are used for searching the current limiting rule according to the initialized local data information, if the current limit rule does not exist in the local data information, searching the current limit rule in the cache, obtaining the current client access amount and the preset access amount, calculating the ratio of the current client access amount to the preset access amount, and determining whether current limit is needed according to the ratio. The service end 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 prevented; if it is determined that the service request is not degraded, the service request is passed. And then the service end fusing component judges whether a fusing method corresponding to the service request is generated or not, and if so, the service request is subjected to a fusing mechanism. In addition, the service end gray list component checks whether the service request can enter the distributed service instance according to a preset white list, and further, the distributed service cluster online and offline component judges whether the current service instance is online or not, and if the current service instance is not online, the service request is refused.
Further, after the service administration component completes the response to the service request, the rights center component responds to the service request according to the response sequence on the responsibility chain, and the rights center component specifically includes: the distributed service authority individual/unified configuration component searches preset authority rules according to local data information, if the preset authority rules do not exist in the local data information, the distributed service authority individual/unified configuration component enters a cache to search the preset authority rules, then the authority whitelist configuration component checks whether the client has whitelist authority according to the preset authority rules, if so, the service request is continued, and then the distributed environment authentication configuration component identifies whether the client has authority to enter a current service instance according to 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 system comprises a unified scheduling task configuration component, a multi-environment distinguishing rule configuration component and a batch job configuration component, wherein the unified scheduling task configuration component firstly searches preset task configuration rules according to local data information, if not, the preset task configuration rules are searched in a cache, then the multi-environment distinguishing rule configuration component judges whether the service request accords with the current environment according to preset environment rules, and if so, the service request is continued; if the current environment is not met, the service request is intercepted. Further, the batch job configuration component judges whether the service request accords with batch job according to the current job information, and if so, batch job is 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 on 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 firstly 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 limiting the flow. And then the service interface cache configuration component judges whether the cache is started or not, and if so, the data information in the cache is stored locally. Further, the distributed lock interface configuration component judges whether a lock is required to be acquired, if the lock is required to be acquired, the lock is searched in a cache to be opened, and if the lock is not opened, the lock waits; if it is already on, the service request is passed. When receiving a service request triggered by a client, 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 functional code is thoroughly realized.
Compared with the prior art that a great number of frames and function codes are introduced into service codes of a distributed operation system, the service processing method based on the AOP function component 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 service codes, meanwhile, the functional component attribute parameters of different distributed services in the distributed operation system are configured at a management end, when the service request is received, a corresponding responsibility chain can be generated, and the service request is responded according to the AOP functional components and the corresponding response sequence of the AOP functional components on the responsibility chain, so that the functional components of the distributed service in the distributed operation system can be ensured to be independent of the service codes, multiplexing and maintenance of the functional components can be facilitated, and the development efficiency of the distributed operation system is improved.
Further, in order to better illustrate the above 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 an AOP function component, as shown in fig. 2, where the method includes:
201. And creating each AOP functional component related to the distributed service by using a preset modularization tool, and issuing the created AOP functional components to a warehouse corresponding to the preset modularization tool.
The preset modularized tool may be a maven tool or other modularized tools, and the embodiment of the invention is not limited specifically. For the embodiment of the invention, in order to realize the separation of service codes and function codes in a distributed operation system, a Spring AOP technology is adopted to create all AOP function components, such as a service management component, a rights center component, a distributed scheduling component, a service monitoring component and the like, which are involved in the operation system in a real-time distributed environment, specifically, a maven modularized tool can be utilized to create all AOP function components, and after all AOP function components are created, all AOP function components which are created are released into a maven warehouse.
In a specific application scenario, besides generating a responsibility chain corresponding to the distributed service according to a functional component and a response sequence configured in advance by a user at a management end, the responsibility chain corresponding to the distributed service can be generated in real time according to a functional component attribute parameter corresponding to the distributed service, which is set in advance by the user at the management end, in the running process of the distributed operation system, wherein the functional component attribute parameter specifically comprises: for different distributed services, the created importance levels corresponding to the AOP functional components and the number requirements of the configured functional components are based on the method comprising: setting importance levels of the AOP functional components 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 level and the quantity requirements.
For example, for the distributed service a, setting the importance level corresponding to the service administration component as one level, the importance level corresponding to the rights center component as two levels, the importance level corresponding to the distributed scheduling component as three levels, the importance level corresponding to the service monitoring component as four levels, and simultaneously setting the number of functional components configured by the service a to be distributed to be no more than two; aiming at the distributed service B, the importance level corresponding to the service management component is set to be four, the importance level corresponding to the authority center component is set to be three, the importance level corresponding to the distributed scheduling component is set to be two, the importance level corresponding to the service monitoring component is set to be one, and meanwhile, the number of functional components configured by the service B is set to be 1.
202. And receiving a service request triggered by the client.
For the embodiment of the invention, a plurality of distributed services are related in the distributed operation system, and a client can trigger corresponding service requests by operating at the 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, in real time, a responsibility chain corresponding to a service request according to a functional component attribute parameter corresponding to the service request, step 203 specifically includes: determining attribute parameters of the functional components 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 for 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 parameter includes an importance level of each created AOP function component for the service request and a number requirement of the service request for a required AOP function component, based on which, the determining, according to the function component attribute parameter, an AOP function component and a response sequence corresponding to the AOP function component that is required to be configured for the service request includes: sequencing all the AOP functional components according to the importance levels corresponding to all the AOP functional components to obtain sequencing results corresponding to all the AOP functional components; screening target AOP functional components which are required to be configured by the service request from the AOP functional components based on the sequencing result and the number 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 distributed service a, each AOP functional component is ranked according to the importance level corresponding to the AOP functional component from high to low, the ranking result is a service governance component, a rights center component, a distributed scheduling component and a service monitoring component, and the number of functional components configured by the distributed service a is determined to be two at the same time, so that two target AOP functional components screened out of the 4 AOP functional components after ranking are the service governance component and the rights center component, further, according to the importance levels corresponding to the service governance component and the rights center component respectively, the service governance component and the rights center component form a responsibility chain, and since the importance level of the service governance 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 is ranked first in the responsibility chain, and then the rights center component responds to a service request, and the service governance component responds to the service request first, and then the rights 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 contains 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 processed () method in the responsibility chain executor traverses an invoke () method of the functional components, the invoke () method takes the executor as a parameter, and after the invoke (executor) processes the service, the executor invokes the processed () method again, and the index is led to the position of the next AOP functional component, thereby realizing the chain response between different AOP functional components on the responsibility chain.
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, a rights center component, a distributed scheduling component, and a service monitoring component, where the service administration component may be a distributed cluster online-offline component, the rights center component may be a distributed environment authentication configuration component, the distributed scheduling component may be a multi-environment distinguishing rule configuration component, and the service monitoring component may be a traffic peak configuration component, based on which step 204 specifically includes: based on the response sequence among the service governance component, the rights issuer component, the distributed scheduling component and the service monitoring component, the service governance component, the rights issuer component, the distributed scheduling component and the service monitoring component respond to the service request in sequence. Further, the responding to the service request by the service governance component, the rights issuer component, the distributed scheduling component, and the service monitoring component in sequence based on a response sequence among the service governance component, the rights issuer component, the distributed scheduling component, and the service monitoring component 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 to enter 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 accords with the current environment; if the service request accords with the current environment, the flow peak configuration component judges whether the service request exceeds a preset flow peak; and if the service request exceeds the preset flow peak value, adopting a dynamic sliding window mechanism to limit the flow.
Specifically, after a service request enters a working area, a distributed cluster online-offline component on a responsibility chain judges whether a current service instance is online or not, and if the current service instance is not online, the service request is refused; if the current service instance is online, the service request is accepted, the distributed environment authentication configuration component continues to judge whether the client has the authority to enter the current service instance, if the client has the authority to enter the current service instance, 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 does not accord with the current environment, the service request is intercepted; if the service request meets the current environment, the flow peak value configuration component continues to 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 limiting the flow.
Compared with the mode of introducing a great number of frames and function codes into service codes of a distributed operation system at present, the service processing method based on the AOP function component 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 service codes, meanwhile, the functional component attribute parameters of different distributed services in the distributed operation system are configured at a management end, when the service request is received, a corresponding responsibility chain can be generated, and the service request is responded according to the AOP functional components and the corresponding response sequence of the AOP functional components on the responsibility chain, so that the functional components of the distributed service in the distributed operation system can be ensured to be independent of the service codes, multiplexing and maintenance of the functional components can be facilitated, and the development efficiency of the distributed operation system is improved.
Further, as a specific implementation of fig. 1, an embodiment of the present invention provides a service processing apparatus based on an AOP function 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 function component on a responsibility chain corresponding to the service request and a response sequence corresponding to the target AOP function component, where the target AOP function component is independent of a service code corresponding to the service request.
The response unit 33 may be configured to respond to the service request by the target AOP function based on the response order.
In a specific application scenario, in order to determine the target AOP function component on the responsibility chain 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 a functional component attribute parameter corresponding to the service request according to a service identifier corresponding to the service request.
The determining module 321 may be further configured to determine, according to the function component attribute parameter, a target AOP function component and a response sequence corresponding to the target AOP function component that is required to be configured for the service request.
The generating module 322 may be configured to generate a responsibility chain corresponding to the service request based on the target AOP function component and the response sequence corresponding to the target AOP function component that is required to be configured by the service request.
Further, the function component attribute parameters include the importance level of each created AOP function component for the service request and the number of required AOP function components required by the service request, and in order to determine the AOP function components required to be configured by the service request and the corresponding response sequence thereof, the determining module 321 includes: the system comprises a sequencing sub-module, a screening sub-module and a determining sub-module.
The sorting sub-module may be configured to sort the AOP functional components according to importance levels corresponding to the AOP functional components, to obtain sorting results corresponding to the AOP functional components.
The screening submodule is used for screening target AOP functional components which are required to be configured by the service request from the AOP functional components based on the sequencing result and the number requirements of the service request on the required AOP functional components.
The determining submodule 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 specifically be configured to respond to the service request sequentially by using 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 online-offline component, the rights center component is a distributed environment authentication configuration component, the distributed scheduling component is a multi-environment distinguishing rule configuration component, the service monitoring component is a traffic peak configuration component, and the response unit 33 includes: a judgment module 331 and a current limiting module 332.
The judging module 331 may be configured to judge whether a service instance corresponding to the service request is online by using the distributed cluster online/offline component.
The determining module 331 may be further configured to determine, by using the distributed environment authentication configuration component, if the service instance is online, whether the client has permission to enter the service instance.
The determining module 331 may be further configured to determine, by using the multi-environment distinguishing rule configuration component, whether the service request meets the current environment if the client specifically enters the authority of the service instance.
The determining module 331 may be further configured to determine, by the traffic peak configuration component, whether the service request exceeds a preset traffic peak if the service request meets the current environment.
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 traffic peak.
In a specific application scenario, to create each AOP function component, the apparatus further includes: a creation unit 34 and a publication unit 35.
The creation unit 34 may be configured to create individual AOP function components involved in the distributed service using a preset modular tool.
The issuing unit 35 may be configured to issue each created AOP function component to a repository corresponding to the preset modularized tool.
Further, in order to set the attribute parameters of the 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 individual AOP functional components for different distributed services, and the number of required AOP functional components required by the different distributed services.
The determining unit 32 may be further configured to determine a functional component attribute parameter corresponding to the different distributed services based on the importance level and the number requirement.
It should be noted that, other corresponding descriptions of each functional module related to the service processing device based on the AOP functional component provided in the embodiment of the present invention may refer to corresponding descriptions of the method shown in fig. 1, which are not described herein again.
Based on the above method as shown in fig. 1, correspondingly, the embodiment of the present invention further provides a computer readable storage medium, on which a computer program is stored, which when being 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 service code corresponding to the service request; based on the response order, the target AOP functional component responds to the service request.
Based on the embodiment of the method shown in fig. 1 and the device shown in fig. 3, the embodiment of the invention further provides a physical 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, the processor 41 performing the following steps when said program is executed: 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 service code corresponding to the service request; based on the response order, the target AOP functional component responds to the service request.
By the technical scheme, the service request triggered by the client can be received; 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 service codes, meanwhile, the functional component attribute parameters of different distributed services in the distributed operation system are configured at a management end, when the service request is received, a corresponding responsibility chain can be generated, and the service request is responded according to the AOP functional components and the corresponding response sequence of the AOP functional components on the responsibility chain, so that the functional components of the distributed service in the distributed operation system can be ensured to be independent of the service codes, multiplexing and maintenance of the functional components can be facilitated, and the development efficiency of the distributed operation system is improved.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A service processing method based on an AOP function component, comprising:
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 service code corresponding to the service request;
Based on the response order, the target AOP functional component responds to the service request
The determining the target AOP function component on the responsibility chain corresponding to the service request and the response sequence corresponding to the target AOP function component includes:
Determining attribute parameters of the functional components 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 for the service request and a corresponding response sequence thereof according to the functional component attribute parameters;
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 a corresponding response sequence thereof;
the function component attribute parameters comprise the importance level of each created AOP function component for the service request and the number requirement of the service request for the required AOP function components, and the determining the AOP function components required to be configured for the service request and the response sequence corresponding to the AOP function components according to the function component attribute parameters comprises the following steps:
sequencing all the AOP functional components according to the importance levels corresponding to all the AOP functional components to obtain sequencing results corresponding to all the AOP functional components;
Screening target AOP functional components which are required to be configured by the service request from the AOP functional components based on the sequencing result and the number 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.
2. The method of claim 1, wherein the target AOP function includes a service administration component, a rights issuer component, a distributed scheduling component, and a service monitor component, the target AOP function responding to the service request based on the response order, comprising:
Based on the response sequence among the service governance component, the rights issuer component, the distributed scheduling component and the service monitoring component, the service governance component, the rights issuer component, the distributed scheduling component and the service monitoring component respond to the service request in sequence.
3. The method of claim 2, wherein the service governance component is a distributed cluster online-offline component, the rights issuer component is a distributed environment authentication configuration component, the distributed scheduling component is a multi-environment differentiation rule configuration component, the service monitor component is a traffic peak configuration component, and the service governance component, the rights issuer component, the distributed scheduling component, and the service monitor component respond to the service request in sequence based on a response order between the service governance component, the rights issuer component, the distributed scheduling component, and the service monitor component, comprising:
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 to enter 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 accords with the current environment;
If the service request accords with the current environment, the flow peak configuration component judges whether the service request exceeds a preset flow peak;
and if the service request exceeds the preset flow peak value, adopting a dynamic sliding window mechanism to limit the flow.
4. A method according to any of claims 1-3, characterized in that before said receiving a customer triggered service request, the method further comprises:
creating each AOP functional component related to the distributed service by using a preset modularization tool;
And publishing each created AOP functional component to a warehouse corresponding to the preset modularized tool.
5. The method of claim 4, wherein after the publishing of each AOP function component created into the repository corresponding to the preset modular tool, the method further comprises:
Setting importance levels of the AOP functional components 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 level and the quantity requirements.
6. A service processing apparatus based on an AOP function, comprising:
the receiving unit is used for receiving a service request triggered by a client;
The determining unit is used for 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;
A response unit, configured to respond to the service request by the target AOP function module based on the response order;
the determination unit includes: a determining module and a generating module;
The determining module is used for determining the attribute parameters of the functional components corresponding to the service request according to the service identifier corresponding to the service request;
the determining module is further configured to determine a target AOP function component and a response sequence corresponding to the target AOP function component, which are required to be configured by the service request, according to the function component attribute parameter, where the function component attribute parameter includes an importance level of each created AOP function component for the service request and a number requirement of the service request for the required AOP function component;
The generating module is used for 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;
The determining module is specifically configured to sort the AOP functional components according to importance levels corresponding to the AOP functional components, so as to obtain a sorting result corresponding to the AOP functional components; screening target AOP functional components which are required to be configured by the service request from the AOP functional components based on the sequencing result and the number 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.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the computer program when executed by the processor implements the steps of the method according to any one of claims 1 to 5.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 5.
CN202110692600.9A 2021-06-22 2021-06-22 Service processing method and device based on AOP functional component and computer equipment Active CN113296959B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110692600.9A CN113296959B (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 CN113296959B (en) 2021-06-22 2021-06-22 Service processing method and device based on AOP functional component and computer equipment

Publications (2)

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

Family

ID=77329106

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110692600.9A Active CN113296959B (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) CN113296959B (en)

Families Citing this family (2)

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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006026673A2 (en) * 2004-08-31 2006-03-09 Ascential Software Corporation Architecture for enterprise data integration systems
CN106293808A (en) * 2016-07-26 2017-01-04 北京北森云计算股份有限公司 The compiling of multilingual cloud realizes the method and system of systemic-function dynamic interception extension
CN109618347A (en) * 2019-02-17 2019-04-12 中国—东盟信息港股份有限公司 A kind of Intelligent gateway system of automation distribution service request
CN109739624A (en) * 2018-12-27 2019-05-10 北京三快在线科技有限公司 Distributed transaction processing method, device, electronic equipment and computer-readable medium
CN111309374A (en) * 2020-01-21 2020-06-19 苏州达家迎信息技术有限公司 Micro-service system and service calling method in micro-service system
CN112751847A (en) * 2020-12-28 2021-05-04 深圳市优必选科技股份有限公司 Interface call request processing method and device, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050256971A1 (en) * 2003-08-14 2005-11-17 Oracle International Corporation Runtime load balancing of work across a clustered computing system using current service performance levels
US11716264B2 (en) * 2018-08-13 2023-08-01 Cisco Technology, Inc. In situ triggered function as a service within a service mesh

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006026673A2 (en) * 2004-08-31 2006-03-09 Ascential Software Corporation Architecture for enterprise data integration systems
CN106293808A (en) * 2016-07-26 2017-01-04 北京北森云计算股份有限公司 The compiling of multilingual cloud realizes the method and system of systemic-function dynamic interception extension
CN109739624A (en) * 2018-12-27 2019-05-10 北京三快在线科技有限公司 Distributed transaction processing method, device, electronic equipment and computer-readable medium
CN109618347A (en) * 2019-02-17 2019-04-12 中国—东盟信息港股份有限公司 A kind of Intelligent gateway system of automation distribution service request
CN111309374A (en) * 2020-01-21 2020-06-19 苏州达家迎信息技术有限公司 Micro-service system and service calling method in micro-service system
CN112751847A (en) * 2020-12-28 2021-05-04 深圳市优必选科技股份有限公司 Interface call request processing method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
微服务架构在电动汽车智能充电服务与运营平台系统中的应用;隋永鑫;微型机与应用;20171225;36(24);第102-108页 *

Also Published As

Publication number Publication date
CN113296959A (en) 2021-08-24

Similar Documents

Publication Publication Date Title
US6112196A (en) Method and system for managing connections to a database management system by reusing connections to a database subsystem
US7065526B2 (en) Scalable database management system
CN109871224A (en) A kind of gray scale dissemination method, system, medium and equipment based on user identifier
US6834303B1 (en) Method and apparatus auto-discovering components of distributed services
CN113296959B (en) Service processing method and device based on AOP functional component and computer equipment
US20030182328A1 (en) Apparatus and method for sharing data between multiple, remote sites of a data network
US8620926B2 (en) Using a hashing mechanism to select data entries in a directory for use with requested operations
CN108632374A (en) Software gray scale dissemination method and device
CN106033373A (en) A virtual machine resource scheduling method and scheduling system in a cloud computing platform
CN101925907A (en) Dataspace protection utilizing virtual private networks on multi-node computer system
WO2004001598A2 (en) Distributed computer
US8055651B2 (en) Distribution of join operations on a multi-node computer system
CN113055252B (en) Method, device, equipment and storage medium for detecting newly added service host
Imdoukh et al. Optimizing scheduling decisions of container management tool using many‐objective genetic algorithm
EP1443423A1 (en) Apparatus and method for data replication in a data network
CN109033184A (en) Data processing method and device
CN106445709A (en) Method and system for invoking servers in distributed manner
CN107181747B (en) handle analytic system containing top-level node
US8572723B2 (en) Utilizing virtual private networks to provide object level security on a multi-node computer system
CN113127906A (en) Unified authority management platform, method and storage medium based on C/S architecture
US10171570B2 (en) Information processing apparatus
CN113240499B (en) Order processing method and device based on system switching
Luo et al. Distributed mining of maximal frequent itemsets on a data grid system
CN101341467A (en) Utilizing component targets in defining roles in a distributed and integrated system or systems
EP0522683B1 (en) Routing of messages in a data processing 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