A business processing method and device
By using target annotations in the business processing method to intercept the business method and analyze the signature and parameter information, and comparing it with the business configuration information in the mapping table, the problem of the inability to perform business downgrades for specific services in the prior art is solved, and the applicable scenarios and user experience are improved.
Patent Information
- Application Number
- CN202110019655.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-07
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-01-07
AI Technical Summary
When solving interface-level failures, existing business processing methods cannot perform business downgrades for specific services, resulting in narrow applicable scenarios, poor scalability, and poor user experience.
By using the target annotation to intercept the business method in the business method, the business method is parsed to obtain signature information and parameter information. Then, the service configuration information is determined from the mapping table based on the signature information, the parameter information is compared with the service configuration information, and the corresponding service processing is performed based on the comparison results.
It realizes business downgrades based on specific services, improves applicable scenarios and scalability, and improves user experience.
Smart Images

Figure CN113746661B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a business processing method and device. Background Art
[0002] Interface-level failures refer to problems such as slow service response, large-scale access timeouts, and large-scale access exceptions during service processing, even though the system is not down and the network is not interrupted. The essence of this is that the system load is too high, resulting in the inability to quickly process services. With the continuous development of Internet services, how to solve interface-level failures to meet user needs is an issue that needs to be solved urgently.
[0003] There are at least the following problems in the prior art:
[0004] Existing service processing methods mainly use timeout downgrade, fault downgrade, current limiting reduction and other methods to solve interface-level failures. Since service downgrade cannot be performed for specific services, the applicable scenarios are narrow, the scalability is poor, and the user experience is poor. Summary of the invention
[0005] In view of this, the embodiments of the present invention provide a service processing method and device, which can perform service downgrade according to specific services, improve the applicable scenarios and scalability, and enhance the user experience.
[0006] To achieve the above object, according to a first aspect of an embodiment of the present invention, a service processing method is provided, including:
[0007] Intercept the business method according to the target annotation, parse the business method to obtain the signature information and parameter information corresponding to the business method;
[0008] Determine the service configuration information from the mapping table according to the signature information; wherein the mapping table indicates the mapping relationship between the signature information and the service configuration information;
[0009] Compare the parameter information with the business configuration information, and perform corresponding business processing on the business method based on the comparison results.
[0010] Furthermore, the target annotation is annotated in the interface implementation class corresponding to the to-be-downgraded business method according to business requirements; before the step of determining the business configuration information from the mapping table according to the signature information, the method further includes a step of constructing the mapping table, including:
[0011] Based on the scanning of the interface implementation class, obtain the business method to be downgraded containing the target annotation;
[0012] Generate business configuration information according to parameter information corresponding to the business method to be downgraded, determine signature information corresponding to the business configuration information, and construct a mapping table.
[0013] Furthermore, the target annotation is at least a first-level setting; when the target annotation is a second-level setting, generating the business configuration information according to the parameter information corresponding to the business method to be downgraded also includes:
[0014] After obtaining multiple business methods to be downgraded according to the first-level target annotation, the parameter information corresponding to the multiple business methods to be downgraded are traversed respectively, and the corresponding business configuration information is generated for the business methods to be downgraded marked with the second-level target annotation.
[0015] Furthermore, generating corresponding business configuration information for the business method to be downgraded marked with the secondary target annotation also includes:
[0016] Obtain the parameter attribute value corresponding to the parameter information of the service method to be downgraded;
[0017] Generate service configuration information based on parameter attribute values.
[0018] Furthermore, it also includes:
[0019] Traverse the parameter information corresponding to the business method to determine whether the parameter information is marked with a secondary target annotation;
[0020] If so, perform business downgrade processing on the business method.
[0021] Furthermore, the service configuration information indicates the parameter information to be downgraded; the parameter information is compared with the service configuration information, and corresponding service processing is performed on the service method according to the comparison result, further comprising:
[0022] The parameter information is compared with the business configuration information one by one, and when at least one item of the parameter information is successfully compared with the business configuration information, business downgrade processing is performed on the business method.
[0023] Furthermore, it also includes:
[0024] The target annotation is updated according to the business requirements, and the mapping table is updated according to the updated target annotation.
[0025] According to a second aspect of an embodiment of the present invention, there is provided a service processing device, including:
[0026] The interception module is used to intercept the business method according to the target annotation and parse the business method to obtain the signature information and parameter information corresponding to the business method;
[0027] A service configuration information determination module, used to determine the service configuration information from a mapping table according to the signature information; wherein the mapping table indicates a mapping relationship between the signature information and the service configuration information;
[0028] The business processing module is used to compare the parameter information with the business configuration information and perform corresponding business processing on the business method according to the comparison result.
[0029] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, including:
[0030] one or more processors;
[0031] a storage device for storing one or more programs,
[0032] When one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned business processing methods.
[0033] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the above-mentioned business processing methods is implemented.
[0034] An embodiment of the above invention has the following advantages or beneficial effects: because the business method is intercepted according to the target annotation, the business method is parsed and processed to obtain the signature information and parameter information corresponding to the business method; the business configuration information is determined from the mapping table according to the signature information; wherein the mapping table indicates the mapping relationship between the signature information and the business configuration information; the parameter information is compared with the business configuration information, and the technical means of performing corresponding business processing on the business method according to the comparison result is overcome. Therefore, the existing business processing methods mainly adopt timeout downgrade, fault downgrade, current limiting reduction and other methods to solve interface level failures, and the technical problems that business downgrade cannot be performed for specific businesses, the applicable scenarios are narrow, the scalability is poor, and the user experience is poor, thereby achieving the technical effect of being able to perform business downgrade according to specific businesses, improving applicable scenarios and scalability, and improving user experience.
[0035] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0037] Figure 1 is a schematic diagram of the main flow of the service processing method provided according to the first embodiment of the present invention;
[0038] Figure 2 is a schematic diagram of the main flow of a service processing method provided according to a second embodiment of the present invention;
[0039] Figure 3 is a schematic diagram of main modules of a service processing device provided according to an embodiment of the present invention;
[0040] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0041] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0043] Figure 1 is a schematic diagram of the main flow of the service processing method provided according to the first embodiment of the present invention; Figure 1 As shown, the service processing method provided by the embodiment of the present invention mainly includes:
[0044] Step S101, intercepting the business method according to the target annotation, and parsing the business method to obtain signature information and parameter information corresponding to the business method.
[0045] Specifically, according to an embodiment of the present invention, the target annotation is annotated in the interface implementation class corresponding to the to-be-downgraded business method according to business requirements.
[0046] Through the above settings, it is possible to intercept specific business methods according to business needs, and obtain signature information and parameter information by parsing the business method, and then compare them with the business configuration information in the mapping table to perform business downgrade, thereby improving the applicable scenarios and scalability.
[0047] Step S102: determining the service configuration information from a mapping table according to the signature information; wherein the mapping table indicates a mapping relationship between the signature information and the service configuration information.
[0048] According to an embodiment of the present invention, the mapping table may adopt a key-value structure, with signature information and business configuration information serving as the primary key (key) and key value (value), respectively. Through the above settings, the business configuration information corresponding to the intercepted business method can be quickly queried, and then the corresponding business processing can be executed through subsequent comparison results, thereby improving business processing efficiency and user experience.
[0049] Specifically, according to an 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:
[0050] Based on the scanning of the interface implementation class, obtain the business method to be downgraded containing the target annotation;
[0051] Generate business configuration information according to parameter information corresponding to the business method to be downgraded, determine signature information corresponding to the business configuration information, and construct a mapping table.
[0052] According to the embodiment of the present invention, the business configuration information can also be generated according to specific parameters in the parameter information based on actual business needs, so as to achieve flexible configuration of the business configuration information and further expand the applicable scenarios.
[0053] Furthermore, the target annotation is at least a first-level setting; when the target annotation is a second-level setting, generating the business configuration information according to the parameter information corresponding to the business method to be downgraded also includes:
[0054] After obtaining multiple business methods to be downgraded according to the first-level target annotation, the parameter information corresponding to the multiple business methods to be downgraded are traversed respectively, and the corresponding business configuration information is generated for the business methods to be downgraded marked with the second-level target annotation.
[0055] Specifically, according to an embodiment of the present invention, the above-mentioned first-level target annotation is annotated on the business method to be downgraded; and the second-level target annotation is annotated on the parameter attribute of the business method to be downgraded. The first-level target annotation is used to identify that the business method needs to perform business downgrade logic processing; the second-level target annotation is used to identify that the parameter attribute needs to generate a downgrade configuration. Through the above-mentioned hierarchical setting, it is achieved that a certain type of request (i.e., a specific request) under the same type of business (the same type of service) performs business downgrade, while ensuring that other requests under this type of business perform business processing normally, which expands the applicable scenarios of the above-mentioned business processing method and further improves the flexible configuration of the business processing method.
[0056] Preferably, generating corresponding business configuration information for the business method to be downgraded marked with the secondary target annotation also includes:
[0057] Obtain the parameter attribute value corresponding to the parameter information of the service method to be downgraded;
[0058] Generate service configuration information based on parameter attribute values.
[0059] Through the above settings, business configuration information is generated according to the attribute values corresponding to the parameter information, avoiding the need to write a separate set of codes for different business service logics in the existing method, avoiding code intrusion, and significantly reducing the complexity of business degradation.
[0060] Step S103, comparing the parameter information with the business configuration information, and executing corresponding business processing on the business method according to the comparison result.
[0061] Preferably, according to an embodiment of the present invention, the method further includes:
[0062] Traverse the parameter information corresponding to the business method to determine whether the parameter information is marked with a secondary target annotation;
[0063] If so, perform business downgrade processing on the business method.
[0064] Through the above settings, the secondary target annotation is used to identify that the parameter attribute needs to generate a downgrade configuration; as long as it is determined that the parameter information of the business method is marked with a secondary target annotation, the business method can be downgraded to improve business processing efficiency.
[0065] Further, according to an embodiment of the present invention, the service configuration information indicates parameter information to be downgraded; the parameter information is compared with the service configuration information, and corresponding service processing is performed on the service method according to the comparison result. The method further includes:
[0066] The parameter information is compared with the business configuration information one by one, and when at least one item of the parameter information is successfully compared with the business configuration information, business downgrade processing is performed on the business method.
[0067] Through the above settings, the above business configuration information indicates the parameter information to be downgraded. It is only necessary to compare the parameter information corresponding to the intercepted business method with the above business configuration information. As long as any parameter field is successfully compared, the business method is downgraded.
[0068] Preferably, according to an embodiment of the present invention, the method further includes:
[0069] The target annotation is updated according to the business requirements, and the mapping table is updated according to the updated target annotation.
[0070] Through the above settings, when business requirements change, the target annotation can be updated to rebuild the mapping table (or update the original mapping table), thereby expanding the business processing method and improving the user experience.
[0071] According to the technical solution of the embodiment of the present invention, a business method is intercepted according to a target annotation, and the business method is parsed to obtain signature information and parameter information corresponding to the business method; the business configuration information is determined from a mapping table according to the signature information; wherein the mapping table indicates a mapping relationship between the signature information and the business configuration information; the parameter information is compared with the business configuration information, and a technical means of performing corresponding business processing on the business method according to the comparison result is overcome. Therefore, the existing business processing methods mainly adopt timeout downgrade, fault downgrade, current limiting reduction and other methods to solve interface-level faults, and the technical problems of being unable to perform business downgrade for specific businesses, having narrow applicable scenarios, poor scalability and poor user experience are overcome, thereby achieving the technical effect of being able to perform business downgrade for specific businesses, improving applicable scenarios and scalability, and enhancing user experience.
[0072] Figure 2 is a schematic diagram of the main flow of the service processing method provided according to the second embodiment of the present invention; Figure 2 As shown, the service processing method provided by the embodiment of the present invention mainly includes:
[0073] Step S201: mark the target annotation in the interface implementation class corresponding to the business method to be downgraded according to business requirements.
[0074] Specifically, according to an embodiment of the present invention, when the target annotation is set as a secondary setting, the primary target annotation (Degradation) is annotated on the business method to be downgraded, which has two functions: a. The business method identified by this annotation will be parsed for parameter information, and the downgrade configuration will be generated through the parameter information; b. It indicates that it needs to be intercepted by AOP (Aspect Oriented Programming), and the business method needs to perform business downgrade logic processing. The signature is a unique identifier of the business method in the class. If the signature is not filled in, the class name or business method name is taken by default. The specific code is as follows:
[0075]
[0076] Through the above code, the first-level target annotation (Degradation) is annotated on the business method to be downgraded, where signature is the business method in the unique identifier class.
[0077] The secondary target annotation is annotated on the parameter attributes of the business method to be downgraded to identify which attributes need to generate downgrade configuration. If not specified, the attribute name is used directly. The specific code is as follows:
[0078]
[0079]
[0080] Through the above code, the secondary target annotation is marked on the parameter attribute (DegradationParam) of the business method to be downgraded to identify which attributes need to generate the downgrade configuration.
[0081] According to an embodiment of the present invention, a specific business method is marked according to business requirements, and then business configuration information is generated according to specific parameters in parameter information of the marked business method, so as to achieve flexible configuration of the business configuration information and further expand applicable scenarios.
[0082] Step S202 , based on scanning the interface implementation class, multiple business methods to be downgraded are obtained according to the first-level target annotation.
[0083] Through the above settings, it is convenient to obtain all the service methods to be downgraded, and then generate corresponding downgrade configuration information, so as to achieve the effect of improving service processing efficiency.
[0084] Step S203 , traversing parameter information corresponding to a plurality of to-be-downgraded business methods respectively, and generating corresponding business configuration information for the to-be-downgraded business methods annotated with secondary target annotations.
[0085] Specifically, according to an embodiment of the present invention, the above-mentioned first-level target annotation is annotated on the business method to be downgraded; and the second-level target annotation is annotated on the parameter attribute of the business method to be downgraded. The first-level target annotation is used to identify that the business method needs to perform business downgrade logic processing; the second-level target annotation is used to identify that the parameter attribute needs to generate a downgrade configuration. Through the above-mentioned hierarchical setting, it is achieved that a certain type of request (i.e., a specific request) under the same type of business (the same type of service) performs business downgrade, while ensuring that other requests under this type of business perform business processing normally, which expands the applicable scenarios of the above-mentioned business processing method and further improves the flexible configuration of the business processing method.
[0086] Preferably, generating corresponding business configuration information for the business method to be downgraded marked with the secondary target annotation also includes:
[0087] Obtain the parameter attribute value corresponding to the parameter information of the service method to be downgraded;
[0088] Generate service configuration information based on parameter attribute values.
[0089] Through the above settings, business configuration information is generated according to the attribute values corresponding to the parameter information, avoiding the need to write a separate set of codes for different business service logics in the existing method, avoiding code intrusion, and significantly reducing the complexity of business degradation.
[0090] Step S204: determine the signature information corresponding to the service configuration information and construct a mapping table.
[0091] According to an embodiment of the present invention, after the business configuration information (i.e., degradation configuration information, DegradationMeta) is generated, the DB (Data Base) is queried to check whether the business configuration information has a matching signature. If not, a unique signature is determined for the business configuration information, and a mapping table is constructed, and the mapping table is stored in the DB for subsequent queries.
[0092] Step S205, intercepting the business method according to the target annotation, and parsing the business method to obtain signature information and parameter information corresponding to the business method.
[0093] Through the above settings, it is possible to intercept specific business methods according to business needs, and obtain signature information and parameter information by parsing the business method, and then compare them with the business configuration information in the mapping table to perform business downgrade, thereby improving the applicable scenarios and scalability.
[0094] According to an embodiment of the present invention, when an application is started, a business method containing @Degradation (first-level target annotation) is intercepted, and the parameter attributes of the parameter fields in the business method annotated with @DegradationParam (second-level target annotation) are parsed, and the signature (signature information) in the annotation @Degradation and the parameter value (parameter information) in @DegradationParam are obtained, so as to determine the metadata DegradationMeta (i.e., the above-mentioned business configuration information) based on the above information.
[0095] Step S206: Determine the service configuration information from the mapping table according to the signature information.
[0096] According to an embodiment of the present invention, the mapping table may adopt a key-value structure, with signature information and business configuration information serving as the primary key (key) and key value (value), respectively. Through the above settings, the business configuration information corresponding to the intercepted business method can be quickly queried, and then the corresponding business processing can be executed through subsequent comparison results, thereby improving business processing efficiency and user experience.
[0097] Step S207: compare the parameter information with the service configuration information one by one. If at least one item of parameter information is successfully compared with the service configuration information, perform service downgrade processing on the service method.
[0098] Through the above settings, the above business configuration information indicates the parameter information to be downgraded. It is only necessary to compare the parameter information corresponding to the intercepted business method with the above business configuration information. As long as any parameter field is successfully compared, the business method is downgraded.
[0099] Preferably, according to an embodiment of the present invention, the method further includes:
[0100] Traverse the parameter information corresponding to the business method to determine whether the parameter information is marked with a secondary target annotation;
[0101] If so, perform business downgrade processing on the business method.
[0102] Through the above settings, the secondary target annotation is used to identify that the parameter attribute needs to generate a downgrade configuration; as long as it is determined that the parameter information of the business method is marked with a secondary target annotation, the business method can be downgraded to improve business processing efficiency.
[0103] Step S208: updating the target annotation according to business requirements, and updating the mapping table according to the updated target annotation.
[0104] Through the above settings, when business requirements change, the target annotation can be updated to rebuild the mapping table (or update the original mapping table), thereby expanding the business processing method and improving the user experience.
[0105] According to the technical solution of the embodiment of the present invention, a business method is intercepted according to a target annotation, and the business method is parsed to obtain signature information and parameter information corresponding to the business method; the business configuration information is determined from a mapping table according to the signature information; wherein the mapping table indicates a mapping relationship between the signature information and the business configuration information; the parameter information is compared with the business configuration information, and a technical means of performing corresponding business processing on the business method according to the comparison result is overcome. Therefore, the existing business processing methods mainly adopt timeout downgrade, fault downgrade, current limiting reduction and other methods to solve interface-level faults, and the technical problems of being unable to perform business downgrade for specific businesses, having narrow applicable scenarios, poor scalability and poor user experience are overcome, thereby achieving the technical effect of being able to perform business downgrade for specific businesses, improving applicable scenarios and scalability, and enhancing user experience.
[0106] Figure 3 is a schematic diagram of main modules of a service processing device provided according to an embodiment of the present invention; Figure 3 As shown, the service processing device 300 provided in this embodiment of the present invention mainly includes:
[0107] The interception module 301 is used to intercept the business method according to the target annotation and parse the business method to obtain the signature information and parameter information corresponding to the business method.
[0108] Specifically, according to an embodiment of the present invention, the target annotation is annotated in the interface implementation class corresponding to the to-be-downgraded business method according to business requirements.
[0109] Through the above settings, it is possible to intercept specific business methods according to business needs, and obtain signature information and parameter information by parsing the business method, and then compare them with the business configuration information in the mapping table to perform business downgrade, thereby improving the applicable scenarios and scalability.
[0110] The service configuration information determination module 302 is used to determine the service configuration information from the mapping table according to the signature information; wherein the mapping table indicates the mapping relationship between the signature information and the service configuration information.
[0111] According to an embodiment of the present invention, the mapping table may adopt a key-value structure, with signature information and business configuration information serving as the primary key (key) and key value (value), respectively. Through the above settings, the business configuration information corresponding to the intercepted business method can be quickly queried, and then the corresponding business processing can be executed through subsequent comparison results, thereby improving business processing efficiency and user experience.
[0112] Specifically, according to an embodiment of the present invention, the service processing device 300 further includes a mapping table construction module. Before the step of determining the service configuration information from the mapping table according to the signature information, the mapping table construction module is used to:
[0113] Based on the scanning of the interface implementation class, obtain the business method to be downgraded containing the target annotation;
[0114] Generate business configuration information according to parameter information corresponding to the business method to be downgraded, determine signature information corresponding to the business configuration information, and construct a mapping table.
[0115] According to the embodiment of the present invention, the business configuration information can also be generated according to specific parameters in the parameter information based on actual business needs, so as to achieve flexible configuration of the business configuration information and further expand the applicable scenarios.
[0116] Furthermore, the target annotation is at least a first-level setting; when the target annotation is a second-level setting, the business configuration information determination module 302 is further used to:
[0117] After obtaining multiple business methods to be downgraded according to the first-level target annotation, the parameter information corresponding to the multiple business methods to be downgraded are traversed respectively, and the corresponding business configuration information is generated for the business methods to be downgraded marked with the second-level target annotation.
[0118] Specifically, according to an embodiment of the present invention, the above-mentioned first-level target annotation is annotated on the business method to be downgraded; and the second-level target annotation is annotated on the parameter attribute of the business method to be downgraded. The first-level target annotation is used to identify that the business method needs to perform business downgrade logic processing; the second-level target annotation is used to identify that the parameter attribute needs to generate a downgrade configuration. Through the above-mentioned hierarchical setting, it is achieved that a certain type of request (i.e., a specific request) under the same type of business (the same type of service) performs business downgrade, while ensuring that other requests under this type of business perform business processing normally, which expands the applicable scenarios of the above-mentioned business processing device and further improves the flexibility of business processing configuration.
[0119] Preferably, the service configuration information determining module 302 is further used to:
[0120] Obtain the parameter attribute value corresponding to the parameter information of the service method to be downgraded;
[0121] Generate service configuration information based on parameter attribute values.
[0122] Through the above settings, business configuration information is generated according to the attribute values corresponding to the parameter information, avoiding the need to write a separate set of codes for different business service logics in the existing method, avoiding code intrusion, and significantly reducing the complexity of business degradation.
[0123] The business processing module 303 is used to compare the parameter information with the business configuration information and perform corresponding business processing on the business method according to the comparison result.
[0124] Preferably, according to an embodiment of the present invention, the service processing module 303 is further used for:
[0125] Traverse the parameter information corresponding to the business method to determine whether the parameter information is marked with a secondary target annotation;
[0126] If so, perform business downgrade processing on the business method.
[0127] Through the above settings, the secondary target annotation is used to identify that the parameter attribute needs to generate a downgrade configuration; as long as it is determined that the parameter information of the business method is marked with a secondary target annotation, the business method can be downgraded to improve business processing efficiency.
[0128] Further, according to an embodiment of the present invention, the service configuration information indicates parameter information to be downgraded; the service processing module 303 is further used to:
[0129] The parameter information is compared with the business configuration information one by one, and when at least one item of the parameter information is successfully compared with the business configuration information, business downgrade processing is performed on the business method.
[0130] Through the above settings, the above business configuration information indicates the parameter information to be downgraded. It is only necessary to compare the parameter information corresponding to the intercepted business method with the above business configuration information. As long as any parameter field is successfully compared, the business method is downgraded.
[0131] Preferably, according to an embodiment of the present invention, the service processing device 300 further includes an updating module, which is used to:
[0132] The target annotation is updated according to the business requirements, and the mapping table is updated according to the updated target annotation.
[0133] Through the above settings, when business requirements change, the target annotation can be updated to rebuild the mapping table (or update the original mapping table), thereby expanding the business processing method and improving the user experience.
[0134] According to the technical solution of the embodiment of the present invention, a business method is intercepted according to a target annotation, and the business method is parsed to obtain signature information and parameter information corresponding to the business method; the business configuration information is determined from a mapping table according to the signature information; wherein the mapping table indicates a mapping relationship between the signature information and the business configuration information; the parameter information is compared with the business configuration information, and a technical means of performing corresponding business processing on the business method according to the comparison result is overcome. Therefore, the existing business processing methods mainly adopt timeout downgrade, fault downgrade, current limiting reduction and other methods to solve interface-level faults, and the technical problems of being unable to perform business downgrade for specific businesses, having narrow applicable scenarios, poor scalability and poor user experience are overcome, thereby achieving the technical effect of being able to perform business downgrade for specific businesses, improving applicable scenarios and scalability, and enhancing user experience.
[0135] Figure 4 An exemplary system architecture 400 is shown to which the service processing method or service processing device according to the embodiment of the present invention can be applied.
[0136] like Figure 4 As shown, the system architecture 400 may include terminal devices 401, 402, 403, a network 404 and a server 405 (this architecture is only an example, and the components included in the specific architecture may be adjusted according to the specific application). The network 404 is used to provide a medium for a communication link between the terminal devices 401, 402, 403 and the server 405. The network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0137] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Terminal devices 401, 402, 403 can be installed with various communication client applications, such as data processing applications, business processing applications, etc. (only for example).
[0138] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0139] The server 405 may be a server that provides various services, such as a server that performs business processing / data processing (for example only) for users using the terminal devices 401, 402, and 403. The server may analyze and process the received data such as business methods, and feed back the processing results (such as signature information and parameter information - for example only) to the terminal device.
[0140] It should be noted that the service processing method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the service processing device is generally disposed in the server 405 .
[0141] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0142] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 5 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0143] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which 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 part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0144] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0145] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0146] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0147] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0148] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be arranged in a processor. For example, they may be described as follows: a processor includes an interception module, a business configuration information determination module, and a business processing module. Among them, the names of these modules do not constitute a limitation on the module itself under certain circumstances. For example, the interception module may also be described as "a module for intercepting business methods according to target annotations, parsing the business methods, and obtaining signature information and parameter information corresponding to the business methods".
[0149] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: intercepting the business method according to the target annotation, parsing the business method to obtain the signature information and parameter information corresponding to the business method; determining the business configuration information from the mapping table according to the signature information; wherein the mapping table indicates the mapping relationship between the signature information and the business configuration information; comparing the parameter information with the business configuration information, and performing corresponding business processing on the business method according to the comparison result.
[0150] According to the technical solution of the embodiment of the present invention, a business method is intercepted according to a target annotation, and the business method is parsed to obtain signature information and parameter information corresponding to the business method; the business configuration information is determined from a mapping table according to the signature information; wherein the mapping table indicates a mapping relationship between the signature information and the business configuration information; the parameter information is compared with the business configuration information, and a technical means of performing corresponding business processing on the business method according to the comparison result is overcome. Therefore, the existing business processing methods mainly adopt timeout downgrade, fault downgrade, current limiting reduction and other methods to solve interface-level faults, and the technical problems of being unable to perform business downgrade for specific businesses, having narrow applicable scenarios, poor scalability and poor user experience are overcome, thereby achieving the technical effect of being able to perform business downgrade for specific businesses, improving applicable scenarios and scalability, and enhancing user experience.
[0151] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A business processing method, characterized in that: include: Intercept the business method according to the target annotation, and parse the business method to obtain the signature information and parameter information corresponding to the business method; The target annotation is at least one level setting; Determine the business configuration information from the mapping table according to the signature information; wherein the mapping table indicates the mapping relationship between the signature information and the business configuration information; when the target annotation is a secondary setting, the step of constructing the mapping table includes: after obtaining multiple business methods to be downgraded according to the primary target annotation, traverse the parameter information corresponding to the multiple business methods to be downgraded respectively, and generate corresponding business configuration information for the business methods to be downgraded annotated with the secondary target annotation; determine the signature information corresponding to the business configuration information, and construct the mapping table; The parameter information is compared with the service configuration information, and corresponding service downgrade processing is performed on the service method according to the comparison result.
2. The service processing method according to claim 1, characterized in that: The target annotation is annotated in the interface implementation class corresponding to the business method to be downgraded according to business requirements; The step of constructing the mapping table further includes: Based on scanning the interface implementation class, the to-be-downgraded business method containing the target annotation is obtained.
3. The service processing method according to claim 2, characterized in that: The generating corresponding business configuration information for the business method to be downgraded marked with the secondary target annotation also includes: Obtaining parameter attribute values corresponding to the parameter information of the service method to be downgraded; Generate service configuration information according to the parameter attribute value.
4. The service processing method according to claim 1, characterized in that: Also includes: Traversing the parameter information corresponding to the business method, and determining whether the parameter information is marked with the secondary target annotation; If so, perform service downgrade processing on the service method.
5. The service processing method according to claim 1, characterized in that: The service configuration information indicates parameter information to be downgraded; comparing the parameter information with the service configuration information, and performing corresponding service processing on the service method according to the comparison result, further comprising: The parameter information is compared with the service configuration information one by one, and when at least one item of parameter information is successfully compared with the service configuration information, service downgrade processing is performed on the service method.
6. The service processing method according to claim 2, characterized in that: Also includes: The target annotation is updated according to business requirements, and the mapping table is updated according to the updated target annotation.
7. A service processing device, characterized in that: include: An interception module is used to intercept a business method according to a target annotation and parse the business method to obtain signature information and parameter information corresponding to the business method; The target annotation is at least one level setting; A business configuration information determination module, used to determine the business configuration information from a mapping table according to the signature information; wherein the mapping table indicates a mapping relationship between the signature information and the business configuration information; when the target annotation is a secondary setting, the step of constructing the mapping table includes: after obtaining multiple business methods to be downgraded according to the primary target annotation, traversing the parameter information corresponding to the multiple business methods to be downgraded respectively, and generating corresponding business configuration information for the business methods to be downgraded annotated with the secondary target annotation; determining the signature information corresponding to the business configuration information, and constructing the mapping table; The service processing module is used to compare the parameter information with the service configuration information, and perform corresponding service downgrade processing on the service method according to the comparison result.
8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for realizing business downgrading
CN107454138A