CN110968497A - Tree-shaped interceptor-based request verification method, device, medium and electronic equipment - Google Patents

Tree-shaped interceptor-based request verification method, device, medium and electronic equipment Download PDF

Info

Publication number
CN110968497A
CN110968497A CN201811156189.8A CN201811156189A CN110968497A CN 110968497 A CN110968497 A CN 110968497A CN 201811156189 A CN201811156189 A CN 201811156189A CN 110968497 A CN110968497 A CN 110968497A
Authority
CN
China
Prior art keywords
interceptor
request
tree
shaped
interceptors
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811156189.8A
Other languages
Chinese (zh)
Inventor
秦小建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811156189.8A priority Critical patent/CN110968497A/en
Publication of CN110968497A publication Critical patent/CN110968497A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Abstract

The embodiment of the invention provides a request verification method, a request verification device, a request verification medium and electronic equipment based on a tree-shaped interceptor, wherein the method comprises the following steps: generating a proxy object corresponding to the request based on the received request, searching an interceptor corresponding to the request by the proxy object, and generating a tree-shaped interceptor; calling an interceptor in the tree-shaped interceptor, and verifying the request to obtain a verification result; based on the check result, it is determined whether to respond to the request. According to the technical scheme of the embodiment of the invention, the request can be intercepted through the tree-shaped interceptors, when one interceptor in the tree-shaped interceptors does not pass through, other interceptors can be continuously executed in a downward bifurcation mode, the length of an interceptor chain is reduced, and the problem of repeated configuration of the interceptors can be solved.

Description

