Data processing method and device, computer equipment and storage medium

The method uses a cache-based system to manage task threads and thresholds, addressing the inefficiencies and costs of third-party middleware, thereby improving server stability and access efficiency.

CN119155351APending Publication Date: 2024-12-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411106326.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-12
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Existing data processing systems rely on third-party current limiting middleware, which introduces incompatibility, additional learning costs, and increased operation and maintenance costs, while failing to accurately manage access requests, leading to server instability and inefficiency.

Method used

A data processing method that manages access requests using a cache to store task threads and thresholds, allowing or denying requests based on custom settings without requiring third-party middleware, thereby improving server stability and efficiency.

Benefits of technology

This approach enhances server stability and access efficiency by directly controlling task execution based on cached task threads, reducing incompatibility issues and operational costs, while maintaining server performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119155351A_ABST
    Figure CN119155351A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, computer equipment and a storage medium. The method comprises the following steps: in response to an access request of a first interface, if the first interface is a preset second interface, determining the number of task threads corresponding to the first interface in a cache and / or the number of times of calling the task threads in a set time period; if the number of the task threads is smaller than or equal to a first set threshold value, and / or the number of times of calling the task threads in a set time period is larger than a second set threshold value, first prompt information is returned, and the first prompt information is used for prompting that the first interface does not execute the access request. Therefore, the execution condition of the task corresponding to the access request is directly controlled based on the task thread stored in the cache, and a third-party current-limiting middleware does not need to be introduced to control the task execution condition corresponding to the access request of the second interface, so that the incompatibility condition of the third-party current-limiting middleware is reduced, and the user experience is improved. The stability of the server where the second interface is located is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a data processing method, apparatus, computer equipment and storage medium. Background Art

[0002] The data service end based on big data technology can provide users with various types of data services. For example, the user terminal can establish a communication connection with the server providing data services to use various data service functions provided by the server. For example, the user terminal can send access requests of different functional types to the server to perform tasks corresponding to the functional types. For example, if the user terminal needs to add data, modify data or delete data, it can send corresponding access requests, such as add data access request, modify data access request or delete data access request. After receiving the access request, the server responds to the access request and performs the task corresponding to the functional type of the access request, and then returns the execution result to the user terminal. In general, the user terminal can interact with the server through the functional interface corresponding to the functional type of the access request, and obtain the execution result of the server through the functional interface. In order to ensure the stability of the server, the functional interface traffic of the server is usually restricted to reduce the situation where too many access requests cause server instability or resource exhaustion. Summary of the invention

[0003] In response to the above technical problems, the present application provides a data processing method, apparatus, computer device and storage medium.

[0004] In a first aspect, the present application provides a data processing method, comprising:

[0005] In response to an access request of a first interface, if the first interface is a preset second interface, determining the number of task threads corresponding to the first interface in the cache and / or the number of times the task threads are called within a set time period;

[0006] If the number of the task threads is less than or equal to the first set threshold, and / or the number of times the task thread is called within the set time period is greater than the second set threshold, a first prompt message is returned, and the first prompt message is used to prompt the first interface not to execute the access request.

[0007] In a second aspect, the present application provides a data processing device, comprising: a determination module, for responding to an access request of a first interface, if the first interface is a preset second interface, determining the number of task threads corresponding to the first interface in a cache and / or the number of times the task thread is called within a set time period;

[0008] A prompt module is used to return a first prompt message if the number of task threads is less than or equal to a first set threshold, and / or the number of times the task thread is called within the set time period is greater than a second set threshold, wherein the first prompt message is used to prompt the first interface not to execute the access request.

[0009] In a third aspect, the present application also provides a computer device, including a processor and a memory, wherein the memory stores multiple instructions; the processor loads instructions from the memory to execute the steps of any data processing method provided in the embodiments of the present application.

[0010] In a fourth aspect, the present application also provides a computer-readable storage medium, which stores a plurality of instructions suitable for loading by a processor to execute the steps of any data processing method provided in the embodiments of the present application.

[0011] In a fifth aspect, the present application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps of any data processing method provided in the embodiments of the present application.

