CN113746661A - Service processing method and device - Google Patents
Service processing method and device Download PDFInfo
- Publication number
- CN113746661A CN113746661A CN202110019655.3A CN202110019655A CN113746661A CN 113746661 A CN113746661 A CN 113746661A CN 202110019655 A CN202110019655 A CN 202110019655A CN 113746661 A CN113746661 A CN 113746661A
- Authority
- CN
- China
- Prior art keywords
- service
- configuration information
- information
- business
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 34
- 238000000034 method Methods 0.000 claims abstract description 189
- 238000012545 processing Methods 0.000 claims abstract description 82
- 238000013507 mapping Methods 0.000 claims abstract description 72
- 230000015556 catabolic process Effects 0.000 claims abstract description 58
- 238000006731 degradation reaction Methods 0.000 claims abstract description 58
- 238000004590 computer program Methods 0.000 claims description 9
- 238000010586 diagram Methods 0.000 description 13
- 238000004891 communication Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000005012 migration Effects 0.000 description 7
- 230000009467 reduction Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 238000007796 conventional method Methods 0.000 description 3
- 238000013508 migration Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0889—Techniques to speed-up the configuration process
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a service processing method and a service processing device, and relates to the technical field of computers. One embodiment of the method comprises: analyzing the business method according to the target annotation interception business method to obtain signature information and parameter information corresponding to the business method; determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information; and comparing the parameter information with the service configuration information, and executing corresponding service processing on the service method according to the comparison result. According to the implementation method, the service degradation is executed aiming at the specific service, the application scene and the expandability are improved, and the user experience is improved.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a service.
Background
The interface level fault means that the system is not down and the network is not interrupted, but the problems of slow service response, excessive access timeout, abnormal access and the like occur in the service processing process. The essence is that the system load is too high to process traffic quickly. With the continuous development of internet services, how to solve interface level faults to meet user requirements is a problem that needs to be solved urgently at present.
The prior art has at least the following problems:
the existing service processing method mainly adopts methods of time-out degradation, fault degradation, current limiting reduction and the like to solve interface level faults, and because the service degradation cannot be executed aiming at specific services, the application scenario is narrow, the expandability is poor and the user experience is poor.
Disclosure of Invention
In view of this, embodiments of the present invention provide a service processing method and apparatus, which can perform service degradation according to a specific service, improve an application scenario and scalability, and improve user experience.
In order to achieve the above object, according to a first aspect of the embodiments of the present invention, there is provided a service processing method, including:
analyzing the business method according to the target annotation interception business method to obtain signature information and parameter information corresponding to the business method;
determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information;
and comparing the parameter information with the service configuration information, and executing corresponding service processing on the service method according to the comparison result.
Further, the target annotation is marked in an interface implementation class corresponding to the service method to be degraded according to the service requirement; before the step of determining the service configuration information from the mapping table according to the signature information, the method further includes a mapping table constructing step, including:
based on the scanning of the interface implementation class, acquiring a service method to be degraded containing a target annotation;
and generating service configuration information according to the parameter information corresponding to the service method to be degraded, determining signature information corresponding to the service configuration information, and constructing a mapping table.
Further, the target annotation is at least one level of settings; when the target annotation is set in the second level, generating service configuration information according to the parameter information corresponding to the service method to be degraded, and further comprising:
after a plurality of service methods to be degraded are obtained according to the primary target annotation, parameter information corresponding to the plurality of service methods to be degraded is traversed respectively, and corresponding service configuration information is generated for the service methods to be degraded marked with the secondary target annotation.
Further, generating corresponding service configuration information for the service method to be degraded marked with the secondary target annotation, further comprising:
acquiring a parameter attribute value corresponding to the parameter information of the service method to be degraded;
and generating service configuration information according to the parameter attribute values.
Further, still include:
traversing the parameter information corresponding to the business method, and judging whether the parameter information is marked with a secondary target annotation;
and if so, performing service degradation processing on the service method.
Further, the service configuration information indicates the parameter information to be degraded; comparing the parameter information with the service configuration information, and executing corresponding service processing to the service method according to the comparison result, further comprising:
comparing the parameter information with the service configuration information one by one, and executing service degradation processing on the service method under the condition that at least one item of parameter information is successfully compared with the service configuration information.
Further, still include:
and updating the target annotation according to the business requirement, and updating the mapping table according to the updated target annotation.
According to a second aspect of the embodiments of the present invention, there is provided a service processing apparatus, including:
the interception module is used for analyzing and processing the business method according to the target annotation interception business method so as to obtain signature information and parameter information corresponding to the business method;
the service configuration information determining module is used for determining service configuration information from the mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information;
and the service processing module is used for comparing the parameter information with the service configuration information and executing corresponding service processing on the service method according to the comparison result.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including:
one or more processors;
a storage device for storing one or more programs,
when executed by one or more processors, cause the one or more processors to implement any of the business processing methods described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements any of the service processing methods described above.
One embodiment of the above invention has the following advantages or benefits: because the business method is intercepted according to the target annotation, the business method is analyzed to obtain the signature information and the parameter information corresponding to the business method; determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information; the technical means of comparing the parameter information with the service configuration information and executing corresponding service processing on the service method according to the comparison result overcome the technical problems that the existing service processing method mainly adopts methods of overtime degradation, fault degradation, current limiting reduction and the like to solve interface level faults, the service degradation cannot be executed aiming at specific services, the applicable scene is narrow, the expandability is poor and the user experience is poor, and further the technical effects of executing the service degradation according to the specific services, improving the applicable scene and the expandability and improving the user experience are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a service processing method provided according to a first embodiment of the present invention;
fig. 2 is a schematic diagram of a main flow of a service processing method according to a second embodiment of the present invention;
fig. 3 is a schematic diagram of main modules of a service processing apparatus provided according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a service processing method provided according to a first embodiment of the present invention; as shown in fig. 1, the service processing method provided in the embodiment of the present invention mainly includes:
and step S101, analyzing the business method according to the target annotation interception business method to obtain signature information and parameter information corresponding to the business method.
Specifically, according to the embodiment of the present invention, the target annotation is labeled in the interface implementation class corresponding to the service method to be degraded according to the service requirement.
By the arrangement, the specific service method is intercepted according to the service requirement, the signature information and the parameter information acquired by the service method are analyzed, and the signature information and the parameter information are compared with the service configuration information in the mapping table subsequently, so that the service degradation is carried out, and the application scene and the expandability are improved.
Step S102, determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relationship between the signature information and the service configuration information.
According to the embodiment of the invention, the mapping table can adopt a key-value structure, the signature information and the service configuration information are respectively used as the main key (key) and the key value (value), through the setting, the service configuration information corresponding to the intercepted service method can be quickly inquired, and then the corresponding service processing is executed through the subsequent comparison result, so that the service processing efficiency is improved, and the user experience is improved.
Specifically, according to the embodiment of the present invention, before the step of determining the service configuration information from the mapping table according to the signature information, the method further includes a step of constructing the mapping table, including:
based on the scanning of the interface implementation class, acquiring a service method to be degraded containing a target annotation;
and generating service configuration information according to the parameter information corresponding to the service method to be degraded, determining signature information corresponding to the service configuration information, and constructing a mapping table.
According to the embodiment of the invention, the service configuration information can be generated according to the actual service requirement and the specific parameter in the parameter information, so that the flexible configuration of the service configuration information is realized, and the application scene is further expanded.
Further, the target annotation is at least one level of settings; when the target annotation is set in the second level, generating service configuration information according to the parameter information corresponding to the service method to be degraded, and further comprising:
after a plurality of service methods to be degraded are obtained according to the primary target annotation, parameter information corresponding to the plurality of service methods to be degraded is traversed respectively, and corresponding service configuration information is generated for the service methods to be degraded marked with the secondary target annotation.
Specifically, according to the embodiment of the present invention, the primary target annotation is marked on a service method to be degraded; and marking the secondary target annotation on the parameter attribute of the service method to be degraded. The primary target annotation is used for identifying that the business method needs to carry out business degradation logic processing; the secondary target annotation is used to identify that the parameter attribute requires generation of a downgraded configuration. Through the hierarchical setting, the degradation of the service executed by a certain type of request (namely a specific request) under the same type of service (same type of service) is realized, the normal execution of the service processing by other requests under the type of service is ensured, the application scene of the service processing method is expanded, and the flexible configuration of the service processing method is further promoted.
Preferably, the method for generating corresponding service configuration information for the service method to be degraded marked with the secondary target annotation further includes:
acquiring a parameter attribute value corresponding to the parameter information of the service method to be degraded;
and generating service configuration information according to the parameter attribute values.
Through the setting, the service configuration information is generated according to the attribute value corresponding to the parameter information, so that the problem that a set of codes are independently compiled aiming at different service logics in the conventional method is avoided, the code intrusion is avoided, and the complexity of service degradation is obviously reduced.
And step S103, comparing the parameter information with the service configuration information, and executing corresponding service processing on the service method according to the comparison result.
Preferably, according to an embodiment of the present invention, the method further includes:
traversing the parameter information corresponding to the business method, and judging whether the parameter information is marked with a secondary target annotation;
and if so, performing service degradation processing on the service method.
Through the setting, the secondary target annotation is used for identifying that the parameter attribute needs to generate a degraded configuration; and only by judging that the parameter information of the business method is marked with the secondary target annotation, the business method can be subjected to business degradation processing so as to improve the business processing efficiency.
Further, according to the embodiment of the present invention, the service configuration information indicates information of parameters to be degraded; comparing the parameter information with the service configuration information, and executing corresponding service processing to the service method according to the comparison result, wherein the method further comprises the following steps:
comparing the parameter information with the service configuration information one by one, and executing service degradation processing on the service method under the condition that at least one item of parameter information is successfully compared with the service configuration information.
Through the setting, the service configuration information indicates the parameter information to be degraded, the parameter information corresponding to the intercepted service method is only required to be compared with the service configuration information, and the service degradation processing is executed on the service method as long as any parameter field is successfully compared.
Preferably, according to an embodiment of the present invention, the method further includes:
and updating the target annotation according to the business requirement, and updating the mapping table according to the updated target annotation.
Through the setting, when the service requirement is changed, the target annotation can be updated, so that the mapping table is reconstructed (or the original mapping table is updated), the service processing method is expanded, and the user experience is improved.
According to the technical scheme of the embodiment of the invention, the business method is intercepted according to the target annotation, and the business method is analyzed to obtain the signature information and the parameter information corresponding to the business method; determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information; the technical means of comparing the parameter information with the service configuration information and executing corresponding service processing on the service method according to the comparison result overcome the technical problems that the existing service processing method mainly adopts methods of overtime degradation, fault degradation, current limiting reduction and the like to solve interface level faults, the service degradation cannot be executed aiming at specific services, the applicable scene is narrow, the expandability is poor and the user experience is poor, and further the technical effects of executing the service degradation according to the specific services, improving the applicable scene and the expandability and improving the user experience are achieved.
Fig. 2 is a schematic diagram of a main flow of a service processing method according to a second embodiment of the present invention; as shown in fig. 2, the service processing method provided in the embodiment of the present invention mainly includes:
step S201, according to the business requirement, marking a target annotation in the interface implementation class corresponding to the business method to be degraded.
Specifically, according to the embodiment of the present invention, when the target annotation is set in the secondary level, the primary target annotation (migration) is marked on the service method to be degraded, and has two functions: a. the service method identified by the annotation is analyzed for parameter information, and degradation configuration is generated through the parameter information; b. the representation needs to be intercepted by AOP (Aspect Oriented Programming), the service method needs to be subjected to service degradation logic processing, signature is a service method in a unique identification class, if the signature is not filled, a class name or a service method name is taken by default, and specific codes are as follows:
and marking a primary target annotation (migration) on the business method to be degraded through the code, wherein the signature is the business method in the unique identification class.
The secondary target annotation is marked on the parameter attribute of the service method to be degraded, and is used for identifying which attributes need to generate degradation configuration, if the attribute does not need to be specified, the attribute name is directly used, and the specific code is as follows:
through the codes, the secondary target annotation is marked on the parameter attribute (DegradationParam) of the business method to be degraded, and is used for identifying which attributes need to generate degradation configuration.
According to the embodiment of the invention, the specific business method is labeled according to the business requirement, and then the business configuration information is generated according to the specific parameter in the parameter information of the labeled business method, so that the flexible configuration of the business configuration information is realized, and the application scene is further expanded.
Step S202, based on the scanning of the interface realization class, a plurality of service methods to be degraded are obtained according to the primary target annotation.
Through the setting, all the service methods to be degraded can be conveniently obtained, and the corresponding degradation configuration information is generated subsequently, so that the effect of improving the service processing efficiency is achieved.
Step S203, respectively traversing the parameter information corresponding to the plurality of service methods to be degraded, and generating corresponding service configuration information for the service methods to be degraded marked with the secondary target annotation.
Specifically, according to the embodiment of the present invention, the primary target annotation is marked on a service method to be degraded; and marking the secondary target annotation on the parameter attribute of the service method to be degraded. The primary target annotation is used for identifying that the business method needs to carry out business degradation logic processing; the secondary target annotation is used to identify that the parameter attribute requires generation of a downgraded configuration. Through the hierarchical setting, the degradation of the service executed by a certain type of request (namely a specific request) under the same type of service (same type of service) is realized, the normal execution of the service processing by other requests under the type of service is ensured, the application scene of the service processing method is expanded, and the flexible configuration of the service processing method is further promoted.
Preferably, the method for generating corresponding service configuration information for the service method to be degraded marked with the secondary target annotation further includes:
acquiring a parameter attribute value corresponding to the parameter information of the service method to be degraded;
and generating service configuration information according to the parameter attribute values.
Through the setting, the service configuration information is generated according to the attribute value corresponding to the parameter information, so that the problem that a set of codes are independently compiled aiming at different service logics in the conventional method is avoided, the code intrusion is avoided, and the complexity of service degradation is obviously reduced.
And step S204, determining signature information corresponding to the service configuration information, and constructing a mapping table.
According to the embodiment of the present invention, after the service configuration information (i.e., the downgrade configuration information) is generated, a DB (Data Base ) is queried to see whether the service configuration information has a matching signature, if not, a unique signature is determined for the service configuration information, and a mapping table is constructed and stored in the DB, so as to facilitate subsequent query.
And step S205, according to the target annotation interception business method, analyzing the business method to obtain the signature information and the parameter information corresponding to the business method.
By the arrangement, the specific service method is intercepted according to the service requirement, the signature information and the parameter information acquired by the service method are analyzed, and the signature information and the parameter information are compared with the service configuration information in the mapping table subsequently, so that the service degradation is carried out, and the application scene and the expandability are improved.
According to the embodiment of the invention, when the application is started, a business method containing @ migration (primary target annotation) is intercepted, the parameter attribute of a parameter field annotated by @ migration param (secondary target annotation) in the business method is analyzed, and the signature (signature information) in the annotation @ migration and the parameter value (parameter information) in the @ migration param are obtained, so that the metadata migration parameter (namely the business configuration information) is determined according to the information.
Step S206, determining the service configuration information from the mapping table according to the signature information.
According to the embodiment of the invention, the mapping table can adopt a key-value structure, the signature information and the service configuration information are respectively used as the main key (key) and the key value (value), through the setting, the service configuration information corresponding to the intercepted service method can be quickly inquired, and then the corresponding service processing is executed through the subsequent comparison result, so that the service processing efficiency is improved, and the user experience is improved.
Step S207, comparing the parameter information with the service configuration information one by one, and executing service degradation processing on the service method under the condition that at least one item of parameter information is successfully compared with the service configuration information.
Through the setting, the service configuration information indicates the parameter information to be degraded, the parameter information corresponding to the intercepted service method is only required to be compared with the service configuration information, and the service degradation processing is executed on the service method as long as any parameter field is successfully compared.
Preferably, according to an embodiment of the present invention, the method further includes:
traversing the parameter information corresponding to the business method, and judging whether the parameter information is marked with a secondary target annotation;
and if so, performing service degradation processing on the service method.
Through the setting, the secondary target annotation is used for identifying that the parameter attribute needs to generate a degraded configuration; and only by judging that the parameter information of the business method is marked with the secondary target annotation, the business method can be subjected to business degradation processing so as to improve the business processing efficiency.
And step S208, updating the target annotation according to the business requirement, and updating the mapping table according to the updated target annotation.
Through the setting, when the service requirement is changed, the target annotation can be updated, so that the mapping table is reconstructed (or the original mapping table is updated), the service processing method is expanded, and the user experience is improved.
According to the technical scheme of the embodiment of the invention, the business method is intercepted according to the target annotation, and the business method is analyzed to obtain the signature information and the parameter information corresponding to the business method; determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information; the technical means of comparing the parameter information with the service configuration information and executing corresponding service processing on the service method according to the comparison result overcome the technical problems that the existing service processing method mainly adopts methods of overtime degradation, fault degradation, current limiting reduction and the like to solve interface level faults, the service degradation cannot be executed aiming at specific services, the applicable scene is narrow, the expandability is poor and the user experience is poor, and further the technical effects of executing the service degradation according to the specific services, improving the applicable scene and the expandability and improving the user experience are achieved.
Fig. 3 is a schematic diagram of main modules of a service processing apparatus provided according to an embodiment of the present invention; as shown in fig. 3, a service processing apparatus 300 according to an embodiment of the present invention mainly includes:
the intercepting module 301 is configured to perform parsing processing on the business method according to the target annotation intercepting business method, so as to obtain signature information and parameter information corresponding to the business method.
Specifically, according to the embodiment of the present invention, the target annotation is labeled in the interface implementation class corresponding to the service method to be degraded according to the service requirement.
By the arrangement, the specific service method is intercepted according to the service requirement, the signature information and the parameter information acquired by the service method are analyzed, and the signature information and the parameter information are compared with the service configuration information in the mapping table subsequently, so that the service degradation is carried out, and the application scene and the expandability are improved.
A service configuration information determining module 302, configured to determine service configuration information from the mapping table according to the signature information; the mapping table indicates the mapping relationship between the signature information and the service configuration information.
According to the embodiment of the invention, the mapping table can adopt a key-value structure, the signature information and the service configuration information are respectively used as the main key (key) and the key value (value), through the setting, the service configuration information corresponding to the intercepted service method can be quickly inquired, and then the corresponding service processing is executed through the subsequent comparison result, so that the service processing efficiency is improved, and the user experience is improved.
Specifically, according to an embodiment of the present invention, the service processing apparatus 300 further includes a mapping table constructing module, before the step of determining the service configuration information from the mapping table according to the signature information, the mapping table constructing module is configured to:
based on the scanning of the interface implementation class, acquiring a service method to be degraded containing a target annotation;
and generating service configuration information according to the parameter information corresponding to the service method to be degraded, determining signature information corresponding to the service configuration information, and constructing a mapping table.
According to the embodiment of the invention, the service configuration information can be generated according to the actual service requirement and the specific parameter in the parameter information, so that the flexible configuration of the service configuration information is realized, and the application scene is further expanded.
Further, the target annotation is at least one level of settings; when the target annotation is set in the second level, the service configuration information determining module 302 is further configured to:
after a plurality of service methods to be degraded are obtained according to the primary target annotation, parameter information corresponding to the plurality of service methods to be degraded is traversed respectively, and corresponding service configuration information is generated for the service methods to be degraded marked with the secondary target annotation.
Specifically, according to the embodiment of the present invention, the primary target annotation is marked on a service method to be degraded; and marking the secondary target annotation on the parameter attribute of the service method to be degraded. The primary target annotation is used for identifying that the business method needs to carry out business degradation logic processing; the secondary target annotation is used to identify that the parameter attribute requires generation of a downgraded configuration. Through the hierarchical setting, the service degradation of a certain type of request (namely a specific request) under the same type of service (same type of service) is realized, the normal service processing of other requests under the type of service is ensured, the application scene of the service processing device is expanded, and the flexible configuration of the service processing is further promoted.
Preferably, the service configuration information determining module 302 is further configured to:
acquiring a parameter attribute value corresponding to the parameter information of the service method to be degraded;
and generating service configuration information according to the parameter attribute values.
Through the setting, the service configuration information is generated according to the attribute value corresponding to the parameter information, so that the problem that a set of codes are independently compiled aiming at different service logics in the conventional method is avoided, the code intrusion is avoided, and the complexity of service degradation is obviously reduced.
The service processing module 303 is configured to compare the parameter information with the service configuration information, and execute corresponding service processing on the service method according to the comparison result.
Preferably, according to the embodiment of the present invention, the service processing module 303 is further configured to:
traversing the parameter information corresponding to the business method, and judging whether the parameter information is marked with a secondary target annotation;
and if so, performing service degradation processing on the service method.
Through the setting, the secondary target annotation is used for identifying that the parameter attribute needs to generate a degraded configuration; and only by judging that the parameter information of the business method is marked with the secondary target annotation, the business method can be subjected to business degradation processing so as to improve the business processing efficiency.
Further, according to the embodiment of the present invention, the service configuration information indicates information of parameters to be degraded; the service processing module 303 is further configured to:
comparing the parameter information with the service configuration information one by one, and executing service degradation processing on the service method under the condition that at least one item of parameter information is successfully compared with the service configuration information.
Through the setting, the service configuration information indicates the parameter information to be degraded, the parameter information corresponding to the intercepted service method is only required to be compared with the service configuration information, and the service degradation processing is executed on the service method as long as any parameter field is successfully compared.
Preferably, according to the embodiment of the present invention, the service processing apparatus 300 further includes an updating module, configured to:
and updating the target annotation according to the business requirement, and updating the mapping table according to the updated target annotation.
Through the setting, when the service requirement is changed, the target annotation can be updated, so that the mapping table is reconstructed (or the original mapping table is updated), the service processing method is expanded, and the user experience is improved.
According to the technical scheme of the embodiment of the invention, the business method is intercepted according to the target annotation, and the business method is analyzed to obtain the signature information and the parameter information corresponding to the business method; determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information; the technical means of comparing the parameter information with the service configuration information and executing corresponding service processing on the service method according to the comparison result overcome the technical problems that the existing service processing method mainly adopts methods of overtime degradation, fault degradation, current limiting reduction and the like to solve interface level faults, the service degradation cannot be executed aiming at specific services, the applicable scene is narrow, the expandability is poor and the user experience is poor, and further the technical effects of executing the service degradation according to the specific services, improving the applicable scene and the expandability and improving the user experience are achieved.
Fig. 4 shows an exemplary system architecture 400 of a service processing method or service processing apparatus to which embodiments of the present invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405 (this architecture is merely an example, and the components included in a particular architecture may be adapted according to application specific circumstances). The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as data processing type applications, service processing type applications, etc. (for example only).
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server that provides various services, such as a server (for example only) that performs business processing/data processing on users using the terminal devices 401, 402, 403. The server may analyze and otherwise process the received data, such as the service method, and feed back the processing result (e.g., signature information and parameter information, for example only) to the terminal device.
It should be noted that the service processing method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the service processing apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use with a terminal device or server implementing an embodiment of the invention is shown. The terminal device or the server shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises an interception module, a service configuration information determination module and a service processing module. The names of the modules do not form a limitation on the modules themselves under certain conditions, for example, the interception module may also be described as a "module for intercepting a business method according to a target annotation and performing parsing processing on the business method to obtain signature information and parameter information corresponding to the business method".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: analyzing the business method according to the target annotation interception business method to obtain signature information and parameter information corresponding to the business method; determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information; and comparing the parameter information with the service configuration information, and executing corresponding service processing on the service method according to the comparison result.
According to the technical scheme of the embodiment of the invention, the business method is intercepted according to the target annotation, and the business method is analyzed to obtain the signature information and the parameter information corresponding to the business method; determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information; the technical means of comparing the parameter information with the service configuration information and executing corresponding service processing on the service method according to the comparison result overcome the technical problems that the existing service processing method mainly adopts methods of overtime degradation, fault degradation, current limiting reduction and the like to solve interface level faults, the service degradation cannot be executed aiming at specific services, the applicable scene is narrow, the expandability is poor and the user experience is poor, and further the technical effects of executing the service degradation according to the specific services, improving the applicable scene and the expandability and improving the user experience are achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and 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 method for processing a service, comprising:
according to a target annotation interception business method, analyzing the business method to obtain signature information and parameter information corresponding to the business method;
determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information;
and comparing the parameter information with the service configuration information, and executing corresponding service processing on the service method according to a comparison result.
2. The business processing method of claim 1, wherein the target annotation is labeled in an interface implementation class corresponding to a business method to be degraded according to business requirements; before the step of determining service configuration information from a mapping table according to the signature information, the method further includes a mapping table constructing step, including:
based on the scanning of the interface implementation class, acquiring a business method to be degraded containing the target annotation;
and generating service configuration information according to the parameter information corresponding to the service method to be degraded, determining signature information corresponding to the service configuration information, and constructing the mapping table.
3. The business processing method of claim 2, wherein the target annotation is at least one level of settings; when the target annotation is set in a secondary level, generating service configuration information according to the parameter information corresponding to the service method to be degraded, and further comprising:
and after the plurality of service methods to be degraded are obtained according to the primary target annotation, respectively traversing the parameter information corresponding to the plurality of service methods to be degraded, and generating corresponding service configuration information for the service methods to be degraded marked with the secondary target annotation.
4. The business processing method of claim 3, wherein the generating of the corresponding business configuration information for the business method to be downgraded labeled with the secondary target annotation further comprises:
acquiring a parameter attribute value corresponding to the parameter information of the service method to be degraded;
and generating service configuration information according to the parameter attribute value.
5. The traffic processing method according to claim 3, further comprising:
traversing the parameter information corresponding to the business method, and judging whether the parameter information is marked with the secondary target annotation;
and if so, performing service degradation processing on the service method.
6. The traffic processing method according to claim 1, wherein the traffic configuration information indicates information of parameters to be degraded; the comparing the parameter information with the service configuration information, and executing corresponding service processing to the service method according to the comparison result, further comprising:
and comparing the parameter information with the service configuration information one by one, and executing service degradation processing on the service method under the condition that at least one item of parameter information is successfully compared with the service configuration information.
7. The traffic processing method according to claim 2, further comprising:
and updating the target annotation according to the business requirement, and updating the mapping table according to the updated target annotation.
8. A traffic processing apparatus, comprising:
the intercepting module is used for analyzing and processing the business method according to a target annotation intercepting business method so as to obtain signature information and parameter information corresponding to the business method;
the service configuration information determining module is used for determining service configuration information from a mapping table according to the signature information; the mapping table indicates the mapping relation between the signature information and the service configuration information;
and the service processing module is used for comparing the parameter information with the service configuration information and executing corresponding service processing on the service method according to a comparison result.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110019655.3A CN113746661A (en) | 2021-01-07 | 2021-01-07 | Service processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110019655.3A CN113746661A (en) | 2021-01-07 | 2021-01-07 | Service processing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113746661A true CN113746661A (en) | 2021-12-03 |
Family
ID=78728111
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110019655.3A Pending CN113746661A (en) | 2021-01-07 | 2021-01-07 | Service processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113746661A (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060288018A1 (en) * | 2005-06-20 | 2006-12-21 | Afshan Ally | Loose coupling of Web services |
US20070290815A1 (en) * | 2006-05-31 | 2007-12-20 | Sap Ag | Utilizing a mapping engine to dynamically map data objects on read/write RFID tags based on customized tag structures |
CN104009994A (en) * | 2014-05-30 | 2014-08-27 | 北京京东尚科信息技术有限公司 | Method and device for achieving communication of server side and client side |
WO2015103523A1 (en) * | 2014-01-06 | 2015-07-09 | Cisco Technology, Inc. | Predictive learning machine-based approach to detect traffic outside of service level agreements |
CN106713028A (en) * | 2016-12-20 | 2017-05-24 | 北京小米移动软件有限公司 | Service degradation method and apparatus, and distributed task scheduling system |
CN106997314A (en) * | 2016-01-22 | 2017-08-01 | 广州市动景计算机科技有限公司 | Abnormality eliminating method, apparatus and system for distributed system |
CN107454138A (en) * | 2017-06-19 | 2017-12-08 | 阿里巴巴集团控股有限公司 | The implementation method and device that business degrades |
CN107592219A (en) * | 2017-09-04 | 2018-01-16 | 北京潘达互娱科技有限公司 | Service degradation processing method and processing device |
CN108920135A (en) * | 2018-06-27 | 2018-11-30 | 杭州贝店科技有限公司 | A kind of customized business generating method, device, computer equipment and storage medium |
CN111026797A (en) * | 2019-12-02 | 2020-04-17 | 卫盈联信息技术(深圳)有限公司 | Service data processing method, server and storage medium |
-
2021
- 2021-01-07 CN CN202110019655.3A patent/CN113746661A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060288018A1 (en) * | 2005-06-20 | 2006-12-21 | Afshan Ally | Loose coupling of Web services |
US20070290815A1 (en) * | 2006-05-31 | 2007-12-20 | Sap Ag | Utilizing a mapping engine to dynamically map data objects on read/write RFID tags based on customized tag structures |
WO2015103523A1 (en) * | 2014-01-06 | 2015-07-09 | Cisco Technology, Inc. | Predictive learning machine-based approach to detect traffic outside of service level agreements |
CN104009994A (en) * | 2014-05-30 | 2014-08-27 | 北京京东尚科信息技术有限公司 | Method and device for achieving communication of server side and client side |
CN106997314A (en) * | 2016-01-22 | 2017-08-01 | 广州市动景计算机科技有限公司 | Abnormality eliminating method, apparatus and system for distributed system |
CN106713028A (en) * | 2016-12-20 | 2017-05-24 | 北京小米移动软件有限公司 | Service degradation method and apparatus, and distributed task scheduling system |
CN107454138A (en) * | 2017-06-19 | 2017-12-08 | 阿里巴巴集团控股有限公司 | The implementation method and device that business degrades |
CN107592219A (en) * | 2017-09-04 | 2018-01-16 | 北京潘达互娱科技有限公司 | Service degradation processing method and processing device |
CN108920135A (en) * | 2018-06-27 | 2018-11-30 | 杭州贝店科技有限公司 | A kind of customized business generating method, device, computer equipment and storage medium |
CN111026797A (en) * | 2019-12-02 | 2020-04-17 | 卫盈联信息技术(深圳)有限公司 | Service data processing method, server and storage medium |
Non-Patent Citations (3)
Title |
---|
EYAL RONEN; ROBERT GILLHAM; DANIEL GENKIN, ET.AL.: "The 9 Lives of Bleichenbacher\'s CAT: New Cache ATtacks on TLS Implementations", 2019 IEEE SYMPOSIUM ON SECURITY AND PRIVACY (SP), 16 September 2019 (2019-09-16) * |
夏海涛, 吴格含, 孟洛明, 邱雪松: "基于生命周期的通用业务管理信息建模的研究", 电子学报, no. 07, 25 July 2004 (2004-07-25) * |
张若庚;张若英;高宇;徐志发;鲁春丛;: "支持QoS管理的下一代互联网网络管理流程", 高技术通讯, no. 03, 30 March 2007 (2007-03-30) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110706093A (en) | Accounting processing method and device | |
CN111427701A (en) | Workflow engine system and business processing method | |
CN111460129A (en) | Method and device for generating identification, electronic equipment and storage medium | |
CN112073395B (en) | File distribution method and device | |
CN111221869A (en) | Method and device for tracking database transaction time and analyzing database lock | |
CN111427899A (en) | Method, device, equipment and computer readable medium for storing file | |
CN118312076A (en) | Map icon processing method and device, electronic equipment and computer readable medium | |
CN113742389A (en) | Service processing method and device | |
CN109087097B (en) | Method and device for updating same identifier of chain code | |
CN111767126A (en) | System and method for distributed batch processing | |
CN112948138A (en) | Method and device for processing message | |
CN114374657B (en) | Data processing method and device | |
CN112685481A (en) | Data processing method and device | |
CN113761433B (en) | Service processing method and device | |
CN113779122A (en) | Method and apparatus for exporting data | |
CN114625458A (en) | Page data processing method and device, electronic equipment and storage medium | |
CN113746661A (en) | Service processing method and device | |
CN113726885A (en) | Method and device for adjusting flow quota | |
CN113282455A (en) | Monitoring processing method and device | |
CN113760469A (en) | Distributed computing method and device | |
CN112463616A (en) | Chaos testing method and device for Kubernetes container platform | |
CN113448652A (en) | Request processing method and device | |
CN111209014A (en) | Parameter checking method and device | |
CN115484149B (en) | Network switching method, network switching device, electronic equipment and storage medium | |
CN110262756B (en) | Method and device for caching data |
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 |