Multifunctional multiplexing interface marking method, device, equipment, medium and product

By customizing the annotation information and method metadata list, dynamically locate and start the target interceptor, the problem of inconvenience in the configuration of multiple annotations or matching path expressions in the prior art is solved, and flexible and accurate interceptor configuration and use is achieved.

CN119939539APending Publication Date: 2025-05-06CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411765345.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The prior art requires defining multiple annotations or determining to enable different types of interceptors based on matching path expressions, which is inconvenient to use and error-prone.

Method used

By obtaining the request information for accessing the target interface, the custom annotation information includes a function block identification and a method metadata list, the method metadata list is located according to the request information and the function block identification, and the target interceptor is started based on the parameters and method metadata list in the request information.

Benefits of technology

It is realized that one annotation can be provided to multiple interceptors for use, thereby performing different business logic processing operations on the requested information, making the configuration flexible and convenient and error-prone.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119939539A_ABST
    Figure CN119939539A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software development, in particular to a multifunctional multiplexing interface marking method and device, equipment, a medium and a product, and the method comprises the steps that request information for accessing a target interface is obtained, the target interface is marked with custom annotation information, and the custom annotation information is sent to a server; the user-defined annotation information is used for representing a starting condition for starting an interception service by the interceptor under various business types, and the user-defined annotation information comprises a function block identifier and a method metadata list; positioning to a method metadata list according to the request information and the function block identifier; and starting a target interceptor according to the parameters in the request information and the method metadata list, so that the target interceptor executes corresponding processing logic on the request information. According to the method and the device, the interceptors are integrated by using the user-defined annotation information, and one annotation can be provided for the target interface to be used by a plurality of interceptors, so that different business logic processing operations can be executed on the request information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of software development technology, and in particular to a multifunctional multiplexed interface marking method, device, equipment, medium and product. Background Art

[0002] In web development, it is often necessary to control user request behavior, such as whether the API requires user login to access, whether there is permission control, what the access limit is, etc.

[0003] In order to achieve different restrictions, interceptors with different functions are used. There are two common methods: (1) define annotations and use Aspect aspects to perform restriction logic on methods. This results in a method having multiple annotations. (2) define web filter interceptors and use path matching expressions to intercept. This also requires planning the API request path prefixes in advance. However, which prefixes are excluded and which are controlled? There are too many rules, which makes it inconvenient to use and easy to misconfigure.

[0004] Therefore, the related technology needs to define multiple annotations or determine to enable different types of interceptors based on the matching path expression, which is inconvenient and error-prone. Summary of the invention

[0005] In view of this, the present disclosure provides a multifunctional and reusable interface marking method, device, equipment, medium and product to solve the problem that the related technology needs to define multiple annotations or determine the opening of different types of interceptors based on matching path expressions, which is inconvenient and error-prone to use.

[0006] In a first aspect, the present disclosure provides a multifunctional multiplexed interface marking method, the method comprising:

[0007] Obtain request information for accessing the target interface, wherein the target interface is marked with custom annotation information, the custom annotation information is used to characterize the start-up conditions for the interceptor to start the interception service under various business types, and the custom annotation information includes a function block identifier and a method metadata list;

[0008] Locate the method metadata list based on the request information and function block identifier;

[0009] According to the parameter and method metadata list in the request information, the target interceptor is started so that the target interceptor executes the corresponding processing logic on the request information, wherein the target interceptor is any type of interceptor under multiple business types.

[0010] In the disclosed embodiment, by obtaining the request information for accessing the target interface, wherein the target interface is marked with custom annotation information, the custom annotation information is used to characterize the start-up conditions for the interceptor under various business types to start the interception service, and the custom annotation information includes a function block identifier and a method metadata list; the method metadata list is located according to the request information and the function block identifier; the target interceptor is started according to the parameters and the method metadata list in the request information, so that the target interceptor executes the corresponding processing logic for the request information, wherein the target interceptor is any type of interceptor under various business types. In this way, the disclosed embodiment uses custom annotation information to integrate interceptors, and can provide the target interface to multiple interceptors through one annotation, thereby realizing the execution of different business logic processing operations on the request information, so that there is no need to configure a matching path expression, and the configuration will be flexible, convenient and error-prone.

[0011] In an optional implementation, locating the method metadata list according to the request information and the function block identifier includes:

[0012] Get the key characters in the request information;

[0013] Matching the key character with the function block identifier in the tag at the target interface;

[0014] Locate the method metadata list based on the matching results.

[0015] In an optional implementation, the method metadata list stores tag information, and starting the target interceptor according to the parameters in the request information and the method metadata list includes:

[0016] Get interface metadata from tag information;

[0017] Match the parameters in the request information with the target metadata in the interface metadata;

[0018] Start the target interceptor based on the matching results.

[0019] In an optional implementation, before starting the target interceptor according to the matching result, the method further includes:

[0020] Define the prefix identifier of the interceptor for each business type;

[0021] Apply prefix identifier to interface metadata.

[0022] In an optional implementation, starting the target interceptor according to the matching result includes:

[0023] When the parameters in the request information match the interface metadata, the target interceptor is obtained according to the prefix identifier corresponding to the interface metadata.

[0024] In an optional implementation, matching the parameters in the request information with the target metadata in the interface metadata includes:

[0025] Parsing multiple key-value pairs present in the tag information, wherein the interface metadata is stored in the tag information in the form of multiple key-value pairs;

[0026] Convert multiple key-value pairs into a key-value pair mapping table, in which each key in the key-value pair mapping table corresponds to a value;

[0027] Get target metadata from the key-value mapping table;

[0028] Match the parameters in the request information with the target metadata.

[0029] In a second aspect, the present disclosure provides a multifunctional multiplexed interface marking device, the device comprising:

[0030] An acquisition module is used to obtain request information for accessing a target interface, wherein the target interface is marked with custom annotation information, and the custom annotation information is used to characterize the start-up conditions for the interceptor to start the interception service under various business types, and the custom annotation information includes a function block identifier and a method metadata list;

[0031] A positioning module, used for locating the method metadata list according to the request information and the function block identifier;

[0032] The startup module is used to start the target interceptor according to the parameter and method metadata list in the request information, so that the target interceptor executes the corresponding processing logic on the request information, wherein the target interceptor is any type of interceptor under multiple business types.

[0033] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the multifunctional multiplexed interface marking method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0034] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the multifunctional multiplexed interface marking method of the first aspect or any corresponding embodiment thereof.

[0035] In a fifth aspect, the present disclosure provides a computer program product, including computer instructions, which are used to enable a computer to execute the multifunctional multiplexed interface marking method of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0037] Figure 1 It is a flowchart of a multifunctional multiplexing interface marking method according to an embodiment of the present disclosure;

[0038] Figure 2 is a schematic diagram of the identification information initialization process according to an embodiment of the present disclosure;

[0039] Figure 3 is a schematic diagram of the interaction after the interceptor is componentized according to an embodiment of the present disclosure;

[0040] Figure 4 is a structural block diagram of a multifunctional multiplexing interface marking device according to an embodiment of the present disclosure;

[0041] Figure 5 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0043] In web development, it is often necessary to control user request behaviors, such as whether the API requires user login to access, whether there is permission control, how the access limit is, etc. In order to achieve different restrictions, interceptors with different functions are used. However, related technologies require defining multiple annotations or determining to enable different types of interceptors based on matching path expressions, which is inconvenient and error-prone.

[0044] In order to solve the above problems, according to an embodiment of the present disclosure, an embodiment of a multifunctional multiplexed interface marking method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0045] In this embodiment, a multifunctional multiplexed interface marking method is provided. Figure 1 is a flowchart of a multifunctional multiplexed interface marking method according to an embodiment of the present disclosure, such as Figure 1 As shown, the method can be applied to the server side, and the method flow includes the following steps:

[0046] Step S101, obtaining request information for accessing a target interface, wherein the target interface is marked with custom annotation information, the custom annotation information is used to characterize the start-up conditions for the interceptor to start the interception service under various business types, and the custom annotation information includes a function block identifier and a method metadata list;

[0047] Step S102, locating the method metadata list according to the request information and the function block identifier;

[0048] Step S103, starting the target interceptor according to the parameter and method metadata list in the request information, so that the target interceptor executes the corresponding processing logic on the request information, wherein the target interceptor is any type of interceptor under multiple business types.

[0049] Optionally, the disclosed embodiment is applied in the spring framework of java web development, and the server can obtain the request information for accessing the target interface (such as the RequestMapping interface) in real time, and then obtain the custom annotation from the method of the target interface. Among them, the custom annotation can be ApiMetaInfo. It should be noted that when obtaining the custom annotation, it can be obtained by the following method: RequestMapping interface information (including pathPattern and the corresponding controller class method, i.e. handlerMethod) will be stored in RequestMappingHandlerMapping bean. Figure 2 After the spring container is initialized, the applicationRunner is executed through this bean, the handlerMethod is obtained from the RequestMappingHandlerMapping, and then the custom annotation ApiMetaInfo on the method is obtained.