[0012] The present application responds to an access request from the first interface. If the first interface is a preset second interface, the number of task threads corresponding to the first interface in the cache and / or the number of times the task thread is called within a set time period are determined. If the number of task threads is less than or equal to the first set threshold, and / or the number of times the task thread is called within the set time period is greater than the second set threshold, a first prompt message is returned, and the first prompt message is used to prompt the first interface not to execute the access request. In this way, the execution of the task corresponding to the access request is directly controlled based on the task thread stored in the cache, without the need to introduce a third-party current limiting middleware to control the execution of the task corresponding to the access request of the second interface, thereby reducing the incompatibility of the third-party current limiting middleware, thereby improving the stability of the server where the second interface is located. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 It is a flow chart of a method for data processing based on current limiting middleware;

[0015] Figure 2 It is a schematic diagram of an application environment of a data processing method provided in an embodiment of the present application;

[0016] Figure 3 is a schematic structural diagram of a display device provided in an embodiment of the present application;

[0017] Figure 4 It is a flowchart of a data processing method provided in an embodiment of the present application;

[0018] Figure 5 is a flow chart of a data processing method provided in another embodiment of the present application;

[0019] Figure 6 It is a schematic diagram of an application environment of a data processing method provided in a specific embodiment of the present application;

[0020] Figure 7 It is a flowchart of a data processing method provided by a specific embodiment of the present application;

[0021] Figure 8 is a timing diagram of a data processing method provided in a specific embodiment of the present application;

[0022] Fig. 9 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0023] Fig.10 It is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0025] The functional interface of the server providing big data services usually corresponds to one or more functions provided by the server, thereby realizing the user terminal's access requirements to the functions corresponding to the functional interface. In order to improve the stability of the server, the flow of the server's functional interface is usually limited. In the related art, by introducing a third-party flow-limiting middleware, flow-limiting related codes are written on the functions that need flow-limiting, thereby limiting the access to each functional interface.

[0026] See also Figure 1 , Figure 1 The invention discloses a flow chart of a method for data processing based on a current limiting middleware. In the related art, a token bucket is usually created first, that is, the number of requests that a server can make per second. When the server receives an access request initiated by a user terminal, the number of tasks in the token bucket is first obtained. If the number of tokens consumed in the token bucket does not reach the number of tasks for current limiting, the access request of the user terminal is allowed. If the number of tokens consumed in the token bucket reaches the number of tasks for current limiting, the access request of the user terminal will be restricted, indicating that the user terminal cannot currently access the server. Among them, writing current limiting related codes in a third-party current limiting middleware is somewhat invasive to the original code. Current limiting of the server through a token bucket cannot accurately limit current according to the needs of the user terminal. In addition, the related art also requires a separate middleware management system, and current limiting data is configured on the middleware management system. At the same time, it is also necessary to consider whether the middleware management system is compatible with the server. In addition, the introduced third-party current limiting middleware and middleware management system require developers to learn the technical framework and usage methods, which increases additional learning costs and debugging costs of the middleware. In addition, the middleware generally needs to deploy one or several sets of services separately, and requires specialized personnel to maintain it, which increases the operation and maintenance costs and has the risk of improper operation.

[0027] Based on the above problems, the embodiment of the present application proposes a solution that does not require the introduction of third-party current limiting middleware and middleware management system. The task thread corresponding to each function type is stored in the cache based on the custom setting conditions. When the access request of the user terminal meets the custom setting conditions, the access request of the user terminal is restricted, and the user terminal is denied access to the server. The embodiment of the present application uses the cache of the server to manage the request access of the user terminal, without the need to introduce additional middleware and increase the additional learning cost of the developers. It not only improves the stability and access efficiency of the server, but also reduces the operation and maintenance costs and improves the security of the server.

[0028] In order to better understand a data processing method, apparatus, computer device and storage medium provided in an embodiment of the present application, an application environment applicable to an embodiment of the present application is first described below.

[0029] See also Figure 2 , Figure 2The following is a schematic diagram of an application environment of a data processing method provided by an embodiment of the present application. The data processing method provided by the embodiment of the present application can be applied to any scenario where access to a server needs to be restricted, and the method can be applied to products in these scenarios. As an example, the application scenario may include a server 100, a display device 200, and a user terminal 300. The display device 200 and the user terminal 300 communicate with the server 100, respectively. The data processing method is run on Figure 1 Taking the server 100 shown in the figure as an example, the server 100 can be connected to the user terminal 300 through a network. The network is used to provide a medium for a communication link between the server 100 and the user terminal 300. The network may include various connection types, such as a wired communication link, a wireless communication link, etc., which is not limited in the embodiment of the present application.