Tree-shaped interceptor-based request verification method, device, medium and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to a request verification method, a request verification device, a request verification medium and electronic equipment based on a tree-shaped interceptor.
Background
At present, all interceptors are chain interceptors, a group of interceptors form an interceptor chain, requests are intercepted in sequence, and a group of interceptors jump to a specific page after being verified completely.
However, as more and more interceptors are configured, the length of the interceptor chain is longer and longer, and it is possible that the interceptor is configured repeatedly, and the next interceptor can be executed only after the last interceptor passes, resulting in difficulty in testing.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
Embodiments of the present invention provide a request verification method, apparatus, medium, and electronic device based on a tree-shaped interceptor, so as to overcome, at least to some extent, one or more problems of an increasingly long interceptor chain and difficulty in testing due to limitations and defects of related technologies.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the invention.
According to a first aspect of the embodiments of the present invention, a request verification method based on a tree-shaped interceptor is provided, including:
generating a proxy object corresponding to the request based on the received request, wherein the proxy object searches an interceptor corresponding to the request and generates a tree-shaped interceptor;
calling an interceptor in the tree-shaped interceptor, and verifying the request to obtain a verification result;
and determining whether to respond to the request or not based on the checking result.
In an embodiment of the present invention, based on the foregoing solution, the generating a corresponding tree interceptor based on the received request includes:
finding out an interceptor corresponding to the request based on a preset interceptor configuration file, and generating an interceptor list;
and arranging the interceptors in the interceptor list according to a preset tree structure to generate the tree interceptors.
In an embodiment of the present invention, based on the foregoing solution, the invoking an interceptor in the tree-shaped interceptor to check the request to obtain a check result includes:
importing the request to the tree interceptor;
performing logic calculation on the request by an interceptor in the tree-shaped interceptor to obtain a calculated value;
calling a left branch or a right branch of the tree-shaped interceptor based on the calculated value, and continuing to perform logic calculation on the request;
and when the request is calculated in the tree-shaped interceptor, generating a checking result.
In an embodiment of the present invention, based on the foregoing solution, the determining whether to respond to the request based on the foregoing verification result includes:
when the check result is true, responding to the request, and jumping to the requested page;
and intercepting the request when the check result is false.
According to a second aspect of the embodiments of the present invention, there is provided a request checking apparatus based on a tree-shaped interceptor, including: the device comprises a generating module, a checking module and a response module; wherein the content of the first and second substances,
a generating module, configured to generate a proxy object corresponding to the received request based on the received request, where the proxy object finds an interceptor corresponding to the request and generates a tree-shaped interceptor;
the verification module is used for calling the interceptors in the tree-shaped interceptors and verifying the request to obtain a verification result;
and the response module is used for determining whether to respond to the request or not based on the verification result.
In an embodiment of the present invention, based on the foregoing scheme, the generating module is specifically configured to:
finding out an interceptor corresponding to the request based on a preset interceptor configuration file, and generating an interceptor list;
and arranging the interceptors in the interceptor list according to a preset tree structure to generate the tree interceptors.
In an embodiment of the present invention, based on the foregoing scheme, the verification module is specifically configured to:
importing the request to the tree interceptor;
performing logic calculation on the request by an interceptor in the tree-shaped interceptor to obtain a calculated value;
calling a left branch or a right branch of the tree-shaped interceptor based on the calculated value, and continuing to perform logic calculation on the request;
and when the request is calculated in the tree-shaped interceptor, generating a checking result.
In an embodiment of the present invention, based on the foregoing scheme, the response module is specifically configured to:
when the check result is true, responding to the request, and jumping to the requested page;
and intercepting the request when the check result is false.
According to a third aspect of embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements the tree-interceptor-based request checking method of the first aspect as in the previous embodiments.
According to a fourth aspect of embodiments of the present invention, there is provided an electronic apparatus, including: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement the tree interceptor-based request checking method of the first aspect as in the above embodiments.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the technical solutions provided by some embodiments of the present invention, a proxy object corresponding to a request is generated based on the received request, and the proxy object finds an interceptor corresponding to the request and generates a tree-shaped interceptor; calling an interceptor in the tree-shaped interceptor, and verifying the request to obtain a verification result; based on the check result, it is determined whether to respond to the request. According to the technical scheme of the embodiment of the invention, the request can be intercepted through the tree-shaped interceptors, when one interceptor in the tree-shaped interceptors does not pass through, other interceptors can be continuously executed in a downward bifurcation mode, the length of an interceptor chain is reduced, and the problem of repeated configuration of the interceptors can be solved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a flow diagram schematically illustrating a tree interceptor-based request verification method according to one embodiment of the present invention;
FIG. 2 schematically shows a schematic diagram of a tree interceptor according to one embodiment of the present invention;
FIG. 3 schematically illustrates a block diagram of a tree interceptor-based request validation mechanism according to one embodiment of the present invention;
fig. 4 schematically shows a structural diagram of a computer system of the electronic device according to an embodiment of the present invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 schematically shows a flowchart of a tree interceptor-based request checking method according to an embodiment of the present invention.
Referring to fig. 1, a request checking method based on a tree-shaped interceptor according to an embodiment of the present invention includes the following steps:
step S110, generating a proxy object corresponding to the request based on the received request, searching an interceptor corresponding to the request by the proxy object, and generating a tree-shaped interceptor;
step S120, calling an interceptor in the tree-shaped interceptor, and verifying the request to obtain a verification result;
step S130, based on the check result, determines whether to respond to the request.
The technical scheme of the embodiment shown in fig. 1 can intercept the request through the tree-shaped interceptors, and when one interceptor in the tree-shaped interceptors does not pass through the tree-shaped interceptors, the tree-shaped interceptors can continue to branch downwards to execute other interceptors, so that the length of an interceptor chain is reduced, and the problem of repeatedly configuring the interceptors can be solved.
Implementation details of the various steps shown in FIG. 1 are set forth below:
in step S110, a proxy object corresponding to the request is generated based on the received request, and the proxy object finds an interceptor corresponding to the request, generating a tree interceptor.
In one embodiment of the invention, after receiving a request, a proxy object corresponding to the request is generated; the agent object searches an interceptor corresponding to the request based on a preset interceptor configuration file, and generates an interceptor list; and arranging the interceptors in the interceptor list according to a preset tree structure to generate the tree interceptors.
In one embodiment of the invention, the request can be part of a web request, a login request of a user, a log audit and other requests of an Action for an object.
In an embodiment of the present invention, based on the foregoing solution, the interceptor is implemented based on java-based dynamic Proxy mechanism, in the java-based dynamic Proxy mechanism, there are two important classes or interfaces, one is invoke handler Interface (Interface) and the other is Proxy Class (Class), and the Class and Interface are necessary for implementing dynamic Proxy,
in an embodiment of the present invention, based on the foregoing scheme, each dynamic agent class must implement the interface, i.e., invoke handler, and each instance of the agent class is associated with a handler, and when a method is called through an agent object, the call of the method is forwarded to be called by the invoke method of the interface, i.e., invoke; the role of Proxy is to dynamically create a Proxy object class.
In one embodiment of the invention, the interceptor may perform some processing before or after the actions and results in java are executed, specifically, may be an object that dynamically intercepts an Action call, and may prevent the execution of the object before calling the object.
In an embodiment of the invention, after a request pointing to a container is sent by a client is received, a proxy object of an interceptor is called, the proxy object queries the interceptor corresponding to the request in a configuration file according to the request of the client to generate a tree-shaped interceptor, and then relevant parameters in the request are transmitted to the tree-shaped interceptor for calculation.
Fig. 2 schematically shows a schematic diagram of a tree interceptor according to an embodiment of the present invention.
In one embodiment of the invention, based on the foregoing scheme, the interceptor method is generally called by proxy, when the request reaches the container, the configuration file is looked up, the opposite interceptor object is instantiated according to the configuration, then the tree interceptor is generated, and finally the interceptor in the tree interceptor is called in a branching manner. Wherein the interceptor is an implementation of an Aspect Organized Programming (AOP); the tree interceptors connect the interceptors into a bifurcated tree according to a certain rule, as shown in fig. 2, when accessing the intercepted method or field, the interceptors in the tree interceptors will be called according to the previously defined sequence.
In step S120, an interceptor in the tree-shaped interceptor is called to check the request, and a check result is obtained.
In one embodiment of the invention, based on the scheme, the request is imported to the tree-shaped interceptor; an interceptor in the tree-shaped interceptor performs logic calculation on the request to obtain a calculated value; calling a left branch or a right branch of the tree-shaped interceptor based on the calculated value, and continuing to perform logic calculation on the request; and when the request is calculated in the tree-shaped interceptor, generating a checking result.
In an embodiment of the present invention, when the calculated value of the interceptor in the tree-shaped interceptor returns false, the next-stage interceptor of the tree-shaped interception may be continuously called, and as long as the last interceptor in the tree-shaped interceptor returns True, the request may be responded, and a correct page may be skipped or a requested object may be called.
In an embodiment of the present invention, based on the foregoing solution, the interceptor is implemented by relying on a Java reflection mechanism, and uses a dynamic proxy implemented by JDK, and the dynamic proxy implemented by JDK needs to rely on an interface, and the interceptor is applied in AOP, that is, calling a method before a service or a method, or calling a method after a method, and the interceptor is not configured in web.
In an embodiment of the present invention, the function of implementing the interceptor may adopt an inheritance class handlentercaptoradapter, or an abstract class abstract interceptor, or implement a handlentercaptor interface.
In step S130, it is determined whether to respond to the request based on the check result.
In an embodiment of the present invention, based on the foregoing scheme, when the check result is true, in response to the request, jumping to the requested page; and when the check result is false, intercepting the request.
In an embodiment of the invention, a user-defined interceptor is realized by using a handlentercaptoradapter provided by a Spring framework to perform interception control of a login request, and the work flow is as follows: if the current user does not log in, jumping to a login page; and after the login is successful, jumping to the URL page visited before.
In the technical solutions provided by some embodiments of the present invention, a corresponding tree interceptor is generated based on a received request; calling an interceptor in the tree-shaped interceptor, and verifying the request to obtain a verification result; based on the check result, it is determined whether to respond to the request. Therefore, the technical scheme of the embodiment of the invention can intercept the request through the tree-shaped interceptors, and when one interceptor in the tree-shaped interceptors does not pass through, other interceptors can be continuously executed in a downward bifurcation mode, so that the length of an interceptor chain is reduced, and the problem of repeated configuration of the interceptors can be solved.
FIG. 3 is a block diagram schematically illustrating a tree interceptor-based request validation mechanism according to an embodiment of the present invention.
Referring to fig. 3, a tree interceptor-based request checking apparatus 300 according to an embodiment of the present invention includes: a generating module 301, a checking module 302 and a responding module 303; wherein the content of the first and second substances,
a generating module 301, configured to generate a corresponding tree interceptor based on the received request;
the checking module 302 is configured to invoke an interceptor in the tree-shaped interceptor, check the request, and obtain a checking result;
a response module 303, configured to determine whether to respond to the request based on the check result.
In an embodiment of the present invention, the generating module 301 is specifically configured to:
after receiving the request, generating a proxy object corresponding to the request;
the agent object searches an interceptor corresponding to the request based on a preset interceptor configuration file, and generates an interceptor list;
and arranging the interceptors in the interceptor list according to a preset tree structure to generate the tree interceptors.
In an embodiment of the present invention, the verification module 302 is specifically configured to:
importing a request to a tree-shaped interceptor;
an interceptor in the tree-shaped interceptor performs logic calculation on the request to obtain a calculated value;
calling a left branch or a right branch of the tree-shaped interceptor based on the calculated value, and continuing to perform logic calculation on the request;
and when the request is calculated in the tree-shaped interceptor, generating a checking result.
In an embodiment of the present invention, the response module 303 is specifically configured to:
when the checking result is true, responding to the request, and jumping to the requested page;
and when the check result is false, intercepting the request.
For details that are not disclosed in the embodiment of the apparatus of the present invention, reference is made to the above-mentioned embodiment of the request verification method based on the tree-shaped interceptor, for details that are not disclosed in the embodiment of the apparatus of the present invention, since each functional module of the request verification apparatus based on the tree-shaped interceptor of the present invention corresponds to the steps of the above-mentioned embodiment of the request verification method based on the tree-shaped interceptor.
Referring now to FIG. 4, a block diagram of a computer system 400 suitable for use with the electronic device implementing an embodiment of the invention is shown. The computer system 400 of the electronic device shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for system operation are also stored. The CPU401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 1206 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411. The above-described functions defined in the system of the present application are executed when the computer program is executed by a Central Processing Unit (CPU) 401.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the tree-interceptor-based request verification method as in the above embodiments.
For example, the electronic device described above may implement as shown in fig. 1: step S110, generating a corresponding tree-shaped interceptor based on the received request; step S120, calling an interceptor in the tree-shaped interceptor, and verifying the request to obtain a verification result; step S130, based on the check result, determines whether to respond to the request.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A request verification method based on a tree-shaped interceptor is characterized by comprising the following steps:
generating a proxy object corresponding to the request based on the received request, wherein the proxy object searches an interceptor corresponding to the request and generates a tree-shaped interceptor;
calling an interceptor in the tree-shaped interceptor, and verifying the request to obtain a verification result;
determining whether to respond to the request based on the checking result.
2. The tree-shaped interceptor-based request checking method of claim 1, wherein the agent object finds the interceptor corresponding to the request, and generates a tree-shaped interceptor, comprising:
finding out an interceptor corresponding to the request based on a preset interceptor configuration file, and generating an interceptor list;
and arranging the interceptors in the interceptor list according to a preset tree structure to generate the tree interceptors.
3. The tree-shaped interceptor-based request checking method of claim 1, wherein the invoking an interceptor in the tree-shaped interceptor to check the request to obtain a checking result comprises:
importing the request to the tree interceptor;
performing logic calculation on the request by an interceptor in the tree-shaped interceptor to obtain a calculated value;
calling a left branch or a right branch of the tree-shaped interceptor based on the calculated value, and continuing to perform logic calculation on the request;
and when the request is calculated in the tree-shaped interceptor, generating a checking result.
4. The method for checking requests of tree-shaped interceptors according to claim 1, wherein said determining whether to respond to the request based on the checking result comprises:
when the checking result is true, responding to the request, and jumping to the requested page;
and intercepting the request when the checking result is false.
5. A request checking device based on a tree-shaped interceptor is characterized by comprising: the device comprises a generating module, a checking module and a response module; wherein the content of the first and second substances,
the generation module is used for generating a proxy object corresponding to the request based on the received request, searching an interceptor corresponding to the request by the proxy object and generating a tree-shaped interceptor;
the verification module is used for calling the interceptors in the tree-shaped interceptors, verifying the request and obtaining a verification result;
and the response module is used for determining whether to respond to the request or not based on the verification result.
6. The tree-interceptor-based request validation device of claim 5, wherein the generating module is specifically configured to:
finding out an interceptor corresponding to the request based on a preset interceptor configuration file, and generating an interceptor list;
and arranging the interceptors in the interceptor list according to a preset tree structure to generate the tree interceptors.
7. The tree-interceptor-based request validation device of claim 5, wherein the validation module is specifically configured to:
importing the request to the tree interceptor;
performing logic calculation on the request by an interceptor in the tree-shaped interceptor to obtain a calculated value;
calling a left branch or a right branch of the tree-shaped interceptor based on the calculated value, and continuing to perform logic calculation on the request;
and when the request is calculated in the tree-shaped interceptor, generating a checking result.
8. The tree-based interceptor request checking device of claim 5, wherein the response module is specifically configured to:
when the checking result is true, responding to the request, and jumping to the requested page;
and intercepting the request when the checking result is false.
9. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the tree-interceptor-based request checking method of any one of claims 1-4.
10. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the tree interceptor-based request checking method of any one of claims 1-4.
CN201811156189.8A 2018-09-30 2018-09-30 Tree-shaped interceptor-based request verification method, device, medium and electronic equipment Pending CN110968497A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811156189.8A CN110968497A (en) 2018-09-30 2018-09-30 Tree-shaped interceptor-based request verification method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811156189.8A CN110968497A (en) 2018-09-30 2018-09-30 Tree-shaped interceptor-based request verification method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN110968497A true CN110968497A (en) 2020-04-07