[0050] The custom annotations here store the request PatternsCondition combined with method matching, that is, establish the relationship between "access path" and "annotation tag". Since the matching on the method is an expression, it supports wildcards and path changes, that is, multiple requests are processed by the same handlerMethod.

[0051] In addition, if Figure 2, get the function block identifier from the controller method, and then store it in the custom annotation information in the form of <function block identifier, List<method metadata list>>. That is, the function block identifier and method metadata list are included in the custom annotation information, such as {"user":[{"pathPattern":" / user / {id}","meta":{"k1":"v1","k2":"v2"},{...}]}.

[0052] Here, the first user represents the function block identifier, and [{"pathPattern":" / user / {id}","meta":{"k1":"v1","k2":"v2"},{...}] represents the method metadata list, where the method metadata list contains the method pathPattern and tag information meta.

[0053] Here, {"user":[{"pathPattern":" / user / {id}","meta":{"k1":"v1","k2":"v2"},{...}]} can be applied to interceptors under multiple business types. If the request information meets the parameter information of any interceptor in the custom annotation, the corresponding interception service can be started to act on the request information.

[0054] Furthermore, when matching the request information with the parameter information of the interceptor in the custom annotation, in order to speed up the indexing, the method metadata list is located according to the request information and the function block identifier, and then the parameters of the request information are matched with the tag information meta in the method metadata list. If the match is successful, the target interceptor currently marked on the target interface is enabled, such as the authentication interceptor, and then the corresponding processing logic is executed on the request information according to the target interceptor.

[0055] It should be noted that the disclosed embodiments support marking key values ​​of different types of interceptors on the target interface, such as authentication interceptors, with values ​​of session / app / public, corresponding to access only after login / signature access / public, so that interfaces with different authentication methods can be made in one project. For example, a current limiting interceptor marks the limit_qbs key on the target interface, and the interceptor obtains this information to limit the number of accesses per second. For example, a state interceptor marks the state key on the target interface, with values ​​of on / off indicating enable or disable. Combined with online marking, an interface can be temporarily online or offline. You can also view the metadata of the marking information in the marking method metadata list through the Endpoint method. Provides modification functions, such as adding a state=off tag to a certain interface to temporarily go offline. Modify the value of limit_qbs, adjust the current limiting threshold, etc.

[0056] In the disclosed embodiment, by obtaining the request information for accessing the target interface, wherein the target interface is marked with custom annotation information, the custom annotation information is used to characterize the start-up conditions for the interceptor under various business types to start the interception service, and the custom annotation information includes a function block identifier and a method metadata list; the method metadata list is located according to the request information and the function block identifier; the target interceptor is started according to the parameters and the method metadata list in the request information, so that the target interceptor executes the corresponding processing logic for the request information, wherein the target interceptor is any type of interceptor under various business types. In this way, the disclosed embodiment uses custom annotation information to integrate interceptors, and can provide the target interface to multiple interceptors through one annotation, thereby realizing the execution of different business logic processing operations on the request information, so that there is no need to configure a matching path expression, and the configuration will be flexible, convenient and error-prone.

[0057] In some optional implementations, locating the method metadata list according to the request information and the function block identifier includes:

[0058] Get the key characters in the request information;

[0059] Matching the key character with the function block identifier in the tag at the target interface;

[0060] Locate the method metadata list based on the matching results.

[0061] Optionally, if the method corresponding to the request information currently obtained for accessing the target interface is user, user is used as the key character to match the function block identifier user on the target interface RequestMapping. If the match is successful, then locate the method metadata list [{"pathPattern":" / user / {id}","meta":{"k1":"v1","k2":"v2"},{...}].

[0062] In some optional implementations, the method metadata list stores tag information, and starting the target interceptor according to the parameters in the request information and the method metadata list includes:

[0063] Get interface metadata from tag information;

[0064] Match the parameters in the request information with the target metadata in the interface metadata;

[0065] Start the target interceptor based on the matching results.

[0066] Optionally, as can be seen from the above embodiment, the method metadata list stores tag information ("meta":{"k1":"v1","k2":"v2"},{...}) and methods (user / {id} or user / get), and the "k1":"v1","k2":"v2" in the tag information represents interface metadata.

[0067] Then the parameters in the request information are matched with the target metadata (including all metadata or part of the metadata) in the interface metadata, and then it can be decided whether to start the target interceptor according to the matching result.

[0068] In some optional implementations, before starting the target interceptor according to the matching result, the method further includes:

[0069] Define the prefix identifier of the interceptor for each business type;

[0070] Apply prefix identifier to interface metadata.

[0071] Optionally, a prefix identifier can be added in front of the interface metadata to represent which type of interceptor is currently marked on the target interface, and then the authentication or current limiting functions of the interceptor can be applied to the interface metadata. For example, f1_k1=v1, f1_k2=v2, where f1 can be the prefix identifier of the authentication interceptor. After comparing the parameters in the request information with k1, v1, k2, v2, if the two match, authentication interception is performed on the request information.

[0072] For example, the authentication interceptor is set to only access {level=1, module=user}. If the request information is {level=2, module=user}, there is no match, the request information is intercepted, and the authentication operation is performed.

[0073] In some optional implementations, matching the parameters in the request information with the target metadata in the interface metadata includes:

[0074] Parsing multiple key-value pairs present in the tag information, wherein the interface metadata is stored in the tag information in the form of multiple key-value pairs;

[0075] Convert multiple key-value pairs into a key-value pair mapping table, where each key in the key-value pair mapping table corresponds to a value;

[0076] Get target metadata from the key-value mapping table;

[0077] Match the parameters in the request information with the target metadata.

[0078] Optionally, the tag information is marked in the form of multiple key-value pairs, that is, in the form of {k1, v1; k2, v2}. When obtaining these metadata, it is necessary to parse these multiple key-value pairs and then convert the multiple key-value pairs into a key-value pair mapping table, wherein each key in the key-value pair mapping table corresponds to a value; obtain the target metadata from the key-value pair mapping table, such as obtaining {k1, v1} and {k2, v2}, or obtaining {k1, v1} or {k2, v2}, and then match the parameters in the request information with the target metadata. When the target metadata is {k1, v1} and {k2, v2}, the parameters in the request information are all matched with {k1, v1} and {k2, v2}. If all are matched, the target interceptor is started; the parameters in the request information can also be matched with {k1, v1} or {k2, v2}. If they are partially matched, the target interceptor is started.

[0079] In some optional embodiments, such as Figure 3 After the user accesses, it will be intercepted by common interceptors, such as authentication interceptors, current limiting interceptors, and status interceptors. It can also be modified online by providing an Endpoint, such as changing the interface status to offline and temporarily going offline.

[0080] Figure 3The current limiting interceptor in: Get the qps (query rate per second) of the request volume, compare it with the threshold in the interface tag information, and return a 429 status code if it exceeds. Status interceptor: If it is in offline state, return a 404 status code. Provide Endpoint with online management capabilities, you can view or modify metadata, and have certain service governance capabilities. Authentication interceptor: According to the ac_type type, different processing methods are performed. If the value is session, check whether it is logged in; if the value is app, check the signature; if the value is public, release it directly.

[0081] The disclosed embodiment integrates commonly used API interception processors, and can authenticate interfaces in different ways (interfaces that can only be accessed after logging in, interfaces that require signature access between services, and public interfaces), limit the flow of interfaces, and perform temporary online and offline control functions to meet the daily development needs of the web. If a new API access interceptor is needed, a unified marking method can also be shared to achieve further functional expansion.

[0082] In the present embodiment, a multifunctional multiplexed interface marking device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0083] This embodiment provides a multifunctional multiplexed interface marking device, such as Figure 4 As shown, including:

[0084] The acquisition module 401 is used to obtain the request information for accessing the target interface, wherein the target interface is marked with custom annotation information, the custom annotation information is used to characterize the start-up conditions for the interceptor to start the interception service under various business types, and the custom annotation information includes a function block identifier and a method metadata list;

[0085] A positioning module 402, used to locate the method metadata list according to the request information and the function block identifier;

[0086] The startup module 403 is used to start the target interceptor according to the parameter and method metadata list in the request information, so that the target interceptor executes the corresponding processing logic on the request information, wherein the target interceptor is any type of interceptor under multiple business types.

[0087] In the disclosed embodiment, by obtaining the request information for accessing the target interface, wherein the target interface is marked with custom annotation information, the custom annotation information is used to characterize the start-up conditions for the interceptor under various business types to start the interception service, and the custom annotation information includes a function block identifier and a method metadata list; the method metadata list is located according to the request information and the function block identifier; the target interceptor is started according to the parameters and the method metadata list in the request information, so that the target interceptor executes the corresponding processing logic for the request information, wherein the target interceptor is any type of interceptor under various business types. In this way, the disclosed embodiment uses custom annotation information to integrate interceptors, and can provide the target interface to multiple interceptors through one annotation, thereby realizing the execution of different business logic processing operations on the request information, so that there is no need to configure a matching path expression, and the configuration will be flexible, convenient and error-prone.

[0088] In some optional implementations, the positioning module 402 is used to obtain key characters in the request information; match the key characters with the function block identifiers in the tags at the target interface; and locate the method metadata list according to the matching results.

[0089] In some optional implementations, the startup module 403 is used to obtain the interface metadata from the tag information; match the parameters in the request information with the target metadata in the interface metadata; and start the target interceptor according to the matching result.

[0090] In some optional embodiments, the device further comprises:

[0091] A definition module is used to define the prefix identifier of each business type of interceptor before starting the target interceptor according to the matching result;

[0092] Applies to modules and is used to apply prefix identifiers to interface metadata.

[0093] In some optional implementations, the startup module 403 is further used to obtain the target interceptor according to the prefix identifier corresponding to the interface metadata when the parameters in the request information match the interface metadata.

[0094] In some optional embodiments, the startup module 403 is also used to parse multiple key-value pairs present in the tag information, wherein the interface metadata is stored in the tag information in the form of multiple key-value pairs; convert the multiple key-value pairs into a key-value pair mapping table, wherein each key in the key-value pair mapping table corresponds to a value; obtain the target metadata from the key-value pair mapping table; and match the parameters in the request information with the target metadata.

[0095] The multifunctional multiplexed interface marking device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0096] The present disclosure also provides a computer device having the above Figure 4 A multifunctional multiplexed interface marking device is shown.

[0097] See also Figure 5 , Figure 5 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0098] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0099] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0100] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0101] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0102] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0103] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0104] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0105] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A multifunctional multiplexed interface marking method, characterized in that: The method comprises: Obtaining request information for accessing a target interface, wherein the target interface is marked with custom annotation information, the custom annotation information is used to characterize the start-up conditions for the interceptor to start the interception service under various business types, and the custom annotation information includes a function block identifier and a method metadata list; Locate the method metadata list according to the request information and the function block identifier; According to the parameters in the request information and the method metadata list, the target interceptor is started so that the target interceptor executes the corresponding processing logic on the request information, wherein the target interceptor is any type of interceptor under multiple business types.