[0030] It should be understood that Figure 2 The server 100, display device 200 and user terminal 300 are merely illustrative. Any number of servers, networks and terminal devices may be configured as required. For example, the server 100 may be a physical server or a server cluster composed of multiple servers, and the user terminal 300 may be a mobile phone, a tablet, a desktop computer, a laptop computer, and the like. It is understood that the embodiments of the present application may also allow multiple user terminals 300 to access the server 100 at the same time.

[0031] In addition, the display device 200 can be integrated into the server 100, or can be an external display device independent of the server 100 and connected to the server 100 for communication. The display device 200 is used to receive the configuration data input by the user and output the result of the execution of the data processing method in the server. The server 100 can store the configuration data input by the user in a cache, so that the data processing method can be executed based on the cache in the server 100.

[0032] In the embodiment of the present application, the display device 200 may include a user operation interface, and the user operation interface may include a selection interface of a first interface. The first interface of the server refers to a functional interface that the server provides to the user terminal for interaction. The user may customize the preset second interface and the parameters of the setting conditions of the second interface and other related information involved in the data processing process in the first interface through the user operation interface. Among them, the preset second interface refers to a functional interface that requires access request restriction, which may also be called a current limiting functional interface. Please refer to Figure 3 , Figure 3It is a structural schematic diagram of a display device 200 provided in an embodiment of the present application. In the display device 200, the operation interface or operation options provided by the functional modules such as the second interface selection module 201, the threshold setting module 202, and the setting user identification setting module 203 can be displayed to realize the corresponding functions. The second interface selection module 201 is used to provide the user with a choice to determine the interface that needs to be restricted for access request. The threshold setting module 202 is used to provide the option to customize the parameters corresponding to each second interface. The setting user identification setting module 203 is used to provide the option to customize the user terminal authority to access the server 100. Among them, the second interface selection module 201, the threshold setting module 202, and the setting user identification setting module 203 can run in the server 100, and display the corresponding operation interface or functional component through the display device 200 during operation.

[0033] Through Figure 3 The display device 200 shown can allow the user to perform operations such as custom selection and setting on the user operation interface of the display device 200, and can also obtain information such as the specific progress of the user terminal 300 accessing the server 100 through the user operation interface.

[0034] It should be noted that Figure 2 and Figure 3 The application scenario of the data processing method shown is only an example. The application scenario of the data processing method described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. Based on the application scenario of the data processing method of the above-mentioned device, an embodiment of the data processing method is proposed. It is described in detail below with reference to the accompanying drawings.

[0035] The following is a detailed description in conjunction with the accompanying drawings. In this embodiment, the execution subject is taken as an example of the server 100. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0036] See also Figure 4 , Figure 4 4 is a flow chart of a data processing method provided in an embodiment of the present application. In an embodiment of the present application, the specific flow of the data processing method may include the following steps 401-402, which are described in detail below.

[0037] Step 401: In response to an access request of a first interface, if the first interface is a preset second interface, determine the number of task threads corresponding to the first interface in the cache and / or the number of times the task thread is called within a set time period.

[0038] In the embodiment of the present application, the first interface of the server refers to the functional interface that the server provides to the user terminal for interaction, for example, the add function interface corresponding to the add function, the delete function interface corresponding to the delete function, and the modify function interface corresponding to the modify function. Through the first interface of the server, the user terminal can communicate with the server and call the functions and services of the server. The server may include multiple first interfaces, each of which may correspond to a function type. In the embodiment of the present application, the first interface refers to the functional interface accessed by the user terminal, and the second interface refers to the functional interface set by the user in the first interface that needs to be restricted in function execution, that is, the current limiting interface. When the server receives an access request from the user terminal to the first interface of the server, it first determines whether the first interface is a preset current limiting interface. In the embodiment of the present application, each first interface may have a corresponding identifier. For example, taking the function type of modifying data as an example, the identifier of the function type of modifying data may be update / user / msg. In this way, it is possible to first preliminarily determine whether the interface corresponding to the access request is an interface with restrictions based on the setting of the first interface, thereby improving the efficiency of the user terminal's access to the server.