Family

ID=70028739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811156189.8A Pending CN110968497A (en) 2018-09-30 2018-09-30 Tree-shaped interceptor-based request verification method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110968497A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113900896A (en) * 2021-10-11 2022-01-07 北京博睿宏远数据科技股份有限公司 Code operation monitoring method, device, equipment and storage medium
CN113900896B (en) * 2021-10-11 2024-04-26 北京博睿宏远数据科技股份有限公司 Method, device, equipment and storage medium for monitoring code operation

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090138893A1 (en) * 2007-11-23 2009-05-28 Ketera Technologies Inc. Interceptor Framework Using Java Dynamic Proxies
CN104363211A (en) * 2014-10-31 2015-02-18 北京思特奇信息技术股份有限公司 Method and system for managing authority

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090138893A1 (en) * 2007-11-23 2009-05-28 Ketera Technologies Inc. Interceptor Framework Using Java Dynamic Proxies
CN104363211A (en) * 2014-10-31 2015-02-18 北京思特奇信息技术股份有限公司 Method and system for managing authority

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
卞世晖;李龙澍;陈圣兵;李浩;: "基于AOP理念的Struts2拦截器的研究与应用", 电子设计工程, no. 01, 5 January 2010 (2010-01-05), pages 8 - 9 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113900896A (en) * 2021-10-11 2022-01-07 北京博睿宏远数据科技股份有限公司 Code operation monitoring method, device, equipment and storage medium
CN113900896B (en) * 2021-10-11 2024-04-26 北京博睿宏远数据科技股份有限公司 Method, device, equipment and storage medium for monitoring code operation

