Method for determining target execution frequency of workflow task
By determining the target execution frequency of the workflow task in argoworkflow and dynamically adjusting the current limit frequency, the pressure problem of argoworkflow on the kubernetes cluster API-server is solved, and refined current limiting for different resources and request types is achieved, improving cluster stability.
Patent Information
- Application Number
- CN202411856123.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, tasks running on argoworkflow put too much pressure on the API-server components in the kubernetes cluster, resulting in the impact of cluster stability, and the current limit configuration cannot be dynamically adjusted, and the stream limiting limit cannot be carried out for different resource types and request types.
It provides a method to determine the target execution frequency of a workflow task. By receiving a workflow task request, obtaining the task type and current execution frequency, recalling the current limiting frequency from the policy service according to the preset frequency, determining whether to execute the task, and dynamically adjusting the target execution frequency.
Dynamic current limiting of argoworkflow requests is realized, which can fine-tune current limiting for different resource types and request types, improve the stability of the kubernetes cluster, and adjust the current limiting frequency without restarting the program.
Smart Images

Figure CN119806732A_ABST
Abstract
Description
Technical Field
[0001] The disclosed embodiments relate to the technical field of workflow engines, and in particular to a method for determining a target execution frequency of a workflow task. Background Art
[0002] Argo Workflow is a cloud-native workflow engine that performs task orchestration based on Kubernetes. When there are a large number of tasks running on Argo Workflow, it will put a lot of pressure on the API-server component in the Kubernetes cluster. The API-server is a very important component in the Kubernetes cluster. Excessive pressure on the API-server will affect the stability of the Kubernetes cluster. In order to ensure the stability of the Kubernetes cluster, it is necessary to limit the requests in Argo Workflow. The basic concept of current limiting is to limit the frequency of API requests to prevent the API-server from being overwhelmed by too many requests.
[0003] Currently, there is a default rate limiter for the api-server, which uniformly limits the rate of all api-server requests. The qps configuration of the rate limit is specified at startup and cannot be dynamically adjusted during operation.
[0004] Therefore, there is an urgent need for a method to determine the target execution frequency of workflow tasks, which can dynamically modify the flow limiting rate, perform refined flow limiting for different resource types and request types, and achieve the purpose of releasing certain request types. Summary of the invention
[0005] In order to solve the above technical problem or at least partially solve the above technical problem, an embodiment of the present disclosure provides a method for determining a target execution frequency of a workflow task.
[0006] A first aspect of an embodiment of the present disclosure provides a method for determining a target execution frequency of a workflow task, which is applied to a workflow engine. The method includes:
[0007] Receive a workflow task request, and obtain the task type of the workflow task and the current execution frequency of the workflow task in the workflow task request; wherein the workflow task request is initiated by a user or is set at a fixed time;
[0008] According to the task type of the workflow task, a current limiting frequency associated with the task type is retrieved from a policy service at a preset frequency; the current limiting frequency is used to represent a request frequency of sending the workflow task request to an application program interface server;
[0009] Determining whether to execute the workflow task according to the current limiting frequency;
[0010] If so, the target execution frequency of the workflow task is determined according to the current limiting frequency and the current execution frequency of the workflow task.
[0011] In one example, before calling the current limiting frequency associated with the task type from the policy service at a preset frequency, the method further includes:
[0012] If the task type of the workflow task is the first service type, calling a first program file; wherein the first program file is in a corresponding relationship with the first service type;
[0013] If the task type of the workflow task is the second service type, a second program file is retrieved; wherein the second program file is in a corresponding relationship with the second service type.
[0014] In one example, if the task type of the workflow task is a first service type, calling a first program file, and calling a current limiting frequency associated with the task type from a policy service according to a preset frequency includes:
[0015] Based on the first program file, obtaining a first resource type and a first request type of the workflow task; wherein the first request type, the first resource type and the first service type have a hierarchical relationship;
[0016] The current limiting frequency associated with the first request type is retrieved from the policy service at a preset frequency.
[0017] In one example, the current limiting frequency changes in real time or is fixed.
[0018] In one example, determining whether to execute the workflow task according to the current limiting frequency includes:
[0019] If the current limiting frequency is 0, it is determined that the workflow task is not executed;
[0020] If the current limiting frequency is non-zero, it is determined to execute the workflow task.
[0021] In one example, determining the target execution frequency of the workflow task according to the current limiting frequency and the current execution frequency of the workflow task includes:
[0022] If the current limiting frequency is the same as the current execution frequency of the workflow task, determining the target execution frequency to be the current execution frequency;
[0023] If the current limiting frequency is different from the current execution frequency of the workflow task, the target execution frequency is determined to be the current limiting frequency.
[0024] In one example, after determining the target execution frequency of the workflow task, the method further includes:
[0025] Sending the workflow task request to the application program interface server according to the target execution frequency;
[0026] The workflow task is executed in the application program interface server.
[0027] A second aspect of an embodiment of the present disclosure provides a device for determining a target execution frequency of a workflow task, which is applied to a workflow engine, and the device includes:
[0028] A receiving module, used to receive a workflow task request, and obtain the task type of the workflow task and the current execution frequency of the workflow task in the workflow task request; wherein the workflow task request is initiated by a user or is set at a fixed time;
[0029] A first calling module is used to call a current limiting frequency associated with the task type from a policy service according to a preset frequency according to the task type of the workflow task; the current limiting frequency is used to represent the request frequency of sending the workflow task request to the application program interface server;
[0030] A first determination module, used to determine whether to execute the workflow task according to the current limiting frequency;
[0031] The second determining module is configured to determine, if yes, a target execution frequency of the workflow task according to the current limiting frequency and the current execution frequency of the workflow task.
[0032] In one example, the apparatus further comprises:
[0033] A second calling module, configured to call a first program file if the task type of the workflow task is a first service type; wherein the first program file corresponds to the first service type;
[0034] The third calling module is used to call a second program file if the task type of the workflow task is a second service type; wherein the second program file is in a corresponding relationship with the second service type.
[0035] In one example, if the task type of the workflow task is a first service type, a first program file is retrieved, and the first retrieval module includes:
[0036] An acquisition submodule, configured to acquire a first resource type and a first request type of the workflow task based on the first program file; wherein the first request type, the first resource type and the first service type have a hierarchical relationship;
[0037] The retrieving submodule is used to retrieve the current limiting frequency associated with the first request type from the policy service according to a preset frequency.
[0038] In one example, the current limiting frequency changes in real time or is fixed.
[0039] In one example, the first determining module includes:
[0040] A first determination submodule, configured to determine not to execute the workflow task if the current limiting frequency is 0;
[0041] The second determining submodule is used to determine to execute the workflow task if the current limiting frequency is non-zero.
[0042] In one example, the second determining module includes:
[0043] A third determination submodule, configured to determine the target execution frequency to be the current execution frequency if the current limiting frequency is the same as the current execution frequency of the workflow task;
[0044] The fourth determining submodule is configured to determine that the target execution frequency is the current limiting frequency if the current limiting frequency is different from the current execution frequency of the workflow task.
[0045] In one example, the apparatus further comprises:
[0046] A sending module, used for sending the workflow task request to the application program interface server according to the target execution frequency;
[0047] An execution module is used to execute the workflow task in the application program interface server.
[0048] A third aspect of an embodiment of the present disclosure provides an electronic device, comprising: a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method of the first aspect above.
[0049] A fourth aspect of an embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect described above can be implemented.
[0050] The disclosed embodiment provides a method for determining the target execution frequency of a workflow task, which is applied to a workflow engine, and the method includes: receiving a workflow task request, and obtaining the task type of the workflow task in the workflow task request and the current execution frequency of the workflow task; wherein the workflow task request is initiated by a user or is set at a fixed time; according to the task type of the workflow task, the flow limiting frequency associated with the task type is retrieved from the policy service at a preset frequency; the flow limiting frequency is used to characterize the request frequency of sending the workflow task request to the application program interface server; according to the flow limiting frequency, determine whether to execute the workflow task; if so, determine the target execution frequency of the workflow task according to the flow limiting frequency and the current execution frequency of the workflow task. By adopting this technical solution, the flow limiting rate can be dynamically modified, and refined flow limiting can be performed for different resource types and request types, and the purpose of releasing certain request types can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0053] Figure 1 It is a flowchart of a method for determining a target execution frequency of a workflow task provided by an embodiment of the present disclosure;
[0054] Figure 2 It is a flowchart of a method for determining a target execution frequency of a workflow task provided by an embodiment of the present disclosure;
[0055] Figure 3a is a schematic diagram of a current limiting frequency determination process provided by an embodiment of the present disclosure;
[0056] Figure 3b is a schematic diagram of another current limiting frequency determination process provided by an embodiment of the present disclosure;
[0057] Figure 3c is a schematic diagram of executing a workflow task provided by an embodiment of the present disclosure;
[0058] Figure 4 It is a structural schematic diagram of a device for determining a target execution frequency of a workflow task provided by an embodiment of the present disclosure;
[0059] Figure 5 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0060] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0061] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0062] Figure 1 The present invention provides a flowchart of a method for determining a target execution frequency of a workflow task, which is applied to a workflow engine and can be executed by an electronic device. The electronic device can be exemplarily understood as a device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, etc. Figure 1 As shown, the method provided in this embodiment includes the following steps:
[0063] S101. Receive a workflow task request, and obtain the task type of the workflow task and the current execution frequency of the workflow task in the workflow task request; wherein the workflow task request is initiated by a user or is set at a fixed time.
[0064] In one example, a workflow task request is initiated by a user or is set to be scheduled. If it is set to be scheduled, it is automatically initiated at the scheduled time. In this embodiment, the workflow engine can be Argo Workflow. The workflow task can be workflow. The task type of the workflow task is used to characterize the attribute information of the workflow task. The current execution frequency of the workflow task refers to the request frequency of sending the workflow task request to the application interface server as requested in the workflow task request. For example, the current execution frequency can be a request once every 5 minutes.
[0065] S102. According to the task type of the workflow task, a current limiting frequency associated with the task type is retrieved from the policy service at a preset frequency; the current limiting frequency is used to represent the request frequency of sending the workflow task request to the application program interface server.
[0066] In one example, the preset frequency is pre-set by the user, for example, once a minute. The advantage of such a setting is that the current limiting frequency associated with the task type can be viewed in real time, and if the current limiting frequency associated with the task type is modified, it can be obtained in real time.
[0067] In this embodiment, the policy service is a common http service that provides a unified policy update, deletion, and query service. Users can create, delete, and modify policies, and the argo workflow can periodically pull and apply these policies. Specifically, the policy service is deployed separately outside the cluster to avoid being unable to directly operate the argo workflow in the event of a cluster crash. The policy service can formulate different flow-limiting strategies for different task types. It is also possible to define certain task types as unrestricted, for example, selecting lease resources that the master depends on, such as deleting resources.
[0068] In this embodiment, different task types correspond to different current limiting frequencies.
[0069] In one example, the current limiting frequency varies in real time or is fixed.
[0070] S103: Determine whether to execute the workflow task according to the current limiting frequency.
[0071] In one example, determining whether to execute a workflow task according to the current limiting frequency includes:
[0072] If the current limiting frequency is 0, it is determined that the workflow task will not be executed;
[0073] If the current limiting frequency is non-zero, the workflow task is determined to be executed.
[0074] In one example, the flow limiting frequency may be QPS. When QPS is 0, it indicates that the request frequency of the workflow task request is not sent to the application program interface server, that is, the workflow task is not executed. When QPS is non-0, that is, QPS is a positive integer, it is determined to execute the workflow task.
[0075] In one example, for a workflow task request submitted by a user, after determining that the workflow task is not to be executed, a specific reason can be returned so that the user can perceive it. For a workflow task request set with a timer, after determining that the workflow task is not to be executed, the external party can be notified or the event can be recorded in a log so that subsequent business can be repaired.
[0076] In an example, the current limiting frequency can include two layers. The outer layer is the default current limiting frequency, which can be implemented through client-go. The inner layer is the current limiting frequency implemented according to the policy service. The current limiting frequency configured in the inner layer needs to be smaller than the outer layer to make sense.
[0077] S104: If yes, determine the target execution frequency of the workflow task according to the current limiting frequency and the current execution frequency of the workflow task.
[0078] In one example, the target execution frequency of the workflow task is the final determined request frequency for sending the workflow task request to the application program interface server. For example, if the current limiting frequency is once every 2 minutes and the current execution frequency is once every 3 minutes, then the target execution frequency of the workflow task is once every 2 minutes.
[0079] The disclosed embodiment provides a method for determining the target execution frequency of a workflow task, which is applied to a workflow engine, and the method includes: receiving a workflow task request, and obtaining the task type of the workflow task in the workflow task request and the current execution frequency of the workflow task; wherein the workflow task request is initiated by a user or is set at a time; according to the task type of the workflow task, the current limiting frequency associated with the task type is retrieved from the policy service at a preset frequency; the current limiting frequency is used to characterize the request frequency of sending the workflow task request to the application program interface server; according to the current limiting frequency, determine whether to execute the workflow task; if so, determine the target execution frequency of the workflow task according to the current limiting frequency and the current execution frequency of the workflow task. By adopting this technical solution, the current limiting rate can be dynamically modified, and refined current limiting can be performed for different resource types and request types, and the purpose of releasing certain request types can be achieved.
[0080] Figure 2 A flowchart of a method for determining a target execution frequency of a workflow task provided by an embodiment of the present disclosure is shown. Applied to a workflow engine, the embodiment of the present disclosure is optimized on the basis of the above embodiment, and the embodiment of the present disclosure can be combined with various optional solutions in one or more of the above embodiments.
[0081] like Figure 2 As shown, the method for determining the target execution frequency of the workflow task may include the following steps:
[0082] S201. Receive a workflow task request, and obtain the task type of the workflow task and the current execution frequency of the workflow task in the workflow task request; wherein the workflow task request is initiated by a user or is set at a fixed time.
[0083] In an example, this step may refer to the content of step S101.
[0084] S202: If the task type of the workflow task is the first service type, retrieve a first program file; wherein the first program file corresponds to the first service type.
[0085] In one example, the first service type may be an argo-server type. The first program file is a program file corresponding to the argo-server type.
[0086] S203: If the task type of the workflow task is the second service type, retrieve the second program file; wherein the second program file is in a corresponding relationship with the second service type.
[0087] In one example, the second service type may be a workflow-controller. The second program file is a program file corresponding to the workflow-controller.
[0088] S204. According to the task type of the workflow task, a current limiting frequency associated with the task type is retrieved from the policy service at a preset frequency; the current limiting frequency is used to represent the request frequency of sending the workflow task request to the application program interface server.
[0089] In one example, if the task type of the workflow task is the first service type, the first program file is called, and the current limiting frequency associated with the task type is called from the policy service according to a preset frequency, including:
[0090] Based on the first program file, a first resource type and a first request type of the workflow task are obtained; wherein the first request type, the first resource type and the first service type have a hierarchical relationship;
[0091] The current limiting frequency associated with the first request type is retrieved from the policy service at a preset frequency.
[0092] In one example, the hierarchical relationship is sorted as follows: first service type>first resource type>first request type. For details, please refer to the list information of task types shown in Table 1.
[0093] Table 1 List information of task types
[0094]
[0095] After determining the first program file, it is necessary to determine the first resource type based on the first program file, and then determine the first request type under the first resource type, and then determine the current limiting frequency associated with the first request type according to the first request type. In one example, each request type corresponds to a current limiting frequency. Specifically, the current limiting frequency can be updated or a new current limiting frequency can be added or a current limiting frequency can be deleted.
[0096] For a clearer explanation, see Figure 3a A schematic diagram of a current limiting frequency determination process is shown. Figure 3b A schematic diagram of another current limiting frequency determination process is shown.
[0097] S205: Determine whether to execute the workflow task according to the current limiting frequency.
[0098] In an example, this step may refer to the content of step S103.
[0099] S206: If yes, determine the target execution frequency of the workflow task according to the current limiting frequency and the current execution frequency of the workflow task.
[0100] In one example, determining a target execution frequency of a workflow task according to a current limiting frequency and a current execution frequency of the workflow task includes:
[0101] If the current limiting frequency is the same as the current execution frequency of the workflow task, the target execution frequency is determined to be the current execution frequency;
[0102] If the current limiting frequency is different from the current execution frequency of the workflow task, the target execution frequency is determined to be the current limiting frequency.
[0103] In one example, the value of the current limiting frequency is less than or equal to the current execution frequency of the workflow task. If the current limiting frequency is once every 5 minutes and the current execution frequency of the workflow task is also once every 5 minutes, the target execution frequency is determined to be once every 5 minutes. If the current limiting frequency is once every 5 minutes and the current execution frequency of the workflow task is also once every 10 minutes, the target execution frequency is determined to be once every 5 minutes.
[0104] S207: Send a workflow task request to the application program interface server according to the target execution frequency.
[0105] In one example, the application program interface server is an api-server. The workflow task request is sent to the application program interface server according to the target execution frequency. If the target execution frequency changes, the workflow task request is sent to the application program interface server according to the target execution frequency determined in real time.
[0106] S208: Execute the workflow task in the application program interface server.
[0107] In an example, a workflow task is executed in the api-server. For details, see Figure 3c A schematic diagram of executing a workflow task is shown.
[0108] The disclosed embodiment provides a method for determining the target execution frequency of a workflow task, which is applied to a workflow engine. The method includes: determining the target execution frequency of the workflow task according to the current limiting frequency and the current execution frequency of the workflow task, and sending a workflow task request to an application program interface server according to the target execution frequency. The workflow task is executed in the application program interface server. By adopting this technical solution, the current limiting frequency can be dynamically adjusted during operation without restarting the program, thereby improving flexibility.
[0109] Figure 4 1 is a schematic diagram of a structure of a device for determining a target execution frequency of a workflow task provided by an embodiment of the present disclosure, which is applied to a workflow engine. The device for determining a target execution frequency of a workflow task can be understood as the above-mentioned electronic device or a part of the functional modules in the above-mentioned electronic device. Figure 4 As shown, the target execution frequency determination device 40 of the workflow task includes:
[0110] The receiving module 401 is used to receive a workflow task request and obtain the task type of the workflow task and the current execution frequency of the workflow task in the workflow task request; wherein the workflow task request is initiated by a user or is set at a fixed time;
[0111] The first retrieving module 402 is used to retrieve the current limiting frequency associated with the task type from the policy service according to the task type of the workflow task at a preset frequency; the current limiting frequency is used to represent the request frequency of sending the workflow task request to the application program interface server;
[0112] A first determination module 403 is used to determine whether to execute a workflow task according to the current limiting frequency;
[0113] The second determining module 404 is configured to determine the target execution frequency of the workflow task according to the current limiting frequency and the current execution frequency of the workflow task.
[0114] In one example, the apparatus 40 further includes:
[0115] The second calling module 405 is used to call the first program file if the task type of the workflow task is the first service type; wherein the first program file is in a corresponding relationship with the first service type;
[0116] The third calling module 406 is used to call the second program file if the task type of the workflow task is the second service type; wherein the second program file is in a corresponding relationship with the second service type.
[0117] In one example, if the task type of the workflow task is the first service type, then the first program file is retrieved, and the first retrieval module 402 includes:
[0118] An acquisition submodule, used to acquire a first resource type and a first request type of a workflow task based on a first program file; wherein the first request type, the first resource type and the first service type have a hierarchical relationship;
[0119] The retrieving submodule is used to retrieve the current limiting frequency associated with the first request type from the policy service according to a preset frequency.
[0120] In one example, the current limiting frequency varies in real time or is fixed.
[0121] In one example, the first determining module 403 includes:
[0122] A first determination submodule is used to determine not to execute the workflow task if the current limiting frequency is 0;
[0123] The second determination submodule is used to determine to execute the workflow task if the current limiting frequency is non-zero.
[0124] In one example, the second determining module 404 includes:
[0125] A third determination submodule is used to determine the target execution frequency as the current execution frequency if the current limiting frequency is the same as the current execution frequency of the workflow task;
[0126] The fourth determination submodule is used to determine the target execution frequency as the current limiting frequency if the current limiting frequency is different from the current execution frequency of the workflow task.
[0127] In one example, the apparatus 40 further includes:
[0128] The sending module 407 is used to send a workflow task request to the application program interface server according to the target execution frequency;
[0129] The execution module 408 is used to execute the workflow task in the application program interface server.
[0130] The device provided in this embodiment can execute the method of any of the above embodiments, and its execution method and beneficial effects are similar, which will not be repeated here.
[0131] An embodiment of the present disclosure further provides an electronic device, which includes: a memory, in which a computer program is stored; and a processor, which is used to execute the computer program. When the computer program is executed by the processor, the method of any of the above embodiments can be implemented.
[0132] For example, Figure 5 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 5 , which shows a schematic diagram of the structure of an electronic device 1000 suitable for implementing the embodiment of the present disclosure. The electronic device 1000 in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0133] like Figure 5 As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0134] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0135] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1009, or installed from a storage device 1008, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0136] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0137] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0138] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0139] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: receives a workflow task request, and obtains the task type of the workflow task and the current execution frequency of the workflow task in the workflow task request; wherein the workflow task request is initiated by the user or set at a time; according to the task type of the workflow task, retrieves the flow limiting frequency associated with the task type from the policy service at a preset frequency; the flow limiting frequency is used to characterize the request frequency of sending the workflow task request to the application interface server; determines whether to execute the workflow task according to the flow limiting frequency; if so, determines the target execution frequency of the workflow task according to the flow limiting frequency and the current execution frequency of the workflow task.
[0140] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0141] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0142] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0143] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0144] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0145] The embodiments of the present disclosure further provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of any of the above embodiments can be implemented. The execution method and beneficial effects are similar and will not be repeated here.
[0146] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0147] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for determining a target execution frequency of a workflow task, characterized in that: Applied to a workflow engine, the method comprises: Receive a workflow task request, and obtain the task type of the workflow task and the current execution frequency of the workflow task in the workflow task request; wherein the workflow task request is initiated by a user or is set at a fixed time; According to the task type of the workflow task, a current limiting frequency associated with the task type is retrieved from a policy service at a preset frequency; the current limiting frequency is used to represent a request frequency of sending the workflow task request to an application program interface server; Determining whether to execute the workflow task according to the current limiting frequency; If so, the target execution frequency of the workflow task is determined according to the current limiting frequency and the current execution frequency of the workflow task.
2. The method according to claim 1, characterized in that Before calling the current limiting frequency associated with the task type from the policy service according to the preset frequency, the method further includes: If the task type of the workflow task is the first service type, calling a first program file; wherein the first program file is in a corresponding relationship with the first service type; If the task type of the workflow task is the second service type, a second program file is retrieved; wherein the second program file is in a corresponding relationship with the second service type.
3. The method according to claim 2, characterized in that If the task type of the workflow task is the first service type, then calling the first program file, and calling the current limiting frequency associated with the task type from the policy service according to the preset frequency includes: Based on the first program file, obtaining a first resource type and a first request type of the workflow task; wherein the first request type, the first resource type and the first service type have a hierarchical relationship; The current limiting frequency associated with the first request type is retrieved from the policy service at a preset frequency.
4. The method according to claim 1 or 3, characterized in that: The current limiting frequency changes in real time or is fixed.
5. The method according to claim 1, characterized in that The determining whether to execute the workflow task according to the current limiting frequency includes: If the current limiting frequency is 0, it is determined that the workflow task is not executed; If the current limiting frequency is non-zero, it is determined to execute the workflow task.
6. The method according to claim 1, characterized in that The determining, according to the current limiting frequency and the current execution frequency of the workflow task, a target execution frequency of the workflow task includes: If the current limiting frequency is the same as the current execution frequency of the workflow task, determining the target execution frequency to be the current execution frequency; If the current limiting frequency is different from the current execution frequency of the workflow task, the target execution frequency is determined to be the current limiting frequency.
7. The method according to claim 1, characterized in that After determining the target execution frequency of the workflow task, the method further includes: Sending the workflow task request to the application program interface server according to the target execution frequency; The workflow task is executed in the application program interface server.
8. A device for determining a target execution frequency of a workflow task, characterized in that: Applied to a workflow engine, the device comprises: A receiving module, used to receive a workflow task request, and obtain the task type of the workflow task and the current execution frequency of the workflow task in the workflow task request; wherein the workflow task request is initiated by a user or is set at a fixed time; A first calling module is used to call a current limiting frequency associated with the task type from a policy service according to a preset frequency according to the task type of the workflow task; the current limiting frequency is used to represent the request frequency of sending the workflow task request to the application program interface server; A first determination module, used to determine whether to execute the workflow task according to the current limiting frequency; The second determining module is configured to determine, if yes, a target execution frequency of the workflow task according to the current limiting frequency and the current execution frequency of the workflow task.
9. An electronic device, characterized in that: include: A processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.