[0039] In an embodiment of the present application, if the first interface is a preset second interface, it means that the first interface is an interface with restrictions. Since each first interface corresponds to a function type, the server needs to get the task thread before it can execute the relevant application code. Therefore, each function type corresponding to the first interface is configured with a corresponding task thread. In an embodiment of the present application, the task thread is stored in the cache, so that it can be judged based on the relevant parameters of the task thread in the cache whether the current task thread can meet the conditions for executing the task corresponding to the access request. Among them, the relevant parameters may include but are not limited to at least one of the following: the number of task threads corresponding to the first interface and the number of times the task thread is called within a set time period. The relevant configuration information of the task thread corresponding to the function type of the second interface is stored in the cache in the server, without the need to introduce a third-party current limiting middleware, and the access request of the lightweight management server can be realized, and there will be no incompatibility between the middleware and the server, thereby improving the efficiency of access to the server.

[0040] Step 402: If the number of task threads is less than or equal to the first set threshold, and / or the number of times the task thread is called within the set time period is greater than the second set threshold, a first prompt message is returned, and the first prompt message is used to prompt the first interface not to execute the access request.

[0041] In an embodiment of the present application, parameter-related information of the task thread corresponding to each function type can be determined according to custom settings, so that the server configures the task thread of the function type corresponding to the second interface after receiving the custom parameter setting information. In one example, a first set threshold corresponding to the number of task threads can be set, and the number of times the task thread is called within a set time period is greater than a second set threshold. Among them, the first set threshold is used to perform task execution restrictions on access requests of user terminals according to the number of task threads in the cache. The second set threshold is used to perform task execution restrictions on access requests of user terminals according to the frequency of use of task threads in the cache.

[0042] Taking the number of task threads as an example, if the number of task threads stored in the cache is less than or equal to the first set threshold, it means that the number of task threads currently stored in the cache cannot respond to the access request of the user terminal. For example, assuming that the first set threshold is 0, if the current task thread is 0, it means that the function type has reached the maximum number of accesses and access requests need to be restricted. If the current task thread is not 0, it means that the function type can still be executed, and the user terminal can be allowed to access the function type of the server.

[0043] Taking the number of times the task thread is called within a set time period as an example, if the number of times the task thread stored in the cache is called within the set time is greater than the second set threshold, it means that the function type has currently reached the maximum access frequency and task execution needs to be restricted. If the number of times the current task thread is called within the set time is less than or equal to the second set threshold, it means that the function type can still execute the corresponding task. For example, assuming that the set condition for modifying data is that the maximum number of user terminals requesting to modify user data within 1 second is 10, then 10 is the second set threshold. If the task thread that modifies user data in the cache is greater than 10 times within 1 second, it is necessary to restrict the execution of the task of modifying user data.

[0044] In another example, the judgment can also be made based on the number of task threads and the frequency of use of the task threads, which is not limited here. After the server receives the parameter setting information input by the user through the user operation interface provided by the server, it determines the first set threshold and the second set threshold of the second interface, and executes the task in an asynchronous manner. It should be noted that in actual applications, the first set threshold and the second set threshold can be customized according to user needs, so as to flexibly manage the user terminal's access request to the server.

[0045] The embodiment of the present application directly controls the execution status of the task corresponding to the access request based on the task thread stored in the cache, without introducing a third-party current limiting middleware to control the execution status of the task corresponding to the access request of the second interface, thereby reducing the incompatibility of the third-party current limiting middleware and improving the stability of the server where the second interface is located.

[0046] In an embodiment of the present application, if the parameter of the task thread is greater than a first set threshold value, and / or the number of times the task thread is called within a set time period is greater than a second set threshold value, the task thread corresponding to the first interface is obtained from the cache. Then, the task corresponding to the access request is executed by the task thread. When the task is executed, the second prompt information is returned, and the task thread is stored in the cache. Among them, the second prompt information is used to prompt that the task is executed.