Similar Documents

Publication Publication Date Title
US11048620B2 (en) Distributed system test device
CN109150978B (en) Method and device for debugging micro service
CN112187558B (en) Data verification method and device and electronic equipment
US20190251019A1 (en) Testing web applications using clusters
CN111177672A (en) Page access control method and device and electronic equipment
CN112104709A (en) Intelligent contract processing method, device, medium and electronic equipment
CN110324185B (en) Hyper-parameter tuning method, device, server, client and medium
CN109325744B (en) Payment processing method, payment processing device, payment processing medium and electronic equipment
CN111737687A (en) Access control method, system, electronic device and medium for webpage application system
US20130124971A1 (en) Real time web script refresh using asynchronous polling without full web page reload
CN115221033A (en) Interface protocol testing method and device, computer readable medium and electronic equipment
CN116561013A (en) Testing method and device based on target service framework, electronic equipment and medium
CN112052152A (en) Simulation test method and device
CN111338928A (en) Chrome-based browser testing method and device
CN113132400B (en) Business processing method, device, computer system and storage medium
CN111400623B (en) Method and device for searching information
CN110968497A (en) Tree-shaped interceptor-based request verification method, device, medium and electronic equipment
CN114237821A (en) Self-discovery method and device for Kubernetes container cluster, electronic device and storage medium
CN112131095A (en) Pressure testing method and device
CN113901377B (en) Service calling method, device, storage medium and equipment of legacy system
CN110262756B (en) Method and device for caching data
US20230350984A1 (en) System and method for client-side rewriting of code included in a web page
CN116185515A (en) Method, device and equipment for loading sidebar tool in instant messaging application
CN113568657A (en) Icon configuration method, icon configuration system, electronic device, and medium
CN115277857A (en) Method and device for interface verification, 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