Method, device and medium for processing idempotency problem of web page

By using AOP technology to generate unique identifiers to handle the idempotency problem of web pages, the problem of interface idempotency anomalies in scenarios with no unique attributes or high database pressure is solved, enabling fast response and decoupling, and preventing data corruption.

CN117216061BActive Publication Date: 2026-03-24HANGZHOU DBAPPSECURITY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-12
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively identify and prevent interface idempotency anomalies when dealing with idempotency issues in web pages, especially in business scenarios without unique attributes or under excessive database pressure, leading to data corruption and inconsistent system states.

Method used

By using Aspect-Oriented Programming (AOP) technology, a unique identifier is generated based on the client's business request parameters. It is then determined whether the interface ID is in the AOP pointcut set. If it is, an idempotency exception message is sent; otherwise, the unique identifier is added to the cache for business processing, reducing the dependence on and pressure on the database.

Benefits of technology

It enables rapid response to idempotency issues in interfaces, prevents data insecurity, shortens the trigger chain for idempotency issues, reduces database pressure, and ensures decoupling of business code.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117216061B_ABST
    Figure CN117216061B_ABST
Patent Text Reader

Abstract

The application relates to a method, device and equipment for processing idempotency problems of a Web page and a medium, wherein the method for processing idempotency problems of the Web page comprises the following steps: obtaining a plurality of business request parameters based on business request information submitted by a client; wherein the business request parameters comprise an interface ID; determining whether the interface ID is in an AOP pointcut set; if yes, an AOP aspect constructed in advance generates a unique identifier according to the plurality of business request parameters; and determining whether an interface corresponding to the interface ID has an idempotency exception according to the unique identifier; if yes, an idempotency exception message is sent to the client; and if not, the unique identifier is added to a cache, and business processing is performed based on the business request information, so that the triggering chain of idempotency problems is shortened, fast response to interface idempotency problems is realized, and data insecurity hazards caused by interface idempotency are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Web service technology, and in particular to methods, apparatus, devices and media for handling idempotency problems in Web pages. Background Technology

[0002] Idempotency is a mathematical and computer science concept. In mathematics, when a variable is idempotent, its operation applied twice to any element will produce the same result as its operation once. Interface idempotency refers to the principle that a single request and multiple requests to a resource should yield the same result for that resource, based on the characteristics of idempotency issues. In business development, duplicate submissions are frequently encountered, whether due to network issues preventing the receipt of a request result and requiring a re-initiation, or due to frontend operational instability causing duplicate submissions.

[0003] Therefore, when a service interface is called multiple times by an external caller, or when idempotency issues arise due to special circumstances such as network or device lag, sending the same request multiple times can lead to data corruption, duplicate processing, and inconsistent system states.

[0004] In existing technologies, determining the idempotency of an interface typically relies on the unique key mechanism in the database. For example, based on the uniqueness of attributes such as ID card numbers, mobile phone numbers, and student ID numbers, a unique key is created in the database. If duplicate data is inserted, an exception is returned, thus ensuring interface idempotency. However, some business scenarios may not have unique attributes. If the business scenario lacks unique attributes, a unique index cannot be created in the database. Alternatively, due to data volume and resource constraints, using unique keys in the database for interface idempotency checks would result in a longer chain of triggering idempotency verifications, while also putting pressure on the database. Summary of the Invention

[0005] Therefore, it is necessary to provide methods, apparatus, devices, and media for handling idempotency issues in web pages to address the aforementioned technical problems.

[0006] In a first aspect, embodiments of this application provide a method for handling idempotency issues in web pages, the method comprising:

[0007] Based on the business request information submitted by the client, multiple business request parameters are obtained; wherein, the business request parameters include the interface ID;

[0008] Determine whether the interface ID is in the AOP pointcut set;

[0009] If present, the pre-built AOP aspect generates a unique identifier based on the multiple business request parameters; and based on the unique identifier, it determines whether the interface corresponding to the interface ID has an idempotency anomaly.

[0010] If so, an idempotency exception message is sent to the client.

[0011] If not, the unique identifier is added to the cache, and business processing is performed based on the business request information.

[0012] In one embodiment, the method further includes:

[0013] Define an AOP aspect;

[0014] Write the idempotency exception judgment logic code into the AOP aspect to obtain the pre-constructed AOP aspect.