[0047] In an embodiment of the present application, if the parameter of the task thread is greater than the first set threshold, and / or the number of times the task thread is called within the set time period is less than or equal to the second set threshold, the task thread corresponding to the first interface is obtained from the cache, indicating that the task corresponding to the function type can be currently executed. Therefore, the server can take out any task thread corresponding to the function type from the cache, thereby executing the task corresponding to the function type. When the task is executed, the server returns the execution result to the user terminal, and at the same time, puts the taken task thread back into the cache, indicating that the task thread has been released and can be obtained by other access requests. For example, the function type corresponding to the second interface accessed by the A user terminal is to modify the data, and the task thread parameter corresponding to the current modification of the data can meet the conditions for executing the corresponding task, then the task thread for modifying the data can be taken out from the cache. The mapping of the identifier of the function type and the task thread can be established in advance in the cache, and a first interface can correspond to at least one task thread. For example, the identifier of the function type of modifying the data is update / user / msg, and the identifier can correspond to 10 task threads for modifying the data. When a task thread is taken out, the task thread parameter corresponding to the identifier is 9 task threads for modifying the data. After the server completes the task of modifying the data, the task thread is put back into the cache. For example, the task thread for modifying the data is put back into the cache. In this way, the number of task threads corresponding to the identifier of the functional type for modifying the data is 10. The embodiment of the present application manages the task threads corresponding to the functional types in the cache, takes out the task threads corresponding to the functional types when executing the tasks, and puts the task threads corresponding to the functional types back when the tasks are completed, so that other access requests can access the server in a timely manner. In this way, the access efficiency of the user terminal to the server can be improved.

[0048] Before step 401 of the embodiment of the present application, if the user identifier corresponding to the access request matches the set user identifier, the first prompt information is returned.

[0049] In the embodiment of the present application, before determining whether the first interface accessed by the user terminal is the preset second interface, the access rights of the user terminal can be determined first. In the embodiment of the present application, the access rights of the user terminal corresponding to the function type can be customized, and only the user terminal with permission is allowed to access the function type. In the embodiment of the present application, the user identifier is used to distinguish the user terminal, and the user identifier is set to a user identifier that does not have access rights. For example, if the user sets a user identifier that allows access to a certain function type, that is, a whitelist, the user identifier is set to identification information other than the user identifier on the whitelist. If the user sets a user identifier that does not allow access to a certain function type, that is, a blacklist, the user identifier is set to a user identifier on the blacklist. When the user identifier corresponding to the access request matches the set user identifier, it means that the user terminal corresponding to the current access request does not have access rights and cannot execute the corresponding task. Therefore, the server can return a first prompt message, prompting that the task corresponding to the access request cannot be executed through the current first interface.

[0050] Take any function type as an example. If the user sets a whitelist, the user ID is set to all user IDs except the user ID that is allowed to execute the task corresponding to the function type. In this way, when the user ID with permission to access initiates an access request to the function type, the access request of this part of the user ID can be allowed, and the corresponding task thread can be obtained. Otherwise, the corresponding task thread cannot be obtained. For example, only four users A, B, C, and D are allowed to modify user information, and other users are not allowed to perform it. In this way, the user IDs of the four users A, B, C, and D are stored in update / user / msg. The set user ID is other users except A, B, C, and D. If user A requests to access the task of modifying user information, the task thread corresponding to modifying user information can be obtained. If user E requests to access the task of modifying user information, there is no user ID of E in update / user / msg, and the user ID of user E matches the set user ID, then it is directly intercepted and user E is not allowed to perform the operation of modifying user information.

[0051] If the user sets a blacklist, the user ID is set to a user ID that is not allowed to execute the task corresponding to the function type. In this way, when the user ID on the blacklist is obtained to access the function type, the task execution of this part of the user ID can be prohibited. For example, if users A and B are not allowed to modify user information, the user IDs of A and B are stored in update / user / msg, and the user ID is set to include the user IDs of A and B. If user A requests access to modify user information, the user ID exists in update / user / msg, and the user ID of user A matches the set user ID, it is directly intercepted and the feedback result of the request failure is returned. If user C requests access to the task of modifying user information, the function of modifying user information can be executed.

[0052] The embodiment of the present application manages the task execution of the access request based on the matching result of the user identifier and the set user identifier, and first performs access management on the user terminal permissions. In this way, user terminals without permissions do not need to perform subsequent judgments, further improving the access efficiency of the user terminal to the server.

[0053] See also Figure 5 , Figure 5 It is a flow chart of a data processing method provided in another embodiment of the present application. In another embodiment of the present application, before step 401, the specific flow of the data processing method may also include the following steps 501-504, which are described in detail below.

[0054] Step 501: Determine a preset second interface in response to a selection instruction of a first interface.

[0055] Step 502: Determine a first set threshold and a second set threshold according to the threshold setting information of the task thread corresponding to the second interface.

