Interface authentication processing method and device, equipment and medium

Through the method of intercepting and annotation drivers of AOP surface, dynamically obtain and update the MD5 generation rules, solve the tedious and inefficient problems of existing interface assessment schemes, and improve the efficiency and security of interface authentication.

CN119363445APending Publication Date: 2025-01-24CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411494379.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

When there are many requests and returns interfaces, the authentication processing process is cumbersome and prone to errors, which reduces efficiency and accuracy.

Method used

Intercept the front-end user's request input data through the pre-created AOP aspect, obtain the user ID, unique identifier and MD5 field, and obtain the MD5 generation rules from the generation rule pool according to the interface authentication annotation for authentication. After success, instruct the backend service to execute the request task, generate a new MD5 value by randomly selecting MD5 generation rules, update the annotations in the request parameter data, and return it to the front-end user.

Benefits of technology

The MD5 generating rules at each test of each verification are updated by annotations, eliminating manual operations, improving the efficiency and accuracy of interface authentication, and enhancing security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363445A_ABST
    Figure CN119363445A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data security, and discloses an interface authentication processing method and device, equipment and a medium, and the method comprises the steps: intercepting request entry parameter data containing an interface authentication annotation through an AOP section; obtaining an MD5 generation rule of the authentication from a preset generation rule pool according to the interface authentication annotation; performing interface authentication according to the incoming parameter data of the request and the MD5 generation rule of the authentication; intercepting request parameter data returned by the back-end service through the AOP aspect, and randomly selecting an MD5 generation rule from the generation rule pool to generate a new MD5 value; the MD5 generation annotation in the request-out parameter data is configured according to the randomly selected MD5 generation rule, the configured request-out parameter data and the new MD5 value are returned to the front-end user, and the MD5 generation annotation is used for instructing the front-end user to configure the corresponding interface authentication annotation when the front-end user initiates the request next time. The MD5 generation rule during each authentication is updated in an annotation manner, so that the efficiency and accuracy of interface authentication are improved, and the security of interface authentication is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of data security technology and financial technology, and in particular to an interface authentication processing method, device, equipment and medium. Background Art

[0002] Financial digitalization refers to the process of transforming and upgrading financial services and businesses through digital technology to improve efficiency, reduce costs, and improve user experience. Financial digitalization includes the digitization of internal business of financial institutions, the digitization of financial products and services, the digitization of financial markets, etc.

[0003] In today's digital financial environment, the security of interfaces is critical, and unauthorized access may lead to serious problems such as data leakage, service abuse, and system failure. Therefore, a reliable and efficient interface authentication solution is needed to ensure that only legitimate users or systems can access and use the interface.

[0004] Currently, commonly used interface authentication solutions all require manual establishment of the relationship between the user ID and the unique identifier, and then perform authentication operations on the user ID and the unique identifier. If there are many requested and returned interfaces, the authentication process will be very cumbersome and prone to errors, reducing the efficiency and accuracy of the interface authentication process. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide an interface authentication processing method, device, equipment and medium that can be applied to financial technology or other related fields. Its main purpose is to improve the efficiency and accuracy of interface authentication processing and enhance the security of interface authentication.

[0006] The technical solution of the present invention is as follows:

[0007] A first aspect of the present invention provides an interface authentication processing method, comprising:

[0008] Intercept the request input data of the front-end user through the pre-created AOP aspect. The request input data contains a user ID field, a unique identification field, and an MD5 field. The unique identification field is also configured with an interface authentication annotation.

[0009] Obtain the MD5 generation rule for this authentication from the preset generation rule pool according to the interface authentication annotation;

[0010] Perform interface authentication according to the request input data and the MD5 generation rule of this authentication, and instruct the backend service to execute the corresponding request task when the authentication is successful;

[0011] The request output parameter data returned by the backend service is intercepted by the AOP aspect, and a new MD5 value is generated by randomly selecting an MD5 generation rule from the generation rule pool;

[0012] Configure the MD5 generation annotation on the unique identification field in the request output parameter data according to the randomly selected MD5 generation rule, return the configured request output parameter data and the new MD5 value to the front-end user, and the MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time.

[0013] A second aspect of the present invention provides an interface authentication processing device, comprising:

[0014] The input parameter interception module is used to intercept the request input parameter data of the front-end user through the pre-created AOP aspect. The request input parameter data contains a user ID field, a unique identification field and an MD5 field. The unique identification field is also configured with an interface authentication annotation;

[0015] A rule acquisition module, used to obtain the MD5 generation rule for this authentication from a preset generation rule pool according to the interface authentication annotation;

[0016] The authentication module is used to perform interface authentication according to the request input data and the MD5 generation rule of this authentication, and instruct the backend service to execute the corresponding request task when the authentication is successful;

[0017] An output parameter interception module is used to intercept the request output parameter data returned by the backend service through the AOP aspect, and randomly select an MD5 generation rule from the generation rule pool to generate a new MD5 value;

[0018] The annotation return module is used to configure the MD5 generation annotation on the unique identification field in the request output parameter data according to the randomly selected MD5 generation rules, and return the configured request output parameter data and the new MD5 value to the front-end user. The MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time.

[0019] A third aspect of the present invention provides a computer device, comprising at least one processor; and

[0020] a memory communicatively connected to the at least one processor; wherein,

[0021] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned interface authentication processing method.

[0022] A fourth aspect of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned interface authentication processing method.

[0023] Beneficial effects: The present invention discloses an interface authentication processing method, device, equipment and medium. Compared with the prior art, the embodiment of the present invention intercepts the request input parameter data of the front-end user through a pre-created AOP aspect, the request input parameter data contains a user ID field, a unique identification field and an MD5 field, and the unique identification field is also configured with an interface authentication annotation; the MD5 generation rule of this authentication is obtained from a preset generation rule pool according to the interface authentication annotation; interface authentication is performed according to the request input parameter data and the MD5 generation rule of this authentication, and when the authentication is successful, the back-end service is instructed to execute the corresponding request task; the request output parameter data returned by the back-end service is intercepted through the AOP aspect, and an MD5 generation rule is randomly selected from the generation rule pool to generate a new MD5 value; the MD5 generation annotation on the unique identification field in the request output parameter data is configured according to the randomly selected MD5 generation rule, and the configured request output parameter data and the new MD5 value are returned to the front-end user, and the MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time. The MD5 generation rules for each authentication are updated through annotations, eliminating the manual operation of generating authentication relationships for user IDs and unique identifiers. The generation and verification of interface authentication MD5 is achieved in an imperceptible manner, which improves the efficiency and accuracy of interface authentication and enhances the security of interface authentication. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the scheme in the present invention, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0025] Figure 1 A schematic diagram of an application environment of the interface authentication processing method provided by an embodiment of the present invention;

[0026] Figure 2 A flow chart of the interface authentication processing method provided by an embodiment of the present invention;

[0027] Figure 3 A flow chart of step S202 in the interface authentication processing method provided in an embodiment of the present invention;

[0028] Figure 4A flow chart of step S203 in the interface authentication processing method provided in an embodiment of the present invention;

[0029] Figure 5 A flow chart of step S204 in the interface authentication processing method provided in an embodiment of the present invention;

[0030] Figure 6 A schematic diagram of the functional modules of the interface authentication processing device provided by an embodiment of the present invention;

[0031] Figure 7 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.

[0033] The interface authentication processing method provided by the embodiment of the present invention can be applied in the following aspects: Figure 1 In the application environment of FIG. 1 , it includes a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0034] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only as examples).

[0035] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0036] The server 105 may be a server that provides various services, such as a background server that provides support for the content browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (for example only). The background server may analyze and process the received data such as the user request, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device. The server 105 may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server 105 may also be a server for a distributed system, or a server combined with a blockchain.

[0037] It should be noted that the interface authentication processing method provided in the embodiment of the present application can generally be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the interface authentication processing device provided in the embodiment of the present invention can also be set in the first terminal device 101, the second terminal device 102 or the third terminal device 103. Alternatively, the interface authentication processing method provided in the embodiment of the present invention can also generally be executed by the server 105. Accordingly, the interface authentication processing device provided in the embodiment of the present invention can generally be set in the server 105.

[0038] It should be understood that the numbers of the above terminal devices, networks and servers are only illustrative. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0039] like Figure 2 As shown, the interface authentication processing method provided by the embodiment of the present invention specifically includes the following steps:

[0040] S201. Intercept the request input parameter data of the front-end user through the pre-created AOP aspect. The request input parameter data contains a user ID field, a unique identification field and an MD5 field. The unique identification field is also configured with an interface authentication annotation.

[0041] In this embodiment, an aspect class is predefined in AOP mode. AOP (Aspect-Oriented Programming) is a programming paradigm that can separate cross-cutting concerns (such as logging, permission checking, transaction management, etc.) from business logic code, thereby improving the modularity and maintainability of the code. The aspect (Aspect) of AOP represents a modular cross-cutting concern, which implements the encapsulation of cross-cutting concerns and can contain multiple advices. Advice is an operation performed at a specific point, which is used to describe the rule notification of when, where and how to apply the aspect logic, that is, Advice can represent the operation performed by the aspect at a connection point (a specific point in program execution, such as a method call or an exception thrown), and can be executed before, after or around the connection point, thereby realizing the function of the cross-cutting concern.

[0042] Through the pre-created AOP aspect, when the front-end user initiates an interface request to the back-end service, all requests entering the Controller layer are intercepted through the AOP aspect, and data such as the user ID field, unique identification field, and MD5 field in the request input data are obtained. The unique identification field is also configured with an interface authentication annotation based on the relevant information returned by the back-end service history, which can realize flexible and dynamic authentication information configuration, realize automatic interception of requests through AOP, and identify the corresponding authentication operations through annotations to meet different types of authentication needs. There is no need to manually add authentication logic in each interface, which improves the reusability and reduces redundancy of the code.

[0043] S202: Obtain the MD5 generation rule for this authentication from a preset generation rule pool according to the interface authentication annotation.

[0044] In this embodiment, after intercepting and obtaining the request input parameter data, the MD5 generation rule for this authentication is queried from a preset generation rule pool, such as a configuration file or a database table, based on the interface authentication annotation configured in the unique identification field in the request input parameter data. In other words, the MD5 generation rule for each interface authentication can be different. Through the combination of annotations and rule pools, flexible authentication rule configuration is achieved, and authentication rules can be dynamically selected according to different interfaces, avoiding the problem of generating MOD5 for interface authentication through fixed rules, which may reduce authentication security due to rule leakage.

[0045] S203: Perform interface authentication according to the request input parameter data and the MD5 generation rule of this authentication, and instruct the backend service to execute the corresponding request task when the authentication is successful.

[0046] In this embodiment, the corresponding interface authentication operation is performed according to the MD5 generation rule obtained for this authentication, as well as the data in the user ID field, unique identification field, and MD5 field in the request input data. After the authentication is successful, the request is released and the backend service is instructed to execute the corresponding request task, otherwise the current request is directly rejected. By dynamically configuring and determining the MD5 generation rule for each authentication to perform interface authentication, an automated authentication process is implemented, the security of the interface is guaranteed, and the errors and tediousness of manually comparing MD5 values ​​are avoided.

[0047] S204. Intercept the request output parameter data returned by the backend service through the AOP aspect, and randomly select an MD5 generation rule from the generation rule pool to generate a new MD5 value.

[0048] In this embodiment, the predefined AOP aspect not only intercepts the requests of the front-end users, but also intercepts the request responses returned by the back-end service. That is, after the authentication is successful and the back-end service executes the current request task, the AOP aspect intercepts the request output parameter data returned by the back-end service in response to the request input parameter data. At this time, an MD5 generation rule is randomly selected from the generation rule pool to generate a new MD5 value different from the input parameter. Therefore, the update of the MD5 value and the MD5 generation rule is realized through automatic interception and automatic processing of the response data, and the security of the interface authentication is enhanced through dynamic update.

[0049] S205. Configure the MD5 generation annotation on the unique identification field in the request output parameter data according to the randomly selected MD5 generation rule, and return the configured request output parameter data and the new MD5 value to the front-end user. The MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time.

[0050] In this embodiment, in the request output parameter data returned by the back-end service in response to the request, an MD5 generation annotation is configured on the unique identification field. On the basis of generating a new MD5 value based on the randomly selected MD5 generation rule, the MD5 generation annotation on the unique identification field in the request output parameter data is also configured based on the randomly selected MD5 generation rule, thereby marking the generation rule of the new MD5 value, and returning the configured request output parameter data and the new MD5 value to the front-end user, so that the front-end user can correctly configure the interface authentication annotation in the input parameter through the MD5 generation annotation and the new MD5 value when initiating a request next time, and carry the new MD5 value for a new round of interface authentication. By dynamically updating the annotation and MD5 value, the security and flexibility of the system are improved, while providing clear authentication guidance for the front-end user, realizing automated interface authentication processing, and reducing the risk of unauthorized access to the system.

[0051] In the above embodiment, the present invention discloses an interface authentication processing method, which intercepts the request input parameter data of the front-end user through a pre-created AOP aspect, wherein the request input parameter data contains a user ID field, a unique identification field and an MD5 field, and the unique identification field is also configured with an interface authentication annotation; according to the interface authentication annotation, the MD5 generation rule for this authentication is obtained from a preset generation rule pool; interface authentication is performed according to the request input parameter data and the MD5 generation rule for this authentication, and when the authentication is successful, the back-end service is instructed to execute the corresponding request task; the request output parameter data returned by the back-end service is intercepted through the AOP aspect, and an MD5 generation rule is randomly selected from the generation rule pool to generate a new MD5 value; the MD5 generation annotation on the unique identification field in the request output parameter data is configured according to the randomly selected MD5 generation rule, and the configured request output parameter data and the new MD5 value are returned to the front-end user, and the MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time. The MD5 generation rules for each authentication are updated through annotations, eliminating the manual operation of generating authentication relationships for user IDs and unique identifiers. The generation and verification of interface authentication MD5 is achieved in an imperceptible manner, which improves the efficiency and accuracy of interface authentication and enhances the security of interface authentication.

[0052] In one embodiment, Figure 3 As shown, step S202 includes:

[0053] S301, parsing the interface authentication annotation to obtain a rule identifier in the interface authentication annotation, where the rule identifier is obtained and configured from the MD5 generation annotation returned from the previous request;

[0054] S302: Obtain an MD5 generation rule for this authentication from a preset generation rule pool according to the rule identifier, wherein the MD5 generation rule for this authentication is an MD5 generation rule randomly selected when a new MD5 value was generated last time.

[0055] In this embodiment, in the aspect class, the annotation information of the current request method can be obtained through the reflection mechanism, by extracting the interface authentication annotation configured under the unique identification field in the request input parameter data, and parsing and extracting the rule identification field in the annotation, the rule identification can be a string, used to represent a specific MD5 generation rule, specifically obtained and configured from the MD5 generation annotation returned by the last request, that is, when the response of the backend service is intercepted and the MD5 generation annotation is generated according to the randomly selected MD5 generation rule, the rule identification of the currently selected MD5 generation rule will be configured in the MD5 generation annotation, so that the front-end user can obtain the accurate rule identification from the MD5 generation annotation of the output parameter data when initiating the request next time, so as to correctly configure the interface authentication annotation in the input parameter data. After obtaining the rule identification, the rule identification can be used as a key to find and obtain the MD5 generation rule for this authentication from the generation rule pool, and the found MD5 generation rule is applied to the authentication logic of the current request. It can be understood that the MD5 generation rule for this authentication obtained is the MD5 generation rule randomly selected when a new MD5 value was generated last time. By dynamically obtaining MD5 generation rules from the generation rule pool through annotations, it can ensure that the latest and most suitable authentication rules are used for each request, and different authentication rules can be used for different interfaces, which enhances the scalability and security of the system.

[0056] In one embodiment, Figure 4 As shown, step S203 includes:

[0057] S401, parse the user ID field, unique identifier field and MD5 field in the request input data, and obtain the corresponding user ID, unique identifier and MD5 value, where the MD5 value is the new MD5 value returned by the previous request;

[0058] S402, generating a corresponding MD5 value to be verified according to the user ID and the unique identifier and the MD5 generation rule of this authentication;

[0059] S403. Compare the MD5 value carried in the request input data with the MD5 value to be verified to confirm whether they are consistent. If they are consistent, the interface authentication is successful, otherwise the interface authentication fails.

[0060] In the present embodiment, when performing interface authentication, by parsing the user ID field, unique identifier field and MD5 field in the request input data, the corresponding user ID, unique identifier and MD5 value are extracted, and the MD5 value is the new MD5 value returned by the last request, that is, the front-end user carries the latest MD5 value generated last time each time when initiating a request, so as to realize the MD5 update in the interface authentication and enhance the authentication security. The MD5 generation rule of this authentication obtained by the interface authentication annotation is encrypted with MD5 for the user ID and the unique identifier, so as to generate the MD5 value to be verified, so that the system can have a standard to compare the MD5 value in the request. By comparing the two MD5 values, it is confirmed whether the MD5 value carried in the request input data is consistent with the generated MD5 value to be verified. If it is consistent, the interface authentication is successful, and the method of continuing to execute the request is continued. Otherwise, the interface authentication fails, and an exception is thrown or an error message is returned, which can effectively prevent unauthorized access and protect the interface from being maliciously used.

[0061] In one embodiment, Figure 5 As shown, step S204 includes:

[0062] S501, screening all MD5 generation rules in the generation rule pool according to a preset screening strategy to obtain a selectable rule range;

[0063] S502: Randomly select an MD5 generation rule from the optional rule range, and generate a new MD5 value according to the randomly selected MD5 generation rule based on the user ID and unique identifier in the request parameter data.

[0064] In the present embodiment, when randomly selecting MD5 generation rules to generate new MD5 values ​​at each time, first all MD5 generation rules in the generation rule pool are screened by the predefined screening strategy to obtain the optional rule range, and the specific preset screening strategy can be flexibly set in cooperation with the maintenance and update rules of the generation rule pool, for example, when the generation rule pool can be regularly updated to eliminate the earliest rule of generation time, the preset screening strategy can be set to remove the earliest MD5 generation rule of generation time, so that when randomly selecting, selection is made from the scope of removing the earliest rule, because if the earliest rule of generation time is not removed, assuming that the earliest rule of generation time is just selected during random selection, and before the front-end user initiates a request next time, the generation rule pool is updated, and the situation of being unable to match this deleted generation rule will occur. Therefore, in order to ensure the reliability of interface authentication, the corresponding screening strategy can be configured based on the update mode of the generation rule pool to ensure random selection within a reliable range.

[0065] By randomly selecting an MD5 generation rule from the optional rule range, the user ID and the unique identifier are encrypted with MD5, and a new MD5 value is generated, and the new MD5 value is added to the response data, ensuring that the front-end user can use the latest authentication information when making the next request. This embodiment randomly selects rules and generates new MD5 values, so that the authentication rules for each request are unpredictable, which helps prevent malicious users from bypassing authentication by guessing the rules and enhancing the security of the system.

[0066] In one embodiment, before step S201, the method further includes:

[0067] Configure multiple MD5 generation rules, and construct a generation rule pool according to the multiple MD5 generation rules;

[0068] The MD5 generation rules in the generation rule pool are updated according to a preset update strategy.

[0069] In this embodiment, multiple MD5 generation rules are predefined, and each rule can be based on different algorithms or parameters, such as using different salt values ​​or encryption modes. For example, rule 1 uses salt value "salt1" and MD5 algorithm; rule 2 uses salt value "salt2" and MD5 algorithm; rule 3 uses salt value "salt3" and MD5 algorithm, etc. Then, a data structure (such as a database table, configuration file, or Map in memory) is created to store these rules. Each rule has a unique identifier, and then a generation rule pool is constructed to ensure that it can be used in the subsequent process scope.

[0070] In addition, for the constructed generation rule pool, an update strategy is also defined to update the multiple MD5 generation rules stored therein, such as regularly updating the rules in the rule pool, or dynamically updating when a security threat is detected. The update mechanism may include adding new rules, deleting old rules, or modifying existing rules, etc. Specifically, the rule pool can be updated at a fixed time every day, new rules based on the salt value of the current date can be added, and the oldest rules can be deleted, thereby achieving regular or on-demand updating of the generation rule pool, ensuring the continuous updating of the rule pool, enabling the system to respond to new security threats in a timely manner, enhancing the system's defense capabilities, and reducing the risk of attacks.

[0071] In one embodiment, updating the MD5 generation rules in the generation rule pool according to a preset update strategy includes:

[0072] Sort all MD5 generation rules in the generation rule pool by generation time;

[0073] Generate a new MD5 generation rule according to a preset time period, and add the new MD5 generation rule to the generation rule pool;

[0074] According to the order of generation time, the MD5 generation rule with the earliest generation time in the generation rule pool is deleted.

[0075] In this embodiment, the MD5 generation rules in the generation rule pool are updated according to the generation time. Specifically, a timestamp can be maintained for each MD5 generation rule to record the creation time of the rule. All the rules in the rule pool are sorted according to the timestamp. For example, the rules in the rule pool and their timestamps can be sorted as follows:

[0076] Rule A, generated at: 2023-10-01T08:00:00

[0077] Rule B, generated at: 2023-10-02T09:00:00

[0078] Rule C, generated at: 2023-10-03T10:00:00

[0079] By sorting, the oldest rules can be accurately identified and maintained, which facilitates the regular updating and deletion of rules. While sorting, a time period, such as daily or weekly, is set as the frequency of generating new rules. New MD5 generation rules are generated according to the preset time period, and the new MD5 generation rules are added to the generation rule pool, and the generation time is recorded. For example, at 1 a.m. every day, an MD5 generation rule based on the date of the day is generated, the new rule is added to the rule pool, and the generation time is marked as the current date and time. The introduction of new rules can increase the complexity of the system, making it difficult for attackers to predict and exploit the rules.

[0080] While adding new MD5 generation rules regularly, we also identify the rules with the earliest generation time based on the sorting results and delete the oldest rules from the rule pool. For example, if the sorting result in the rule pool is rule A->rule B->rule C, after the new rule D is generated regularly, the earliest generated rule A will be deleted at the same time, so as to keep the rule pool updated and streamlined, and prevent the rule pool from becoming too large and difficult to manage. By removing outdated rules, we can ensure that only the most effective and secure rules are retained in the system, improving the system's response speed and efficiency.

[0081] In one embodiment, updating the MD5 generation rules in the generation rule pool according to a preset update strategy includes:

[0082] Sort all MD5 generation rules in the generation rule pool by generation time;

[0083] Whenever a new MD5 value is generated by randomly selecting an MD5 generation rule, a new MD5 generation rule is generated and added to the generation rule pool;

[0084] According to the order of generation time, the MD5 generation rule with the earliest generation time in the generation rule pool is deleted.

[0085] In the present embodiment, the same as the previous embodiment is that the generation time of all MD5 generation rules in the rule pool is also sorted, and the difference is that the update operation of the generation rule pool in the present embodiment is not based on a fixed time cycle, but each time the request is responded to, after randomly selecting the MD5 generation rule from the rule pool to generate a new MD5 value, the update operation of the generation rule pool is executed, for example, after intercepting the response data of request 1, and randomly selecting rule Y to generate a new MD5 value and returning it to the front-end user together, a new rule W is created, and the new rule W is added to the rule pool, and the generation time is marked as the current date and time. Similarly, after the new generation rule is generated, the MD5 generation rule with the earliest generation time in the generation rule pool is deleted based on the sorting of the generation time, and the update of the rule pool is completed once. The present embodiment ensures the continuous update and optimization of the rule pool by performing the update operation only when the rule selection operation occurs, and also avoids the waste of power consumption caused by too many update operations on the rule pool.

[0086] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.

[0087] Further references Figure 6 , as a response to the above Figure 2 The present invention provides an embodiment of an interface authentication processing device, and the device embodiment is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0088] like Figure 6 As shown, the interface authentication processing device 60 described in this embodiment includes:

[0089] The input parameter interception module 601 is used to intercept the request input parameter data of the front-end user through the pre-created AOP aspect. The request input parameter data contains a user ID field, a unique identification field and an MD5 field. The unique identification field is also configured with an interface authentication annotation.

[0090] A rule acquisition module 602 is used to acquire the MD5 generation rule for this authentication from a preset generation rule pool according to the interface authentication annotation;

[0091] The authentication module 603 is used to perform interface authentication according to the request input data and the MD5 generation rule of this authentication, and instruct the backend service to execute the corresponding request task when the authentication is successful;

[0092] The output parameter interception module 604 is used to intercept the request output parameter data returned by the backend service through the AOP aspect, and randomly select an MD5 generation rule from the generation rule pool to generate a new MD5 value;

[0093] The annotation return module 605 is used to configure the MD5 generation annotation on the unique identification field in the request output parameter data according to the randomly selected MD5 generation rule, and return the configured request output parameter data and the new MD5 value to the front-end user. The MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time.

[0094] The module referred to in the present invention refers to a series of computer program instruction segments that can perform specific functions, which is more suitable for describing the interface authentication processing execution process than a program. For the specific implementation of each module, please refer to the corresponding method embodiment above, which will not be repeated here.

[0095] In one embodiment, the rule acquisition module 602 includes:

[0096] An annotation parsing unit is used to parse the interface authentication annotation and obtain a rule identifier in the interface authentication annotation, where the rule identifier is obtained and configured from the MD5 generation annotation returned from the previous request;

[0097] The acquisition unit is used to acquire the MD5 generation rule for this authentication from a preset generation rule pool according to the rule identifier, wherein the MD5 generation rule for this authentication is the MD5 generation rule randomly selected when a new MD5 value was generated last time.

[0098] In one embodiment, the authentication module 603 includes:

[0099] A request parsing unit is used to parse the user ID field, unique identifier field and MD5 field in the request input parameter data to obtain the corresponding user ID, unique identifier and MD5 value, where the MD5 value is the new MD5 value returned by the previous request;

[0100] A generating unit, configured to generate a corresponding MD5 value to be verified according to the user ID and the unique identifier and the MD5 generation rule of the current authentication;

[0101] The authentication unit is used to compare the MD5 value carried in the request input data with the MD5 value to be verified to confirm whether they are consistent. If they are consistent, the interface authentication is successful, otherwise the interface authentication fails.

[0102] In one embodiment, the parameter output interception module 604 includes:

[0103] A screening unit, used to screen all MD5 generation rules in the generation rule pool according to a preset screening strategy to obtain a selectable rule range;

[0104] The random selection unit is used to randomly select an MD5 generation rule in the optional rule range, and generate a new MD5 value according to the randomly selected MD5 generation rule based on the user ID and unique identifier in the request parameter data.

[0105] In one embodiment, the device 60 further includes:

[0106] A configuration module, used for configuring a plurality of MD5 generation rules, and constructing a generation rule pool according to the plurality of MD5 generation rules;

[0107] The updating module is used to update the MD5 generation rules in the generation rule pool according to a preset updating strategy.

[0108] In one embodiment, the update module includes:

[0109] A first sorting unit, used to sort all MD5 generation rules in the generation rule pool according to generation time;

[0110] A first updating unit, used to generate new MD5 generation rules according to a preset time period, and add the new MD5 generation rules to the generation rule pool;

[0111] The first deleting unit is used to delete the MD5 generation rule with the earliest generation time in the generation rule pool according to the order of generation time.

[0112] In one embodiment, the update module includes:

[0113] A second sorting unit is used to sort all MD5 generation rules in the generation rule pool according to generation time;

[0114] A second updating unit is used to generate a new MD5 generation rule and add it to the generation rule pool every time a new MD5 value is generated by randomly selecting an MD5 generation rule;

[0115] The second deleting unit is used to delete the MD5 generation rule with the earliest generation time in the generation rule pool according to the order of generation time.

[0116] In the above embodiment, the present invention discloses an interface authentication processing device, which intercepts the request input parameter data of the front-end user through a pre-created AOP aspect, wherein the request input parameter data contains a user ID field, a unique identification field and an MD5 field, and the unique identification field is also configured with an interface authentication annotation; according to the interface authentication annotation, the MD5 generation rule for this authentication is obtained from a preset generation rule pool; interface authentication is performed according to the request input parameter data and the MD5 generation rule for this authentication, and when the authentication is successful, the back-end service is instructed to execute the corresponding request task; the request output parameter data returned by the back-end service is intercepted through the AOP aspect, and an MD5 generation rule is randomly selected from the generation rule pool to generate a new MD5 value; the MD5 generation annotation on the unique identification field in the request output parameter data is configured according to the randomly selected MD5 generation rule, and the configured request output parameter data and the new MD5 value are returned to the front-end user, and the MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time. The MD5 generation rules for each authentication are updated through annotations, eliminating the manual operation of generating authentication relationships for user IDs and unique identifiers. The generation and verification of interface authentication MD5 is achieved in an imperceptible manner, which improves the efficiency and accuracy of interface authentication and enhances the security of interface authentication.

[0117] Another embodiment of the present invention provides a computer device, such as Figure 7 As shown, the computer device 70 includes:

[0118] One or more processors 701 and memory 702, Figure 7 A processor 701 is used as an example for description. The processor 701 and the memory 702 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.

[0119] Processor 701 is used to complete various control logics of computer device 70, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component or any combination of these components. In addition, processor 701 can also be any traditional processor, microprocessor or state machine. Processor 701 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.

[0120] The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the interface authentication processing method in the embodiment of the present invention. The processor 701 executes various functional applications and data processing of the computer device 70 by running the non-volatile software programs, instructions and units stored in the memory 702, that is, implements the interface authentication processing method in the above method embodiment.

[0121] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the computer device 70, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 702 may optionally include a memory remotely arranged relative to the processor 701, and these remote memories may be connected to the computer device 70 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 a combination thereof. One or more units are stored in the memory 702, and when executed by one or more processors 701, the steps of the interface authentication processing method in any of the above-mentioned method embodiments are executed.

[0122] In the above embodiment, the present invention discloses a computer device, which intercepts the request input parameter data of the front-end user through a pre-created AOP aspect, wherein the request input parameter data contains a user ID field, a unique identification field and an MD5 field, and the unique identification field is also configured with an interface authentication annotation; according to the interface authentication annotation, the MD5 generation rule for this authentication is obtained from a preset generation rule pool; interface authentication is performed according to the request input parameter data and the MD5 generation rule for this authentication, and when the authentication is successful, the back-end service is instructed to execute the corresponding request task; the request output parameter data returned by the back-end service is intercepted through the AOP aspect, and an MD5 generation rule is randomly selected from the generation rule pool to generate a new MD5 value; the MD5 generation annotation on the unique identification field in the request output parameter data is configured according to the randomly selected MD5 generation rule, and the configured request output parameter data and the new MD5 value are returned to the front-end user, and the MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time. The MD5 generation rules for each authentication are updated through annotations, eliminating the manual operation of generating authentication relationships for user IDs and unique identifiers. The generation and verification of interface authentication MD5 is achieved in an imperceptible manner, which improves the efficiency and accuracy of interface authentication and enhances the security of interface authentication.

[0123] An embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the steps of the interface authentication processing method in any of the above method embodiments are executed.

[0124] In the above embodiment, the present invention discloses a non-volatile computer-readable storage medium, which intercepts the request input parameter data of the front-end user through a pre-created AOP aspect, wherein the request input parameter data contains a user ID field, a unique identification field and an MD5 field, and the unique identification field is also configured with an interface authentication annotation; the MD5 generation rule for this authentication is obtained from a preset generation rule pool according to the interface authentication annotation; interface authentication is performed according to the request input parameter data and the MD5 generation rule for this authentication, and when the authentication is successful, the back-end service is instructed to execute the corresponding request task; the request output parameter data returned by the back-end service is intercepted through the AOP aspect, and an MD5 generation rule is randomly selected from the generation rule pool to generate a new MD5 value; the MD5 generation annotation on the unique identification field in the request output parameter data is configured according to the randomly selected MD5 generation rule, and the configured request output parameter data and the new MD5 value are returned to the front-end user, and the MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time. The MD5 generation rules for each authentication are updated through annotations, eliminating the manual operation of generating authentication relationships for user IDs and unique identifiers. The generation and verification of interface authentication MD5 is achieved in an imperceptible manner, which improves the efficiency and accuracy of interface authentication and enhances the security of interface authentication.

[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0126] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0127] In summary, the present invention discloses an interface authentication processing method, device, equipment and medium, the method comprising: intercepting the request input parameter data of the front-end user through a pre-created AOP aspect, the request input parameter data contains a user ID field, a unique identification field and an MD5 field, and the unique identification field is also configured with an interface authentication annotation; obtaining the MD5 generation rule for this authentication from a preset generation rule pool according to the interface authentication annotation; performing interface authentication according to the request input parameter data and the MD5 generation rule for this authentication, and instructing the back-end service to execute the corresponding request task when the authentication is successful; intercepting the request output parameter data returned by the back-end service through the AOP aspect, and randomly selecting an MD5 generation rule from the generation rule pool to generate a new MD5 value; configuring the MD5 generation annotation on the unique identification field in the request output parameter data according to the randomly selected MD5 generation rule, returning the configured request output parameter data and the new MD5 value to the front-end user, the MD5 generation annotation being used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time. The MD5 generation rules for each authentication are updated through annotations, eliminating the manual operation of generating authentication relationships for user IDs and unique identifiers. The generation and verification of interface authentication MD5 is achieved in an imperceptible manner, which improves the efficiency and accuracy of interface authentication and enhances the security of interface authentication.

[0128] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, a floppy disk, a flash memory, an optical storage device, etc.

[0129] It should be noted that if any software tools or components other than those of the Company appear in the embodiments of the present application, they are merely used for illustration and do not represent actual use. It should be understood that the application of the present invention is not limited to the above examples, and that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes shall fall within the scope of protection of the claims attached to the present invention.