2. The method according to claim 1, characterized in that The locating the method metadata list according to the request information and the function block identifier includes: Obtaining key characters in the request information; Matching the key character with the function block identifier in the tag at the target interface; The method metadata list is located according to the matching result.

3. The method according to claim 1, characterized in that The method metadata list stores tag information, and the method metadata list starts the target interceptor according to the parameters in the request information and the method metadata list, including: Acquire interface metadata from the tag information; Matching the parameters in the request information with the target metadata in the interface metadata; The target interceptor is started according to the matching result.

4. The method according to claim 3, characterized in that Before starting the target interceptor according to the matching result, the method further includes: Define the prefix identifier of the interceptor for each business type; The prefix identifier is applied to the interface metadata.

5. The method according to claim 4, characterized in that The starting the target interceptor according to the matching result includes: In the case where the parameters in the request information match the interface metadata, the target interceptor is obtained according to the prefix identifier corresponding to the interface metadata.

6. The method according to claim 3, characterized in that The matching of the parameters in the request information with the target metadata in the interface metadata includes: Parsing multiple key-value pairs present in the tag information, wherein the interface metadata is stored in the tag information in the form of multiple key-value pairs; Convert the multiple key-value pairs into a key-value pair mapping table, wherein each key in the key-value pair mapping table corresponds to a value; Acquire the target metadata from the key-value pair mapping table; The parameters in the request information are matched with the target metadata.

7. A multifunctional multiplexed interface marking device, characterized in that: The device comprises: An acquisition module, used to acquire request information for accessing a target interface, wherein the target interface is marked with custom annotation information, the custom annotation information is used to characterize the start-up conditions for the interceptor to start the interception service under various business types, and the custom annotation information includes a function block identifier and a method metadata list; A positioning module, used for locating the method metadata list according to the request information and the function block identifier; A startup module is used to start a target interceptor according to the parameters in the request information and the method metadata list, so that the target interceptor executes corresponding processing logic on the request information, wherein the target interceptor is any type of interceptor under multiple business types.

8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the multifunctional multiplexed interface marking method according to any one of claims 1 to 6 by executing the computer instructions.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the multifunctional multiplexed interface marking method according to any one of claims 1 to 6.

10. A computer program product, characterized in that It comprises computer instructions, and the computer instructions are used to make a computer execute the multifunctional multiplexed interface marking method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Secret-related operation interception method and device, storage medium and terminal

    CN120512277A

  • Activity data monitoring method and device, computer equipment and readable storage medium

    CN120973643A