[0015] In one embodiment, determining whether the interface corresponding to the interface ID has an idempotency anomaly based on the unique identifier includes:

[0016] Use the pre-built AOP aspect to determine whether the unique identifier exists in the cache;

[0017] If it exists, then the interface corresponding to the interface ID has an idempotency anomaly;

[0018] If it does not exist, then the interface corresponding to the interface ID has not experienced an idempotency anomaly.

[0019] In one embodiment, the plurality of business request parameters further includes a user token, request parameters, and a form timestamp; wherein the form timestamp is generated when the client submits business request information.

[0020] In one embodiment, the pre-built AOP aspect generates a unique identifier based on the plurality of business request parameters, including:

[0021] Perform web service permission verification on the user token to obtain the user ID;

[0022] The request parameters are processed using a hash function to obtain a hash value;

[0023] The user ID, the interface ID, the hash value, and the form timestamp are concatenated to form a unique identifier.

[0024] In one embodiment, the method further includes:

[0025] The pre-built AOP aspect is used to determine whether the unique identifier is generated by the user ID, the interface ID, the hash value, and the form timestamp; if not, a parameter exception message is returned to the client.

[0026] In one embodiment, the method further includes:

[0027] The pointcut function adds the interface ID corresponding to the specified interface to the AOP pointcut set.

[0028] Secondly, embodiments of this application also provide a processing apparatus for idempotency issues in web pages, characterized in that the apparatus comprises:

[0029] The generation module is used to obtain multiple business request parameters based on the business request information submitted by the client; wherein, the business request parameters include the interface ID;

[0030] The first judgment module is used to determine whether the interface ID is in the AOP pointset set;

[0031] The second judgment module is used to, if present, generate a unique identifier based on the multiple business request parameters using the pre-constructed AOP aspect; and determine whether the interface corresponding to the interface ID has an idempotency anomaly based on the unique identifier.

[0032] The sending module is configured to send an idempotency exception message to the client if the condition is met.

[0033] The processing module is used to add the unique identifier to the cache if not, and to perform business processing based on the business request information.

[0034] Thirdly, embodiments of this application also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect above.

[0035] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the method described in the first aspect above.

[0036] The aforementioned method, apparatus, device, and readable storage medium for handling idempotency issues on web pages obtain multiple business request parameters based on business request information submitted by the client. These parameters include an interface ID. The method determines whether the interface ID is in an AOP pointcut set. If it is, a pre-constructed AOP aspect generates a unique identifier based on the multiple business request parameters. Based on the unique identifier, the method determines whether the interface corresponding to the interface ID has an idempotency anomaly. If yes, an idempotency anomaly message is sent to the client. If no, the unique identifier is added to the cache, and business processing is performed based on the business request information. This application writes the idempotency verification logic within an AOP aspect for interface idempotency checking, ensuring decoupling from business code, shortening the idempotency issue triggering chain, enabling rapid response to interface idempotency issues, preventing data insecurity and other harms caused by interface idempotency, and reducing database pressure by not relying on business scenarios and database characteristics.

[0037] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0038] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0039] Figure 1 This is a schematic diagram illustrating the application environment of a method for handling idempotency issues in a web page, as described in one embodiment.

[0040] Figure 2 This is a flowchart illustrating a method for handling idempotency issues in a web page in one embodiment;

[0041] Figure 3 This is a flowchart illustrating the specific steps of S203 in one embodiment;

[0042] Figure 4 This is a flowchart illustrating a preferred embodiment of a method for handling idempotency issues in web pages.

[0043] Figure 5 This is a structural block diagram of a device for handling idempotency issues in a web page in one embodiment;

[0044] Figure 6 This is a schematic diagram of the computer device structure in one embodiment. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0046] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.

[0047] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0048] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.

[0049] The method for handling idempotency issues in web pages provided in this application can be applied to, for example... Figure 1 In the application environment shown, client 102 communicates with server 104 via a network. Client 102 first sends a business request to the server. Server 104 obtains multiple business request parameters based on the business request information submitted by the client; these parameters include an interface ID. A unique identifier is generated based on these multiple business request parameters. The server determines whether the interface ID is in the AOP pointcut set. If it is, the server uses a pre-built AOP aspect to determine whether the interface corresponding to the interface ID has an idempotency exception. If yes, an idempotency exception message is sent to the client. If no, the unique identifier is added to the cache, and business processing is performed based on the business request information.