Claims

1. An interface authentication processing method, characterized in that: include: Intercept the request input data of the front-end user through the pre-created AOP aspect. The request input data contains a user ID field, a unique identification field, and an MD5 field. The unique identification field is also configured with an interface authentication annotation. Obtain the MD5 generation rule for this authentication from the preset generation rule pool according to the interface authentication annotation; Perform interface authentication according to the request input data and the MD5 generation rule of this authentication, and instruct the backend service to execute the corresponding request task when the authentication is successful; The request output parameter data returned by the backend service is intercepted by the AOP aspect, and a new MD5 value is generated by randomly selecting an MD5 generation rule from the generation rule pool; Configure the MD5 generation annotation on the unique identification field in the request output parameter data according to the randomly selected MD5 generation rule, return the configured request output parameter data and the new MD5 value to the front-end user, and the MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time.

2. The interface authentication processing method according to claim 1, characterized in that: The step of obtaining the MD5 generation rule for this authentication from a preset generation rule pool according to the interface authentication annotation includes: Parse the interface authentication annotation to obtain the rule identifier in the interface authentication annotation, where the rule identifier is obtained and configured from the MD5 generation annotation returned from the previous request; The MD5 generation rule for this authentication is obtained from a preset generation rule pool according to the rule identifier, and the MD5 generation rule for this authentication is the MD5 generation rule randomly selected when a new MD5 value was generated last time.

3. The interface authentication processing method according to claim 1, characterized in that: The interface authentication is performed according to the request input parameter data and the MD5 generation rule of the current authentication, including: Parse the user ID field, unique identifier field, and MD5 field in the request input data to obtain the corresponding user ID, unique identifier, and MD5 value, where the MD5 value is the new MD5 value returned by the previous request; Generate a corresponding MD5 value to be verified according to the user ID and unique identifier and the MD5 generation rule of this authentication; The MD5 value carried in the request input data is compared with the MD5 value to be verified to confirm whether they are consistent. If they are consistent, the interface authentication is successful, otherwise the interface authentication fails.

4. The interface authentication processing method according to claim 1, characterized in that: The randomly selecting an MD5 generation rule from the generation rule pool to generate a new MD5 value includes: Filter all MD5 generation rules in the generation rule pool according to a preset filtering strategy to obtain a range of optional rules; An MD5 generation rule is randomly selected from the optional rule range, and a new MD5 value is generated according to the randomly selected MD5 generation rule based on the user ID and unique identifier in the request parameter data.

5. The interface authentication processing method according to claim 1, characterized in that: Before intercepting the request input parameter data of the front-end user through the pre-created AOP aspect, the method also includes: Configure multiple MD5 generation rules, and construct a generation rule pool according to the multiple MD5 generation rules; The MD5 generation rules in the generation rule pool are updated according to a preset update strategy.

6. The interface authentication processing method according to claim 5, characterized in that: The updating of the MD5 generation rules in the generation rule pool according to a preset update strategy includes: Sort all MD5 generation rules in the generation rule pool by generation time; Generate a new MD5 generation rule according to a preset time period, and add the new MD5 generation rule to the generation rule pool; According to the order of generation time, the MD5 generation rule with the earliest generation time in the generation rule pool is deleted.

7. The interface authentication processing method according to claim 5, characterized in that: The updating of the MD5 generation rules in the generation rule pool according to a preset update strategy includes: Sort all MD5 generation rules in the generation rule pool by generation time; Whenever a new MD5 value is generated by randomly selecting an MD5 generation rule, a new MD5 generation rule is generated and added to the generation rule pool; According to the order of generation time, the MD5 generation rule with the earliest generation time in the generation rule pool is deleted.

8. An interface authentication processing device, characterized in that: include: The input parameter interception module is used to intercept the request input parameter data of the front-end user through the pre-created AOP aspect. The request input parameter data contains a user ID field, a unique identification field and an MD5 field. The unique identification field is also configured with an interface authentication annotation; A rule acquisition module, used to obtain the MD5 generation rule for this authentication from a preset generation rule pool according to the interface authentication annotation; The authentication module is used to perform interface authentication according to the request input data and the MD5 generation rule of this authentication, and instruct the backend service to execute the corresponding request task when the authentication is successful; An output parameter interception module is used to intercept the request output parameter data returned by the backend service through the AOP aspect, and randomly select an MD5 generation rule from the generation rule pool to generate a new MD5 value; The annotation return module is used to configure the MD5 generation annotation on the unique identification field in the request output parameter data according to the randomly selected MD5 generation rules, and return the configured request output parameter data and the new MD5 value to the front-end user. The MD5 generation annotation is used to instruct the front-end user to configure the corresponding interface authentication annotation when initiating a request next time.

9. A computer device, characterized in that: comprising at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the interface authentication processing method described in any one of claims 1-7.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the interface authentication processing method described in any one of claims 1-7.