CN110727537A - Method and device for uniformly processing response message, computer equipment and storage medium - Google Patents

Method and device for uniformly processing response message, computer equipment and storage medium Download PDF

Info

Publication number
CN110727537A
CN110727537A CN201911001292.XA CN201911001292A CN110727537A CN 110727537 A CN110727537 A CN 110727537A CN 201911001292 A CN201911001292 A CN 201911001292A CN 110727537 A CN110727537 A CN 110727537A
Authority
CN
China
Prior art keywords
request
abnormal
response message
exception
preset
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.)
Granted
Application number
CN201911001292.XA
Other languages
Chinese (zh)
Other versions
CN110727537B (en
Inventor
刘倍材
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd
Original Assignee
Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd filed Critical Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd
Priority to CN201911001292.XA priority Critical patent/CN110727537B/en
Publication of CN110727537A publication Critical patent/CN110727537A/en
Application granted granted Critical
Publication of CN110727537B publication Critical patent/CN110727537B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a method and a device for uniformly processing response messages, computer equipment and a storage medium. The method comprises the following steps: if the request is detected to be abnormal on a Filter layer, skipping the request to a preset abnormal Filter; acquiring the exception type and exception information of the request; generating a response message in a preset format according to the abnormal type and the abnormal information of the request, and sending the generated response message to the front end; if the request is detected to be abnormal from Service to afterCompletion, the preset annotation is used for processing the request abnormality, wherein the format of the response message generated by the preset annotation is the preset format, so that the response message with a uniform format can be returned to the front end, the workload of the front end is reduced, and the front end can correctly analyze the response message.

Description

Method and device for uniformly processing response message, computer equipment and storage medium
Technical Field
The invention relates to the technical field of Spring MVC development, in particular to a method and a device for uniformly processing response messages, computer equipment and a storage medium.
Background
In the Spring MVC development process, most companies use a front-end and back-end separated application mode, the front end accesses the back-end service, and except for a normal returned result, the situations that a service code is abnormal, a server cannot find a request and the like can also occur. The formats of the data response messages returned to the front end under different conditions are not consistent, if the front end is required to analyze the result types, the workload of the front end is increased undoubtedly, and a bigger problem is that: the data formats of all response messages cannot be expected.
In the prior art, it is common practice to capture exceptions using the annotations @ exceptinonhandler and @ controlleraddress.
Referring to fig. 2, the exception from Service to artifact may be sent to the exception class defined by @ exception handler for processing, and then a response message with a uniform format is returned. However, since the @ exceptinonhandler cannot handle the abnormality of the Filter layer (Filter pre and Filter after in fig. 2), when the request of the front end is abnormal in the Filter layer, the front end may receive a response message in a different data format.
Disclosure of Invention
The embodiment of the invention provides a method, a device, computer equipment and a storage medium for uniformly processing response messages, and aims to solve the problem that the formats of the response messages returned to a front end are inconsistent.
In a first aspect, an embodiment of the present invention provides a method for uniformly processing response packets, where the method includes:
if the request is detected to be abnormal on a Filter layer, skipping the request to a preset abnormal Filter;
acquiring the exception type and exception information of the request;
generating a response message in a preset format according to the abnormal type and the abnormal information of the request, and sending the generated response message to the front end;
if the request is detected to be abnormal from Service to afterCompletion, processing the request abnormality by a preset annotation, wherein the format of a response message generated by the preset annotation is the preset format.
The further technical scheme is that the acquiring of the exception type and exception information of the request comprises:
and calling a doFilter method to acquire the exception type and exception information of the request from the ServeltRequest.
A further technical solution is that the generating a response packet in a preset format according to the exception type and the exception information of the request includes:
and generating a response message in a preset format according to a pre-stored response message template, the abnormal type of the request and the abnormal information.
The further technical scheme is that an abnormal type space and an abnormal information space are arranged in the response message template, and the response message with a preset format is generated according to the pre-stored response message template, the abnormal type of the request and the abnormal information, and the method comprises the following steps:
and filling the abnormal type and the abnormal information of the request into an abnormal type space and an abnormal information space in the response message template respectively.
The further technical scheme is that the preset annotation is an annotation @ ExceptionHandler.
In a second aspect, an embodiment of the present invention further provides an apparatus for uniformly processing a response packet, where the apparatus includes:
the skipping unit is used for skipping the request to a preset exception Filter if the request is detected to be abnormal on the Filter layer;
an obtaining unit, configured to obtain an exception type and exception information of the request;
the first generating unit is used for generating a response message in a preset format according to the abnormal type and the abnormal information of the request and sending the generated response message to the front end;
and the processing unit is used for processing the request exception by a preset annotation if the request exception is detected between Service and afterCompletion, wherein the format of a response message generated by the preset annotation is the preset format.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can implement the above method when being executed by a processor.
The embodiment of the invention provides a method and a device for uniformly processing response messages, computer equipment and a storage medium. Wherein the method comprises the following steps: if the request is detected to be abnormal on a Filter layer, skipping the request to a preset abnormal Filter; acquiring the exception type and exception information of the request; generating a response message in a preset format according to the abnormal type and the abnormal information of the request, and sending the generated response message to the front end; if the request is detected to be abnormal from Service to afterCompletion, the preset annotation is used for processing the request abnormality, wherein the format of the response message generated by the preset annotation is the preset format, so that the response message with a uniform format can be returned to the front end, the workload of the front end is reduced, and the front end can correctly analyze the response message.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for uniformly processing response packets according to an embodiment of the present invention;
FIG. 2 is a flow diagram illustrating request processing in the prior art;
FIG. 3 is a flow chart illustrating request processing according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of an apparatus for uniformly processing response packets according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of an obtaining unit of an apparatus for uniformly processing response packets according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of a first generating unit of an apparatus for uniformly processing response packets according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of a second generating unit of an apparatus for uniformly processing response packets according to an embodiment of the present invention;
fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Referring to fig. 1 and fig. 3, fig. 1 is a schematic flow chart of a method for uniformly processing response messages according to an embodiment of the present invention. FIG. 3 is a flowchart illustrating request processing according to an embodiment of the invention.
Fig. 1 is a flowchart illustrating a method for uniformly processing a response packet according to an embodiment of the present invention. As shown, the method includes the following steps S1-S4.
S1, if the request is detected to be abnormal on the Filter layer, jumping the request to a preset abnormal Filter.
In the embodiment of the invention, aiming at the defect that the annotation @ exceptinonHandler can not capture the Filter exception, a Filter (Filter) for processing errors (type is DispatcterType.ERROR) is added by combining the characteristics of the Filter (the execution of the Filter is processed according to a chain, and different types of filters can process different requests), and the Filter (Filter) is named as ErrorFilter, is used for processing the exception which can not be processed by the annotation @ exceptinonHandler, and returns a response message with a uniform format.
In specific implementation, if it is detected that the request is abnormal in the Filter layer, the request is skipped to a preset abnormal Filter (ErrorFilter) so that the abnormal Filter processes the abnormality of the request.
In specific operation, when the SpringMVC item is started and loaded, the exception Filter (ErrorFilter) sets the dispatchtypes to dispatchtype.
And S2, acquiring the exception type and exception information of the request.
In specific implementation, the exception type and exception information of the request are obtained, so as to generate a response message according to the exception type and exception information of the request.
In an embodiment, the step S2 specifically includes: and calling a doFilter method to acquire the exception type and exception information of the request from the ServeltRequest. The doFilter method is a method in which a Filter (Filter) has a single means for processing requests and responses. The dofilterr method accepts three input parameters: servlet Request, response, and Filter Chain objects. And calling a doFilter method to acquire the abnormal type and the abnormal information of the request from the ServeltRequest.
And S3, generating a response message in a preset format according to the abnormal type and the abnormal information of the request, and sending the generated response message to the front end.
In specific implementation, a response message in a preset format is generated according to the abnormal type and the abnormal information of the request, and the generated response message is sent to the front end.
In an embodiment, the step S3 includes the following steps: and generating a response message in a preset format according to a pre-stored response message template, the abnormal type of the request and the abnormal information.
In a specific implementation, the response packet template is provided with an abnormal type space and an abnormal information space, and the generating of the response packet in the preset format according to the pre-stored response packet template, the abnormal type of the request and the abnormal information specifically includes:
and filling the abnormal type and the abnormal information of the request into an abnormal type space and an abnormal information space in the response message template respectively, thereby generating the response message with a uniform format.
S4, if detecting that the request is abnormal between Service and afterCompletion, processing the request abnormality by a preset annotation, wherein the format of the response message generated by the preset annotation is the preset format.
In a specific implementation, if it is detected that an exception occurs between Service and afterCompletion of a request, a preset annotation is used to process the exception of the request, wherein a format of a response message generated by the preset annotation is the preset format.
In one embodiment, the preset annotation is the annotation @ exceptinonhandler.
The exception from Service to artifact can be sent to @ exception handler for processing, and then a response message is returned to the terminal. The format of the response message is the preset format.
The invention provides a method for uniformly processing response messages, wherein if a request is detected to be abnormal on a Filter layer, the request is jumped to a preset abnormal Filter; acquiring the exception type and exception information of the request; generating a response message in a preset format according to the abnormal type and the abnormal information of the request, and sending the generated response message to the front end; if the request is detected to be abnormal from Service to afterCompletion, the preset annotation is used for processing the request abnormality, wherein the format of the response message generated by the preset annotation is the preset format, so that the response message with a uniform format can be returned to the front end, the workload of the front end is reduced, and the front end can correctly analyze the response message.
Fig. 4 is a schematic block diagram of an apparatus 70 for uniformly processing response messages according to an embodiment of the present invention. As shown in fig. 4, the present invention further provides a device 70 for uniformly processing response messages, corresponding to the above method for uniformly processing response messages. The apparatus for uniformly processing response messages 70 includes a unit for performing the above-described method for uniformly processing response messages, and the apparatus may be configured in a server. Specifically, referring to fig. 4, the apparatus 70 for uniformly processing response messages includes a jumping unit 71, an obtaining unit 72, a first generating unit 73, and a processing unit 74.
A skipping unit 71, configured to skip the request to a preset exception Filter if it is detected that the request is abnormal on the Filter layer;
an acquiring unit 72, configured to acquire an exception type and exception information of the request;
a first generating unit 73, configured to generate a response packet in a preset format according to the exception type and the exception information of the request, and send the generated response packet to the front end;
the processing unit 74 is configured to, if it is detected that an exception occurs between Service and afterCompletion of the request, process the exception of the request with a preset annotation, where a format of a response packet generated by the preset annotation is the preset format.
In one embodiment, as shown in fig. 5, the obtaining unit 72 includes a calling unit 721.
The invoking unit 721 is configured to invoke the doFilter method, so as to obtain the exception type and the exception information of the request from the ServletRequest.
In an embodiment, as shown in fig. 6, the first generating unit 73 includes a second generating unit 731.
The second generating unit 731 is configured to generate a response packet in a preset format according to a pre-stored response packet template, the exception type of the request, and the exception information.
In an embodiment, the response message template has an abnormal type space and an abnormal information space, as shown in fig. 7, the second generating unit 731 includes a filling unit 7311.
A filling unit 7311, configured to fill the exception type and the exception information of the request into an exception type space and an exception information space in the response message template, respectively.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation process of the apparatus 70 for uniformly processing a response packet and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and conciseness of description, no further description is provided herein.
The means 70 for uniformly processing the response messages may be implemented in the form of a computer program which can be run on a computer device as shown in fig. 8.
Referring to fig. 8, fig. 8 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal or a server, where the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 8, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer programs 5032, when executed, cause the processor 502 to perform a method for uniformly processing response messages.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to perform a method for uniformly processing the response message.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 8 is a block diagram of only a portion of the configuration relevant to the present teachings and does not constitute a limitation on the computer device 500 to which the present teachings may be applied, and that a particular computer device 500 may include more or less components than those shown, or combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
if the request is detected to be abnormal on a Filter layer, skipping the request to a preset abnormal Filter;
acquiring the exception type and exception information of the request;
generating a response message in a preset format according to the abnormal type and the abnormal information of the request, and sending the generated response message to the front end;
if the request is detected to be abnormal from Service to afterCompletion, processing the request abnormality by a preset annotation, wherein the format of a response message generated by the preset annotation is the preset format.
In an embodiment, when the step of obtaining the exception type and the exception information of the request is implemented, the processor 502 specifically implements the following steps:
and calling a doFilter method to acquire the exception type and exception information of the request from the ServeltRequest.
In an embodiment, when the processor 502 implements the step of generating the response packet in the preset format according to the exception type and the exception information of the request, the following steps are specifically implemented:
and generating a response message in a preset format according to a pre-stored response message template, the abnormal type of the request and the abnormal information.
In an embodiment, the response packet template is provided with an abnormal type space and an abnormal information space, and when the processor 502 implements the step of generating the response packet with the preset format according to the pre-stored response packet template, the abnormal type of the request, and the abnormal information, the following steps are specifically implemented:
and filling the abnormal type and the abnormal information of the request into an abnormal type space and an abnormal information space in the response message template respectively.
It should be understood that, in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. The computer program, when executed by a processor, causes the processor to perform the steps of:
if the request is detected to be abnormal on a Filter layer, skipping the request to a preset abnormal Filter;
acquiring the exception type and exception information of the request;
generating a response message in a preset format according to the abnormal type and the abnormal information of the request, and sending the generated response message to the front end;
if the request is detected to be abnormal from Service to afterCompletion, processing the request abnormality by a preset annotation, wherein the format of a response message generated by the preset annotation is the preset format.
In an embodiment, when the processor executes the computer program to implement the step of obtaining the exception type and the exception information of the request, the following steps are specifically implemented:
and calling a doFilter method to acquire the exception type and exception information of the request from the ServeltRequest.
In an embodiment, when the processor executes the computer program to implement the step of generating the response packet in the preset format according to the exception type and the exception information of the request, the following steps are specifically implemented:
and generating a response message in a preset format according to a pre-stored response message template, the abnormal type of the request and the abnormal information.
In an embodiment, the response packet template is provided with an abnormal type space and an abnormal information space, and when the processor executes the computer program to implement the step of generating the response packet with the preset format according to the pre-stored response packet template, the requested abnormal type and the abnormal information, the following steps are specifically implemented:
and filling the abnormal type and the abnormal information of the request into an abnormal type space and an abnormal information space in the response message template respectively.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, while the invention has been described with respect to the above-described embodiments, it will be understood that the invention is not limited thereto but may be embodied with various modifications and changes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for uniformly processing response messages is characterized by comprising the following steps:
if the request is detected to be abnormal on a Filter layer, skipping the request to a preset abnormal Filter;
acquiring the exception type and exception information of the request;
generating a response message in a preset format according to the abnormal type and the abnormal information of the request, and sending the generated response message to the front end;
if the request is detected to be abnormal from Service to afterCompletion, processing the request abnormality by a preset annotation, wherein the format of a response message generated by the preset annotation is the preset format.
2. The method according to claim 1, wherein the obtaining the exception type and exception information of the request comprises:
and calling a doFilter method to acquire the exception type and exception information of the request from the ServeltRequest.
3. The method according to claim 1, wherein the generating a response packet in a preset format according to the exception type and the exception information of the request comprises:
and generating a response message in a preset format according to a pre-stored response message template, the abnormal type of the request and the abnormal information.
4. The method according to claim 3, wherein the response message template has an abnormal type space and an abnormal information space, and the generating of the response message with the preset format according to the pre-stored response message template, the requested abnormal type and the abnormal information comprises:
and filling the abnormal type and the abnormal information of the request into an abnormal type space and an abnormal information space in the response message template respectively.
5. The method for uniformly processing response messages according to claim 1, wherein the preset annotation is an annotation @ exceptinonhandler.
6. An apparatus for uniformly processing response messages, comprising:
the skipping unit is used for skipping the request to a preset exception Filter if the request is detected to be abnormal on the Filter layer;
an obtaining unit, configured to obtain an exception type and exception information of the request;
the first generating unit is used for generating a response message in a preset format according to the abnormal type and the abnormal information of the request and sending the generated response message to the front end;
and the processing unit is used for processing the request exception by a preset annotation if the request exception is detected between Service and afterCompletion, wherein the format of a response message generated by the preset annotation is the preset format.
7. The apparatus for uniformly processing response packets according to claim 6, wherein the obtaining unit comprises:
and the calling unit is used for calling the doFilter method so as to acquire the abnormal type and the abnormal information of the request from the ServeltRequest.
8. The apparatus for processing response messages in unison according to claim 6, wherein the first generating unit comprises:
and the second generation unit is used for generating a response message in a preset format according to a pre-stored response message template, the abnormal type of the request and the abnormal information.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the method according to any of claims 1-5 when executing the computer program.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when being executed by a processor, is adapted to carry out the method according to any one of claims 1-5.
CN201911001292.XA 2019-10-21 2019-10-21 Method, device, computer equipment and storage medium for uniformly processing response message Active CN110727537B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911001292.XA CN110727537B (en) 2019-10-21 2019-10-21 Method, device, computer equipment and storage medium for uniformly processing response message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911001292.XA CN110727537B (en) 2019-10-21 2019-10-21 Method, device, computer equipment and storage medium for uniformly processing response message

Publications (2)

Publication Number Publication Date
CN110727537A true CN110727537A (en) 2020-01-24
CN110727537B CN110727537B (en) 2023-12-26

Family

ID=69220462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911001292.XA Active CN110727537B (en) 2019-10-21 2019-10-21 Method, device, computer equipment and storage medium for uniformly processing response message

Country Status (1)

Country Link
CN (1) CN110727537B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113609012A (en) * 2021-07-30 2021-11-05 南京控维通信科技有限公司 Method and system for standardized processing of back-end exception error reporting

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009028342A1 (en) * 2007-08-28 2009-03-05 Nec Corporation Service providing system, filtering device, filtering method, and message check method
CN102271069A (en) * 2011-09-08 2011-12-07 北京网康科技有限公司 Method, device and system for detecting multi-dimensional information of users
CN108614763A (en) * 2016-12-09 2018-10-02 武汉斗鱼网络科技有限公司 A kind of adjustment method and device of application
CN108647107A (en) * 2018-05-14 2018-10-12 浪潮软件集团有限公司 Unified exception handling method for micro-service development framework
CN108737473A (en) * 2017-04-20 2018-11-02 贵州白山云科技有限公司 A kind of data processing method, apparatus and system
CN108762966A (en) * 2018-06-05 2018-11-06 中国平安人寿保险股份有限公司 System exception hold-up interception method, device, computer equipment and storage medium
CN109408320A (en) * 2018-09-03 2019-03-01 中国平安人寿保险股份有限公司 Abnormality eliminating method, device, computer equipment and storage medium are developed in front end
CN109522222A (en) * 2018-10-26 2019-03-26 深圳点猫科技有限公司 It is a kind of for educating the exception catching method and device of cloud platform
CN110069297A (en) * 2019-03-28 2019-07-30 平安科技(深圳)有限公司 Abnormality eliminating method, device, computer equipment and storage medium based on Spring MVC

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009028342A1 (en) * 2007-08-28 2009-03-05 Nec Corporation Service providing system, filtering device, filtering method, and message check method
CN102271069A (en) * 2011-09-08 2011-12-07 北京网康科技有限公司 Method, device and system for detecting multi-dimensional information of users
CN108614763A (en) * 2016-12-09 2018-10-02 武汉斗鱼网络科技有限公司 A kind of adjustment method and device of application
CN108737473A (en) * 2017-04-20 2018-11-02 贵州白山云科技有限公司 A kind of data processing method, apparatus and system
CN108647107A (en) * 2018-05-14 2018-10-12 浪潮软件集团有限公司 Unified exception handling method for micro-service development framework
CN108762966A (en) * 2018-06-05 2018-11-06 中国平安人寿保险股份有限公司 System exception hold-up interception method, device, computer equipment and storage medium
CN109408320A (en) * 2018-09-03 2019-03-01 中国平安人寿保险股份有限公司 Abnormality eliminating method, device, computer equipment and storage medium are developed in front end
CN109522222A (en) * 2018-10-26 2019-03-26 深圳点猫科技有限公司 It is a kind of for educating the exception catching method and device of cloud platform
CN110069297A (en) * 2019-03-28 2019-07-30 平安科技(深圳)有限公司 Abnormality eliminating method, device, computer equipment and storage medium based on Spring MVC

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘淑华: ""J2EE项目中一种新的错误处理方法"", 《计算机应用与软件》, pages 143 - 146 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113609012A (en) * 2021-07-30 2021-11-05 南京控维通信科技有限公司 Method and system for standardized processing of back-end exception error reporting
CN113609012B (en) * 2021-07-30 2024-03-29 南京控维通信科技有限公司 Method and system for normalized processing back-end exception reporting

Also Published As

Publication number Publication date
CN110727537B (en) 2023-12-26

Similar Documents

Publication Publication Date Title
CN108388514B (en) Interface automation test method, device, equipment and computer readable storage medium
CN107679081B (en) Information modification method and device, computer equipment and computer readable storage medium
CN109684008B (en) Card rendering method, device, terminal and computer readable storage medium
CN106547580B (en) Method and device for hooking function, mobile terminal and storage medium
CN108733720B (en) On-line checking method and checking system for SQL (structured query language) query of multiple database types
CN110995539A (en) Business system monitoring method and device and computer equipment
US20060026463A1 (en) Methods and systems for validating a system environment
CN110955409B (en) Method and device for creating resources on cloud platform
WO2019223136A1 (en) Data acquisition method and apparatus, and computer device and storage medium
CN110808877A (en) Statistical analysis method and device based on interface response duration and computer equipment
JP2018005535A (en) Software development assist method and system
CN111199146A (en) Test report generation method and device, computer equipment and storage medium
CN110881224B (en) Network long connection method, device, equipment and storage medium
CN110727537A (en) Method and device for uniformly processing response message, computer equipment and storage medium
CN111046393B (en) Vulnerability information uploading method and device, terminal equipment and storage medium
CN111176987A (en) Method and device for uniformly outputting front-end log, computer equipment and storage medium
CN108959508B (en) SQL data generation method and device
JP2021505989A5 (en)
CN113392010A (en) Common component testing method and device, electronic equipment and storage medium
JP2023553587A (en) Providing application error data for use by third party library development systems
CN111090578B (en) Joint debugging method and device for engineering development, computer equipment and storage medium
CN111061613A (en) Front-end abnormity monitoring method and device and computer equipment
CN112817922A (en) Log dynamic printing method and device, computer equipment and storage medium
JP5545133B2 (en) Static analysis processing system, method, and program
CN111859403A (en) Method and device for determining dependency vulnerability, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant