Method, apparatus, electronic device and computer readable medium for traffic scheduling

By obtaining cluster attribute information to determine the target cluster for traffic scheduling, the complexity of multi-cluster scheduling is solved, and simplified traffic scheduling management is achieved.

CN116233258BActive Publication Date: 2025-11-28SINA TECH (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310101306.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-18
Publication Date
2025-11-28
Estimated Expiration
2043-01-18

AI Technical Summary

Technical Problem

Existing methods for traffic scheduling across multiple Kubernetes clusters are complex, requiring administrators to learn about multiple custom resources, which increases workload.

Method used

By acquiring attribute information from multiple clusters, the target cluster is identified and traffic is scheduled. A registration-based mechanism simplifies the administrator's workflow and allows deployment using native Kubernetes resources.

Benefits of technology

It enables multi-cluster traffic scheduling without human learning, reducing learning costs, simplifying management processes, and improving ease of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116233258B_ABST
    Figure CN116233258B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a traffic scheduling method and device, electronic equipment and computer readable medium, and relate to the technical field of cloud computing. The traffic scheduling method comprises: obtaining attribute information of each cluster in a plurality of clusters, at least one service being deployed in the plurality of clusters, the attribute information comprising first state information for indicating a traffic scheduling state of the cluster; determining a target cluster running a target service in the plurality of clusters according to the attribute information of each cluster, the target service being a service required to be called by a target business; and calling the target cluster to perform traffic scheduling of the target business.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cloud computing, and particularly relates to a traffic scheduling method and device, electronic equipment and computer readable medium. BACKGROUND

[0002] In the process of department project migration to containers, more and more projects are deployed to more and more container orchestration scheduling engines (Kubernetes, k8s) clusters. Sometimes, multiple k8s clusters need to be called at the same time to provide services for the same project business, which requires effective traffic scheduling for multiple clusters.

[0003] Currently, the method for traffic scheduling for multiple clusters is relatively complex. For example, in the method of developing a k8s custom resource definition (Custom Resource Definition, crd), the custom k8s resource generated by packaging multiple k8s native resources is deployed to the corresponding cluster, and when the traffic scheduling is implemented, the administrator needs to learn the use method of the custom k8s resource; if an administrator is responsible for multiple projects, the administrator needs to learn the different custom k8s resources of the multiple projects, which greatly increases the complexity of the administrator's work. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a traffic scheduling method, device, electronic equipment and computer readable medium, which can solve the problem that the current method for traffic scheduling for multiple clusters is relatively complex.

[0005] To solve the above technical problems, the embodiments of the present application are implemented through the following aspects.

[0006] In a first aspect, the embodiments of the present application provide a traffic scheduling method, comprising: obtaining attribute information of each cluster in a plurality of clusters, at least one service being deployed in the plurality of clusters, the attribute information comprising first state information used to indicate a traffic scheduling state of the cluster; determining a target cluster running a target service in the plurality of clusters according to the attribute information of each cluster, the target service being a service called by a target business; and calling the target cluster to perform traffic scheduling of the target business.

[0007] In a second aspect, an embodiment of the present application provides a device for flow scheduling, comprising: an obtaining module, configured to obtain attribute information of each cluster in a plurality of clusters, at least one service being deployed in the plurality of clusters, the attribute information comprising first state information for indicating a flow scheduling state of the cluster; a determining module, configured to determine a target cluster running a target service in the plurality of clusters according to the attribute information of each cluster, the target service being a service required to be called by a target business; and a scheduling module, configured to call the target cluster to perform flow scheduling of the target business.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and computer executable instructions stored in the memory and executable in the processor, when the computer executable instructions are executed by the processor, the method for flow scheduling in the first aspect is implemented.

[0009] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, configured to store computer executable instructions, when the computer executable instructions are executed by a processor, the method for flow scheduling in the first aspect is implemented.

[0010] In the embodiment of the present application, by obtaining attribute information of each cluster in a plurality of clusters, at least one service being deployed in the plurality of clusters, the attribute information comprising first state information for indicating a flow scheduling state of the cluster, determining a target cluster running a target service in the plurality of clusters according to the attribute information of each cluster, the target service being a service required to be called by a target business, and calling the target cluster to perform flow scheduling of the target business, the target cluster can be determined according to the obtained attribute information of the cluster, and the determined target cluster is called to perform flow scheduling, and the calling process does not require human learning and participation, thereby solving the problem that the method for flow scheduling of the plurality of clusters is relatively complex. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0012] Figure 1 FIG. 1 shows a flowchart of a method for flow scheduling according to an embodiment of the present application;

[0013] Figure 2Another flowchart showing a method for traffic scheduling provided by an embodiment of the present application is shown.

[0014] Figure 3 A schematic diagram showing a method for traffic scheduling provided by an embodiment of the present application is shown.

[0015] Figure 4 A structural schematic diagram of an apparatus for traffic scheduling provided by an embodiment of the present application is shown.

[0016] Figure 5 A hardware structural schematic diagram of an electronic device for implementing a method for traffic scheduling provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0017] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should fall within the scope of protection of the present application.

[0018] As described above, the related art defines a new k8s resource by developing a crd or an admission controller of k8s, and deploys the self-defined resource to the k8s cluster. The resource actually packs the k8s native resource used by the business and processes them together to complete the deployment of a business in a cluster. Alternatively, the same purpose is achieved by scheduling based on the http protocol or similar protocols such as istio. These methods have the following problems: unable to handle the case of managing the deployment of a business to multiple clusters in a control terminal; the non-native k8s resource is not friendly to administrators, and needs to learn the use method of the self-defined resource; needs to rely on the http protocol to complete, which is more complex to manage, has a high learning cost, and is not simple to use.

[0019] Therefore, the embodiments of the present application aim to provide a method for traffic scheduling, and the main technical idea is that: through a control terminal, deploying a business to multiple clusters, scheduling the service to multiple clusters, and realizing global traffic scheduling switch control. There is a control terminal software, which is simple and easy to use; based on the registration mechanism, it is easy to manage.

[0020] Figure 1A flowchart of a method for flow scheduling is shown, which can be executed by an electronic device, such as a terminal device or a server device. In other words, the method can be executed by software or hardware installed in the terminal device or the server device. The server includes but is not limited to a single server, a server cluster, a cloud server, or a cloud server cluster, etc. As shown in the figure, the method can include the following steps.

[0021] Step S110: Obtain attribute information of each cluster in the plurality of clusters.

[0022] At least one service is deployed in the plurality of clusters, and the attribute information includes first state information for indicating a flow scheduling state of the cluster.

[0023] The cluster and the service are in a many-to-many correspondence. Specifically, one cluster can deploy one or more services, and one service can be deployed in one cluster or distributed in multiple clusters.

[0024] The flow scheduling state of the cluster refers to a global flow scheduling state, also known as an inter-cluster scheduling state, which includes a global flow scheduling on state and a global flow scheduling off state. The scheduling switch is a configuration item in the service. When the central controller detects the relevant configuration, it will determine whether to allow global flow scheduling. When a cluster is in a global flow scheduling on state, it is allowed to schedule from the cluster to other clusters and to schedule from other clusters to the cluster; otherwise, when a cluster is in a global flow scheduling off state, it is not allowed to schedule from the cluster to other clusters and to schedule from other clusters to the cluster.

[0025] Optionally, the attribute information of the cluster further includes an IP address, a port, a possessed service, an agent ID, etc. of the cluster.

[0026] By obtaining the attribute information of each cluster, the flow scheduling state of each cluster can be correspondingly obtained.

[0027] Step S120: Determine a target cluster running a target service in the plurality of clusters according to the attribute information of each cluster.

[0028] The target service is a service that needs to be called to run a target business.

[0029] Each target business corresponds to one or more target services. At least one target service needs to be called to run each target business or project. The target cluster running the target service needs to at least deploy the target service, and the global flow scheduling state of the target cluster is in an on state.

[0030] Step S130: Call the target cluster to perform flow scheduling of the target business.

[0031] The information of starting global traffic scheduling is sent to the agent, and the agent converts the scheduling information into local rules, such as K8S network policy rules, virtual machine iptables rules, and server iptables rules. Then, the determined target group is called to complete the global traffic scheduling of traffic out of the network and into the network.

[0032] In the embodiment of the present application, by obtaining attribute information of each cluster in a plurality of clusters, at least one service is deployed in the plurality of clusters, and the attribute information includes first state information for indicating a traffic scheduling state of the cluster; according to the attribute information of each cluster, a target cluster running a target service in the plurality of clusters is determined, the target service is a service that needs to be called for running a target business; and the target cluster is called for traffic scheduling of the target business, which can determine the target cluster according to the obtained attribute information of the cluster, and call the determined target cluster for traffic scheduling, so that the implementation of the method for traffic scheduling of the plurality of clusters is relatively complex.

[0033] Figure 2 Another flowchart of a method for traffic scheduling provided by the embodiment of the present application is shown. As shown in the figure, the method can include the following steps.

[0034] Step S210: Obtain attribute information of each cluster in a plurality of clusters.

[0035] Step S221: Obtain second state information corresponding to each first service respectively, which needs to be called for running the target business, and determine the first service that has started global traffic scheduling as the target service in the case of determining whether the corresponding first service has started global traffic scheduling according to the second state information.

[0036] For global scheduling at the service level, when the service has started global scheduling, and the global scheduling flag is started on the service, the service allows global scheduling. The global scheduling flag is realized through the annotation function of k8s.

[0037] Step S222: Obtain first state information corresponding to each first cluster respectively, in which the target service is deployed, and determine the first cluster that has started global traffic scheduling as the target cluster in the case of determining whether the corresponding first cluster has started global traffic scheduling according to the first state information.

[0038] Global scheduling at the cluster level is realized by whether the cluster has started global mesh. If the cluster has started global mesh function, it means that the cluster allows global scheduling at the cluster level.

[0039] It should be noted that if the global mesh function is not enabled at the cluster level, the service deployed on the cluster is not allowed to perform global scheduling regardless of whether the global scheduling is enabled.

[0040] Step S230: calling the target cluster to perform traffic scheduling of the target service.

[0041] Steps S210 and S230 can be implemented by using Figure 1 Embodiments correspond to the description of the steps, and for repeatable parts, they will not be described here.

[0042] In the embodiments of the present application, by obtaining attribute information of each cluster in a plurality of clusters, at least one service is deployed in the plurality of clusters, the attribute information includes first state information for indicating a traffic scheduling state of the cluster; obtaining second state information corresponding to each first service respectively, which is required to be called to run the target service, and in a case of determining whether the corresponding first service has enabled global traffic scheduling according to the second state information, determining the first service having enabled global traffic scheduling as the target service; obtaining first state information corresponding to each first cluster respectively, in which the target service is deployed, and in a case of determining whether the corresponding first cluster has enabled global traffic scheduling according to the first state information, determining the first cluster having enabled global traffic scheduling as the target cluster; calling the target cluster to perform traffic scheduling of the target service, different levels of traffic scheduling management can be realized according to different state information of clusters and services.

[0043] In a possible implementation, the obtaining attribute information of each cluster in a plurality of clusters includes: receiving the attribute information reported by each cluster at a time; and storing the attribute information received last time for use in traffic scheduling.

[0044] The cluster first connects the registration controller and reports its own attribute information to the registration controller at a time, including the current address of the agent, the owned service, the port, whether to enable global traffic scheduling, the ID number of the agent, the cluster name and the like. Reporting the attribute information at a time can prevent local attribute changes from being unknown to the registerer.

[0045] On the other hand, the modification of the to-be-operated resource is stored into the storage system, for example, the modification of the attribute information is stored into the storage system. In this way, when the cluster and the corresponding member information change, the scheduling controller can receive the changes reported by the agent and issue the changes to other agents, so as to achieve the purpose of global unification. The member refers to the smallest unit of providing a service, for example, an IP address, a port and the like.

[0046] In a possible implementation, the calling the target cluster to perform the traffic scheduling of the target service comprises: calling the target cluster to perform the traffic scheduling of the target service according to the identification information of the target cluster; and the identification information is unique identification of the target cluster distinguished from other clusters, and comprises at least one of a cluster address, a cluster identification number and a cluster name of the target cluster.

[0047] When the traffic is scheduled between clusters, the traffic needs to be scheduled to an IP address or a name, and the IP address or the name has an attribute, which includes a cluster ID and a cluster name. A globally unique cluster IP address or a cluster identification number or a cluster name is used, so that no confusion occurs when the traffic is scheduled.

[0048] Optionally, the cluster identification number is all numbers. The numbers can be used to indicate the order of the clusters. When multiple clusters implement global scheduling, the numbers can be used to distinguish the order of the clusters receiving the scheduling.

[0049] It should be noted that a cluster that does not satisfy the globally unique identification number is not allowed to join the global scheduling of the cluster. The uniqueness of the cluster identification can be confirmed by software.

[0050] In a possible implementation, before the calling the target cluster to perform the traffic scheduling of the target service, the method further comprises: obtaining a working state of each cluster, the working state comprising normal or abnormal; and determining, according to the working state of each cluster, that a cluster with an abnormal working state is a non-target cluster.

[0051] The working state of the cluster can be actively checked. If it is found that the working state is abnormal, the abnormality is reported to the central controller, and it is reported that the current cluster component is unavailable. Global traffic will not be scheduled to the cluster detected as having an abnormal working state.

[0052] In a possible implementation, the type of the cluster comprises at least one of a K8S cluster, a server cluster and a virtual machine cluster, different types of clusters correspond to different priorities; and the determining the target cluster running the target service in the multiple clusters comprises: in each first cluster in which the target service is deployed, according to first state information corresponding to each first cluster, determining a first cluster that has started global traffic scheduling as a candidate target cluster; and in a case where the candidate target cluster includes multiple candidate target clusters and corresponds to different priorities, selecting a candidate target cluster with a high priority as the target cluster.

[0053] The K8S cluster, the server cluster and the virtual machine cluster can be used to provide same or different services. When providing the same service, the priorities of the different types of clusters can be same or customized as different priorities according to user demand. For the multiple clusters providing the same service with different priorities, the cluster with higher priority is called first.

[0054] Figure 3 A schematic diagram of a method for traffic scheduling provided by an embodiment of the application is shown.

[0055] As shown in the figure, the administrator 301 opens the registration function of the cluster and the service through the user interface 302 to realize the adding, deleting and modifying of the K8S cluster, the server cluster and the virtual machine cluster. The administrator 301 can perform global traffic scheduling switch operation on different services of different clusters 307.

[0056] The user interface 302 serves as a bridge for communication between the central controller 303 and the administrator 301, and transmits the operation of the administrator 301 to the central controller 303.

[0057] The central controller 303 distributes instructions to different components according to the operation of the administrator 301, and is responsible for receiving the instructions of the administrator 301, verifying the login of the administrator 301, verifying the authority of the administrator 301 and the like. In addition, the central controller 303 receives the registration information of the register 305 and stores the registration information and its modification into the storage 304. The stored information includes the attribute information of the K8S cluster, the server cluster and the virtual machine cluster, such as the IP address, the port, the service name, the global traffic scheduling start state and the like of the cluster. The central controller 303 also receives the information of the scheduling controller 306, including the service state information reported by the scheduling controller, the state information of the proxy component and the information of the back-end member of the service and the like.

[0058] The register 305 receives the attribute information reported by the K8S cluster, the server cluster and the virtual machine cluster at regular intervals; the scheduling controller 306 receives the cluster and service change information reported by the proxy component and transmits the received information to other proxy components.

[0059] The proxy component is deployed in the K8S cluster, the server cluster and the virtual machine cluster, and each cluster 307 corresponds to a proxy component. The proxy component is responsible for communicating with the register and the scheduling controller on behalf of different clusters to complete the collaborative work of the cluster and the integrated system, reports its own state and attribute, and receives the action to be executed. The proxy component completes the information interaction between the cluster, the register and the controller to achieve the purpose of global traffic control and scheduling.

[0060] By the method provided in the embodiment, traffic of the same service can be scheduled to multiple different clusters without using protocols such as http, and a global traffic scheduling switch is supported. The method is simple and easy to use, and is friendly to users and has lower learning cost, without the need to learn the use method of a new K8S resource. In addition, the method uses a registration-based mechanism, so that traffic scheduling between multiple clusters is easy to manage.

[0061] Figure 4 A structure diagram of a device for traffic scheduling provided by an embodiment of the application is shown, and the device 400 includes an obtaining module 410, a determining module 420, and a scheduling module 430.

[0062] The obtaining module 410 is configured to obtain attribute information of each cluster in a plurality of clusters, at least one service is deployed in the plurality of clusters, and the attribute information includes first state information used to indicate a traffic scheduling state of the cluster; the determining module 420 is configured to determine a target cluster running a target service in the plurality of clusters according to the attribute information of each cluster, the target service is a service that needs to be called by a target service; and the scheduling module 430 is configured to call the target cluster to perform traffic scheduling of the target service.

[0063] In a possible implementation, the attribute information further includes second state information used to indicate a traffic scheduling state of a service deployed in the cluster. The determining module 420 includes: a first determining submodule, configured to obtain second state information corresponding to each first service that needs to be called by the target service, and determine the first service that has started global traffic scheduling as the target service in a case where it is determined according to the second state information that the corresponding first service has started global traffic scheduling; and a second determining submodule, configured to obtain first state information corresponding to each first cluster in which the target service is deployed, and determine the first cluster that has started global traffic scheduling as the target cluster in a case where it is determined according to the first state information that the corresponding first cluster has started global traffic scheduling.

[0064] In a possible implementation, the obtaining module 410 is specifically configured to receive the attribute information reported by each cluster in real time, and store the attribute information received last time for use in traffic scheduling. In a possible implementation, the scheduling module 430 is specifically configured to call the target cluster to perform traffic scheduling of the target service according to identification information of the target cluster, wherein the identification information is a unique identifier of the target cluster that is different from other clusters, and includes at least one of a cluster address, a cluster identification number, and a cluster name of the target cluster.

[0065] In a possible implementation, the device for traffic scheduling further includes a working module, configured to acquire a working state of each cluster before calling the target cluster to perform traffic scheduling of the target service, the working state including normal or abnormal; and determine, according to the working state of each cluster, that a cluster with an abnormal working state is a non-target cluster.

[0066] In a possible implementation, the types of the clusters include at least one of a K8S cluster, a server cluster, and a virtual machine cluster, different types of clusters correspond to different priorities; and the determining module is specifically configured to, in each first cluster in which the target service is deployed, determine, according to the first state information corresponding to each first cluster, a first cluster in which global traffic scheduling is started as a candidate target cluster; and in a case where the candidate target cluster includes multiple candidate target clusters and corresponds to different priorities, select a candidate target cluster with a high priority as the target cluster.

[0067] The device 400 provided by the embodiment of the present application can execute the methods described in the foregoing method embodiments, and realize the functions and beneficial effects of the methods described in the foregoing method embodiments, which will not be described herein again.

[0068] Figure 5 A hardware structure schematic diagram of an electronic device 500 that executes the method for data processing provided by the embodiment of the present application is shown, with reference to the diagram, at a hardware level, the electronic device includes a processor 510, and optionally, an internal bus 520, a network interface 530, and a memory. The memory can include a memory 540, for example, a random-access memory (RAM), and can also include a non-volatile memory 550, for example, at least one disk memory. Of course, the electronic device can also include other hardware required by a service.

[0069] The processor 510, the network interface 530, and the memory can be connected to each other through the internal bus 520, which can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one bidirectional arrow is used in the diagram, but it does not mean that there is only one bus or only one type of bus.

[0070] The memory is used to store programs. Specifically, the program may include program code, which includes computer operation instructions. The memory may include main memory 540 and non-volatile memory 550, and provides instructions and data to the processor 510.

[0071] Processor 510 reads the corresponding computer program from non-volatile memory 550 into memory 540 and then runs it, forming a device for locating the target user at the logical level. Processor 510 executes the program stored in memory and specifically performs... Figures 1-3 The method described in the embodiments achieves the same or corresponding technical effects.

[0072] The above is as stated in this application. Figures 1-3 The methods disclosed in the illustrated embodiments can be applied to a processor or implemented by processor 510. Processor 510 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the hardware of processor 510 or by instructions in software form. The processor 510 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in the memory, and the processor 510 reads the information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0073] The electronic device can also execute the methods described in the preceding method embodiments and achieve the functions and beneficial effects of the methods described in the preceding method embodiments, which will not be repeated here.

[0074] Of course, in addition to the software implementation, the electronic device of the present application does not exclude other implementation manners, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and can also be hardware or a logic device.

[0075] The embodiment of the present application further provides a computer readable storage medium, the computer readable medium stores one or more programs, when the one or more programs are executed by an electronic device including a plurality of application programs, the electronic device executes Figures 1-3 The embodiment of the present application further provides a computer readable storage medium, the computer readable medium stores one or more programs, when the one or more programs are executed by an electronic device including a plurality of application programs, the electronic device executes

[0076] The computer readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disc or an optical disc, and the like.

[0077] Further, the embodiment of the present application further provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer readable storage medium, the computer program includes program instructions, when the program instructions are executed by a computer, the method of Figures 1-3 The embodiment of the present application further provides a computer readable storage medium, the computer readable medium stores one or more programs, when the one or more programs are executed by an electronic device including a plurality of application programs, the electronic device executes

[0078] In summary, the above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0079] The system, device, module or unit illustrated in the above embodiment can be specifically implemented by a computer chip or entity, or by a product with certain function. A typical implementation device is a computer. Specifically, the computer may, for example, be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0080] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0081] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed, or inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0082] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

Claims

1. A method of flow scheduling, wherein, The method comprises the following steps: obtaining attribute information of each cluster in a plurality of clusters, at least one service being deployed in the plurality of clusters, the attribute information comprising first state information for indicating a traffic scheduling state of the cluster and second state information for indicating a traffic scheduling state of the service deployed in the cluster; obtaining the second state information corresponding to each first service respectively called by the target business, and determining whether the corresponding first service has started global traffic scheduling according to the second state information, and determining the first service having started global traffic scheduling as a target service; obtaining the first state information corresponding to each first cluster respectively deploying the target service, and determining whether the corresponding first cluster has started global traffic scheduling according to the first state information, and determining the first cluster having started global traffic scheduling as a target cluster, the target service being a service called by the target business; calling the target cluster to perform traffic scheduling of the target business.

2. The method of claim 1, wherein, The method comprises the following steps: receiving the attribute information reported by each cluster at a time; storing the attribute information received last time for use in traffic scheduling.

3. The method of claim 1, wherein, The method comprises the following steps: calling the target cluster to perform traffic scheduling of the target business according to identification information of the target cluster; wherein the identification information is a unique identification of the target cluster distinguished from other clusters, comprising at least one of a cluster address, a cluster identification number and a cluster name of the target cluster.

4. The method of claim 1, wherein, Before the calling, the method further comprises the following steps: obtaining a working state of each cluster, the working state comprising normal or abnormal; determining a cluster having an abnormal working state as a non-target cluster according to the working state of each cluster.

5. The method of claim 1, wherein, The type of the cluster comprises at least one of a K8S cluster, a server cluster and a virtual machine cluster, different types of clusters corresponding to different priorities; The method comprises the following steps: in each first cluster deploying the target service, determining a first cluster having started global traffic scheduling as a candidate target cluster according to the first state information corresponding to each first cluster respectively; in the case that the candidate target cluster comprises a plurality of candidate target clusters and corresponds to different priorities, selecting a candidate target cluster having a high priority as the target cluster.

6. An apparatus for flow scheduling, wherein, The method comprises the following steps: a obtaining module, configured to obtain attribute information of each cluster in a plurality of clusters, at least one service being deployed in the plurality of clusters, the attribute information comprising first state information for indicating a traffic scheduling state of the cluster and second state information for indicating a traffic scheduling state of the service deployed in the cluster; a first determining submodule, configured to obtain the second state information corresponding to each first service respectively called by the target business, and determine whether the corresponding first service has started global traffic scheduling according to the second state information, and determine the first service having started global traffic scheduling as a target service; a second determining sub-module, configured to acquire first state information corresponding to each of the first clusters in which the target service is deployed, and determine whether a global traffic scheduling has been started in each of the first clusters according to the first state information, and determine a first cluster in which the global traffic scheduling has been started as a target cluster, the target service being a service required to be invoked by a target service; a scheduling module, configured to invoke the target cluster to perform traffic scheduling for the target service.

7. An electronic device, comprising: a processor; and a memory arranged to store computer-executable instructions that, when executed, use the processor to perform the method of traffic scheduling of any of claims 1-5.

8. A computer-readable medium storing one or more programs, which when executed by an electronic device including multiple applications, cause the electronic device to perform the method of traffic scheduling of any of claims 1-5.