[0056] Step 503: configure the task thread corresponding to the second interface based on the first set threshold and the second set threshold.

[0057] Step 504: Store the configured task thread and threshold setting information into the cache.

[0058] In an embodiment of the present application, the server may provide a user operation interface to enable the user to perform custom settings through the user operation interface. The user may select a second interface with a task execution restriction requirement according to the requirements, and set the threshold setting information for each second interface corresponding to the task thread, so that the server determines the first set threshold and the second set threshold of each second interface according to the parameter setting information, thereby configuring the task thread of the functional type corresponding to the second interface. In an embodiment of the present application, the selection instruction of the first interface refers to the instruction to select the second interface, and the server may determine the preset second interface according to the first interface selection instruction, thereby determining the first interface on which the user needs to perform task execution restrictions. The threshold setting information refers to the threshold for each second interface to perform task execution restrictions. The server stores the first interface and the configured task thread that are customized by the user in the cache, so that after receiving the access request from the user terminal in the future, the task execution restriction of the second interface is performed based on the first set threshold and the second set threshold, as well as the number of task threads or the number of times they are called. For example, the user selects the first interface for modifying the user data as the second interface, and the corresponding threshold setting information includes the current limit number of 10 and the duration of 1. It means that the number of user terminals that execute the task of modifying the user data within 1 second is at most 10. When the server determines that more than 10 user terminals have modified user data within 1 second, the task execution of the user terminal can be rejected to achieve the purpose of flow control. In this way, the embodiment of the present application can customize the user terminal access to the server without configuring an additional management system, saving costs and reducing the risk of security issues such as incompatibility.

[0059] However, if the user frequently customizes settings through the user interface in a short period of time, and the server needs a certain amount of time to respond, the server may execute useless functions, resulting in performance loss. Therefore, in an embodiment of the present application, a cache queue including threshold setting information can also be established in the cache to store the threshold setting information of the second interface. Whenever the server receives an update to the user's threshold setting information, the threshold setting information can be updated according to the updated update data, overwriting the previous threshold setting information, thereby deduplicating the threshold setting information. After the deduplication process, the cache queue only needs to distribute the latest data, and no other useless processing is required, which can reduce the performance loss of the server executing useless functions.

[0060] Before step 504 in the embodiment of the present application, the threshold setting range of the task thread corresponding to the second interface can also be determined according to the performance parameters of the second interface. The threshold setting range refers to the setting range of the task thread dynamically determined according to the performance parameters of the second interface in the current server. Within the threshold setting range, the user can make any custom settings, and the server has the ability to bear the configuration within the range. However, if the input threshold setting information exceeds the parameter setting range, it means that the current parameter setting information exceeds the tolerance range of the server, and there may be risks such as downtime, so it is necessary to generate a prompt message to prompt the user to reset.

[0061] Specifically, the performance parameters of the second interface may include but are not limited to the number of cores of the central processing unit (CPU) of the server, the utilization rate of the target CPU corresponding to the second interface, the average waiting time, the average working time, etc. Therefore, the number of task threads of the second interface is allocated by the method of the number of task threads = the number of CPU cores * the target CPU utilization rate * (1 + the average waiting time / the average working time), so as to perform the setting management of the access request restriction of the second interface. By utilizing the fluctuation of the server CPU utilization rate, the cache efficiency of the task thread can be improved, the waste of server resources can be reduced, and the access efficiency of the user terminal to the server can be improved.

[0062] The following takes the server 100 including the processor 101 and the cache 102 as an example. Figure 6 , Figure 6 1 is a schematic diagram of an application environment of a data processing method provided in a specific embodiment of the present application. In this application environment, a user can input a first interface selection instruction and threshold setting information through a user operation interface of the display device 200 to customize the task execution authority in the server 100. After receiving the user's customized setting information, the processor determines the preset second interface and threshold setting information, thereby configuring the task thread of the functional type corresponding to the second interface, and stores the configured task thread, threshold setting information, and the first set threshold and the second set threshold determined based on the threshold setting information in the cache 102. In this way, when an access request from the user terminal 300 to the first interface of the server 100 is received, the access request of the user terminal 300 is processed based on the task thread of the second interface stored in the cache 102 and the first set threshold and the second set threshold.

