Method, device, computer equipment and storage medium for executing business processing
By analyzing client requests in the QoS service of the storage cluster and adding them to the message queue, combining the calculation of resource adequacy metric value and target duration, the blockage problem caused by insufficient bandwidth of protocol threads is solved, and the request processing efficiency is improved and message blockage is prevented.
Patent Information
- Application Number
- CN202411854709.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-04
AI Technical Summary
In the QoS service mechanism of the storage cluster, protocol threads are prone to blockage due to insufficient bandwidth, resulting in the problem of message blockage.
By parsing client requests, obtaining the request length and operation directory, determining whether network resource configuration information exists, and adding the request to the message queue of the target protocol thread. When it is detected that the target request meets the triggering condition, the resource adequacy index value is determined based on the target request length and network resource configuration information. If it is less than the threshold, the target duration is calculated, and business processing operations are performed when the timer reaches the timer.
It avoids blockage caused by protocol threads due to waiting for bandwidth resources, improves request processing efficiency, ensures reasonable allocation of network resources, and prevents message blockage.
Smart Images

Figure CN119766729A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network service technology, and in particular to a method, device, computer equipment and storage medium for executing business processing. Background Art
[0002] In the field of network service technology, Quality of Service (QoS) can be used to optimize network performance and resource allocation to meet the requirements of different business scenarios for performance indicators such as bandwidth, delay, packet loss rate and jitter.
[0003] In the existing QoS service mechanism of the storage cluster, synchronous processing is generally used. The client sends a request to the server. When the server receives a request, it parses the request through the corresponding protocol thread, obtains the QoS configuration parameters, and determines whether the bandwidth resources are sufficient based on the QoS configuration parameters. If the bandwidth is sufficient after the check is completed, the business processing will be carried out directly. If the bandwidth is insufficient, it is necessary to wait until the bandwidth is sufficient before processing the business. After completing the business processing of the request, the QoS check of the next request can be started.
[0004] In the case of insufficient bandwidth in the above QoS inspection process, message congestion may occur. Summary of the invention
[0005] In view of this, the present invention provides a method, apparatus, computer equipment, storage medium and program product for executing business processing to solve the problem of protocol thread blocking.
[0006] In a first aspect, the present invention provides a method for performing business processing, the method comprising:
[0007] When receiving a request sent by a client, the request is parsed to obtain the request length and operation directory;
[0008] According to the operation catalog, determining whether there is network resource configuration information corresponding to the operation catalog;
[0009] When it is determined that there is network resource configuration information corresponding to the operation directory, adding the request to a message queue corresponding to a target protocol thread, wherein the target protocol thread is a protocol thread that matches an access protocol of the client;
[0010] When it is detected that the target request in the message queue meets the trigger condition, determining the resource sufficiency index value according to the target request length corresponding to the target request and the target network resource configuration information;
[0011] When it is determined that the resource sufficiency index value is less than a preset threshold, determining a target duration according to the resource sufficiency index value and the target network resource configuration information;
[0012] When the timing duration reaches the target duration, the business processing operation corresponding to the target request is executed.
[0013] The method for executing business processing provided by the present invention has the following advantages:
[0014] After receiving the request sent by the client, this solution first parses the request to obtain the request length and operation directory, and then determines whether the operation directory is set with network resource configuration information based on the operation directory, and adds the request to the message queue when it is determined that the operation directory is set with network resource configuration information. In this way, at least one request that requires a network check operation will be stored in the message queue. For any request, taking the target request as an example, when it is detected that it meets the trigger condition, it can be determined whether the bandwidth resources of the current target operation directory are sufficient based on the target request length and the target network resource configuration information. If it is not sufficient, the target duration is calculated, and when the timing duration reaches the target duration, the business processing operation is performed. In this way, in the process of timing the request, other requests can continue to be received and processed, and the problem of message congestion can be avoided.
[0015] In an optional implementation, the target network resource configuration information includes a bandwidth threshold of the target operation directory and a preset request processing duration; the trigger condition includes: when the message queue includes only the target request, or when the message queue also includes other requests in addition to the target request, when the business processing of the previous request arranged before the target request in the message queue is completed, or when the resource sufficiency index value of the previous request is calculated;
[0016] When it is detected that the target request in the message queue meets the trigger condition, determining the resource sufficiency index value according to the target request length corresponding to the target request and the target network resource configuration information, including:
[0017] Obtaining the real-time occupied bandwidth of the target operation directory;
[0018] Determining the real-time remaining bandwidth of the target operation directory according to the real-time occupied bandwidth and the bandwidth threshold;
[0019] Determining a target bandwidth required to process the target request according to the request processing time and the target request length;
[0020] The resource sufficiency index value is determined according to the real-time remaining bandwidth and the target bandwidth.
[0021] Specifically, by setting the bandwidth threshold, it can be ensured that the operation directory will not exhaust all available bandwidth due to a single request, and it can also prevent a client from over-occupying network resources, thereby causing network congestion. Based on the bandwidth information of the target operation directory and the target request length, it can be determined whether the bandwidth resources of the current target operation directory are sufficient for the bandwidth resources of the target request, so that the server can process the request accordingly based on the judgment result, rather than waiting for sufficient bandwidth resources before processing. This can improve the request processing efficiency and avoid the problem of message congestion.
[0022] In an optional embodiment, the method further includes:
[0023] When it is determined that the resource sufficiency index value is greater than or equal to the preset threshold, the service processing operation corresponding to the target request is directly executed.
[0024] Specifically, when it is determined that the resource sufficiency index value is greater than or equal to a preset threshold, it can be considered that the current bandwidth resources of the target operation directory are sufficient to execute the business processing operation of the target request. At this time, the business processing operation can be performed directly to free up the bandwidth resources of the target operation directory occupied by the target request in time, thereby improving the request response speed.
[0025] In an optional implementation, when it is determined that there is no network resource configuration information corresponding to the operation directory, the method further includes:
[0026] Directly execute the business processing operation corresponding to the request.
[0027] Specifically, when it is determined that there is no network resource configuration information corresponding to the operation directory, it means that the operation directory has no bandwidth resource restrictions and may be a request with high timeliness. At this time, the business processing operation can be directly executed according to the request, which meets the special needs of the client.
[0028] In an optional implementation, when it is determined that the resource sufficiency index value is less than a preset threshold, using a target timing thread corresponding to the target protocol thread to determine a target duration according to the resource sufficiency index value and the target network resource configuration information, including:
[0029] The target duration is determined as a ratio of the resource sufficiency index value to the bandwidth threshold.
[0030] Specifically, by taking the ratio of the resource sufficiency index value (reflecting the current bandwidth usage) to the bandwidth threshold (i.e. the configured maximum allowed bandwidth) as the target duration, the waiting time can be adjusted dynamically. This means that the server can decide how long the request needs to wait before it can be processed based on the actual load of the current network. This dynamic adjustment makes the waiting time more reasonable and avoids the waste of resources or excessive waiting that may be caused by a fixed waiting time.
[0031] In an optional implementation, when it is detected that the target request in the message queue meets the trigger condition, the method further includes:
[0032] According to the target request, the target network resource configuration information is locked.
[0033] Specifically, the locking mechanism ensures that the target network resource configuration information will not be modified by other threads or processes during the processing of the target request, which ensures the consistency and integrity of the data and prevents data conflicts caused by concurrent operations.
[0034] In an optional implementation, when the timing duration reaches the target duration, the method further includes:
[0035] Re-determining the real-time remaining bandwidth of the target operation directory;
[0036] Re-determining the resource sufficiency index value according to the re-determined real-time remaining bandwidth and the target bandwidth;
[0037] When the re-determined resource sufficiency index value is greater than or equal to the preset threshold, the business processing operation corresponding to the target request is executed.
[0038] Specifically, by recalculating the resource sufficiency index value after the waiting time is over, it can be ensured that sufficient resources are still available when the request is actually processed. This is because the resource status of the network or storage system may change during the waiting period, and recalculation can reflect the latest resource status in a timely manner.
[0039] In a second aspect, the present invention provides a device for performing business processing, the device comprising:
[0040] The acquisition module is used to parse the request sent by the client and obtain the request length and operation directory when receiving the request;
[0041] A determination module, used to determine whether there is network resource configuration information corresponding to the operation catalog according to the operation catalog;
[0042] an adding module, configured to add the request to a message queue corresponding to a target protocol thread when it is determined that there is network resource configuration information corresponding to the operation directory, wherein the target protocol thread is a protocol thread that matches an access protocol of the client;
[0043] The determination module is further configured to determine a resource sufficiency index value according to a target request length and target network resource configuration information corresponding to the target request when it is detected that the target request in the message queue meets a trigger condition; and determine a target duration according to the resource sufficiency index value and the target network resource configuration information when it is determined that the resource sufficiency index value is less than a preset threshold;
[0044] The execution module is used to execute the business processing operation corresponding to the target request when the timing duration reaches the target duration.
[0045] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the method for executing business processing of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0046] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for executing business processing of the above-mentioned first aspect or any corresponding embodiment thereof.
[0047] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for executing business processing according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 is a schematic diagram of a system architecture according to an embodiment of the present invention;
[0050] Figure 2 is a flow chart of a method for executing business processing according to an embodiment of the present invention;
[0051] Figure 3is a flowchart of another method for executing business processing according to an embodiment of the present invention;
[0052] Figure 4 is a structural block diagram of an apparatus for executing business processing according to an embodiment of the present invention;
[0053] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0055] The method for executing business processing provided by the embodiment of the present invention can be applied to a system composed of a client and a server, such as Figure 1 As shown. The client can be a terminal such as a computer or a mobile phone. The server can be a cluster consisting of one or more servers. The server can include at least one protocol thread, at least one timing thread, and a return thread. A protocol thread is used to process a request for a specific access protocol. A protocol thread can correspond to a timing thread. The timing thread is used to time, and when the timing time reaches a certain time, the request is sent to the return thread. The return thread is used to return the request processed by the timing thread to the corresponding protocol thread.
[0056] The embodiment of the present invention provides a method for executing business processing. For requests that cannot be processed in time, timing is performed first, and when the timing time reaches a certain time, subsequent business processing is performed to avoid the problem of message congestion.
[0057] According to an embodiment of the present invention, a method embodiment for performing business processing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0058] In this embodiment, a method for executing business processing is provided, which can be executed by the above-mentioned server. Figure 2 is a flowchart of a method for executing business processing according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0059] Step S201, when a request sent by a client is received, the request is parsed to obtain the request length and operation directory.
[0060] Specifically, when any user performs a business operation on the client, the client can generate a request based on the user's operation and send it to the server. The server calls the target protocol thread that matches the client's access protocol to parse the request and obtain multiple inspection parameters for network inspection operations. Among them, the multiple inspection parameters may include multiple of the request length, operation directory, operation type, data, operation information, etc. The request length is used to indicate the length of the data that needs to be transmitted by the request. The operation directory usually refers to the specific file system path for the user or application to perform read and write operations, which can be one of the directories for storing database files, shared directories for storing user files, directories for storing log files, etc. The operation type can include a read operation or a write operation. The operation information can be used to indicate the specific location of the data in the operation directory.
[0061] Step S202: Determine, based on the operation catalog, whether there is network resource configuration information corresponding to the operation catalog.
[0062] The network resource configuration information may include multiple parameters for limiting the network resources of the operation directory. For example, the bandwidth threshold of the operation directory, the response time threshold, the preset request processing time, etc. The request processing time in different time periods may be different to adapt to the real-time status of the overall load of the server. For example, the network resource configuration information may be a Quality of Service (QoS) configuration domain.
[0063] Specifically, in order to effectively manage network resources, some operation directories of the server can be set with network resource configuration information. Therefore, after parsing out multiple inspection parameters for network inspection operations, the server can use the target protocol thread to determine whether the operation directory is set with corresponding network resource configuration information according to the operation directory. If yes, it means that the request for business operation of the operation directory needs to perform a network inspection operation. If not, it means that the request for business operation of the operation directory does not need to perform a network inspection operation, and the business processing operation can be performed directly.
[0064] Step S203: When it is determined that there is network resource configuration information corresponding to the operation directory, the request is added to the message queue corresponding to the target protocol thread.
[0065] Specifically, since multiple requests for business operations for each operation directory may be received continuously, and a protocol thread can only perform a network check operation or a business processing operation on one request at a time. Therefore, each protocol thread can be provided with a message queue for storing requests that have not yet been subjected to a network check. When it is determined that the operation directory is provided with corresponding network resource configuration information, the server can add the request to the message queue corresponding to the target protocol thread.
[0066] After adding the request to the message queue corresponding to the target protocol thread, the server can further confirm whether there are other requests in the message queue except the request. If not, the server can directly perform a network check operation on the request. If so, the server can wait until the previous request corresponding to the request in the message queue is processed before performing a network check operation.
[0067] In some optional implementations, when it is determined that there is no network resource configuration information corresponding to the operation catalog, the business processing operation corresponding to the request is directly executed.
[0068] Specifically, when the operation type includes a read operation, the server can perform a read operation according to the operation information in the target request through the target protocol thread. Alternatively, when the operation type includes a write operation, the server can perform a write operation according to the operation type, operation information and data in the target request.
[0069] Step S204: when it is detected that the target request in the message queue meets the trigger condition, a resource sufficiency index value is determined according to the target request length corresponding to the target request and the target network resource configuration information.
[0070] Among them, the trigger conditions may include: when the message queue only includes the target request, or when the message queue also includes other requests besides the target request, when the business processing of the previous request arranged before the target request in the message queue is completed, or, the resource sufficiency index value of the previous request is calculated (or, the resource sufficiency index value of the previous request may be calculated).
[0071] Specifically, when the server detects that the target request in the message queue meets the trigger condition, it can start to perform a network check operation on the target request. The specific network check operation can be as follows:
[0072] Step 1: Obtain the real-time occupied bandwidth of the target operation directory.
[0073] Step 2: Determine the real-time remaining bandwidth of the target operation directory according to the real-time occupied bandwidth and the bandwidth threshold.
[0074] Step three: determine the resource sufficiency index value based on the real-time remaining bandwidth, request processing time and request length.
[0075] Step 1: Determine the target bandwidth required to process the target request based on the request processing time and the target request length.
[0076] Step 2: Determine the resource sufficiency index value according to the real-time remaining bandwidth and the target bandwidth.
[0077] Specifically, the server may first obtain the real-time occupied bandwidth of the target operation directory corresponding to the target request, and determine the difference between the bandwidth threshold and the real-time occupied bandwidth as the real-time remaining bandwidth. Then, the ratio of the target request length to the request processing time is determined as the target bandwidth. Finally, the difference between the real-time remaining bandwidth and the target bandwidth is determined as the resource sufficiency index value.
[0078] In some optional implementations, when it is detected that the target request in the message queue meets the trigger condition, the server can first lock the target network resource configuration information according to the target request to ensure that only one request is checked on the network at the same time, avoiding inaccurate calculation of real-time occupied bandwidth.
[0079] In some optional implementations, different operations processed by the protocol thread can be set with priorities, that is, the priority of the business processing operation is greater than the priority of the resolution request, and the priority of the resolution request is greater than the priority of the network inspection operation. In this way, after the protocol thread has parsed the first request, if a second request sent by the return thread is received, the business processing operation can be performed preferentially according to the received second request. At this time, the first request will be placed in the message queue. After the business processing operation is completed on the second request, if a new third request is received, the third request can be parsed using the protocol thread first, so that after the third request is added to the message queue, the message queue includes multiple requests, namely the first request and the third request. Since the network resource configuration information of the operation directory is still occupied by the first request, it is necessary to complete the network inspection operation on the first request before performing the network inspection operation on the third request.
[0080] Step S205: When it is determined that the resource sufficiency index value is less than the preset threshold, a target duration is determined according to the resource sufficiency index value and target network resource configuration information.
[0081] The preset threshold may be 0.
[0082] Specifically, after determining the resource sufficiency index value, the server can determine how to perform subsequent operations according to the relationship between the resource sufficiency index value and the preset threshold value. The specific processing can be as follows:
[0083] When it is determined that the resource sufficiency index value is less than the preset threshold, it means that the bandwidth resources of the current target operation directory are insufficient to process the target request, and it is necessary to wait for the bandwidth resources of the target operation directory to be released before processing. If you wait for the release of bandwidth resources directly in the target protocol thread, it will cause the target protocol thread to be blocked. In order to solve this problem, at this time, the server can determine the ratio of the resource sufficiency index value and the bandwidth threshold as the target duration, and send the resource sufficiency index value to the target timing thread through the target protocol thread. In this way, the server can determine that the next request after the target request meets the trigger condition. At this time, the target protocol thread can be used to continue to perform network checks on the requests after the target request in the message queue.
[0084] When it is determined that the resource sufficiency index value is greater than or equal to the preset threshold, it means that the network resources of the current target operation directory are sufficient. At this time, the server can directly execute the business processing operation corresponding to the target request through the target protocol thread. After executing the business processing operation of the target business, the server can also determine that the next request after the target request meets the trigger condition. At this time, the network check can be performed on the request after the target request.
[0085] Step S206: When the timing duration reaches the target duration, the business processing operation corresponding to the target request is executed.
[0086] Specifically, the server can use the target timing thread to perform timing. When the timing duration reaches the target duration, the target request is sent to the return thread. The return thread obtains the corresponding return method according to the access protocol of the target request, and sends the target request to the target protocol thread according to the corresponding return method. The server can use the target protocol thread to perform subsequent business processing operations on the target request (refer to the specific processing in step S203).
[0087] In some optional implementations, when the timing duration reaches the target duration, the server uses the timing thread to re-perform the network check operation, and the specific processing may be:
[0088] Step 1: Re-determine the real-time remaining bandwidth of the target operation directory.
[0089] Step 2: Re-determine the resource sufficiency index value according to the re-determined real-time remaining bandwidth and target bandwidth.
[0090] Step three: when the re-determined resource sufficiency index value is greater than or equal to the preset threshold, the target request is sent to the target protocol thread by using the return thread.
[0091] The specific processing of steps 1 to 3 can refer to the specific processing of step S204 above, which will not be repeated here.
[0092] In some optional implementations, the server may further include at least one monitoring thread. During the timing process of the server, the target monitoring thread (the monitoring thread corresponding to the target protocol thread) may periodically calculate the resource sufficiency index value according to the specific processing of step S204. When it is determined in any cycle that the resource sufficiency index value is greater than a preset threshold, the server may immediately stop the timing operation of the target timing thread, send the target request to the return thread, and use the return thread to send the target request to the target protocol thread to perform the business processing operation corresponding to the target request. In this way, the processing speed of the target request can be accelerated.
[0093] The method for executing business processing provided by this embodiment, after receiving the request sent by the client, first parses the request to obtain the request length and the operation directory, and then can determine whether the operation directory is set with network resource configuration information according to the operation directory, and in the case of determining that the operation directory is set with network resource configuration information, add the request to the message queue. In this way, at least one request that needs to perform a network check operation will be stored in the message queue. For any request, taking the target request as an example, when it is detected that it meets the trigger condition, it can be determined whether the bandwidth resources of the current target operation directory are sufficient according to the target request length and the target network resource configuration information. If it is not sufficient, the request will be handed over to the target timing thread for processing, so that the target protocol thread can be vacated to continue to process other requests. In addition, the target timing thread is used to calculate the target duration, and when the timing duration reaches the target duration, the target protocol thread is called back to perform business processing operations. In this way, in the process of timing the request, the protocol thread can continue to process operations related to other requests, which can avoid the problem of message congestion in the protocol thread.
[0094] The method for executing business processing described above is described below with a specific example.
[0095] The server can provide a variety of functional services, including read-write services and quality of service (QoS) services. The above-mentioned method of executing business processing can be implemented by the cooperation between the read-write service and the QoS service of the server. The software implementing the QoS service can be composed of multiple components such as a QoS configuration finder, a QoS queuer, a QoS generation timer, and a QoS timer eventer, each of which is used to implement a sub-function of the QoS service.
[0096] like Figure 3As shown, the target protocol thread parses the target request, obtains the target request length, the target operation directory, the target operation type, and transmits it to the QoS checker. The QoS finder can determine whether there is network resource configuration information corresponding to the target operation directory based on the target operation directory. If not, the QoS service can be exited and the read-write service can be entered. If yes, the target request and the network resource configuration information can be transmitted to the QoS queuer. The QoS queuer adds the target request to the message queue corresponding to the target protocol thread, and determines whether there are other requests in the message queue. If not, the target request can be locked and a network check operation can be performed. If yes, it can wait for processing. In the process of performing the network check operation, the QoS generation timer can calculate the resource sufficiency index value according to the specific processing in the above step S204. When the resource sufficiency index value is greater than or equal to the preset threshold, the QoS service can be exited and the read-write service can be performed. When the resource sufficiency index value is less than the preset threshold, the QoS timer event can calculate the target duration according to the specific processing in the above step S204, and use its own Timer component to count, and when the counted duration reaches the target duration, the target request is transmitted to the return thread. The return thread can return the target request to the target protocol thread corresponding to the access protocol according to the access protocol corresponding to the target request, and the target protocol thread performs subsequent read and write processing according to the target operation type.
[0097] In the present embodiment, a device for performing business processing is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0098] This embodiment provides a device for performing business processing, such as Figure 4 As shown, including:
[0099] The acquisition module 401 is used to parse the request and obtain the request length and operation directory when receiving the request sent by the client;
[0100] A determination module 402 is used to determine whether there is network resource configuration information corresponding to the operation catalog according to the operation catalog;
[0101] An adding module 403, configured to add the request to a message queue corresponding to a target protocol thread when it is determined that there is network resource configuration information corresponding to the operation directory, wherein the target protocol thread is a protocol thread that matches the access protocol of the client;
[0102] The determination module 402 is further configured to determine a resource sufficiency index value according to a target request length corresponding to the target request and target network resource configuration information when it is detected that the target request in the message queue meets the trigger condition; and determine a target duration according to the resource sufficiency index value and the target network resource configuration information when it is determined that the resource sufficiency index value is less than a preset threshold;
[0103] The execution module 404 is used to execute the business processing operation corresponding to the target request when the timing duration reaches the target duration.
[0104] In some optional implementations, the target network resource configuration information includes a bandwidth threshold of a target operation directory and a preset request processing duration; the triggering condition includes: when only the target request is included in the message queue, or when other requests other than the target request are included in the message queue, when the business processing of the previous request arranged before the target request in the message queue is completed, or when the resource sufficiency index value of the previous request is calculated;
[0105] The determination module 402 is specifically configured to:
[0106] Get the real-time occupied bandwidth of the target operation directory;
[0107] Determine the real-time remaining bandwidth of the target operation directory based on the real-time occupied bandwidth and bandwidth threshold;
[0108] Determine the target bandwidth required to process the target request based on the request processing time and the target request length;
[0109] The resource adequacy index value is determined based on the real-time remaining bandwidth and the target bandwidth.
[0110] In some optional implementations, the execution module 404 is further configured to:
[0111] When it is determined that the resource sufficiency index value is greater than or equal to the preset threshold, the business processing operation corresponding to the target request is directly executed.
[0112] In some optional implementations, the execution module 404 is further configured to:
[0113] When it is determined that there is no network resource configuration information corresponding to the operation catalog, the service processing operation corresponding to the request is directly executed.
[0114] In some optional implementations, the determination module 402 is specifically configured to:
[0115] The ratio of the resource sufficiency index value to the bandwidth threshold is determined as the target duration.
[0116] In some optional implementations, the device further includes a locking module 405, and the locking module 405 is used to:
[0117] When it is detected that the target request in the message queue meets the trigger condition, the target network resource configuration information is locked according to the target request.
[0118] In some optional implementations, the determination module 402 is further configured to:
[0119] When the timing duration reaches the target duration, the real-time remaining bandwidth of the target operation directory is re-determined;
[0120] Re-determine the resource sufficiency index value according to the re-determined real-time remaining bandwidth and target bandwidth;
[0121] When the re-determined resource sufficiency index value is greater than or equal to the preset threshold, the business processing operation corresponding to the target request is executed.
[0122] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0123] The device for performing business processing in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0124] The embodiment of the present invention also provides a computer device having the above Figure 4 The device shown performs business processing.
[0125] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0126] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware integrated circuit. The hardware integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable logic gate array, a general purpose array logic or any combination thereof.
[0127] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0128] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0129] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0130] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0131] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0132] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0133] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for executing business processing, characterized in that: The method comprises: When receiving a request sent by a client, the request is parsed to obtain the request length and operation directory; According to the operation catalog, determining whether there is network resource configuration information corresponding to the operation catalog; When it is determined that there is network resource configuration information corresponding to the operation directory, adding the request to a message queue corresponding to a target protocol thread, wherein the target protocol thread is a protocol thread that matches an access protocol of the client; When it is detected that the target request in the message queue meets the trigger condition, determining the resource sufficiency index value according to the target request length corresponding to the target request and the target network resource configuration information; When it is determined that the resource sufficiency index value is less than a preset threshold, determining a target duration according to the resource sufficiency index value and the target network resource configuration information; When the timing duration reaches the target duration, the business processing operation corresponding to the target request is executed.
2. The method according to claim 1, characterized in that: The target network resource configuration information includes the bandwidth threshold of the target operation directory and the preset request processing time; the trigger condition includes: when the message queue only includes the target request, or when the message queue also includes other requests except the target request, when the business processing of the previous request arranged before the target request in the message queue is completed, or when the resource sufficiency index value of the previous request is calculated; When it is detected that the target request in the message queue meets the trigger condition, determining the resource sufficiency index value according to the target request length corresponding to the target request and the target network resource configuration information, including: Obtaining the real-time occupied bandwidth of the target operation directory; Determining the real-time remaining bandwidth of the target operation directory according to the real-time occupied bandwidth and the bandwidth threshold; Determining a target bandwidth required to process the target request according to the request processing time and the target request length; The resource sufficiency index value is determined according to the real-time remaining bandwidth and the target bandwidth.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: When it is determined that the resource sufficiency index value is greater than or equal to the preset threshold, the service processing operation corresponding to the target request is directly executed.
4. The method according to claim 1 or 2, characterized in that: When it is determined that there is no network resource configuration information corresponding to the operation directory, the method further includes: Directly execute the business processing operation corresponding to the request.
5. The method according to claim 2, characterized in that: When it is determined that the resource sufficiency index value is less than a preset threshold, using a target timing thread corresponding to the target protocol thread, and determining a target duration according to the resource sufficiency index value and the target network resource configuration information, comprises: The target duration is determined as a ratio of the resource sufficiency index value to the bandwidth threshold.
6. The method according to claim 1 or 2, characterized in that: When it is detected that the target request in the message queue meets the trigger condition, the method further includes: According to the target request, the target network resource configuration information is locked.
7. The method according to claim 2, characterized in that: When the timing duration reaches the target duration, the method further includes: Re-determining the real-time remaining bandwidth of the target operation directory; Re-determining the resource sufficiency index value according to the re-determined real-time remaining bandwidth and the target bandwidth; When the re-determined resource sufficiency index value is greater than or equal to the preset threshold, the business processing operation corresponding to the target request is executed.
8. A device for executing business processing, characterized in that: The device comprises: The acquisition module is used to parse the request sent by the client and obtain the request length and operation directory when receiving the request; A determination module, used to determine whether there is network resource configuration information corresponding to the operation catalog according to the operation catalog; an adding module, configured to add the request to a message queue corresponding to a target protocol thread when it is determined that there is network resource configuration information corresponding to the operation directory, wherein the target protocol thread is a protocol thread that matches an access protocol of the client; The determination module is further configured to determine a resource sufficiency index value according to a target request length and target network resource configuration information corresponding to the target request when it is detected that the target request in the message queue meets a trigger condition; and determine a target duration according to the resource sufficiency index value and the target network resource configuration information when it is determined that the resource sufficiency index value is less than a preset threshold; The execution module is used to execute the business processing operation corresponding to the target request when the timing duration reaches the target duration.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for executing business processing according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for executing business processing according to any one of claims 1 to 7.