[0050] Aspect-Oriented Programming (AOP) is a programming paradigm or approach used to address cross-cutting concerns in object-oriented programming. AOP typically utilizes the following key concepts:

[0051] Aspect: An aspect is a modular unit of cross-cutting concerns. It contains the logic of where (the pointcut), when (the notification), and how (the enhancement) the cross-cutting concerns are applied.

[0052] Join point: A join point is a point where aspects can be inserted during the execution of an application. For example, method calls and method returns can be join points.

[0053] Pointcut: A pointcut is a set of join points that defines where the cutoff line inserts code. Pointcuts use expressions to match join points.

[0054] Advice: Advice is the code that an aspect executes at a specific join point. Common advice types include before advice (executed before the join point), after advice (executed after the join point), around advice (executed before and after the join point), exception advice (executed when an exception occurs at the join point), and finally advice (executed after the join point, regardless of whether an exception occurs at the join point).

[0055] Introduction: Introduction allows aspects to add new methods or properties to the advised class.

[0056] Firstly, embodiments of this application provide a method for handling idempotency issues in web pages, such as... Figure 2 As shown, the method includes the following steps:

[0057] Step S201: Based on the business request information submitted by the client, obtain multiple business request parameters; wherein, the business request parameters include the interface ID.

[0058] Specifically, in a single sign-on web service environment, a client user sends an HTTP request to the server-side interface through their business system. When the server receives the request from the client's business system, it retrieves multiple business request parameters based on the submitted business request information. These business request parameters include the interface ID corresponding to the server-side interface.

[0059] Step S202: Determine whether the interface ID is in the AOP pointset set;

[0060] Step S203: If yes, the pre-built AOP aspect generates a unique identifier based on the multiple business request parameters; and based on the unique identifier, it is determined whether the interface corresponding to the interface ID has an idempotency anomaly.

[0061] This application uses the Spring Boot microservice framework and AOP to determine interface idempotency. Specifically, after the server verifies user login permissions via a web service, if the interface requested by the client is configured in the idempotency-handling AOP pointcut set, the idempotency aspect code will be called to determine whether an idempotency exception has occurred. Therefore, before idempotency exception checking, an AOP aspect needs to be defined, marked with the `@Aspect` annotation to indicate that the current class is an aspect class. The idempotency exception checking logic is then written into the defined AOP aspect class. This logic generates a unique identifier based on multiple business request parameters and determines whether the interface corresponding to the interface ID has an idempotency exception based on the unique identifier. This application decouples the idempotency check logic from the business code by writing it within the AOP aspect.

[0062] Step S204: If yes, then send an idempotency exception message to the client;

[0063] Step S205: If not, add the unique identifier to the cache and perform business processing based on the business request information.

[0064] This application will also add a unique identifier to the database with a reasonable expiration time, which will help the database better manage user memory. The expiration time can be reasonably set according to business conditions and the timeout time filled in by the caller's form.

[0065] Through steps S201 to S205 above, multiple business request parameters are obtained based on the business request information submitted by the client; wherein, the business request parameters include an interface ID; a unique identifier is generated based on the multiple business request parameters; it is determined whether the interface ID is in the AOP pointcut set; if it is, then based on the unique identifier, a pre-built AOP aspect is used to determine whether the interface corresponding to the interface ID has an idempotency exception; if yes, an idempotency exception message is sent to the client; if no, the unique identifier is added to the cache, and business processing is performed based on the business request information. This application writes the idempotency verification logic in the AOP aspect to perform interface idempotency verification, ensuring decoupling from business code, shortening the idempotency problem triggering chain, realizing a fast response to interface idempotency problems, preventing data insecurity and other harms caused by interface idempotency, and reducing database pressure by not relying on business scenario and database characteristics.

[0066] In one embodiment, such as Figure 3 As shown, determining whether the interface corresponding to the interface ID has an idempotency anomaly based on the unique identifier includes the following steps:

[0067] Step S301: Use the pre-built AOP aspect to determine whether the unique identifier exists in the cache.

[0068] Step S302: If it exists, then the interface corresponding to the interface ID has an idempotency anomaly.

[0069] Step S303: If it does not exist, then the interface corresponding to the interface ID has not experienced an idempotency anomaly.

[0070] In this application, the cache is a Redis cache. Specifically, the unique identifier can be added to the Redis cache using the `SETNX` function. If the addition is successful, the result returns TRUE, indicating that this is a new business request and the called interface has not encountered an idempotency exception, allowing the interface to process business logic. If the addition fails, the result returns FALSE, indicating that the business request has already been processed, and an idempotency exception can be returned to the caller. The user can re-enter the business system to submit the business request and call the server interface again. The `SETNX` function is a command in the Redis cache used to set the value of a key. However, it only succeeds and returns TRUE if the key does not already exist; if the key already exists, the `SETNX` function will not perform any operation and will return FALSE.

[0071] In one embodiment, the plurality of business request parameters further includes a user token, request parameters, and a form timestamp; the form timestamp is generated when the client submits business request information.

[0072] In one embodiment, generating a unique identifier based on the multiple business request parameters includes: obtaining the interface ID based on attributes such as the Uniform Resource Locator (URL) of the HTTP protocol, request parameters, and request method; performing Web service permission verification on the user token to obtain the user ID, wherein the token is an encrypted string generated by the server as a token for client requests and used for user authentication; processing the request parameters using a hash function to obtain a hash value; and concatenating the user ID, the interface ID, the hash value, and the form timestamp into a unique identifier, specifically, the concatenation method being user ID + interface ID + hash value + form timestamp.

[0073] In one embodiment, the method further includes: determining whether the unique identifier is generated from the user ID, the interface ID, the hash value, and the form timestamp; if not, returning a parameter error message to the client. For example, if the unique identifier is constructed from other parameters or missing parameters, it will violate the idempotency determination, and the page terminal should be prompted with a parameter error message.

[0074] In one embodiment, the method further includes adding the interface ID corresponding to the specified interface to the AOP pointcut set via a pointcut function. Specifically, different business scenarios call different server-side interfaces. If certain specified interfaces need to be protected, simply add the interface IDs corresponding to these specified interfaces to the pointcut set. The pointcut set can be maintained in any location such as code, disk, or database, so that the service can read the pointcut set upon startup to perform interface idempotency checks. This avoids rewriting the interface idempotency check logic code, thereby achieving a configurable solution to the idempotency problem of specified interfaces.

[0075] In one example embodiment, such as Figure 4 As shown, the caller enters the client's business system submission page, generates a form timestamp, and after completing the form, sends the relevant parameters (request parameters, form timestamp) to the server. The server verifies the user's login permissions via the web service. If the request interface is configured in the idempotent AOP pointcut set, it will enter the idempotent aspect code's judgment: It obtains the interface identifier (interface ID) based on the HTTP protocol's URL, request parameters, request method, and other attributes; it obtains the user's unique identifier (user ID) based on the interface's token and through our web service's permission verification; it obtains the interface's request parameters and processes them using a hash function. Calculate the hash value of the parameters; obtain the form timestamp generated when submitting the form; concatenate the four parameters above (interface ID, user ID, request parameter hash value, and form timestamp) to generate a unique identifier key; add the unique identifier key to Redis using the Redis setnx function. If the addition is successful, the result returns TRUE, indicating that this is a new request and the progress interface business logic can be processed. If the addition fails, the result returns FALSE, indicating that the request has already been processed and an idempotency exception can be returned to the caller, and the form submission page can be revisited to fill in and submit.

[0076] Secondly, embodiments of this application also provide a processing apparatus for idempotency issues in web pages, such as... Figure 5 As shown, the device includes:

[0077] The generation module 510 is used to obtain multiple business request parameters based on the business request information submitted by the client; wherein, the business request parameters include the interface ID;

[0078] The first judgment module 520 is used to determine whether the interface ID is in the AOP pointset set;

[0079] The second judgment module 530 is used to, if present, generate a unique identifier based on the multiple business request parameters using the pre-constructed AOP aspect; and determine whether the interface corresponding to the interface ID has an idempotency anomaly based on the unique identifier.

[0080] The sending module 540 is used to send an idempotency exception message to the client if the condition is met.

[0081] The processing module 550 is used to add the unique identifier to the cache if not, and to perform business processing based on the business request information.

[0082] In one embodiment, the second judgment module 530 is further configured to define an AOP aspect; write the idempotency exception judgment logic code into the AOP aspect to obtain the pre-constructed AOP aspect.

[0083] In one embodiment, the second judgment module 530 is further configured to use the pre-built AOP aspect to determine whether the unique identifier exists in the cache; if it exists, the interface corresponding to the interface ID has an idempotency anomaly; if it does not exist, the interface corresponding to the interface ID has no idempotency anomaly.

[0084] In one embodiment, the plurality of business request parameters further includes a user token, request parameters, and a form timestamp; wherein the form timestamp is generated when the client submits business request information.

[0085] In one embodiment, the second judgment module 530 is further configured to perform Web service permission verification on the user token to obtain the user ID; process the request parameters using a hash function to obtain a hash value; and concatenate the user ID, the interface ID, the hash value, and the form timestamp into a unique identifier.

[0086] In one embodiment, the second judgment module 530 is further configured to determine whether the unique identifier is generated by the user ID, the interface ID, the hash value, and the form timestamp; if not, a parameter exception message is returned to the client.

[0087] In one embodiment, the apparatus further includes an adding module 560, which is used to add the interface ID corresponding to the specified interface to the AOP pointcut set through a pointcut function.

[0088] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0089] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, memory, and network interface connected via a device bus.

[0090] The processor of this computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores operating devices, computer programs, and a database. The internal memory provides an environment for the operation of the operating devices and computer programs in the non-volatile storage medium. The database of the computer device stores unique identification data. The network interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in any of the above embodiments for handling idempotency issues in web pages.

[0091] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0092] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in any of the above-described cleaning strategy generation method embodiments.

[0093] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps in any of the above-described message push method or message forwarding method embodiments.

[0094] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0095] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0096] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for handling idempotency problems of a Web page, characterized in that, The method comprises: defining an AOP aspect; writing idempotency exception judgment logic code into the AOP aspect to obtain a pre-constructed AOP aspect; based on the business request information submitted by the client, obtaining a plurality of business request parameters; wherein the business request parameters comprise an interface ID; judging whether the interface ID is in an AOP pointcut set; if yes, the pre-constructed AOP aspect generates a unique identifier according to the plurality of business request parameters, and judges whether the interface corresponding to the interface ID has an idempotency exception according to the unique identifier; including: using the pre-constructed AOP aspect to judge whether the unique identifier exists in the cache; if yes, the interface corresponding to the interface ID has an idempotency exception; if no, the interface corresponding to the interface ID does not have an idempotency exception; if no, sending an idempotency exception message to the client; if no, adding the unique identifier to the cache and performing business processing based on the business request information.

2. The method of claim 1, wherein, The plurality of business request parameters further comprise a user token, a request parameter, and a form timestamp; wherein the form timestamp is generated when the client submits the business request information.

3. The method of claim 2, wherein, The method further comprises: judging whether the unique identifier is generated from the user ID, the interface ID, the hash value, and the form timestamp; if no, returning a parameter exception message to the client. The method further comprises: adding the interface ID corresponding to the specified interface to the AOP pointcut set through a pointcut function.

4. The method of claim 3, wherein, The device comprises: a construction module for defining an AOP aspect and writing idempotency exception judgment logic code into the AOP aspect to obtain a pre-constructed AOP aspect; 5. The method of claim 1, wherein, an acquisition module for acquiring a plurality of business request parameters based on the business request information submitted by the client; wherein the business request parameters comprise an interface ID; a generation module for acquiring a plurality of business request parameters based on the business request information submitted by the client; wherein the business request parameters comprise an interface ID; 6. A device for handling idempotency issues in web pages, characterized in that, a first judgment module for judging whether the interface ID is in an AOP pointcut set; a second judgment module for, if yes, generating a unique identifier according to the plurality of business request parameters by the pre-constructed AOP aspect, and judging whether the interface corresponding to the interface ID has an idempotency exception according to the unique identifier; including: using the pre-constructed AOP aspect to judge whether the unique identifier exists in the cache; if yes, the interface corresponding to the interface ID has an idempotency exception; if no, the interface corresponding to the interface ID does not have an idempotency exception; a sending module for, if no, sending an idempotency exception message to the client; ​ ​ ​ ​ A processing module is configured to add the unique identifier to a cache if not, and perform service processing based on the service request information. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The computer program is executed by the processor to implement the method in any one of claims 1-5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the method in any one of claims 1-5.

Citation Information

Patent Citations

  • Method for automatically achieving interface idempotence based on annotations

    CN112035118A

  • Service processing method based on API interface, equipment and computer readable storage medium

    CN112835916A