[0063] See also Figure 7 , Figure 7It is a flow chart of a data processing method provided by a specific embodiment of the present application. Take the server including a user management center as an example. The user management center first receives the current limiting conditions set by the user (such as ClientX and ClientY, etc.). Among them, the current limiting conditions are the above-mentioned first interface selection instructions, parameter setting information, etc. Then, the user management center publishes the task thread according to the set current limiting conditions and stores it in the cache. When an access request from a user terminal (such as Client1, Client2 and Client3, etc.) is received, a task thread is taken out from the cached task thread queue. The task thread corresponds to the functional type of the access request. Then, the task corresponding to the task thread is executed. When the task ends, the task execution result is returned to the user terminal.

[0064] Figure 8 is a timing diagram of a data processing method provided in a specific embodiment of the present application. Figure 8 In a specific embodiment, the data processing method may include steps 801-812.

[0065] 801. A processor of a server receives a first interface selection instruction and threshold setting information inputted from a user operation interface of a display device.

[0066] 802. The processor configures a Uniform Resource Locator (URL) of a second interface and a task thread of a function type corresponding to the second interface according to the first interface selection instruction and the threshold setting information.

[0067] 803. The processor distributes the task thread to the cache.

[0068] 804. The user terminal sends an access request.

[0069] 805. The processor obtains a URL in the access request of the user terminal, and determines a function type of the second interface according to the URL.

[0070] 806. The processor queries the number of task threads in the cache and the number of times they are called within a set time period.

[0071] 807. The processor determines whether the number of task threads in the cache is greater than the first set threshold, and / or whether the number of times the task thread is called within the set time period is less than or equal to the second set threshold. If so, proceed to step 808; otherwise, proceed to step 811.

[0072] 808. The processor returns true to the display device.

[0073] 809. Take out a task thread corresponding to the function type from the cache, and execute the task corresponding to the task thread.

[0074] 810. When the task execution is completed, put the task thread back into the cache.

[0075] 811. The processor returns false to the display device; and executes 812. Sending the first prompt information to the user terminal.

[0076] In the above specific embodiments, there is no need to introduce a third-party current limiting middleware. Only the processor and cache configured by the server are used to execute the data processing method of the embodiment of the present application. When the function of the task execution restriction is triggered, the second interface that needs to be restricted in task execution and the corresponding task thread are stored in the cache, which will not affect the server system, and there is no need to invest too much in targeted development. Use multi-threading to add an asynchronous task. Before the task goes online, the tester can use automated testing for full-scale testing and stress testing, add a unified verification method, and perform unified verification on the access request. If the verification passes, the required function type is accessed, otherwise the current access request is directly intercepted. It is not invasive to the original function code of the server. In this way, the stability of the server and the efficiency of user terminal access to the server can be improved.

[0077] It should be understood that, although each step in the flowcharts involved in the above-mentioned embodiments is displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0078] Based on the same inventive concept, the embodiment of the present application also provides a data processing device for implementing the data processing method involved above. The implementation scheme for solving the problem provided by the data processing device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more data processing devices provided below can refer to the limitations on the data processing method above, and the specific limitations will not be repeated here.

[0079] Fig. 9 is a structural diagram of a data processing device 900 provided in an embodiment of the present application, please refer to Fig. 9, the data processing device 900 may include a determination module 901 and a prompt module 902. The determination module 901 is used to respond to an access request of a first interface, and if the first interface is a preset second interface, determine the number of task threads corresponding to the first interface in the cache and / or the number of times the task thread is called within a set time period. The prompt module 902 is used to return a first prompt message if the number of task threads is less than or equal to a first set threshold, and / or the number of times the task thread is called within a set time period is greater than a second set threshold, and the first prompt message is used to prompt the first interface not to execute the access request.

[0080] The above-mentioned determination module 901 and prompt module 902 can respectively execute steps 401-402 in the above-mentioned method embodiment. For detailed introduction of these modules, please refer to the introduction of the corresponding steps of the above-mentioned method, which will not be repeated here.

[0081] Based on the same inventive concept, an embodiment of the present application further provides a computer device, which may be the aforementioned server, including a processor and a memory, wherein the memory stores a computer program, and the processor implements the steps of the aforementioned data processing method when executing the computer program, thereby realizing various functions, such as:

[0082] In response to an access request of the first interface, if the first interface is a preset second interface, determining the number of task threads corresponding to the first interface in the cache and / or the number of times the task thread is called within a set time period;

