Interface current limiting method and system, electronic equipment and storage medium
By obtaining the Key value and current limit type of the interface, and using LUA scripts and SpEL expressions to build a current limit polymorphic adapter, it solves the problem that the existing technology is difficult to achieve global consistent interface current limit in distributed scenarios, and realizes efficient and reliable interface current limit management.
Patent Information
- Application Number
- CN202411680341.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-21
AI Technical Summary
The prior art is difficult to meet the global consistency requirements of interface current limiting strategies in distributed scenarios, especially when dealing with complex current limiting logic, Redis's basic commands cannot effectively implement current limiting of dynamic rates and complex sliding windows.
By obtaining the Key value of the target interface, determining its current limit type, and using LUA scripts and SpEL expressions to build a current limit polymorphic adapter to achieve unified management and efficient control of the interface current limit.
It improves the convenience of calling and switching operations of interface current limits, greatly enhances the security of the interface, realizes unified management of interface current limits, and provides an efficient and reliable solution for interface current limit scenarios.
Smart Images

Figure CN119676169A_ABST
Abstract
Description
Background Art
[0002] With the development of the Internet industry, more and more systems are directly facing customers and users, which increases the probability of simultaneous and repeated use of system functions. However, most of the current calls to system interfaces use a combination of Redis basic commands to implement current limiting algorithms such as "fixed window counter", "leaky bucket algorithm", and "token bucket algorithm". Although Redis' basic commands are highly atomic, they cannot handle complex current limiting logic (such as dynamic rate, complex sliding window, etc.). In distributed scenarios, the current limiting strategy implemented by simple Redis atomic operations may not meet the requirements of global consistency.
[0003] Therefore, it is urgent to provide a technical solution to solve the above problems. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides an interface current limiting method, system, electronic device and storage medium.
[0005] In a first aspect, the present invention provides an interface current limiting method, and the technical solution of the method is as follows:
[0006] When the target interface receives the access request information, the key value of the target interface is obtained, and the interface current limiting type of the target interface is determined according to the key value;
[0007] Based on the interface current limiting type and the Key value, determine whether to perform current limiting control on the target interface.
[0008] The beneficial effects of an interface current limiting method of the present invention are as follows:
[0009] The method of the present invention can improve the convenience of calling and switching operations of interface current limiting, greatly enhance the security of the interface, realize unified management of interface current limiting, provide an efficient and reliable solution for interface current limiting scenarios, and make the overall interface performance safer.
[0010] Based on the above solution, an interface current limiting method of the present invention can also be improved as follows.
[0011] In an optional manner, the step of obtaining the Key value of the target interface includes:
[0012] Use Spring's SpEL expression to obtain the Key value of the target interface.
[0013] In an optional manner, the step of determining the interface current limiting type of the target interface according to the Key value includes:
[0014] The interface current limiting type of the target interface is determined by using the annotation interceptor and according to the Key value.
[0015] In an optional manner, the step of determining whether to perform current limiting control on the target interface based on the interface current limiting type and the Key value includes:
[0016] Use LUA scripts to build current-limiting polymorphic adapters;
[0017] Using the current limiting polymorphic adapter, and based on the interface current limiting type and the Key value, it is determined whether to perform current limiting control on the target interface.
[0018] In an optional manner, the interface current limiting type is: a time period current limiting type or a total number of current limiting type; based on the interface current limiting type and the Key value, the step of determining whether to perform current limiting control on the target interface includes:
[0019] When the interface current limiting type is the time period current limiting type, determine whether the Key value already exists in the Redis cache before being stored in the Redis cache, and obtain a first determination result; when the first determination result is yes, perform current limiting control on the target interface; otherwise, do not perform current limiting control on the target interface;
[0020] When the interface current limiting type is the total number of current limiting type, determine whether the current number of accesses corresponding to the Key value exceeds the maximum limit value to obtain a second judgment result; when the second judgment result is yes, perform current limiting control on the target interface; otherwise, do not perform current limiting control on the target interface.
[0021] In an optional manner, the method further includes:
[0022] When the first judgment result is no, the duration corresponding to the access request information is written into the Key value for storage, and when the access request information is executed, the Key value is deleted from the Redis cache.
[0023] In an optional manner, the method further includes:
[0024] When the second judgment result is no, the current access count corresponding to the Key value is increased by one, and when the access request information is executed, the current access count corresponding to the Key value is decreased by one.
[0025] In a second aspect, the present invention provides an interface current limiting system, the technical solution of which is as follows:
[0026] It includes: a processing module and a control module;
[0027] The processing module is used to: when the target interface receives the access request information, obtain the Key value of the target interface, and determine the interface current limiting type of the target interface according to the Key value;
[0028] The control module is used to determine whether to perform current limiting control on the target interface based on the interface current limiting type and the Key value.
[0029] The beneficial effects of an interface current limiting system of the present invention are as follows:
[0030] The system of the present invention can improve the convenience of calling and switching operations of interface current limiting, greatly enhance the security of the interface, realize unified management of interface current limiting, provide an efficient and reliable solution for interface current limiting scenarios, and make the overall interface performance safer.
[0031] In a third aspect, a technical solution of an electronic device of the present invention is as follows:
[0032] The invention comprises a memory, a processor and a program stored in the memory and running on the processor. When the processor executes the program, the steps of the interface current limiting method of the present invention are realized.
[0033] In a fourth aspect, the present invention provides a computer-readable storage medium having the following technical solution:
[0034] Instructions are stored in the computer-readable storage medium. When the computer-readable storage medium reads the instructions, the computer-readable storage medium executes the steps of the interface current limiting method of the present invention.
[0035] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:
[0037] Figure 1 A schematic diagram of a flow chart of an embodiment of an interface current limiting method of the present invention;
[0038] Figure 2 It is a structural schematic diagram of an embodiment of an interface current limiting system of the present invention;
[0039] Figure 3 The figure is a schematic structural diagram of an embodiment of an electronic device of the present invention. DETAILED DESCRIPTION
[0040] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0041] Figure 1 A flow chart of an embodiment of an interface current limiting method provided by the present invention is shown, and the interface current limiting method can be executed by an electronic device such as a terminal device or a server. The terminal device can be any fixed or mobile terminal such as a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The server can be a single server or a server cluster composed of multiple servers. Any electronic device can implement the interface current limiting method by calling computer-readable instructions stored in a memory through a processor. Figure 1 As shown, the following steps are included:
[0042] S1. When a target interface receives access request information, a Key value of the target interface is obtained, and an interface current limiting type of the target interface is determined according to the Key value.
[0043] Among them, the target interface is any type of interface, such as a data addition interface, a data deletion interface, and a data modification interface, etc., and there is no restriction here. The access request information can be an access request for the target interface sent by any terminal (system). Different interfaces correspond to corresponding Key values, and the Key value is the unique interface identifier of the target interface. The Key value of the target interface is relatively fixed and is not affected by the requester. It only changes after the access request information is executed. The Key value mainly includes the interface method name and the interface current limiting type, and the configuration parameters corresponding to different current limiting types are different. The interface current limiting types include: time period current limiting type and total number of current limiting type. When the interface current limiting type is a time period current limiting type, the Key value contains time parameter information (mainly involving current limiting expiration time, etc.); when the interface current limiting type is a total number of current limiting type, the Key value contains information such as the current number of visits.
[0044] S2. Determine whether to perform current limiting control on the target interface based on the interface current limiting type and the Key value.
[0045] Among them, different interface current limiting types correspond to different current limiting control methods.
[0046] In an optional manner, the step of obtaining the Key value of the target interface includes:
[0047] Use Spring's SpEL expression to obtain the Key value of the target interface.
[0048] Among them, using Spring's SpEL expression to obtain the Key value in the target interface can make the development process easier. The obtained Key value can be stored in the Redis cache in real time.
[0049] In an optional manner, the step of determining the interface current limiting type of the target interface according to the Key value includes:
[0050] The interface current limiting type of the target interface is determined by using the annotation interceptor and according to the Key value.
[0051] In an optional manner, S2 includes:
[0052] Use LUA scripts to build a current-limiting polymorphic adapter.
[0053] Using the current limiting polymorphic adapter, and based on the interface current limiting type and the Key value, it is determined whether to perform current limiting control on the target interface.
[0054] Among them, the LUA script is the LUA script of the Redis cache. The LUA script can access all commands of the Redis cache, and package multiple operations (addition, deletion, modification) in the Redis cache in a LUA script, avoiding multiple network communications between the client and the server. The LUA script is used to implement the optimistic lock function to achieve time period current limiting and total number of current limiting. The current limiting polymorphic adapter is constructed through the LUA script. The current limiting polymorphic adapter uses the specific implementation details of different current limiting types to expand the current limiting function by adding new current limiting types without modifying the original code.
[0055] In an optional manner, S2 includes:
[0056] When the interface current limiting type is the time period current limiting type, determine whether the Key value already exists in the Redis cache before being stored in the Redis cache to obtain a first judgment result; when the first judgment result is yes, perform current limiting control on the target interface; otherwise, do not perform current limiting control on the target interface.
[0057] It should be noted that when the first judgment result is no, the duration corresponding to the access request information is written into the Key value for storage, and when the access request information is executed, the Key value is deleted from the Redis cache. For example, if the duration corresponding to the access request information is 10s and the current time is 14:00:00, then only the access request information is executed during the time period of 14:00:00-14:00:10, and the Key value of the target interface is stored in the Redis cache, and the target interface performs current limiting control on other access request information (because the first judgment result corresponding to other access request information is yes at this time, that is: whether the Key value obtained corresponding to other access request information already exists in the Redis cache before being stored in the Redis cache).
[0058] When the interface current limiting type is the total number of current limiting type, determine whether the current number of accesses corresponding to the Key value exceeds the maximum limit value to obtain a second judgment result; when the second judgment result is yes, perform current limiting control on the target interface; otherwise, do not perform current limiting control on the target interface.
[0059] The maximum limit value is a positive integer, which can be set according to the actual situation and is not limited here. It should be noted that when the second judgment result is no, the current access count corresponding to the Key value is increased by one, and when the access request information is executed, the current access count corresponding to the Key value is reduced by one.
[0060] The technical solution of this embodiment innovatively proposes a method to implement interface current limiting based on LUA scripts and SpEL expressions, realizes unified current limiting type management of interfaces, unified calls and unified current limiting interception, can improve the convenience of calling and switching operations of interface current limiting, greatly enhances the security of the interface, and provides an efficient and reliable solution for interface current limiting scenarios, making the overall interface performance safer.
[0061] Figure 2 FIG. 2 shows a schematic diagram of the structure of an embodiment of an interface current limiting system 200 provided by the present invention. Figure 2 As shown, the system 200 includes: a processing module 210 and a control module 220;
[0062] The processing module 210 is used to: when the target interface receives the access request information, obtain the Key value of the target interface, and determine the interface current limiting type of the target interface according to the Key value;
[0063] The control module 220 is used to determine whether to perform current limiting control on the target interface based on the interface current limiting type and the Key value.
[0064] In an optional manner, the processing module 210 is specifically used for:
[0065] Use Spring's SpEL expression to obtain the Key value of the target interface.
[0066] In an optional manner, the processing module 210 is specifically used for:
[0067] The interface current limiting type of the target interface is determined by using the annotation interceptor and according to the Key value.
[0068] In an optional manner, the control module 220 is specifically used to:
[0069] Use LUA scripts to build a current-limiting polymorphic adapter;
[0070] Using the current limiting polymorphic adapter, and based on the interface current limiting type and the Key value, it is determined whether to perform current limiting control on the target interface.
[0071] In an optional manner, the interface current limiting type is: time period current limiting type or total number of current limiting type; the control module 220 is specifically used to:
[0072] When the interface current limiting type is the time period current limiting type, determine whether the Key value already exists in the Redis cache before being stored in the Redis cache, and obtain a first determination result; when the first determination result is yes, perform current limiting control on the target interface; otherwise, do not perform current limiting control on the target interface;
[0073] When the interface current limiting type is the total number of current limiting type, determine whether the current number of accesses corresponding to the Key value exceeds the maximum limit value to obtain a second judgment result; when the second judgment result is yes, perform current limiting control on the target interface; otherwise, do not perform current limiting control on the target interface.
[0074] In an optional manner, the method further includes: a first adjustment module; the first adjustment module is used to:
[0075] When the first judgment result is no, the duration corresponding to the access request information is written into the Key value for storage, and when the access request information is executed, the Key value is deleted from the Redis cache.
[0076] In an optional manner, the method further includes: a second adjustment module; the second adjustment module is used to:
[0077] When the second judgment result is no, the current access count corresponding to the Key value is increased by one, and when the access request information is executed, the current access count corresponding to the Key value is decreased by one.
[0078] It should be noted that the beneficial effects of the interface current limiting system provided in the above embodiment are the same as the beneficial effects of the above interface current limiting method, which will not be described in detail here. In addition, when the system provided in the above embodiment realizes its functions, it only takes the division of the above functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be described in detail here.
[0079] Among them, the interface current limiting system of the present invention can be a computer program (including program code) running in a computer device. For example, the interface current limiting system of the present invention is an application software that can be used to execute the corresponding steps in the interface current limiting method of the present invention.
[0080] In some embodiments, the interface current limiting system of the present invention can be implemented by combining software and hardware. As an example, the interface current limiting system of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the interface current limiting method of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.
[0081] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The name of a module does not limit the module itself in some cases.
[0082] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any one of the above-mentioned interface current limiting methods is implemented. That is, an electronic device according to an embodiment of the present invention may include but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute the interface current limiting method shown in any embodiment of the present invention by calling the computer program.
[0083] In an alternative embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.
[0084] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0085] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 In the figure, only one thick line is used to represent the bus 4002, but this does not mean that there is only one bus or one type of bus.
[0086] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.
[0087] The memory 4003 is used to store the application code (computer program) for executing the solution of the present invention, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the application code stored in the memory 4003 to implement the content shown in the above method embodiment.
[0088] Among them, the electronic device can also be a terminal device, and the terminal device can be any terminal device that can install applications and access web pages through applications, including at least one of a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart TV, and a smart car device.
[0089] It should be noted that Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0090] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned interface current limiting methods is implemented.
[0091] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0092] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the above-mentioned interface current limiting method.
[0093] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0094] It should be understood that the flow charts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, the program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0095] The computer-readable storage medium provided by the embodiment of the present invention may be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or component.
[0096] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0097] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the disclosure scope involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) by each other.
[0098] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.
[0099] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present invention can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.
[0100] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. An interface current limiting method, characterized in that: include: When the target interface receives the access request information, the key value of the target interface is obtained, and the interface current limiting type of the target interface is determined according to the key value; Based on the interface current limiting type and the Key value, determine whether to perform current limiting control on the target interface.
2. The interface current limiting method according to claim 1, characterized in that: The step of obtaining the Key value of the target interface includes: Use Spring's SpEL expression to obtain the Key value of the target interface.
3. The interface current limiting method according to claim 1, characterized in that: The step of determining the interface current limiting type of the target interface according to the Key value includes: The interface current limiting type of the target interface is determined by using the annotation interceptor and according to the Key value.
4. The interface current limiting method according to claim 1, characterized in that: The step of determining whether to perform current limiting control on the target interface based on the interface current limiting type and the Key value includes: Use LUA scripts to build a current-limiting polymorphic adapter; Using the current limiting polymorphic adapter, and based on the interface current limiting type and the Key value, it is determined whether to perform current limiting control on the target interface.
5. The interface current limiting method according to any one of claims 1 to 4, characterized in that: The interface current limiting type is: time period current limiting type or total number of current limiting type; The step of determining whether to perform current limiting control on the target interface based on the interface current limiting type and the Key value includes: When the interface current limiting type is the time period current limiting type, determine whether the Key value already exists in the Redis cache before being stored in the Redis cache, and obtain a first determination result; when the first determination result is yes, perform current limiting control on the target interface; otherwise, do not perform current limiting control on the target interface; When the interface current limiting type is the total number of current limiting type, determine whether the current number of accesses corresponding to the Key value exceeds the maximum limit value to obtain a second judgment result; when the second judgment result is yes, perform current limiting control on the target interface; otherwise, do not perform current limiting control on the target interface.
6. The interface current limiting method according to claim 5, characterized in that: Also includes: When the first judgment result is no, the duration corresponding to the access request information is written into the Key value for storage, and when the access request information is executed, the Key value is deleted from the Redis cache.
7. The interface current limiting method according to claim 5, characterized in that: Also includes: When the second judgment result is no, the current access count corresponding to the Key value is increased by one, and when the access request information is executed, the current access count corresponding to the Key value is decreased by one.
8. An interface current limiting system, characterized in that: include: Processing module and control module; The processing module is used to: when the target interface receives the access request information, obtain the Key value of the target interface, and determine the interface current limiting type of the target interface according to the Key value; The control module is used to determine whether to perform current limiting control on the target interface based on the interface current limiting type and the Key value.
9. An electronic device, characterized in that: The electronic device includes a processor, the processor is coupled to a memory, the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the electronic device implements the interface current limiting method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the computer-readable storage medium implements the interface current limiting method according to any one of claims 1 to 7.