[0083] If the number of task threads is less than or equal to the first set threshold, and / or the number of times the task thread is called within the set time period is greater than the second set threshold, a first prompt message is returned, and the first prompt message is used to prompt the first interface not to execute the access request.

[0084] The embodiment of the present application directly controls the execution of the task corresponding to the access request based on the task thread stored in the cache, without introducing a third-party current limiting middleware to control the execution of the task corresponding to the access request of the second interface, thereby reducing the incompatibility of the third-party current limiting middleware, thereby improving the stability of the server where the second interface is located. The specific implementation of each of the above operations can be found in the previous embodiments, which will not be repeated here.

[0085] In one embodiment, the computer device is a terminal device, for example, its internal structure diagram can be as follows: Fig.10As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data processing method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0086] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0087] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0088] Since the computer program stored in the computer-readable storage medium can execute any data processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any data processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0089] Based on the same inventive concept, the embodiment of the present application further provides a computer program product or a computer program, which includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations in the above embodiments.

[0090] It should be noted that the object data (including but not limited to user device information, user personal information, etc.) and conversation data involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions. A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.

[0091] Any reference to the memory, database or other media used in the embodiments provided in the present application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (Re RAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0092] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0093] In the above-mentioned server, computer-readable storage medium, computer device, and computer program product embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process and beneficial effects of the above-mentioned server, computer-readable storage medium, computer program product, computer device, and its corresponding units can refer to the description of the data processing method in the above embodiment, and will not be repeated here.

[0094] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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.

[0095] The above is a detailed introduction to a data processing method, a server, a computer device, a computer-readable storage medium and a computer program product provided in an embodiment of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data processing method, It is characterized in that include: In response to an access request of a first interface, if the first interface is a preset second interface, determining the number of task threads corresponding to the first interface in the cache and / or the number of times the task threads are called within a set time period; If the number of the task threads is less than or equal to the first set threshold, and / or the number of times the task thread is called within the set time period is greater than the second set threshold, a first prompt message is returned, and the first prompt message is used to prompt the first interface not to execute the access request.

2. The data processing method according to claim 1, It is characterized in that Also includes: If the parameter of the task thread is greater than a first set threshold, and / or the number of times the task thread is called within a set time period is less than or equal to a second set threshold, then acquiring the task thread corresponding to the first interface from the cache; Executing the task corresponding to the access request through the task thread; When the task is completed, a second prompt message is returned and the task thread is stored in a cache, wherein the second prompt message is used to prompt that the task is completed.

3. The data processing method according to claim 1, It is characterized in that After responding to the access request of the first interface, the method further includes: If the user identifier corresponding to the access request matches the set user identifier, the first prompt information is returned.

4. The data processing method according to claim 1, It is characterized in that Also includes: In response to the selection instruction of the first interface, determining the preset second interface; Determine the first set threshold and the second set threshold according to the threshold setting information of the task thread corresponding to the second interface; configuring a task thread corresponding to the second interface based on the first set threshold and the second set threshold; The configured task thread and the threshold setting information are stored in the cache.

5. The data processing method according to claim 4, It is characterized in that Also includes: Establishing a cache queue including the threshold setting information in the cache; When update data of the threshold setting information is received, the threshold setting information is updated according to the update data.

6. The data processing method according to claim 4, It is characterized in that Before determining the first set threshold and the second set threshold according to the threshold setting information of the task thread corresponding to the second interface, the method further includes: Determine a threshold setting range of a task thread corresponding to the second interface according to the performance parameter of the second interface; If the input threshold setting information exceeds the threshold setting range, third prompt information is generated, and the third prompt information is used to prompt to reset the threshold setting information.

7. A data processing device, It is characterized in that include: a determination module, configured to respond to an access request of a first interface, and if the first interface is a preset second interface, determine the number of task threads corresponding to the first interface in the cache and / or the number of times the task threads are called within a set time period; A prompt module is used to return a first prompt message if the number of task threads is less than or equal to a first set threshold, and / or the number of times the task thread is called within the set time period is greater than a second set threshold, wherein the first prompt message is used to prompt the first interface not to execute the access request.

8. A computer device, It is characterized in that It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the data processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the data processing method according to any one of claims 1 to 6.

10. A computer program product, It is characterized in that The computer program product comprises a computer program, and the computer program is used by a processor to execute the steps of the data processing method according to any one of claims 1 to 6.