WO2022148050A1 - Traffic management method and apparatus, traffic management strategy configuration method and apparatus, and device and medium - Google Patents

Traffic management method and apparatus, traffic management strategy configuration method and apparatus, and device and medium Download PDF

Info

Publication number
WO2022148050A1
WO2022148050A1 PCT/CN2021/117939 CN2021117939W WO2022148050A1 WO 2022148050 A1 WO2022148050 A1 WO 2022148050A1 CN 2021117939 W CN2021117939 W CN 2021117939W WO 2022148050 A1 WO2022148050 A1 WO 2022148050A1
Authority
WO
WIPO (PCT)
Prior art keywords
traffic
traffic management
identifier
target
scenario
Prior art date
Application number
PCT/CN2021/117939
Other languages
French (fr)
Chinese (zh)
Inventor
田晓亮
薛腾飞
郭勇良
刘宝
Original Assignee
华为云计算技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为云计算技术有限公司 filed Critical 华为云计算技术有限公司
Publication of WO2022148050A1 publication Critical patent/WO2022148050A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation

Definitions

  • the present application relates to the technical field of traffic management, and in particular, to a traffic management method, a method, apparatus, device and medium for configuring a traffic management policy.
  • the micro service pattern refers to splitting an application into a set of cooperating services, each of which can be responsible for a specific function.
  • the back-end system of the mall can include product evaluation services and product description services. , commodity recommendation service and other microservices; and the services are loosely coupled (that is, the interdependence between services is low) and can be deployed independently.
  • the requesting device such as a client such as a browser
  • the network communication when calling microservices remotely is usually complex and unstable.
  • the application may send requests to the microservice multiple times due to network congestion and other reasons. To avoid the application from repeatedly sending too many requests, you can limit the number of times the same request is sent to the microservice.
  • the embodiment of the present application provides a configuration method for configuring a traffic management policy, so as to reduce the learning cost for technicians when configuring the network traffic management policy, and improve the configuration efficiency.
  • the present application also provides corresponding apparatuses, devices, computer-readable storage media, and computer program products.
  • an embodiment of the present application provides a traffic management method, which can be applied to a corresponding traffic management device, and the traffic management device can be used to manage the traffic of microservices in the application.
  • the traffic The management device may receive an access request to the microservice by the user of the application, and the access request of the user of the application to the microservice may be directly or indirectly triggered by the user;
  • the target traffic characteristics are determined, and the identifier of the target business scenario is determined, wherein the business scenario represents an event when the user of the application uses the microservice; then, the traffic management device can search for the target traffic associated with the identifier of the target business scenario. management policy, and manage the network traffic belonging to the target business scenario according to the found target traffic management policy.
  • the traffic management device can effectively manage the generated network traffic by using the traffic management policy corresponding to the business scenario, so as to avoid the problem of abnormal network traffic caused by unstable network communication.
  • the application may generate various events in the process of requesting a microservice, that is, there may be various business scenarios in the process of requesting a microservice, so that the network generated when the application requests a microservice may be affected.
  • the traffic management device can find out the traffic management policy corresponding to the business scenario to which the network traffic belongs to perform traffic management.
  • the traffic management apparatus may further obtain the traffic feature corresponding to the identifier of the business scenario and the identifier of the business scenario in advance, and use the identifier of the business scenario Associate with traffic management policies.
  • technicians do not need to configure according to the microservices in the business system, that is, they do not need to know the microservice architecture of the backend of the business system in advance; at the same time, not only multiple microservices may
  • the same business scenarios such as user login scenarios, etc.
  • the traffic management device can also store the association between the established identification of the business scenario and the traffic management strategy, so that each time the management strategy for network traffic is determined, the identification and flow of the business scenario can be obtained locally. Manage associations between policies.
  • the target business scenario is a scenario that exists when requesting access to multiple microservices.
  • the same business scenario can be used. It can be managed by traffic management policies, which can effectively reduce the number of traffic management policies that technicians need to configure, and can effectively improve configuration efficiency while reducing the number of traffic management policies configured by technicians.
  • the traffic management apparatus may specifically check whether there is an identifier of the target microservice that matches the target traffic feature included in the access request, and whether there is an identifier of the target microservice that matches the target traffic feature included in the access request.
  • the traffic management policy associated with the identifier of the service If there is no identifier of the target microservice that matches the target traffic characteristics, or there is no traffic management policy associated with the identifier of the target microservice, it is determined that the search fails. At this time, The traffic management apparatus may determine the identifier of the target service scenario matching the target traffic feature included in the access request, so as to further determine a traffic management policy for managing network traffic based on the identifier of the target service scenario.
  • the traffic management apparatus can use the successfully found The traffic management policy manages the network traffic generated by the application requesting microservices. In this way, for the existing traffic management device to determine the traffic management strategy based on the microservice identifier, changes to the existing traffic management device can be reduced as much as possible, and the flexibility and universality of the solution implementation can be improved.
  • the traffic management apparatus may further associate the identifier of the microservice with the traffic management policy in advance, and store the identifier of the microservice with the traffic management policy. The association between the second traffic management policies, so that the traffic management apparatus can also determine a traffic management policy for managing network traffic according to the microservice identifier.
  • the traffic management device may specifically present a business scenario input interface to the technician, and respond to the technical staff's specific request for the business scenario For the input operation, the identifier of the input business scenario and the traffic characteristics corresponding to the identifier of the business scenario are obtained. In this way, through the visualized business scenario input interface, it is convenient for technicians to input business scenarios and traffic characteristics.
  • the traffic management device when the traffic management device associates the identifier of the service scenario with the traffic management policy, it may specifically present a policy configuration interface to the technician, and respond to the technician's configuration operation for the traffic management policy, Associate the identifier of the business scenario with the traffic management policy. In this way, through the visualized policy configuration interface, it is convenient for technicians to configure traffic management policies corresponding to different business scenarios.
  • an embodiment of the present application further provides a method for configuring a traffic management policy, the method is applied to a traffic management device, and the traffic management device obtains an access request to the first microservice from a user of the application before receiving the request.
  • the identifier of the business scenario and the traffic feature corresponding to the identifier of the business scenario associate the acquired identifier of the business scenario with the traffic management policy, and then store the established association between the identifier of the business scenario and the traffic management policy,
  • the traffic management policy is used to manage the network traffic belonging to the service scenario corresponding to the service scenario identifier.
  • technicians do not need to configure according to the microservices in the business system, that is, they do not need to know the microservice architecture of the backend of the business system in advance; at the same time, not only multiple microservices may
  • the same business scenarios such as user login scenarios, etc.
  • the number of business scenarios where technicians configure traffic management policies is less than the number of microservices.
  • the target business scenario is a scenario that exists when requesting access to multiple microservices.
  • the same business scenario can be used. It can be managed by traffic management policies, which can effectively reduce the number of traffic management policies that technicians need to configure, and can effectively improve configuration efficiency while reducing the number of traffic management policies configured by technicians.
  • an embodiment of the present application further provides a traffic management device.
  • the traffic management device is used to manage the traffic of microservices in an application, and the device includes a parsing module, a matching module, and a traffic management module.
  • the parsing module is used to receive the access request of the user of the application to the micro-service
  • the matching module is used to determine the identifier of the target business scenario according to the target traffic characteristics included in the access request, wherein the target business scenario indicates that the user of the application uses the micro-service.
  • An event during service the traffic management module is used to find the target traffic management policy associated with the identifier of the target business scenario, and manage the network traffic belonging to the target business scenario according to the target traffic management policy.
  • the apparatus further includes: a policy management module, configured to obtain the identifier of the business scenario and the traffic characteristics corresponding to the identifier of the business scenario before receiving the access request for the micro-service from the user of the application, and assign the service The identifier of the scene is associated with the traffic management policy.
  • a policy management module configured to obtain the identifier of the business scenario and the traffic characteristics corresponding to the identifier of the business scenario before receiving the access request for the micro-service from the user of the application, and assign the service The identifier of the scene is associated with the traffic management policy.
  • the apparatus may further include a policy storage module for storing the association between the identifier of the business scenario established by the policy management module and the traffic management policy.
  • the target business scenario is a scenario that exists when requesting access to multiple microservices.
  • the matching module is specifically configured to: find an identifier of the target microservice that matches the target traffic feature included in the access request of the microservice and a traffic management policy associated with the identifier of the target microservice; and , when the search fails, determine the identifier of the target business scenario according to the target traffic characteristics.
  • the policy management module is specifically configured to: present a business scenario input interface; and in response to an input operation for the business scenario, obtain an identifier of the business scenario and a traffic feature corresponding to the identifier of the business scenario.
  • the policy management module is specifically configured to: present a policy configuration interface; and in response to a configuration operation for the traffic management policy, associate the identifier of the service scenario with the traffic management policy.
  • an embodiment of the present application further provides a traffic management device, the device includes a policy management module and a policy storage module.
  • the policy management module is specifically used to obtain the identifier of the business scenario and the traffic characteristics corresponding to the identifier of the business scenario before receiving the access request of the user of the application to the microservice, and to associate the identifier of the business scenario with the traffic management policy;
  • the policy The storage module is specifically used to store the association between the identifier of the service scenario and the traffic management policy, wherein the traffic management policy is used to manage the network traffic belonging to the service scenario corresponding to the service scenario identifier.
  • the target business scenario is a scenario that exists when requesting access to multiple microservices.
  • the present application provides a computing device including a processor, a memory and a display.
  • the processor and the memory communicate with each other.
  • the processor is configured to execute instructions stored in the memory, so that the computing device executes the traffic management method according to the first aspect or any one of the implementations of the first aspect.
  • the present application provides a computing device including a processor, a memory and a display.
  • the processor and the memory communicate with each other.
  • the processor is configured to execute instructions stored in the memory to cause the computing device to perform the method of configuring a traffic management policy as in the second aspect or any implementation manner of the second aspect.
  • the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium is run on a computing device, the computing device is made to perform the first aspect or any of the first aspects.
  • the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, which, when executed on a computing device, cause the computing device to perform the second aspect or any of the second aspects.
  • the present application provides a computer program product containing instructions, which, when run on a computing device, enables the computing device to execute the traffic management method described in the first aspect or any implementation manner of the first aspect .
  • the present application provides a computer program product comprising instructions, which, when executed on a computing device, cause the computing device to perform the configuration traffic management described in the second aspect or any implementation manner of the second aspect. method of strategy.
  • the present application may further combine to provide more implementation manners.
  • FIG. 1 is a schematic diagram of an exemplary system architecture of the application
  • Fig. 2 is a specific example schematic diagram
  • FIG. 3 is a schematic diagram of an exemplary application scenario provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a method for configuring a traffic management policy according to an embodiment of the present application
  • FIG. 5 is a schematic diagram of an exemplary business scenario input interface provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of an association relationship between a service scenario identifier and a first traffic feature provided by an embodiment of the present application
  • FIG. 7 is a schematic diagram of a configuration file provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an exemplary policy configuration interface provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of another configuration file provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of multiplexing a first traffic feature with a second traffic feature
  • FIG. 11 is a schematic flowchart of an exemplary method for managing network traffic provided by an embodiment of the present application.
  • FIG. 12 is a schematic diagram of an exemplary system architecture provided by an embodiment of the present application.
  • FIG. 13 is a schematic flowchart of another exemplary method for managing network traffic provided by an embodiment of the present application.
  • FIG. 14 is a schematic diagram of another exemplary system architecture provided by an embodiment of the present application.
  • FIG. 15 is a schematic diagram of a hardware structure of a computing device according to an embodiment of the present application.
  • FIG. 1 it is a schematic diagram of an exemplary system architecture.
  • the system includes a request device 100 , a traffic management device 200 and a service execution device 300 .
  • the requesting device 100 is, for example, a client, etc., and can request access to any one or more from the business system through the seventh layer protocol (ie the application layer, Application Layer) in the Open System Interconnection Model (OSI) kind of microservices.
  • OSI Open System Interconnection Model
  • the traffic management device 200 can manage the network traffic generated in the process of accessing the microservice by the requesting device 100, which can include a parsing module 201, a matching module 202, a traffic management module 203, a policy storage module 204, and a policy management module 205;
  • the service executing apparatus 300 is configured to execute a corresponding service according to the microservice requested by the requesting apparatus 100 .
  • the aforementioned business system can be implemented as an application, and therefore, the application includes a plurality of microservices, and each microservice implements a specific function of the application.
  • An application can be published and used, and when a user of the application uses the application, one or more microservices in the application are run to provide corresponding responses to the user of the application.
  • the foregoing requesting apparatus 100 requests access to any one or more microservices from the business system, which may be directly or indirectly triggered by the user of the application when the user of the application uses the application.
  • the parsing module 201 may parse the microservice access request sent by the requesting device 100 to obtain the microservice identifier, request method, user name and other contents carried in the microservice access request.
  • the microservice access request sent by the requesting device 100 may be a HyperText Transfer Protocol (HyperText Transfer Protocol, HTTP) message as shown in FIG. 2 , and the parsing module 201 parses the HTTP message to determine the microservice to be accessed. It is "CommentService” (evaluation service), the request method is "GET”, and the user name (X-User) is "Jack", wherein the parsed information can be stored in the corresponding address and the pointer is used to indicate that the information is stored the address of.
  • HTTP HyperText Transfer Protocol
  • the matching module 202 finds the microservice indicated by the pointer in the pre-stored list of microservices, and further finds out the microservice that requests the microservice from the microservice list according to the found microservice and other information indicated by the pointer.
  • the category to which the network traffic belongs For example, in the example shown in FIG. 2, the matching module 202 finds the microservice in the list of microservices according to the microservice name "CommentService” indicated by the pointer, and determines the subset according to the user name "JACK" indicated by the pointer Named "Subset A".
  • different subset names represent different types of network traffic, and each subset name has corresponding traffic characteristics.
  • “Subset A” in Figure 2 represents that the network traffic comes from the user "JACK”
  • “Subset B” represents that the network traffic comes from the Chrome browser under the Linux operating system.
  • the traffic management module 203 can determine the traffic management policy corresponding to the subset name of the network traffic by looking up the association table between the subset name and the traffic management policy according to the category (ie the subset) to which the found network traffic belongs, and based on the determination
  • the corresponding management unit is used to manage the network traffic generated by requesting microservices.
  • the retry unit 2031 is responsible for managing the number of retries for requesting microservices from the business system
  • the timeout unit 2032 is responsible for managing The timeout when requesting microservices from the business system
  • the current limiting module 2033 is responsible for managing the frequency of requesting microservices from the business system, etc. Still taking FIG.
  • the traffic management module 203 may search the pre-saved association table between the subset name and the traffic management policy according to the subset name “subset A” determined by the matching module 202, thereby determining the request microarray.
  • the network traffic generated by the service "CommentService” is configured as a timeout judgment time threshold of 10s (seconds), and the maximum number of retries for request errors is 2 times.
  • the retry unit 2031 or the timeout unit 2032 controls to stop the microservice request process of the requesting device 100 this time, so as to avoid the requesting device 100
  • the abnormal network traffic when requesting the micro-service this time causes a series of problems such as excessive network traffic in the network between the requesting device 100 and the business system, so as to achieve effective management of the network traffic.
  • the list of microservices stored in the matching module 202 and the association table between the subset names and the traffic management policies stored in the traffic management module 203 may be pulled from the policy storage module 204 in advance.
  • the association table may also be pre-established by the policy management module 205 and sent to the policy storage module 204 for storage.
  • the policy management module 205 can also update the association table stored in the policy storage module 204 .
  • the association table may be configured by a technician in advance and stored in the policy storage module 204 in a unified manner.
  • the matching module 202 needs to be pre-configured with a microservice identifier and a traffic feature corresponding to the microservice identifier. Otherwise, when the microservice requested by the requesting device 100 does not have a corresponding microservice identifier in the matching module 202 to match, the traffic management device 200 cannot determine the corresponding traffic management policy for the microservice requested by the requesting device 100, Therefore, the problem of abnormal network traffic due to unstable network communication is prone to occur.
  • the functions of the business system are usually rich, which means that the business system includes a large number of microservices. Therefore, in order to avoid abnormal network traffic when requesting microservices from the business system as much as possible, technicians need to know in advance.
  • the microservice architecture of the backend of the business system that is, each microservice included in the business system
  • the corresponding traffic management strategy is separately configured for each microservice, which makes the learning cost of technicians high, and configures the microservices one by one Traffic management strategies are less efficient.
  • the network traffic generated when the application requests the micro-service can be managed from the dimension of the business scenario.
  • the business scenario refers to an event generated by the application when requesting a microservice, and the application may generate a variety of events in the process of requesting a microservice, that is, there may exist in the process of requesting a microservice
  • a variety of different business scenarios For example, in the process of the application requesting the microservice "CommentService", there may be an event of the user logging in to the account, the event of feeding back comment information, and the event of the user logging out of the account. business scenarios, business scenarios for feedback information, and business scenarios for user logout, etc.
  • the association between the identifier of the business scenario and the traffic management policy may be established before the application requests the microservice.
  • the traffic management device determines the The identification of the business scenario can further determine the corresponding traffic management policy, so that the network traffic generated in the process of the application requesting the micro-service can be effectively managed based on the determined traffic management policy.
  • the traffic management device can also effectively manage the generated network traffic by using the traffic management policy corresponding to the business scenario, so as to avoid the problem of abnormal network traffic caused by unstable network communication.
  • the embodiment of the present application may be applied to the application scenario shown in FIG. 3 .
  • the front-end application 303 may invoke one or more microservices (not shown in FIG. 3 ).
  • the technician 301 can call the traffic management service through a language development framework such as Java/Go or a service grid, and the traffic management service can be implemented by the above-mentioned traffic management device 200.
  • the technician 301 also calls the front-end or back-end application program.
  • the interface application programming interface, API implements policy configuration for the network traffic generated when the front-end application 303 requests the microservice.
  • the front-end application 303 can present a user interface (UI) for human-computer interaction to the technician 301, and the technician 201 can perform operations on the UI interaction interface.
  • UI user interface
  • the technician 301 inputs the identifier of the above-mentioned service scenario, the traffic characteristics and the traffic management policy on the UI interaction interface, and completes the corresponding configuration.
  • the technician 301 may also configure the traffic management policy by calling the back-end API interface, for example, the policy configuration may be completed by means of a command line or the like.
  • the above-mentioned traffic management device 200 may be deployed in the cloud as a cloud service. Then, the technician 301 calls the traffic management device 200 in the cloud through a programming language development framework or a service mesh to perform corresponding operations on network traffic. Policy configuration. Alternatively, the traffic management apparatus 200 may also be deployed locally, such as in a local server. Accordingly, the technician 301 can implement policy configuration of network traffic by invoking the traffic management apparatus 200 on the local server. Of course, in other possible implementations, different modules in the traffic management apparatus 200 may be deployed in the cloud and locally, respectively. For example, the policy storage module 204 and the policy management module 205 in the traffic management apparatus 200 may be deployed in the cloud and stored in the cloud.
  • the cloud saves the association relationship between the traffic management policy configured by the technician 301 and the service scenario identifier; and the parsing module 201, the matching module 202 and the traffic management module 203 in the traffic management device 200 can be deployed locally, and the matching module 202 may pre-fetch the association relationship between the service scenario identifier and the traffic feature from the cloud, and the traffic management module 203 may pre-fetch the association relationship between the service scenario ID and the traffic management policy from the cloud.
  • the above deployment manners are only used for exemplary description, and are not intended to be limiting, and other possible deployment manners may also be used to deploy the traffic management apparatus 200 in practical applications.
  • the user 302 can directly or indirectly trigger the front-end application 303 to call one or more microservices.
  • the user 302 performs an operation of browsing the evaluation information of a certain product on the front-end application 303
  • the front-end application 303 may request the microservice “CommentService” to obtain the product evaluation information to be presented to the user 302 .
  • the traffic management apparatus 200 can manage the network traffic generated when the front-end application 303 requests the micro-service according to the configured traffic management policy.
  • FIG. 4 it is a schematic flowchart of a method for configuring a traffic management policy in an embodiment of the present application.
  • This method can be applied to the traffic management apparatus 200 shown in FIG. 1, and of course, it can also be applied to a separately configured apparatus, which is not limited in this embodiment.
  • the configuration is performed by the traffic management apparatus 200 below.
  • the method of traffic management policy is described as an example.
  • the method for configuring a traffic management policy shown in FIG. 4 may specifically include:
  • the traffic management apparatus 200 acquires an identifier of a service scenario and a first traffic feature corresponding to the identifier of the service scenario, where the first traffic feature is used to describe network traffic in a service scenario corresponding to the identifier of the service scenario.
  • a traffic management policy can be configured for network traffic from the perspective of the business domain, and different business scenarios can be distinguished by using corresponding business scenario identifiers, and the network traffic in the business scenario can be described according to the traffic characteristics of the business scenario .
  • the business scenario refers to an event generated when a user of the application (the user 302 shown in FIG. 3 ) uses the microservice, such as the above-mentioned user login event, user logout event, and the like.
  • the application accesses multiple different microservices, there may be the same business scenarios. For example, when the application accesses multiple microservices such as the microservices "CommentService" and "CreateResource”, there may be business scenarios in which users log in. In this way, when configuring traffic management policies based on business scenarios, only one traffic management policy can be configured for the same business scenario that appears in multiple microservices, thereby reducing the number of traffic management policies configured by technicians.
  • the traffic management policy 200 may first obtain the service scenario identifier and the first traffic feature corresponding to the service scenario identifier, so as to configure the corresponding traffic management policy for the network traffic in the service scenario.
  • the language development framework or service mesh can call the traffic management apparatus 200, and the traffic management apparatus 200 can present a service scenario input interface to the technician, so that the technician can input the corresponding service scenario identifier and traffic characteristics on the service scenario input interface.
  • a language development framework such as a Go language development framework, a Java language development framework
  • the network can call the traffic management apparatus 200, and the traffic management apparatus 200 can present a service scenario input interface to the technician, so that the technician can input the corresponding service scenario identifier and traffic characteristics on the service scenario input interface.
  • the service scenario input interface presented to the technician by the traffic management apparatus 200 may be as shown in FIG.
  • the technician may input a service scenario name (used as a service scenario identifier) on the service scenario input interface, and when requesting a microservice
  • the request method, request path, user name used as the traffic feature to describe the network traffic in this business scenario
  • the traffic management apparatus 200 acquires the service scenario identifier and the corresponding traffic characteristics according to the input operation performed by the technician.
  • the business scenario name is used as the business scenario identifier as an example for illustrative illustration. "(UserActivity), "VIP UserActivity” (VIPUserActivity), etc.
  • the traffic management apparatus 200 may also combine the business scenario name and other information as the business scenario identifier, for example, the business scenario name "create resource” and the specific resource object "order” or "account” ) as a business scenario identifier, at this time, creating an order and creating an account belong to different business scenarios; or, the traffic management device 200 may combine the business scenario name, the name of the network environment (such as cellular data network, WIFI network, etc.) for requesting microservices and The application name of the requesting microservice is used as the business scenario identifier.
  • the business scenario name and other information for example, the business scenario name "create resource” and the specific resource object "order” or "account”
  • the traffic management device 200 may combine the business scenario name, the name of the network environment (such as cellular data network, WIFI network, etc.) for requesting microservices and The application name of the requesting microservice is used as the business scenario identifier.
  • business scenarios with the same business scenario name but different application names are different business scenarios; or, the traffic management policy 200 may associate the business scenario name with user behavior, request source, and resource Any information in the operation is combined to define different types of business scenarios. In this way, more fine-grained division of business scenarios can be achieved.
  • other information may also be used as the service scenario identifier, which is not limited in this embodiment.
  • the above traffic characteristics are not limited to the request method, request path and user name shown in FIG. 5, but can be any of these information, or can also be other information that can be used to describe network traffic, such as The name of the communication protocol used when requesting the micro-service, the header including which browser, mobile phone model, and any information in the operating system that the network traffic originates from, etc.
  • the specific implementation of the traffic characteristics in this embodiment does not be limited.
  • the traffic management apparatus 200 may establish an association between the service scenario identifier and the first traffic feature, so that when the network traffic requesting the microservice has the first traffic feature , the traffic management apparatus 200 may determine that the network traffic belongs to a service scenario associated with the first traffic feature.
  • the business scenario identifier input by the technician may include coarse-grained business scenario descriptions, such as "create resources" and "user activity", and the technician may further input fine-grained business scenario descriptions under the coarse-grained business scenario description.
  • the traffic management policy 200 may establish an association relationship as shown in FIG. 6 based on the service scenario identifier input by the technician and the first traffic feature.
  • the traffic management policy 200 may specifically generate a corresponding configuration file when establishing the relationship between the service scenario identifier and the first traffic feature. For example, for the association relationship shown in FIG. 6 , the traffic management policy 200 may generate the configuration file shown in FIG. 7 .
  • the configuration file on the left side of Figure 7 indicates the relationship between the business scenario identifier "create resource" and its corresponding traffic characteristics
  • the configuration file on the right side of Figure 7 indicates the business scenario identifier "user activity" and its corresponding traffic characteristics relationship between.
  • the traffic management apparatus 200 associates the service scenario identifier with a first traffic management policy, where the first traffic management policy is used to manage network traffic belonging to the service scenario corresponding to the service scenario identifier.
  • the traffic management apparatus 200 stores the association between the service scenario identifier and the traffic management policy.
  • the traffic management apparatus 200 can configure corresponding traffic management policies for management, so as to avoid abnormal network traffic as much as possible.
  • the traffic management apparatus 200 may present a policy configuration interface to the technician, so that the technician can configure the corresponding first traffic management policy for each service scenario on the policy configuration interface.
  • the policy configuration interface presented by the traffic management apparatus 200 may be as shown in FIG. 8
  • the technician may input the corresponding traffic management policy according to the business scenarios and traffic characteristics presented on the policy configuration interface, as shown in FIG. 8 .
  • the traffic management policy input by the technician for the business scenario A and the traffic feature a includes: the request timeout time is 10s, and the upper limit of the number of retries for a request error is 2 times. Then, the traffic management apparatus 200 may establish an association relationship between the first traffic management policy input by the technician and the service scenario identifier.
  • the traffic management apparatus 200 may specifically establish the association relationship between the service scenario identifier and the first traffic management policy in the form of a configuration file.
  • the service scenario identifiers are "UserActivity.login” and "create.order”
  • the first traffic management policy is the upper limit of the number of retries (retry) when the request is incorrect
  • the association between the service identifier and the first traffic management policy is shown in Figure 9, that is, when the business scenario is that a user logs in or creates an order, the maximum number of error retries (MaxAttempts) of its network traffic is 3 times.
  • the policy configuration interface shown in FIG. 8 can also be combined with the business scenario input interface shown in FIG. 5 into one interface, so that technicians can complete the definition of business scenarios and the corresponding business scenarios on the configuration interface at the same time.
  • Configuration of traffic management policies In this way, in the process of configuring the traffic management strategy, technicians can configure the traffic management strategy from the perspective of the business domain, without knowing the microservice architecture under the business system, realizing the decoupling between the configuration traffic management strategy and the microservice architecture. Thereby, the learning cost of technicians can be effectively reduced, and the configuration efficiency can be improved.
  • the traffic management apparatus 200 may further configure a traffic management policy for the microservice. Specifically, in the process of configuring the corresponding traffic management policy according to the business scenario, the traffic management apparatus 200 may also obtain the micro-service identifier and the second traffic feature corresponding to the micro-service identifier at the same time, where the second traffic feature is used to describe the request for the The network traffic generated during the microservice, and then, the traffic management device 200 can associate the microservice identifier with the second traffic management policy, so that the traffic management device 200 can use the second traffic management policy to The network traffic of the corresponding microservice is managed.
  • the traffic management apparatus 200 may, according to the association between the microservice identifier and the second traffic management policy, find out whether the microservice requested by the requesting apparatus 100 has the corresponding second traffic management policy , if found, the network traffic generated by requesting the micro-service can be managed directly based on the found second traffic management policy, and if not found, the device 100 can request the network traffic of the micro-service according to the traffic characteristics of the micro-service , determine the business scenario to which the network traffic belongs, and further according to the relationship between the business scenario identifier and the first traffic management strategy, find out the first traffic management strategy corresponding to the business scenario, and based on the found first traffic management strategy Policies govern this network traffic. In this way, changes to the existing traffic management device 200 can be minimized, and the flexibility and universality of solution implementation can be improved.
  • the second traffic feature and the first traffic feature are used to describe the network traffic generated when the microservice is requested, in some embodiments, some or all of the second traffic feature associated with the microservice identifier may be the same as the first traffic feature. Traffic characteristics are the same.
  • the traffic management apparatus 200 may specifically establish an association relationship between the microservice identifier and the indication information of the second traffic feature, wherein the second traffic feature The indication information of the traffic feature is used to indicate the first traffic feature associated with the service scenario identifier.
  • the traffic management device 200 can reuse the feature description of the first traffic feature without re-pasting the same feature description as the first traffic feature for the microservice identifier, thereby reducing the storage burden and maintenance cost of the traffic management device 200.
  • Reduce redundant configuration For example, assuming that the association relationship (configuration file) between the business scenario identifier (UserActivity) and the first traffic feature (Jack, that is, the user name is Jack) is shown on the left side of FIG.
  • the traffic management apparatus 200 associates the microservice
  • the configuration file generated when identifying ("CommentService) and the second traffic feature can be shown on the right side of Figure 10, where "refer: UserActivity.Jack" in the configuration file is used to indicate the feature description of the second traffic feature
  • the feature descriptions that reuse the first traffic feature all refer to the user name "Jack" of the network traffic.
  • the technical solutions of the embodiments of the present application are described in detail mainly from the perspective of configuring a traffic management policy by the traffic management device 200 .
  • the network will perform network processing on the microservice access request sent by the traffic management device 200 to the requesting device 100 .
  • the specific implementation process of traffic management is exemplarily described.
  • FIG. 11 it is a schematic flowchart of an exemplary method for managing network traffic.
  • the process can be applied to the system architecture shown in FIG. 12 , and the process can specifically include:
  • the matching module 202 pulls the association relationship between the service scenario identifier and the first traffic feature from the policy storage module 204, and the traffic management module 203 pulls the relationship between the service scenario identifier and the first traffic management policy from the policy storage module 204 association relationship.
  • the two association relationships stored in the policy storage module 204 may be established by the policy management module 205 according to the input operation by the technician on the corresponding interface, and the established association relationship is stored in the policy storage module 204 .
  • the policy management module 205 realizes the establishment of the association relationship between the service scenario identifier and the first traffic feature and the first traffic management policy, please refer to the description of the relevant part in the foregoing embodiment, and will not be described here. Repeat.
  • the above-mentioned association relationship may also be pre-established by a technician and stored in the policy storage module 204 .
  • the above step S1101 may not be executed, for example, the matching module 202 and the traffic management module 203 may pre-store the correlation between the corresponding business scenario identifiers and traffic characteristics, as well as the business scenario identifiers and traffic management.
  • the association relationship between policies does not need to be re-pulled from the policy management module 204 every time the network traffic is managed; alternatively, the association relationship stored in the matching module 202 and the traffic management module 203 can also be pre-defined by the technical personnel Static configuration is performed without obtaining from the policy storage module 204 or the like.
  • the requesting apparatus 100 sends an access request for the microservice.
  • the requesting device 100 may send a microservice access request, and the access request carries the target traffic characteristics representing the network traffic generated by requesting the target microservice.
  • the access request may also include the identifier of the target microservice.
  • the requesting apparatus 100 may send a network packet based on the HTTP protocol, where the network packet includes information such as the name of the target microservice "CommentService", the target traffic feature "POST/login” (request method).
  • the requesting apparatus 100 may be, for example, an application that needs to call a microservice, such as a browser.
  • the requesting apparatus 100 may generate an access request for the target microservice under the direct or indirect trigger of the user, and send it to the traffic management apparatus 200 .
  • the parsing module 201 parses the received access request, and stores information such as target traffic characteristics obtained by parsing, wherein the address where the information is stored is indicated by a pointer.
  • the parsing module 201 may run a corresponding parsing model, and through the parsing model, contents such as the name of the target microservice, the target traffic feature, etc. in the data access request can be parsed.
  • the parsing module 201 can store the information obtained by parsing in a corresponding storage area, and use a pointer to indicate a storage address where the information is stored.
  • the matching module 202 determines the target service scenario identifier corresponding to the target traffic feature by searching for the correlation between the service scenario identifier and the first traffic feature according to the information indicated by the pointer.
  • the matching module 202 can determine the target business scenario identifier as “UserActivity” by looking up the correlation according to the target traffic feature “POST/login” indicated by the pointer.
  • the traffic management module 203 determines a target traffic management policy corresponding to the target service scenario identifier by searching for the association relationship between the service scenario identifier and the first traffic management policy according to the determined target service scenario identifier.
  • the traffic management Module 203 determines, according to the target business scenario identifier "UserActivity" determined in step S1004, that the target traffic management policy is the timeout period of 10s and the upper limit of the number of retries is 2, so as to request the requesting device 100 for microservices using the found target traffic management policy.
  • the network traffic generated during the service is managed.
  • the traffic management module 203 manages the network traffic generated when the service execution apparatus 300 requests the micro-service according to the determined target traffic management policy.
  • the traffic management module 203 controls the service execution device 300 Terminate requests for microservices from the business system.
  • the target traffic management policy is to limit the current to 50 times per second
  • the traffic management module 203 controls the service execution device 300 to request microservices from the service system within a unit time (for example, 1 second), which can be limited within 50 times, etc. .
  • the matching module 202 may be multiple target business scenario identifiers determined by the matching module 202 according to the target traffic characteristics, such as including a coarse-grained business scenario description "CreateResource” (create resources) and a fine-grained business scenario name “CreateResource.order”. ” (creating an order), correspondingly, the number of target traffic management policies determined by the traffic management module 203 for multiple business scenario identifiers of different granularities is also multiple.
  • the traffic management module 203 is managing the network traffic.
  • the network traffic can be managed according to the target traffic management policy corresponding to the fine-grained service scenario identifier, for example, the network traffic is managed according to the target traffic management policy corresponding to "CreateResource.order".
  • the traffic management device 200 may determine a traffic management policy according to the business scenario described by the network traffic in the process of requesting the microservice by the requesting device 100, and use the traffic management policy to implement the traffic management policy generated by the requesting microservice. Efficient management of network traffic.
  • the association relationship saved in the matching module 202 may only be the association relationship between the service scenario identifier and the traffic feature, while in other possible embodiments, the matching module 202 may save the service scenario at the same time.
  • the specific implementation process of the traffic management apparatus 200 processing the microservice access request sent by the requesting apparatus 100 may be as shown in FIG. 13 , and the process may be applied to the system architecture shown in FIG. 14 .
  • the traffic management device 200 also has an association relationship between the identification of the business scenario and the traffic management strategy, as well as the identification of the microservice and the traffic management relationship between strategies.
  • the process can include:
  • the matching module 202 pulls the association between the business scenario identifier and the first traffic feature and the association between the microservice identifier and the second traffic feature from the policy storage module 204, and the traffic management module 203 retrieves the association from the policy storage module 204. Pull the association between the business scenario identifier and the first traffic management policy and the association between the microservice identifier and the second traffic management policy.
  • the association relationship stored in the policy storage module 204 may be established by the policy management module 205 according to the input operation by the technician on the corresponding interface, and the established association relationship is stored in the policy storage module 204 .
  • the policy management module 205 realizes the establishment of the association relationship between the business scenario identifier and the first traffic feature and the first traffic management policy, and the association between the microservice identifier and the second traffic feature and the second traffic management policy, respectively
  • the association relationship stored in the policy storage module 204 may also be imported into the policy storage module 204 in advance by a technician, which is not limited in this embodiment.
  • step S1301 may not be executed, for example, the matching module 202 and the traffic management module 203 may store the corresponding associations in advance, and there is no need to obtain them from the policy storage module 204;
  • the association relationship stored in the module 202 and the traffic management module 203 may also be statically configured by a technician in advance, and does not need to be acquired from the policy storage module 204 or the like.
  • S1302 The requesting apparatus 100 sends an access request for the microservice.
  • the parsing module 201 parses the received access request, and stores information such as the target traffic characteristics obtained by parsing, wherein the address where the information is stored is indicated by a pointer.
  • the matching module 202 searches for the association relationship between the microservice identifier and the second traffic feature according to the information indicated by the pointer, and determines whether there is a target microservice identifier matching the target traffic feature.
  • the traffic management module 203 searches for a target traffic management policy associated with the target microservice identifier according to the association relationship between the microservice identifier and the second traffic management policy.
  • the traffic management module 203 manages the network traffic generated when the target microservice is requested according to the determined target traffic management policy.
  • the matching module 202 searches for the association relationship between the business scenario identifier and the first traffic feature according to the information indicated by the pointer, and determines the target business scenario identifier matching the target traffic feature.
  • the traffic management module 203 searches for the target traffic management policy associated with the target service scenario identifier according to the association relationship between the service scenario identifier and the first traffic management policy.
  • the traffic management module 203 manages the network traffic generated when the microservice is requested according to the determined target traffic management policy.
  • Figure 15 provides a computing device. As shown in FIG. 15 , the computing device 1500 may be specifically configured to implement the functions of the traffic management apparatus 200 in the embodiments shown in FIGS. 2 , 11 to 15 .
  • Computing device 1500 includes bus 1501 , processor 1502 and memory 1503 .
  • the processor 1502 and the memory 1503 communicate through the bus 1501 .
  • the bus 1501 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus or the like.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is shown in FIG. 15, but it does not mean that there is only one bus or one type of bus.
  • the processor 1502 may be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc. any one or more of the devices.
  • CPU central processing unit
  • GPU graphics processing unit
  • MP microprocessor
  • DSP digital signal processor
  • the memory 1503 may include volatile memory, such as random access memory (RAM).
  • RAM random access memory
  • the memory 1503 may also include non-volatile memory (non-volatile memory), such as read-only memory (ROM), flash memory, hard drive drive (HDD) or solid state drive (solid state drive) , SSD).
  • ROM read-only memory
  • HDD hard drive drive
  • SSD solid state drive
  • Executable program code is stored in the memory 1503, and the processor 1502 executes the executable program code to execute the traffic management method and/or the method for configuring the traffic management policy performed by the aforementioned traffic management apparatus 200.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium may be any available medium that a computing device can store, or a data storage device such as a data center that contains one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.
  • the computer-readable storage medium includes instructions, the instructions instruct the computing device to execute the traffic management method executed by the traffic management apparatus 200 described above.
  • the embodiments of the present application further provide another computer-readable storage medium.
  • the computer-readable storage medium may be any available medium that a computing device can store, or a data storage device such as a data center that contains one or more available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like.
  • the computer-readable storage medium includes instructions, the instructions instruct the computing device to execute the method for configuring a traffic management policy performed by the traffic management apparatus 200 described above.
  • the embodiments of the present application also provide a computer program product.
  • the computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computing device, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer or data center. (eg coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) to another website site, computer or data center.
  • a website site e.g coaxial cable, fiber optic, digital subscriber line (DSL)
  • wireless eg infrared, wireless, microwave, etc.
  • the computer program product can be a software installation package, which can be downloaded and executed on a computing device if any one of the aforementioned object recognition methods needs to be used.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Provided are a traffic management method and apparatus, a device and a medium. The traffic management method comprises: a traffic management apparatus receiving an access request, for a micro service, of a user of an application, and determining an identifier of a target service scenario according to a target traffic feature included in the access request, wherein the service scenario represents an event of the user of the application using the micro-service; and then, the traffic management apparatus searching for a target traffic management strategy associated with the identifier of the target service scenario, and managing, according to a found target traffic management strategy, network traffic belonging to the target service scenario. Therefore, during the process of an application requesting a micro-service, a traffic management apparatus effectively manages generated network traffic by using a traffic management strategy corresponding to a service scenario, thereby avoiding the problem of a network traffic anomaly caused by unstable network communication.

Description

流量管理、配置流量管理策略的方法、装置、设备及介质Traffic management, method, apparatus, device and medium for configuring traffic management policy
本申请要求于2021年1月5日递交中国国家知识产权局、申请号为202110008946.2,发明名称为“流量管理、配置流量管理策略的方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110008946.2 and the invention titled "Traffic Management, Method, Apparatus, Equipment and Medium for Configuring Traffic Management Policies", which was submitted to the State Intellectual Property Office of China on January 5, 2021, The entire contents of which are incorporated herein by reference.
技术领域technical field
本申请涉及流量管理技术领域,尤其涉及一种流量管理方法、配置流量管理策略的方法、装置、设备及介质。The present application relates to the technical field of traffic management, and in particular, to a traffic management method, a method, apparatus, device and medium for configuring a traffic management policy.
背景技术Background technique
微服务模式(micro service pattern),是指将一项应用拆分成一组相互协作的服务,每个服务可以负责特定的功能,如:实际应用中商城后台系统可以包括商品评价服务、商品描述服务、商品推荐服务等多个微服务;并且,服务之间松耦合(即服务之间的相互依赖程度较低)、可独立部署。当开发者采用微服务模式实现应用时,请求装置(如浏览器等客户端)在请求调用该应用中的微服务的过程中,通常会产生相应的网络流量,如请求评价服务的流量等。实际应用时,远程调用微服务时的网络通信通常是复杂并且不稳定的,因此,需要在调用微服务过程中对网络流量进行有效管理。例如,在远程请求调用微服务时,可能因为网络阻塞等原因导致应用多次向微服务发送请求,为避免应用重复发送的请求过多,可以限制向微服务发送相同请求的次数。The micro service pattern refers to splitting an application into a set of cooperating services, each of which can be responsible for a specific function. For example, in the actual application, the back-end system of the mall can include product evaluation services and product description services. , commodity recommendation service and other microservices; and the services are loosely coupled (that is, the interdependence between services is low) and can be deployed independently. When a developer implements an application in the microservice mode, the requesting device (such as a client such as a browser) usually generates corresponding network traffic in the process of requesting to call the microservice in the application, such as the traffic requesting the evaluation service. In practical applications, the network communication when calling microservices remotely is usually complex and unstable. Therefore, it is necessary to effectively manage network traffic during the process of calling microservices. For example, when a remote request calls a microservice, the application may send requests to the microservice multiple times due to network congestion and other reasons. To avoid the application from repeatedly sending too many requests, you can limit the number of times the same request is sent to the microservice.
因此,如何实现对请求微服务过程中所产生的网络流量进行有效管理,成为亟需解决的重要问题。Therefore, how to effectively manage the network traffic generated in the process of requesting microservices has become an important problem that needs to be solved urgently.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请实施例提供了一种配置流量管理策略的配置方法,以降低配置网络流量管理策略时对于技术人员的学习成本,提高配置效率。本申请还提供了对应的装置、设备、计算机可读存储介质以及计算机程序产品。In view of this, the embodiment of the present application provides a configuration method for configuring a traffic management policy, so as to reduce the learning cost for technicians when configuring the network traffic management policy, and improve the configuration efficiency. The present application also provides corresponding apparatuses, devices, computer-readable storage media, and computer program products.
第一方面,本申请实施例提供了一种流量管理方法,该方法可以应用于相应的流量管理装置中,该流量管理装置可以用于对应用中的微服务的流量进行管理,具体的,流量管理装置可以接收应用的用户对微服务的访问请求,该应用的用户对微服务的访问请求可以是由用户直接或者间接触发而产生的;然后,流量管理装置可以根据接收到的访问请求所包括的目标流量特征,确定目标业务场景的标识,其中,该业务场景表示应用的用户使用该微服务时的一种事件;接着,流量管理装置可以查找与该目标业务场景的标识相关联的目标流量管理策略,并根据查找到的目标流量管理策略管理属于该目标业务场景的网络流量。如此,在应用请求微服务的过程中,流量管理装置可以利用与业务场景对应的流量管理策略对产生的网络流量进行有效管理,从而可以避免因为网络通信不稳定而导致网络流量异常的问题。In a first aspect, an embodiment of the present application provides a traffic management method, which can be applied to a corresponding traffic management device, and the traffic management device can be used to manage the traffic of microservices in the application. Specifically, the traffic The management device may receive an access request to the microservice by the user of the application, and the access request of the user of the application to the microservice may be directly or indirectly triggered by the user; The target traffic characteristics are determined, and the identifier of the target business scenario is determined, wherein the business scenario represents an event when the user of the application uses the microservice; then, the traffic management device can search for the target traffic associated with the identifier of the target business scenario. management policy, and manage the network traffic belonging to the target business scenario according to the found target traffic management policy. In this way, in the process of requesting microservices by an application, the traffic management device can effectively manage the generated network traffic by using the traffic management policy corresponding to the business scenario, so as to avoid the problem of abnormal network traffic caused by unstable network communication.
实际应用时,应用在请求一个微服务的过程中可能会产生多种事件,也即一次请求微服务的过程中可能会存在多种不同的业务场景,从而对于应用请求微服务时所产生的网络流量,流量管理装置可以查找出该网络流量所属业务场景对应的流量管理策略进行流量管 理。In actual application, the application may generate various events in the process of requesting a microservice, that is, there may be various business scenarios in the process of requesting a microservice, so that the network generated when the application requests a microservice may be affected. traffic, the traffic management device can find out the traffic management policy corresponding to the business scenario to which the network traffic belongs to perform traffic management.
在一种可能的实施方式中,流量管理装置在接收到应用的用户对微服务的访问请求之前,还可以预先获取业务场景的标识与业务场景的标识对应的流量特征,并将业务场景的标识与流量管理策略建立关联。如此,技术人员在配置流量管理策略的过程中,无需根据业务系统中的微服务进行配置,也即无需要求技术人员预先了解业务系统后端的微服务架构;同时,不仅多个微服务中均可能存在相同的业务场景(如均存在用户登录场景等),从而技术人员配置流量管理策略的业务场景数量相较于微服务数量较少,而且,技术人员从业务领域视角配置流量管理策略的难度通常也较低。如此,可以有效降低技术人员配置流量管理策略的学习成本,相应的,技术人员配置流量管理策略的效率也能得到提升。In a possible implementation manner, before receiving the access request to the micro-service from the user of the application, the traffic management apparatus may further obtain the traffic feature corresponding to the identifier of the business scenario and the identifier of the business scenario in advance, and use the identifier of the business scenario Associate with traffic management policies. In this way, in the process of configuring traffic management policies, technicians do not need to configure according to the microservices in the business system, that is, they do not need to know the microservice architecture of the backend of the business system in advance; at the same time, not only multiple microservices may There are the same business scenarios (such as user login scenarios, etc.), so the number of business scenarios where technicians configure traffic management policies is less than the number of microservices. Moreover, it is usually difficult for technicians to configure traffic management policies from the perspective of the business domain. also lower. In this way, the learning cost of configuring the traffic management policy by the technicians can be effectively reduced, and accordingly, the efficiency of configuring the traffic management policy by the technicians can also be improved.
可选地,该流量管理装置还可以存储所建立的业务场景的标识与流量管理策略之间的关联,从而每次在确定对于网络流量的管理策略时,可以从本地获取业务场景的标识与流量管理策略之间的关联。Optionally, the traffic management device can also store the association between the established identification of the business scenario and the traffic management strategy, so that each time the management strategy for network traffic is determined, the identification and flow of the business scenario can be obtained locally. Manage associations between policies.
在一种可能的实施方式中,目标业务场景为请求访问多个微服务时均存在的场景,这样,针对于应用访问多个微服务时所产生的网络流量,均可以利用相同业务场景对应的流量管理策略对其进行管理,从而可以有效减少技术人员所需配置的流量管理策略的数量,降低技术人员配置流量管理策略的同时,也能有效提高配置效率。In a possible implementation, the target business scenario is a scenario that exists when requesting access to multiple microservices. In this way, for the network traffic generated when an application accesses multiple microservices, the same business scenario can be used. It can be managed by traffic management policies, which can effectively reduce the number of traffic management policies that technicians need to configure, and can effectively improve configuration efficiency while reducing the number of traffic management policies configured by technicians.
在一种可能的实施方式中,流量管理装置在确定目标业务场景的标识时,具体可以是先查找是否存在与访问请求包括的目标流量特征相匹配的目标微服务的标识,以及与该目标微服务的标识关联的流量管理策略,若不存在与该目标流量特征相匹配的目标微服务的标识,或者不存在与该目标微服务的标识关联的流量管理策略,则认定查找失败,此时,流量管理装置可以根据访问请求包括的目标流量特征确定与其相匹配的目标业务场景的标识,以便基于该目标业务场景的标识进一步确定出用于管理网络流量的流量管理策略。In a possible implementation manner, when determining the identifier of the target service scenario, the traffic management apparatus may specifically check whether there is an identifier of the target microservice that matches the target traffic feature included in the access request, and whether there is an identifier of the target microservice that matches the target traffic feature included in the access request. The traffic management policy associated with the identifier of the service. If there is no identifier of the target microservice that matches the target traffic characteristics, or there is no traffic management policy associated with the identifier of the target microservice, it is determined that the search fails. At this time, The traffic management apparatus may determine the identifier of the target service scenario matching the target traffic feature included in the access request, so as to further determine a traffic management policy for managing network traffic based on the identifier of the target service scenario.
在一种可能的实施方式中,若存在与该目标流量特征相匹配的目标微服务的标识,且存在于该目标微服务的标识关联的流量管理策略,则流量管理装置可以利用成功查找出的流量管理策略对应用请求微服务所产生的网络流量进行管理。如此,针对于已有的流量管理装置依据微服务标识确定流量管理策略的实现方式,可以尽可能减少对于已有的流量管理装置的改动,提高方案实施的灵活性以及普适性。In a possible implementation manner, if there is an identifier of the target microservice that matches the target traffic characteristics, and there is a traffic management policy associated with the identifier of the target microservice, the traffic management apparatus can use the successfully found The traffic management policy manages the network traffic generated by the application requesting microservices. In this way, for the existing traffic management device to determine the traffic management strategy based on the microservice identifier, changes to the existing traffic management device can be reduced as much as possible, and the flexibility and universality of the solution implementation can be improved.
在一种可能的实施方式中,流量管理装置在查找出与微服务的标识关联的流量管理策略之前,还可以预先将微服务的标识与流量管理策略建立关联,并存储该微服务的标识与第二流量管理策略之间的关联,以便流量管理装置还可以根据微服务标识确定用于管理网络流量的流量管理策略。In a possible implementation manner, before finding out the traffic management policy associated with the identifier of the microservice, the traffic management apparatus may further associate the identifier of the microservice with the traffic management policy in advance, and store the identifier of the microservice with the traffic management policy. The association between the second traffic management policies, so that the traffic management apparatus can also determine a traffic management policy for managing network traffic according to the microservice identifier.
在一种可能的实施方式中,流量管理装置在获取业务场景的标识以及该业务场景的标识对应的流量特征时,具体可以是向技术人员呈现业务场景输入界面,并响应技术人员针对于业务场景输入的输入操作,获取其输入的业务场景的标识以及该业务场景的标识对应的流量特征。如此,通过可视化的业务场景输入界面,方便技术人员对于业务场景以及流量特征的输入。In a possible implementation manner, when acquiring the identifier of the business scenario and the traffic characteristics corresponding to the identifier of the business scenario, the traffic management device may specifically present a business scenario input interface to the technician, and respond to the technical staff's specific request for the business scenario For the input operation, the identifier of the input business scenario and the traffic characteristics corresponding to the identifier of the business scenario are obtained. In this way, through the visualized business scenario input interface, it is convenient for technicians to input business scenarios and traffic characteristics.
在一种可能的实施方式中,流量管理装置在将业务场景的标识与流量管理策略建立关联时,具体可以是向技术人员呈现策略配置界面,并响应技术人员针对于流量管理策略的 配置操作,将业务场景的标识与流量管理策略建立关联。如此,通过可视化的策略配置界面,方便技术人员对于不同业务场景对应的流量管理策略进行配置。In a possible implementation manner, when the traffic management device associates the identifier of the service scenario with the traffic management policy, it may specifically present a policy configuration interface to the technician, and respond to the technician's configuration operation for the traffic management policy, Associate the identifier of the business scenario with the traffic management policy. In this way, through the visualized policy configuration interface, it is convenient for technicians to configure traffic management policies corresponding to different business scenarios.
第二方面,本申请实施例还提供了一种配置流量管理策略的方法,该方法应用于流量管理装置,并且,流量管理装置在接收应用的用户对第一微服务的访问请求之前,先获取业务场景的标识以及该业务场景的标识对应的流量特征,并将获取的业务场景的标识与流量管理策略建立关联,然后将建立的业务场景的标识与流量管理策略之间的关联关系进行存储,其中,流量管理策略用于对属于该业务场景标识对应的业务场景的网络流量进行管理。In a second aspect, an embodiment of the present application further provides a method for configuring a traffic management policy, the method is applied to a traffic management device, and the traffic management device obtains an access request to the first microservice from a user of the application before receiving the request. The identifier of the business scenario and the traffic feature corresponding to the identifier of the business scenario, associate the acquired identifier of the business scenario with the traffic management policy, and then store the established association between the identifier of the business scenario and the traffic management policy, The traffic management policy is used to manage the network traffic belonging to the service scenario corresponding to the service scenario identifier.
如此,技术人员在配置流量管理策略的过程中,无需根据业务系统中的微服务进行配置,也即无需要求技术人员预先了解业务系统后端的微服务架构;同时,不仅多个微服务中均可能存在相同的业务场景(如均存在用户登录场景等),从而技术人员配置流量管理策略的业务场景数量相较于微服务数量较少,而且,技术人员从业务领域视角配置流量管理策略的难度通常也较低。如此,可以有效降低技术人员配置流量管理策略的学习成本,相应的,技术人员配置流量管理策略的效率也能得到提升。In this way, in the process of configuring traffic management policies, technicians do not need to configure according to the microservices in the business system, that is, they do not need to know the microservice architecture of the backend of the business system in advance; at the same time, not only multiple microservices may There are the same business scenarios (such as user login scenarios, etc.), so the number of business scenarios where technicians configure traffic management policies is less than the number of microservices. Moreover, it is usually difficult for technicians to configure traffic management policies from the perspective of the business domain. also lower. In this way, the learning cost of configuring the traffic management policy by the technicians can be effectively reduced, and accordingly, the efficiency of configuring the traffic management policy by the technicians can also be improved.
在一种可能的实施方式中,目标业务场景为请求访问多个微服务时均存在的场景,这样,针对于应用访问多个微服务时所产生的网络流量,均可以利用相同业务场景对应的流量管理策略对其进行管理,从而可以有效减少技术人员所需配置的流量管理策略的数量,降低技术人员配置流量管理策略的同时,也能有效提高配置效率。In a possible implementation, the target business scenario is a scenario that exists when requesting access to multiple microservices. In this way, for the network traffic generated when an application accesses multiple microservices, the same business scenario can be used. It can be managed by traffic management policies, which can effectively reduce the number of traffic management policies that technicians need to configure, and can effectively improve configuration efficiency while reducing the number of traffic management policies configured by technicians.
第三方面,本申请实施例还提供了一种流量管理装置该流量管理装置用于对应用中的微服务的流量进行管理,该装置包括解析模块、匹配模块以及流量管理模块。其中,解析模块,用于接收应用的用户对微服务的访问请求;匹配模块,用于根据访问请求包括的目标流量特征,确定目标业务场景的标识,其中,目标业务场景表示应用的用户使用微服务时的一种事件;流量管理模块,用于查找与目标业务场景的标识关联的目标流量管理策略,并根据目标流量管理策略管理属于目标业务场景的网络流量。In a third aspect, an embodiment of the present application further provides a traffic management device. The traffic management device is used to manage the traffic of microservices in an application, and the device includes a parsing module, a matching module, and a traffic management module. Among them, the parsing module is used to receive the access request of the user of the application to the micro-service; the matching module is used to determine the identifier of the target business scenario according to the target traffic characteristics included in the access request, wherein the target business scenario indicates that the user of the application uses the micro-service. An event during service; the traffic management module is used to find the target traffic management policy associated with the identifier of the target business scenario, and manage the network traffic belonging to the target business scenario according to the target traffic management policy.
在一种可能的实施方式中,装置还包括:策略管理模块,用于在接收应用的用户对微服务的访问请求之前,获取业务场景的标识以及业务场景的标识对应的流量特征,并将业务场景的标识与流量管理策略建立关联。In a possible implementation manner, the apparatus further includes: a policy management module, configured to obtain the identifier of the business scenario and the traffic characteristics corresponding to the identifier of the business scenario before receiving the access request for the micro-service from the user of the application, and assign the service The identifier of the scene is associated with the traffic management policy.
可选地,该装置还可以包括策略存储模块,用于存储策略管理模块所建立的业务场景的标识与流量管理策略之间的关联。Optionally, the apparatus may further include a policy storage module for storing the association between the identifier of the business scenario established by the policy management module and the traffic management policy.
在一种可能的实施方式中,目标业务场景为请求访问多个微服务时均存在的场景。In a possible implementation, the target business scenario is a scenario that exists when requesting access to multiple microservices.
在一种可能的实施方式中,匹配模块,具体用于:查找与微服务的访问请求包括的目标流量特征相匹配的目标微服务的标识以及与目标微服务的标识关联的流量管理策略;并且,当查找失败时,根据目标流量特征确定目标业务场景的标识。In a possible implementation manner, the matching module is specifically configured to: find an identifier of the target microservice that matches the target traffic feature included in the access request of the microservice and a traffic management policy associated with the identifier of the target microservice; and , when the search fails, determine the identifier of the target business scenario according to the target traffic characteristics.
在一种可能的实施方式中,策略管理模块,具体用于:呈现业务场景输入界面;并响应针对于业务场景的输入操作,获取业务场景的标识以及业务场景的标识对应的流量特征。In a possible implementation, the policy management module is specifically configured to: present a business scenario input interface; and in response to an input operation for the business scenario, obtain an identifier of the business scenario and a traffic feature corresponding to the identifier of the business scenario.
在一种可能的实施方式中,策略管理模块,具体用于:呈现策略配置界面;并响应针对于流量管理策略的配置操作,将业务场景的标识与流量管理策略建立关联。In a possible implementation manner, the policy management module is specifically configured to: present a policy configuration interface; and in response to a configuration operation for the traffic management policy, associate the identifier of the service scenario with the traffic management policy.
第四方面,本申请实施例还提供了一种流量管理装置,该装置包括策略管理模块以及 策略存储模块。其中,策略管理模块,具体用于在接收应用的用户对微服务的访问请求之前,获取业务场景的标识以及业务场景的标识对应的流量特征,将业务场景的标识与流量管理策略建立关联;策略存储模块,具体用于存储业务场景的标识与流量管理策略之间的关联,其中,流量管理策略用于对属于业务场景标识对应的业务场景的网络流量进行管理。In a fourth aspect, an embodiment of the present application further provides a traffic management device, the device includes a policy management module and a policy storage module. Among them, the policy management module is specifically used to obtain the identifier of the business scenario and the traffic characteristics corresponding to the identifier of the business scenario before receiving the access request of the user of the application to the microservice, and to associate the identifier of the business scenario with the traffic management policy; the policy The storage module is specifically used to store the association between the identifier of the service scenario and the traffic management policy, wherein the traffic management policy is used to manage the network traffic belonging to the service scenario corresponding to the service scenario identifier.
在一种可能的实施方式中,目标业务场景为请求访问多个微服务时均存在的场景。In a possible implementation, the target business scenario is a scenario that exists when requesting access to multiple microservices.
第五方面,本申请提供一种计算设备,所述计算设备包括处理器、存储器和显示器。所述处理器、所述存储器进行相互的通信。所述处理器用于执行存储器中存储的指令,以使得计算设备执行如第一方面或第一方面的任一种实现方式中的流量管理方法。In a fifth aspect, the present application provides a computing device including a processor, a memory and a display. The processor and the memory communicate with each other. The processor is configured to execute instructions stored in the memory, so that the computing device executes the traffic management method according to the first aspect or any one of the implementations of the first aspect.
第六方面,本申请提供一种计算设备,所述计算设备包括处理器、存储器和显示器。所述处理器、所述存储器进行相互的通信。所述处理器用于执行存储器中存储的指令,以使得计算设备执行如第二方面或第二方面的任一种实现方式中的配置流量管理策略的方法。In a sixth aspect, the present application provides a computing device including a processor, a memory and a display. The processor and the memory communicate with each other. The processor is configured to execute instructions stored in the memory to cause the computing device to perform the method of configuring a traffic management policy as in the second aspect or any implementation manner of the second aspect.
第七方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算设备上运行时,使得计算设备执行上述第一方面或第一方面的任一种实现方式所述的流量管理方法。In a seventh aspect, the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium is run on a computing device, the computing device is made to perform the first aspect or any of the first aspects. A traffic management method described in an implementation manner.
第八方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算设备上运行时,使得计算设备执行上述第二方面或第二方面的任一种实现方式所述的配置流量管理策略的方法。In an eighth aspect, the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, which, when executed on a computing device, cause the computing device to perform the second aspect or any of the second aspects. A method for configuring a traffic management policy described in an implementation manner.
第九方面,本申请提供了一种包含指令的计算机程序产品,当其在计算设备上运行时,使得计算设备执行上述第一方面或第一方面的任一种实现方式所述的流量管理方法。In a ninth aspect, the present application provides a computer program product containing instructions, which, when run on a computing device, enables the computing device to execute the traffic management method described in the first aspect or any implementation manner of the first aspect .
第十方面,本申请提供了一种包含指令的计算机程序产品,当其在计算设备上运行时,使得计算设备执行上述第二方面或第二方面的任一种实现方式所述的配置流量管理策略的方法。In a tenth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device, cause the computing device to perform the configuration traffic management described in the second aspect or any implementation manner of the second aspect. method of strategy.
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。On the basis of the implementation manners provided by the above aspects, the present application may further combine to provide more implementation manners.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some implementations described in the present application. For example, for those skilled in the art, other drawings can also be obtained from these drawings.
图1为本申请一示例性系统架构示意图;FIG. 1 is a schematic diagram of an exemplary system architecture of the application;
图2为一具体实例示意图;Fig. 2 is a specific example schematic diagram;
图3为本申请实施例提供的一示例性应用场景示意图;FIG. 3 is a schematic diagram of an exemplary application scenario provided by an embodiment of the present application;
图4为本申请实施例提供的一种配置流量管理策略的方法流程示意图;4 is a schematic flowchart of a method for configuring a traffic management policy according to an embodiment of the present application;
图5为本申请实施例提供的一示例性业务场景输入界面的示意图;5 is a schematic diagram of an exemplary business scenario input interface provided by an embodiment of the present application;
图6为本申请实施例提供的业务场景标识以及第一流量特征的关联关系示意图;6 is a schematic diagram of an association relationship between a service scenario identifier and a first traffic feature provided by an embodiment of the present application;
图7为本申请实施例提供的配置文件示意图;7 is a schematic diagram of a configuration file provided by an embodiment of the present application;
图8为本申请实施例提供的一示例性策略配置界面的示意图;8 is a schematic diagram of an exemplary policy configuration interface provided by an embodiment of the present application;
图9为本申请实施例提供的又一种配置文件的示意图;FIG. 9 is a schematic diagram of another configuration file provided by an embodiment of the present application;
图10为第二流量特征复用第一流量特征的示意图;10 is a schematic diagram of multiplexing a first traffic feature with a second traffic feature;
图11为本申请实施例提供的一示例性管理网络流量的方法流程示意图;FIG. 11 is a schematic flowchart of an exemplary method for managing network traffic provided by an embodiment of the present application;
图12为本申请实施例提供的一示例性系统架构示意图;FIG. 12 is a schematic diagram of an exemplary system architecture provided by an embodiment of the present application;
图13为本申请实施例提供的又一示例性管理网络流量的方法流程示意图;13 is a schematic flowchart of another exemplary method for managing network traffic provided by an embodiment of the present application;
图14为本申请实施例提供的又一示例性系统架构示意图;FIG. 14 is a schematic diagram of another exemplary system architecture provided by an embodiment of the present application;
图15为本申请实施例提供的一种计算设备的硬件结构示意图。FIG. 15 is a schematic diagram of a hardware structure of a computing device according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请中的附图,对本申请提供的实施例中的方案进行描述。The solutions in the embodiments provided in this application will be described below with reference to the accompanying drawings in this application.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。The terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, and this is only a distinguishing manner adopted when describing objects with the same attributes in the embodiments of the present application.
如图1所示,为一示例性系统架构示意图。如图1所示,该系统包括请求装置100、流量管理装置200以及业务执行装置300。其中请求装置100例如是客户端等,并且可以通过开放式系统互联模型(Open System Interconnection Model,OSI)中的第七层协议(即应用层,Application Layer)向业务系统请求访问任意一种或多种微服务。其中,流量管理装置200可以对请求装置100访问微服务过程中所产生的网络流量进行管理,其可以包括解析模块201、匹配模块202、流量管理模块203、策略存储模块204以及策略管理模块205;业务执行装置300用于根据请求装置100所请求的微服务执行相应的业务。前述业务系统可以实现为一项应用,因此,该应用包括多个微服务,每个微服务实现该应用的特定功能。应用可以被发布和使用,应用的用户使用应用时,应用中的一个或多个微服务被运行以向以应用的用户提供相应的响应。前述请求装置100向业务系统请求访问任意一种或多种微服务,可以是在应用的用户使用应用时,由应用的用户直接或间接触发的。As shown in FIG. 1 , it is a schematic diagram of an exemplary system architecture. As shown in FIG. 1 , the system includes a request device 100 , a traffic management device 200 and a service execution device 300 . Wherein the requesting device 100 is, for example, a client, etc., and can request access to any one or more from the business system through the seventh layer protocol (ie the application layer, Application Layer) in the Open System Interconnection Model (OSI) kind of microservices. Wherein, the traffic management device 200 can manage the network traffic generated in the process of accessing the microservice by the requesting device 100, which can include a parsing module 201, a matching module 202, a traffic management module 203, a policy storage module 204, and a policy management module 205; The service executing apparatus 300 is configured to execute a corresponding service according to the microservice requested by the requesting apparatus 100 . The aforementioned business system can be implemented as an application, and therefore, the application includes a plurality of microservices, and each microservice implements a specific function of the application. An application can be published and used, and when a user of the application uses the application, one or more microservices in the application are run to provide corresponding responses to the user of the application. The foregoing requesting apparatus 100 requests access to any one or more microservices from the business system, which may be directly or indirectly triggered by the user of the application when the user of the application uses the application.
具体实现时,解析模块201可以对请求装置100发送的微服务访问请求进行解析,获得该微服务访问请求中所携带的微服务标识、请求方式、用户名等内容。例如,请求装置100所发送的微服务访问请求可以如图2所示的超文本传输协议(HyperText Transfer Protocol,HTTP)报文,解析模块201对该HTTP报文进行解析,确定所要访问的微服务为“CommentService”(评价服务),请求方式为“GET”,用户名(X-User)为“Jack”,其中,所解析出的信息可以被存储于相应的地址中并利用指针指示存储这些信息的地址。During specific implementation, the parsing module 201 may parse the microservice access request sent by the requesting device 100 to obtain the microservice identifier, request method, user name and other contents carried in the microservice access request. For example, the microservice access request sent by the requesting device 100 may be a HyperText Transfer Protocol (HyperText Transfer Protocol, HTTP) message as shown in FIG. 2 , and the parsing module 201 parses the HTTP message to determine the microservice to be accessed. It is "CommentService" (evaluation service), the request method is "GET", and the user name (X-User) is "Jack", wherein the parsed information can be stored in the corresponding address and the pointer is used to indicate that the information is stored the address of.
然后,匹配模块202在预先保存的微服务列表中查找出该指针所指示的微服务,并根据查找出的微服务以及指针所指示的其它信息从该微服务列表中进一步查找出请求该微服务的网络流量所属的类别。比如,在图2所示实例中,匹配模块202根据指针所指示的微服务名称“CommentService”,在微服务列表中查找出该微服务,并根据指针所指示的用户名“JACK”确定子集名称为“子集A”。其中,不同子集名称代表了不同类别的网络流量,并且每个子集名称具有相应的流量特征。如图2中的“子集A”表征了网络流量来自用户“JACK”,而“子集B”表征了网络流量来自Linux操作系统下的Chrome浏览器。Then, the matching module 202 finds the microservice indicated by the pointer in the pre-stored list of microservices, and further finds out the microservice that requests the microservice from the microservice list according to the found microservice and other information indicated by the pointer. The category to which the network traffic belongs. For example, in the example shown in FIG. 2, the matching module 202 finds the microservice in the list of microservices according to the microservice name "CommentService" indicated by the pointer, and determines the subset according to the user name "JACK" indicated by the pointer Named "Subset A". Among them, different subset names represent different types of network traffic, and each subset name has corresponding traffic characteristics. "Subset A" in Figure 2 represents that the network traffic comes from the user "JACK", while "Subset B" represents that the network traffic comes from the Chrome browser under the Linux operating system.
接着,流量管理模块203可以根据查找出的网络流量所属的类别(即子集),通过查找子集名称与流量管理策略关联表确定该网络流量的子集名称对应的流量管理策略,并基于确定出的流量管理策略,采用相应的管理单元对请求微服务所产生的网络流量进行管理, 如图1中的重试单元2031负责管理向业务系统请求微服务的重试次数、超时单元2032负责管理向业务系统请求微服务时的超时时间、限流模块2033负责管理向业务系统请求微服务的频次等。仍以图2为例,流量管理模块203可以根据匹配模块202所确定出的子集名称“子集A”,查找预先保存的子集名称与流量管理策略的关联表,以此确定出请求微服务“CommentService”所产生的网络流量的配置为超时判定的时间阈值为10s(秒),请求错误重试的次数上限为2次,则在向业务系统请求该微服务“CommentService”时,若业务系统持续10秒未响应或者重新向业务系统发起请求的次数达到2次并仍然存在请求错误时,重试单元2031或超时单元2032控制停止此次请求装置100的微服务请求过程,以避免请求装置100此次请求微服务时的网络流量异常而导致请求装置100与业务系统之间的网络出现网络流量过大等系列问题,实现对网络流量的有效管理。Next, the traffic management module 203 can determine the traffic management policy corresponding to the subset name of the network traffic by looking up the association table between the subset name and the traffic management policy according to the category (ie the subset) to which the found network traffic belongs, and based on the determination The corresponding management unit is used to manage the network traffic generated by requesting microservices. As shown in Figure 1, the retry unit 2031 is responsible for managing the number of retries for requesting microservices from the business system, and the timeout unit 2032 is responsible for managing The timeout when requesting microservices from the business system, and the current limiting module 2033 is responsible for managing the frequency of requesting microservices from the business system, etc. Still taking FIG. 2 as an example, the traffic management module 203 may search the pre-saved association table between the subset name and the traffic management policy according to the subset name “subset A” determined by the matching module 202, thereby determining the request microarray. The network traffic generated by the service "CommentService" is configured as a timeout judgment time threshold of 10s (seconds), and the maximum number of retries for request errors is 2 times. When requesting the microservice "CommentService" from the business system, if the business When the system does not respond for 10 seconds or the number of re-initiated requests to the business system reaches 2 times and there is still a request error, the retry unit 2031 or the timeout unit 2032 controls to stop the microservice request process of the requesting device 100 this time, so as to avoid the requesting device 100 The abnormal network traffic when requesting the micro-service this time causes a series of problems such as excessive network traffic in the network between the requesting device 100 and the business system, so as to achieve effective management of the network traffic.
其中,匹配模块202中存储的微服务列表以及流量管理模块203存储的子集名称与流量管理策略的关联表,可以预先从策略存储模块204中拉取。其中,该关联表也可以是由策略管理模块205预先进行建立,并将发送至策略存储模块204中进行存储。实际应用时,该策略管理模块205还可以对策略存储模块204中存储的关联表进行更新。当然,在其它可能的实施方式中,该关联表可以预先由技术人员完成配置并统一存储于策略存储模块204中。The list of microservices stored in the matching module 202 and the association table between the subset names and the traffic management policies stored in the traffic management module 203 may be pulled from the policy storage module 204 in advance. The association table may also be pre-established by the policy management module 205 and sent to the policy storage module 204 for storage. In practical application, the policy management module 205 can also update the association table stored in the policy storage module 204 . Of course, in other possible implementations, the association table may be configured by a technician in advance and stored in the policy storage module 204 in a unified manner.
因此,在实现对网络流量的管理时,需要预先为匹配模块202配置微服务标识及该微服务标识所对应的流量特征。否则,当请求装置100所请求的微服务在匹配模块202中不存在相应的微服务标识与之匹配时,则流量管理装置200无法为请求装置100所请求的微服务确定相应的流量管理策略,从而容易出现因为网络通信不稳定而导致网络流量异常的问题。Therefore, when implementing the management of network traffic, the matching module 202 needs to be pre-configured with a microservice identifier and a traffic feature corresponding to the microservice identifier. Otherwise, when the microservice requested by the requesting device 100 does not have a corresponding microservice identifier in the matching module 202 to match, the traffic management device 200 cannot determine the corresponding traffic management policy for the microservice requested by the requesting device 100, Therefore, the problem of abnormal network traffic due to unstable network communication is prone to occur.
但是,实际应用时,业务系统的功能通常较为丰富,这意味着业务系统所包括的微服务数量众多,因此,为尽可能避免向业务系统请求微服务时出现网络流量异常,技术人员需要预先了解业务系统后端的微服务架构(即业务系统中包括的各个微服务),并针对于每个微服务单独配置相应的流量管理策略,这使得技术人员的学习成本较高,并且逐个为微服务配置流量管理策略的效率较低。However, in practical applications, the functions of the business system are usually rich, which means that the business system includes a large number of microservices. Therefore, in order to avoid abnormal network traffic when requesting microservices from the business system as much as possible, technicians need to know in advance. The microservice architecture of the backend of the business system (that is, each microservice included in the business system), and the corresponding traffic management strategy is separately configured for each microservice, which makes the learning cost of technicians high, and configures the microservices one by one Traffic management strategies are less efficient.
为此,本申请实施例中可以从业务场景维度对应用请求微服务时所产生的网络流量进行管理。其中,业务场景,是指应用在请求微服务时所产生的一种事件,并且,应用在请求一个微服务的过程中可能会产生多种事件,也即一次请求微服务的过程中可能会存在多种不同的业务场景。比如,在应用请求微服务“CommentService”的过程中,可能存在用户登录账号的事件、反馈评论信息的事件、用户注销账号的事件等,则,此次请求微服务“CommentService”时,存在用户登录的业务场景、反馈信息的业务场景以及用户注销的业务场景等。To this end, in the embodiment of the present application, the network traffic generated when the application requests the micro-service can be managed from the dimension of the business scenario. Among them, the business scenario refers to an event generated by the application when requesting a microservice, and the application may generate a variety of events in the process of requesting a microservice, that is, there may exist in the process of requesting a microservice A variety of different business scenarios. For example, in the process of the application requesting the microservice "CommentService", there may be an event of the user logging in to the account, the event of feeding back comment information, and the event of the user logging out of the account. business scenarios, business scenarios for feedback information, and business scenarios for user logout, etc.
具体的,在应用请求微服务之前,可以先建立业务场景的标识与流量管理策略之间的关联,这样,在应用请求微服务的过程中,流量管理装置通过确定请求微服务的过程中所存在的业务场景的标识,可以进一步确定相应的流量管理策略,从而能够基于所确定出流量管理策略对应用请求微服务的过程中所产生的网络流量进行有效管理。在技术人员预先(如流量管理装置的管理员等)配置流量管理策略的过程中,无需根据业务系统中的微服务进行配置,从而无需要求技术人员了解业务系统后端的微服务架构;并且,一方面多个微服务中均可能存在相同的业务场景(如均存在用户登录场景等),从而技术人员配置流 量管理策略的业务场景数量相较于微服务数量较少,另一方面,技术人员从业务领域视角配置流量管理策略的难度通常也较低。如此,可以有效降低技术人员配置流量管理策略的学习成本,相应的,配置流量管理策略的效率也能得到提升。同时,在应用调用微服务的过程中,流量管理装置也能利用与业务场景对应的流量管理策略对产生的网络流量进行有效管理,避免因为网络通信不稳定而导致网络流量异常的问题。Specifically, before the application requests the microservice, the association between the identifier of the business scenario and the traffic management policy may be established. In this way, in the process of requesting the microservice by the application, the traffic management device determines the The identification of the business scenario can further determine the corresponding traffic management policy, so that the network traffic generated in the process of the application requesting the micro-service can be effectively managed based on the determined traffic management policy. In the process of configuring traffic management policies in advance by technicians (such as administrators of traffic management devices, etc.), there is no need to configure according to the microservices in the business system, so that the technicians do not need to understand the microservice architecture of the backend of the business system; and, a On the one hand, multiple microservices may have the same business scenarios (such as user login scenarios, etc.), so the number of business scenarios where technicians configure traffic management policies is less than the number of microservices. It is also generally less difficult to configure traffic management policies from a business domain perspective. In this way, the learning cost of configuring the traffic management policy can be effectively reduced, and accordingly, the efficiency of configuring the traffic management policy can be improved. At the same time, in the process of invoking the micro-service by the application, the traffic management device can also effectively manage the generated network traffic by using the traffic management policy corresponding to the business scenario, so as to avoid the problem of abnormal network traffic caused by unstable network communication.
作为一种示例,本申请实施例可以应用于如图3所示的应用场景。在该场景中,前端应用303可以调用一个或者多个微服务(图3中未示出)。技术人员301可以通过Java/Go等语言开发框架或者服务网格调用流量管理服务,该流量管理服务具体可以是通过上述流量管理装置200实现,同时,技术人员301还通过调用前端或者后端的应用程序接口(application programming interface,API)实现对前端应用303请求微服务时所产生的网络流量进行策略配置。具体的,在调用前端API接口配置和管理网络流量时,前端应用303可以向技术人员301呈现用于人机交互的用户界面(user interface,UI),技术人员201可以在该UI交互界面上进行相应的配置和管理操作,如技术人员301在该UI交互界面上输入上述业务场景的标识、流量特征以及流量管理策略并完成相应配置。或者,技术人员301也可以是通过调用后端API接口进行流量管理策略的配置,如可以是通过命令行等方式完成策略配置等。As an example, the embodiment of the present application may be applied to the application scenario shown in FIG. 3 . In this scenario, the front-end application 303 may invoke one or more microservices (not shown in FIG. 3 ). The technician 301 can call the traffic management service through a language development framework such as Java/Go or a service grid, and the traffic management service can be implemented by the above-mentioned traffic management device 200. At the same time, the technician 301 also calls the front-end or back-end application program. The interface (application programming interface, API) implements policy configuration for the network traffic generated when the front-end application 303 requests the microservice. Specifically, when calling the front-end API interface to configure and manage network traffic, the front-end application 303 can present a user interface (UI) for human-computer interaction to the technician 301, and the technician 201 can perform operations on the UI interaction interface. For the corresponding configuration and management operations, for example, the technician 301 inputs the identifier of the above-mentioned service scenario, the traffic characteristics and the traffic management policy on the UI interaction interface, and completes the corresponding configuration. Alternatively, the technician 301 may also configure the traffic management policy by calling the back-end API interface, for example, the policy configuration may be completed by means of a command line or the like.
实际应用时,上述流量管理装置200可以是作为云服务部署在云端,则,技术人员301在通过程序语言开发框架或者服务网格调用云端中的流量管理装置200,以针对于网络流量进行相应的策略配置。或者,流量管理装置200也可以是被部署于本地,如部署于本地服务器中,相应的,技术人员301可以通过调用本地服务器上的流量管理装置200实现网络流量的策略配置。当然,在其它可能的实施方式中,流量管理装置200中的不同模块可以分别部署于云端与本地,如流量管理装置200中的策略存储模块204、策略管理模块205可以被部署于云端,并在云端保存技术人员301已配置的流量管理策略与业务场景标识之间的关联关系;而流量管理装置200中的解析模块201、匹配模块202以及流量管理模块203可以被部署于本地,并且,匹配模块202可以预先从云端拉取业务场景标识与流量特征之间的关联关系,以及流量管理模块203预先从云端拉取业务场景标识与流量管理策略之间的关联关系。应理解,上述部署方式仅用于示例性说明,并不用于进行限定,实际应用中也可以是采用其它可能的部署方式对流量管理装置200进行部署。In practical application, the above-mentioned traffic management device 200 may be deployed in the cloud as a cloud service. Then, the technician 301 calls the traffic management device 200 in the cloud through a programming language development framework or a service mesh to perform corresponding operations on network traffic. Policy configuration. Alternatively, the traffic management apparatus 200 may also be deployed locally, such as in a local server. Accordingly, the technician 301 can implement policy configuration of network traffic by invoking the traffic management apparatus 200 on the local server. Of course, in other possible implementations, different modules in the traffic management apparatus 200 may be deployed in the cloud and locally, respectively. For example, the policy storage module 204 and the policy management module 205 in the traffic management apparatus 200 may be deployed in the cloud and stored in the cloud. The cloud saves the association relationship between the traffic management policy configured by the technician 301 and the service scenario identifier; and the parsing module 201, the matching module 202 and the traffic management module 203 in the traffic management device 200 can be deployed locally, and the matching module 202 may pre-fetch the association relationship between the service scenario identifier and the traffic feature from the cloud, and the traffic management module 203 may pre-fetch the association relationship between the service scenario ID and the traffic management policy from the cloud. It should be understood that the above deployment manners are only used for exemplary description, and are not intended to be limiting, and other possible deployment manners may also be used to deploy the traffic management apparatus 200 in practical applications.
在技术人员301通过流量管理装置完成策略配置后,用户302可以直接或者间接触发前端应用303调用一个或者多个微服务,如用户302在该前端应用303上执行浏览某一商品的评价信息的操作时,前端应用303可以请求微服务“CommentService”来获取待呈现给用户302的商品评价信息。在前端应用303请求微服务的过程中,流量管理装置200可以根据已配置的流量管理策略对前端应用303请求微服务时所产生的网络流量进行相应管理。After the technician 301 completes the policy configuration through the traffic management device, the user 302 can directly or indirectly trigger the front-end application 303 to call one or more microservices. For example, the user 302 performs an operation of browsing the evaluation information of a certain product on the front-end application 303 , the front-end application 303 may request the microservice “CommentService” to obtain the product evaluation information to be presented to the user 302 . During the process that the front-end application 303 requests the micro-service, the traffic management apparatus 200 can manage the network traffic generated when the front-end application 303 requests the micro-service according to the configured traffic management policy.
接下来,对对象识别的各种非限定性的具体实施方式进行详细描述。Next, various non-limiting embodiments of object recognition are described in detail.
参阅图4,为本申请实施例中一种配置流量管理策略的方法的流程示意图。该方法可以应用于上述图1所示的流量管理装置200,当然也可以是应用于单独配置的装置中,本实施例对此并不进行限定,为便于描述,下面以流量管理装置200执行配置流量管理策略的方式为例进行说明。图4所示的配置流量管理策略的方法具体可以包括:Referring to FIG. 4 , it is a schematic flowchart of a method for configuring a traffic management policy in an embodiment of the present application. This method can be applied to the traffic management apparatus 200 shown in FIG. 1, and of course, it can also be applied to a separately configured apparatus, which is not limited in this embodiment. For the convenience of description, the configuration is performed by the traffic management apparatus 200 below. The method of traffic management policy is described as an example. The method for configuring a traffic management policy shown in FIG. 4 may specifically include:
S401:流量管理装置200获取业务场景的标识以及该业务场景的标识对应的第一流量特征,其中,该第一流量特征用于描述该业务场景的标识对应的业务场景下的网络流量。S401: The traffic management apparatus 200 acquires an identifier of a service scenario and a first traffic feature corresponding to the identifier of the service scenario, where the first traffic feature is used to describe network traffic in a service scenario corresponding to the identifier of the service scenario.
本实施例中,可以从业务领域视角为网络流量配置流量管理策略,而不同的业务场景可以利用相应的业务场景标识进行区分,并根据该业务场景的流量特征来描述该业务场景下的网络流量。其中,业务场景,是指应用的用户(如图3所示的用户302)使用微服务时所产生的一种事件,如上述用户登录事件、用户注销事件等。并且,在应用访问多个不同的微服务时,可能均存在相同的业务场景,如应用访问微服务“CommentService”、“CreateResource”等多个微服务时,均可能存在用户登录的业务场景等。如此,在基于业务场景配置流量管理策略时,针对于多个微服务所出现的相同业务场景,可以仅配置一个流量管理策略,从而可以减少技术人员配置流量管理策略的数量。In this embodiment, a traffic management policy can be configured for network traffic from the perspective of the business domain, and different business scenarios can be distinguished by using corresponding business scenario identifiers, and the network traffic in the business scenario can be described according to the traffic characteristics of the business scenario . The business scenario refers to an event generated when a user of the application (the user 302 shown in FIG. 3 ) uses the microservice, such as the above-mentioned user login event, user logout event, and the like. In addition, when the application accesses multiple different microservices, there may be the same business scenarios. For example, when the application accesses multiple microservices such as the microservices "CommentService" and "CreateResource", there may be business scenarios in which users log in. In this way, when configuring traffic management policies based on business scenarios, only one traffic management policy can be configured for the same business scenario that appears in multiple microservices, thereby reducing the number of traffic management policies configured by technicians.
流量管理策略200在配置流量管理策略的过程中,可以先获取业务场景标识以及该业务场景标识对应的第一流量特征,以便为该业务场景下的网络流量配置相应的流量管理策略。In the process of configuring the traffic management policy, the traffic management policy 200 may first obtain the service scenario identifier and the first traffic feature corresponding to the service scenario identifier, so as to configure the corresponding traffic management policy for the network traffic in the service scenario.
作为一种示例性的具体实现方式,当技术人员通过语言开发框架(如Go语言开发框架、Java语言开发框架)或者服务网格为网络流量配置相应的流量管理策略时,语言开发框架或者服务网格可以调用该流量管理装置200,并且流量管理装置200可以向技术人员呈现业务场景输入界面,以便技术人员在该业务场景输入界面上输入相应的业务场景标识以及流量特征。例如,流量管理装置200向技术人员呈现的业务场景输入界面可以如图5所示,技术人员可以在该业务场景输入界面上输入业务场景名称(用于作为业务场景标识),以及请求微服务时的请求方式、请求路径、用户名(用于作为描述该业务场景下的网络流量的流量特征)等。这样,流量管理装置200根据技术人员执行的输入操作,获取业务场景标识以及相应的流量特征。As an exemplary specific implementation manner, when a technician configures a corresponding traffic management policy for network traffic through a language development framework (such as a Go language development framework, a Java language development framework) or a service mesh, the language development framework or service mesh The network can call the traffic management apparatus 200, and the traffic management apparatus 200 can present a service scenario input interface to the technician, so that the technician can input the corresponding service scenario identifier and traffic characteristics on the service scenario input interface. For example, the service scenario input interface presented to the technician by the traffic management apparatus 200 may be as shown in FIG. 5 , and the technician may input a service scenario name (used as a service scenario identifier) on the service scenario input interface, and when requesting a microservice The request method, request path, user name (used as the traffic feature to describe the network traffic in this business scenario), etc. In this way, the traffic management apparatus 200 acquires the service scenario identifier and the corresponding traffic characteristics according to the input operation performed by the technician.
其中,图5中是以业务场景名称作为业务场景标识为例进行示例性说明,该业务场景名称,例如可以是“创建资源”(CreateResource)、“VIP用户创建资源”(VIPUserCreateResource)、“用户活动”(UserActivity)、“VIP用户活动”(VIPUserActivity)等。Among them, in FIG. 5, the business scenario name is used as the business scenario identifier as an example for illustrative illustration. "(UserActivity), "VIP UserActivity" (VIPUserActivity), etc.
实际应用时,流量管理装置200也可以是结合业务场景名称以及其它信息作为业务场景标识,如可以将业务场景名称“创建资源”与具体的资源对象“订单”(order)或“账号”(account)作为业务场景标识,此时,创建订单与创建账号属于不同的业务场景;或者,流量管理装置200可以结合业务场景名称、请求微服务的网络环境(如蜂窝数据网络、WIFI网络等)名称以及请求微服务的应用名称作为业务场景标识,此时,业务场景名称相同而应用名称不同的业务场景为不同的业务场景;或者,流量管理策略200可以将业务场景名称与用户行为、请求来源以及资源操作中的任意一种信息进行组合,定义出不同类型的业务场景。如此,可以实现对业务场景的更细粒度的划分。当然,也可以是采用其它信息作为业务场景标识,本实施例对此并不进行限定。In practical application, the traffic management apparatus 200 may also combine the business scenario name and other information as the business scenario identifier, for example, the business scenario name "create resource" and the specific resource object "order" or "account" ) as a business scenario identifier, at this time, creating an order and creating an account belong to different business scenarios; or, the traffic management device 200 may combine the business scenario name, the name of the network environment (such as cellular data network, WIFI network, etc.) for requesting microservices and The application name of the requesting microservice is used as the business scenario identifier. In this case, business scenarios with the same business scenario name but different application names are different business scenarios; or, the traffic management policy 200 may associate the business scenario name with user behavior, request source, and resource Any information in the operation is combined to define different types of business scenarios. In this way, more fine-grained division of business scenarios can be achieved. Of course, other information may also be used as the service scenario identifier, which is not limited in this embodiment.
另外,上述流量特征,也不局限于图5中所示的请求方式、请求路径以及用户名,可以是这些信息中的任意一种,或者也可以是其它能够用于描述网络流量的信息,如请求微服务时采用的通信协议名称、包含描述网络流量来源于哪个浏览器、手机型号、操作系统中任意信息的报文头(header)等,本实施例中对于流量特征的具体实现方式并不进行限定。In addition, the above traffic characteristics are not limited to the request method, request path and user name shown in FIG. 5, but can be any of these information, or can also be other information that can be used to describe network traffic, such as The name of the communication protocol used when requesting the micro-service, the header including which browser, mobile phone model, and any information in the operating system that the network traffic originates from, etc. The specific implementation of the traffic characteristics in this embodiment does not be limited.
本实施例中,流量管理装置200在获取业务场景标识以及第一流量特征时,可以将该业务场景标识以及第一流量特征建立关联,这样,当请求微服务的网络流量存在该第一流量特征时,流量管理装置200可以确定该网络流量属于与该第一流量特征关联的业务场景。举例来说,技术人员输入的业务场景标识可以包括粗粒度的业务场景描述,如:“创建资源”以及“用户活动”,并且,技术人员可以在粗粒度的业务场景描述下进一步输入细粒度的业务场景名称,如:“创建订单”、“创建账号”以及“登录”,并且,技术人员输入的流量特征分别为请求路径为“/v1/order”、请求路径为“/v1/account”、以及请求方式为“POST/login”。则,流量管理策略200可以基于技术人员输入的业务场景标识以及第一流量特征,建立如图6所示的关联关系。In this embodiment, when acquiring the service scenario identifier and the first traffic feature, the traffic management apparatus 200 may establish an association between the service scenario identifier and the first traffic feature, so that when the network traffic requesting the microservice has the first traffic feature , the traffic management apparatus 200 may determine that the network traffic belongs to a service scenario associated with the first traffic feature. For example, the business scenario identifier input by the technician may include coarse-grained business scenario descriptions, such as "create resources" and "user activity", and the technician may further input fine-grained business scenario descriptions under the coarse-grained business scenario description. The name of the business scenario, such as "create order", "create account" and "login", and the traffic characteristics entered by the technician are the request path "/v1/order", the request path "/v1/account", And the request method is "POST/login". Then, the traffic management policy 200 may establish an association relationship as shown in FIG. 6 based on the service scenario identifier input by the technician and the first traffic feature.
实际应用时,流量管理策略200在建立业务场景标识以及第一流量特征之间的关联关系时,具体可以是生成相应的配置文件。例如,针对于图6所示的关联关系,流量管理策略200可以生成如图7所示的配置文件。其中,图7左侧的配置文件指示了业务场景标识“创建资源”与其对应的流量特征之间的关联关系,图7右侧的配置文件指示了业务场景标识“用户活动”与其对应的流量特征之间的关联关系。In practical application, the traffic management policy 200 may specifically generate a corresponding configuration file when establishing the relationship between the service scenario identifier and the first traffic feature. For example, for the association relationship shown in FIG. 6 , the traffic management policy 200 may generate the configuration file shown in FIG. 7 . The configuration file on the left side of Figure 7 indicates the relationship between the business scenario identifier "create resource" and its corresponding traffic characteristics, and the configuration file on the right side of Figure 7 indicates the business scenario identifier "user activity" and its corresponding traffic characteristics relationship between.
S402:流量管理装置200将业务场景标识与第一流量管理策略建立关联,其中,第一流量管理策略用于对属于该业务场景标识对应的业务场景的网络流量进行管理。S402: The traffic management apparatus 200 associates the service scenario identifier with a first traffic management policy, where the first traffic management policy is used to manage network traffic belonging to the service scenario corresponding to the service scenario identifier.
S403:流量管理装置200存储业务场景标识与流量管理策略之间的关联。S403: The traffic management apparatus 200 stores the association between the service scenario identifier and the traffic management policy.
对于各种业务场景下的网络流量,流量管理装置200可以为其配置相应的流量管理策略进行管理,以尽可能避免网络流量出现异常。For network traffic in various service scenarios, the traffic management apparatus 200 can configure corresponding traffic management policies for management, so as to avoid abnormal network traffic as much as possible.
在一种示例性的实施方式中,流量管理装置200可以向技术人员呈现策略配置界面,以便于技术人员在该策略配置界面上为各个业务场景配置相应的第一流量管理策略。例如,流量管理装置200所呈现的策略配置界面可以如图8所示,技术人员可以根据该策略配置界面上所呈现的业务场景以及流量特征,输入相应的流量管理策略,如图8中所示,技术人员为业务场景A以及流量特征a输入的流量管理策略包括:请求超时时间为10s,请求错误重试次数上限为2次等。然后,流量管理装置200可以将技术人员输入的第一流量管理策略与业务场景标识建立关联关系。这样,对于该业务场景下的网络流量,即可以利用与其关联的第一流量管理策略进行流量管理。作为一种示例,流量管理装置200具体可以是配置文件的形式建立业务场景标识与第一流量管理策略之间的关联关系。例如,假设业务场景标识为“UserActivity.login”以及“create.order”,第一流量管理策略为请求错误时的重试(retry)次数上限,则业务标识与第一流量管理策略之间的关联关系的配置文件如图9所示,即当业务场景为用户登录或者创建订单时,其网络流量的最大错误重试次数(MaxAttempts)为3次。In an exemplary implementation, the traffic management apparatus 200 may present a policy configuration interface to the technician, so that the technician can configure the corresponding first traffic management policy for each service scenario on the policy configuration interface. For example, the policy configuration interface presented by the traffic management apparatus 200 may be as shown in FIG. 8 , and the technician may input the corresponding traffic management policy according to the business scenarios and traffic characteristics presented on the policy configuration interface, as shown in FIG. 8 . , the traffic management policy input by the technician for the business scenario A and the traffic feature a includes: the request timeout time is 10s, and the upper limit of the number of retries for a request error is 2 times. Then, the traffic management apparatus 200 may establish an association relationship between the first traffic management policy input by the technician and the service scenario identifier. In this way, for the network traffic in the service scenario, the first traffic management policy associated therewith can be used for traffic management. As an example, the traffic management apparatus 200 may specifically establish the association relationship between the service scenario identifier and the first traffic management policy in the form of a configuration file. For example, assuming that the service scenario identifiers are "UserActivity.login" and "create.order", and the first traffic management policy is the upper limit of the number of retries (retry) when the request is incorrect, then the association between the service identifier and the first traffic management policy The configuration file of the relationship is shown in Figure 9, that is, when the business scenario is that a user logs in or creates an order, the maximum number of error retries (MaxAttempts) of its network traffic is 3 times.
实际应用时,图8所示的策略配置界面也可以与图5所示的业务场景输入界面合并为一个界面,从而技术人员可以在该配置界面上同时完成业务场景的定义以及该业务场景对应的流量管理策略的配置。如此,在配置流量管理策略的过程中,技术人员可以从业务领域视角出发配置流量管理策略,无需了解业务系统下的微服务架构,实现了配置流量管理策略与微服务架构之间的解耦,从而可以有效降低技术人员的学习成本,提高配置效率。In practical application, the policy configuration interface shown in FIG. 8 can also be combined with the business scenario input interface shown in FIG. 5 into one interface, so that technicians can complete the definition of business scenarios and the corresponding business scenarios on the configuration interface at the same time. Configuration of traffic management policies. In this way, in the process of configuring the traffic management strategy, technicians can configure the traffic management strategy from the perspective of the business domain, without knowing the microservice architecture under the business system, realizing the decoupling between the configuration traffic management strategy and the microservice architecture. Thereby, the learning cost of technicians can be effectively reduced, and the configuration efficiency can be improved.
在进一步可能的实施方式中,流量管理装置200还可以为微服务配置流量管理策略。具 体的,流量管理装置200在根据业务场景配置相应的流量管理策略的过程中,还可以同时获取微服务标识以及该微服务标识对应的第二流量特征,该第二流量特征用于描述请求该微服务时所产生的网络流量,然后,流量管理装置200可以将微服务标识与第二流量管理策略建立关联,从而流量管理装置200可以利用该第二流量管理策略用于对属于该微服务标识对应的微服务的网络流量进行管理。In a further possible implementation manner, the traffic management apparatus 200 may further configure a traffic management policy for the microservice. Specifically, in the process of configuring the corresponding traffic management policy according to the business scenario, the traffic management apparatus 200 may also obtain the micro-service identifier and the second traffic feature corresponding to the micro-service identifier at the same time, where the second traffic feature is used to describe the request for the The network traffic generated during the microservice, and then, the traffic management device 200 can associate the microservice identifier with the second traffic management policy, so that the traffic management device 200 can use the second traffic management policy to The network traffic of the corresponding microservice is managed.
这样,当请求装置100请求微服务时,流量管理装置200可以根据微服务标识与第二流量管理策略之间的关联关系,查找请求装置100所请求的微服务是否具有相应的第二流量管理策略,若查找到,则可以直接基于查找出的第二流量管理策略对请求该微服务所产生的网络流量进行管理,而若未查找到,则可以根据装置100请求微服务的网络流量的流量特征,确定该网络流量所属的业务场景,并进一步根据业务场景标识与第一流量管理策略之间的关联关系,查找出该业务场景对应的第一流量管理策略,并基于查找出的第一流量管理策略对该网络流量进行管理。如此,可以尽可能减少对于已有的流量管理装置200的改动,提高方案实施的灵活性以及普适性。In this way, when the requesting apparatus 100 requests a microservice, the traffic management apparatus 200 may, according to the association between the microservice identifier and the second traffic management policy, find out whether the microservice requested by the requesting apparatus 100 has the corresponding second traffic management policy , if found, the network traffic generated by requesting the micro-service can be managed directly based on the found second traffic management policy, and if not found, the device 100 can request the network traffic of the micro-service according to the traffic characteristics of the micro-service , determine the business scenario to which the network traffic belongs, and further according to the relationship between the business scenario identifier and the first traffic management strategy, find out the first traffic management strategy corresponding to the business scenario, and based on the found first traffic management strategy Policies govern this network traffic. In this way, changes to the existing traffic management device 200 can be minimized, and the flexibility and universality of solution implementation can be improved.
由于第二流量特征与第一流量特征,均用于描述请求微服务时所产生的网络流量,因此,在一些实施方式中,与微服务标识关联的部分或全部第二流量特征可能与第一流量特征相同。此时,流量管理装置200在建立微服务标识与第二流量特征之间的关联关系时,具体可以是建立微服务标识与第二流量特征的指示信息之间的关联关系,其中,该第二流量特征的指示信息用于指示与业务场景标识关联的第一流量特征。如此,流量管理装置200可以通过复用第一流量特征的特征描述,而无需为微服务标识重新粘贴与第一流量特征相同的特征描述,从而可以降低流量管理装置200的存储负担以及维护成本,减少冗余配置。举例来说,假设业务场景标识(UserActivity)与第一流量特征(Jack,即用户名为Jack)之间的关联关系(配置文件)如图10左侧所示,则流量管理装置200关联微服务标识(“CommentService”)与第二流量特征时所生成的配置文件可以如图10右侧所示,其中,配置文件中的“refer:UserActivity.Jack”用于指示该第二流量特征的特征描述复用了第一流量特征的特征描述,均是指该网络流量的用户名为“Jack”。Since both the second traffic feature and the first traffic feature are used to describe the network traffic generated when the microservice is requested, in some embodiments, some or all of the second traffic feature associated with the microservice identifier may be the same as the first traffic feature. Traffic characteristics are the same. At this time, when the traffic management apparatus 200 establishes an association relationship between the microservice identifier and the second traffic feature, it may specifically establish an association relationship between the microservice identifier and the indication information of the second traffic feature, wherein the second traffic feature The indication information of the traffic feature is used to indicate the first traffic feature associated with the service scenario identifier. In this way, the traffic management device 200 can reuse the feature description of the first traffic feature without re-pasting the same feature description as the first traffic feature for the microservice identifier, thereby reducing the storage burden and maintenance cost of the traffic management device 200. Reduce redundant configuration. For example, assuming that the association relationship (configuration file) between the business scenario identifier (UserActivity) and the first traffic feature (Jack, that is, the user name is Jack) is shown on the left side of FIG. 10 , the traffic management apparatus 200 associates the microservice The configuration file generated when identifying ("CommentService") and the second traffic feature can be shown on the right side of Figure 10, where "refer: UserActivity.Jack" in the configuration file is used to indicate the feature description of the second traffic feature The feature descriptions that reuse the first traffic feature all refer to the user name "Jack" of the network traffic.
上述实施例中,主要是以流量管理装置200配置流量管理策略的角度,对本申请实施例的技术方案进行详细描述,下面,将对流量管理装置200对请求装置100发送的微服务访问请求进行网络流量管理的具体实现过程进行示例性描述。In the above-mentioned embodiments, the technical solutions of the embodiments of the present application are described in detail mainly from the perspective of configuring a traffic management policy by the traffic management device 200 . Below, the network will perform network processing on the microservice access request sent by the traffic management device 200 to the requesting device 100 . The specific implementation process of traffic management is exemplarily described.
如图11所示,为一示例性管理网络流量的方法流程示意图,该流程可以应用于图12所示的系统架构,该流程具体可以包括:As shown in FIG. 11 , it is a schematic flowchart of an exemplary method for managing network traffic. The process can be applied to the system architecture shown in FIG. 12 , and the process can specifically include:
S1101:匹配模块202从策略存储模块204中拉取业务场景标识与第一流量特征之间的关联关系,流量管理模块203从策略存储模块204中拉取业务场景标识与第一流量管理策略之间的关联关系。S1101: The matching module 202 pulls the association relationship between the service scenario identifier and the first traffic feature from the policy storage module 204, and the traffic management module 203 pulls the relationship between the service scenario identifier and the first traffic management policy from the policy storage module 204 association relationship.
其中,策略存储模块204中存储的这两种关联关系,可以是策略管理模块205根据技术人员在相应界面上的输入操作完成建立,并将建立的关联关系存储于策略存储模块204中。其中,对于策略管理模块205如何实现建立业务场景标识分别与第一流量特征以及第一流量管理策略之间的关联关系的具体实现,可以参见前述实施例中的相关之处描述,在此不做 赘述。当然,在其它示例中,也可以是由技术人员预先建立上述关联关系,并将其存储于策略存储模块204中。The two association relationships stored in the policy storage module 204 may be established by the policy management module 205 according to the input operation by the technician on the corresponding interface, and the established association relationship is stored in the policy storage module 204 . Wherein, for the specific implementation of how the policy management module 205 realizes the establishment of the association relationship between the service scenario identifier and the first traffic feature and the first traffic management policy, please refer to the description of the relevant part in the foregoing embodiment, and will not be described here. Repeat. Of course, in other examples, the above-mentioned association relationship may also be pre-established by a technician and stored in the policy storage module 204 .
应理解,在其它实施例中,上述步骤S1101也可以不执行,例如匹配模块202以及流量管理模块203可以预先存储有相应的业务场景标识与流量特征之间的关联关系以及业务场景标识与流量管理策略之间的关联关系,无需每次在管理网络流量时重新从策略管理模块204中拉取上述关联关系;或者,匹配模块202以及流量管理模块203中存储的关联关系也可以是预先由技术人员进行静态配置,无需从策略存储模块204中获取等。It should be understood that, in other embodiments, the above step S1101 may not be executed, for example, the matching module 202 and the traffic management module 203 may pre-store the correlation between the corresponding business scenario identifiers and traffic characteristics, as well as the business scenario identifiers and traffic management. The association relationship between policies does not need to be re-pulled from the policy management module 204 every time the network traffic is managed; alternatively, the association relationship stored in the matching module 202 and the traffic management module 203 can also be pre-defined by the technical personnel Static configuration is performed without obtaining from the policy storage module 204 or the like.
S1102:请求装置100发送针对微服务的访问请求。S1102: The requesting apparatus 100 sends an access request for the microservice.
本实施例中,请求装置100在向业务系统访问目标微服务时,可以发送微服务访问请求,该访问请求中携带有表征请求目标微服务所产生的网络流量的目标流量特征,实际应用时,该访问请求中还可以包括目标微服务的标识。示例性的,请求装置100可以基于HTTP协议发送网络报文,该网络报文包括目标微服务名称“CommentService”、以及目标流量特征“POST/login”(请求方式)等信息。In this embodiment, when accessing the target microservice to the business system, the requesting device 100 may send a microservice access request, and the access request carries the target traffic characteristics representing the network traffic generated by requesting the target microservice. In practical application, The access request may also include the identifier of the target microservice. Exemplarily, the requesting apparatus 100 may send a network packet based on the HTTP protocol, where the network packet includes information such as the name of the target microservice "CommentService", the target traffic feature "POST/login" (request method).
本实施例中,请求装置100例如可以是需要调用微服务的应用,如浏览器等。该请求装置100可以是在用户的直接或者间接触发下,生成针对于目标微服务的访问请求,并将其发送给流量管理装置200。In this embodiment, the requesting apparatus 100 may be, for example, an application that needs to call a microservice, such as a browser. The requesting apparatus 100 may generate an access request for the target microservice under the direct or indirect trigger of the user, and send it to the traffic management apparatus 200 .
S1103:解析模块201对接收到的访问请求进行解析,并将解析得到的目标流量特征等信息进行存储,其中,存储该信息的地址通过指针指示。S1103: The parsing module 201 parses the received access request, and stores information such as target traffic characteristics obtained by parsing, wherein the address where the information is stored is indicated by a pointer.
示例性的,解析模块201中可以运行有相应的解析模型(model),并且通过该解析模型可以将数据访问请求中的目标微服务的名称、目标流量特征等内容解析出来。解析模块201可以将解析得到的信息存储于相应的存储区域,并利用指针指示存储这些信息的存储地址。Exemplarily, the parsing module 201 may run a corresponding parsing model, and through the parsing model, contents such as the name of the target microservice, the target traffic feature, etc. in the data access request can be parsed. The parsing module 201 can store the information obtained by parsing in a corresponding storage area, and use a pointer to indicate a storage address where the information is stored.
S1104:匹配模块202根据指针指示的信息,通过查找业务场景标识与第一流量特征之间的关联关系,确定目标流量特征对应的目标业务场景标识。S1104: The matching module 202 determines the target service scenario identifier corresponding to the target traffic feature by searching for the correlation between the service scenario identifier and the first traffic feature according to the information indicated by the pointer.
仍以上述目标流量特征为“POST/login”为例,假设业务场景标识与第一流量特征之间的关联关系可以包括如图12所示的“UserActivity”(业务场景标识)与“POST/login”(第一流量特征)之间的关联关系,匹配模块202可以根据指针所指示的目标流量特征“POST/login”,通过查找该关联关系确定目标业务场景标识为“UserActivity”。Still taking the above-mentioned target traffic feature as "POST/login" as an example, it is assumed that the relationship between the business scenario identifier and the first traffic feature may include "UserActivity" (business scenario identifier) and "POST/login" as shown in Figure 12. ” (the first traffic feature), the matching module 202 can determine the target business scenario identifier as “UserActivity” by looking up the correlation according to the target traffic feature “POST/login” indicated by the pointer.
S1105:流量管理模块203根据确定出的目标业务场景标识,通过查找业务场景标识与第一流量管理策略之间的关联关系,确定目标业务场景标识对应的目标流量管理策略。S1105: The traffic management module 203 determines a target traffic management policy corresponding to the target service scenario identifier by searching for the association relationship between the service scenario identifier and the first traffic management policy according to the determined target service scenario identifier.
假设业务场景标识与第一流量管理策略之间的关联关系,可以包括如图12所示的“UserActivity”与超时时间10s、重试次数上限为2次(第一流量管理策略),则流量管理模块203根据步骤S1004中确定出的目标业务场景标识“UserActivity”,确定目标流量管理策略为超时时间10s并且重试次数上限为2次,以便利用查找出的目标流量管理策略对请求装置100请求微服务时所产生的网络流量进行管理。Assuming that the relationship between the service scenario identifier and the first traffic management policy may include "UserActivity" as shown in Figure 12, the timeout time is 10s, and the maximum number of retries is 2 (the first traffic management policy), then the traffic management Module 203 determines, according to the target business scenario identifier "UserActivity" determined in step S1004, that the target traffic management policy is the timeout period of 10s and the upper limit of the number of retries is 2, so as to request the requesting device 100 for microservices using the found target traffic management policy. The network traffic generated during the service is managed.
S1106:流量管理模块203根据确定出的目标流量管理策略对业务执行装置300请求微服务时产生的网络流量进行管理。S1106: The traffic management module 203 manages the network traffic generated when the service execution apparatus 300 requests the micro-service according to the determined target traffic management policy.
例如,当目标流量管理策略为重试次数上限为2次时,业务执行装置300在存在请求错 误并且重试次数达到2次后,若仍然发生请求错误,则流量管理模块203控制业务执行装置300终止向业务系统请求微服务。又例如,当目标流量管理策略为限流50次每秒时,流量管理模块203控制业务执行装置300在单位时间(如1秒钟)内向业务系统请求微服务的次数可以限制在50次以内等。For example, when the target traffic management policy is that the upper limit of the number of retries is 2, after the service execution device 300 has a request error and the number of retries reaches 2, if a request error still occurs, the traffic management module 203 controls the service execution device 300 Terminate requests for microservices from the business system. For another example, when the target traffic management policy is to limit the current to 50 times per second, the traffic management module 203 controls the service execution device 300 to request microservices from the service system within a unit time (for example, 1 second), which can be limited within 50 times, etc. .
实际应用时,匹配模块202根据目标流量特征所确定出的目标业务场景标识可能为多个,如包括粗粒度的业务场景描述“CreateResource”(创建资源)以及细粒度的业务场景名称“CreateResource.order”(创建订单),相应的,流量管理模块203为多个不同粒度的业务场景标识所确定出的目标流量管理策略的数量也为多个,此时,流量管理模块203在对网络流量进行管理时,可以是根据细粒度的业务场景标识所对应的目标流量管理策略管理网络流量,如根据“CreateResource.order”对应的目标流量管理策略管理网络流量。In practical application, there may be multiple target business scenario identifiers determined by the matching module 202 according to the target traffic characteristics, such as including a coarse-grained business scenario description "CreateResource" (create resources) and a fine-grained business scenario name "CreateResource.order". ” (creating an order), correspondingly, the number of target traffic management policies determined by the traffic management module 203 for multiple business scenario identifiers of different granularities is also multiple. At this time, the traffic management module 203 is managing the network traffic. At the time, the network traffic can be managed according to the target traffic management policy corresponding to the fine-grained service scenario identifier, for example, the network traffic is managed according to the target traffic management policy corresponding to "CreateResource.order".
如此,本实施例中,流量管理装置200可以在请求装置100请求微服务的过程中,根据网络流量所述的业务场景确定流量管理策略,并利用该流量管理策略实现对请求微服务所产生的网络流量的有效管理。In this way, in this embodiment, the traffic management device 200 may determine a traffic management policy according to the business scenario described by the network traffic in the process of requesting the microservice by the requesting device 100, and use the traffic management policy to implement the traffic management policy generated by the requesting microservice. Efficient management of network traffic.
上述图11所示实施例中,匹配模块202中保存的关联关系可以仅为业务场景标识与流量特征之间的关联关系,而在其它可能的实施例中,匹配模块202中可以同时保存业务场景标识与流量特征之间的关联关系,以及微服务标识与流量特征之间的关联关系。此时,流量管理装置200处理请求装置100发送的微服务访问请求的具体实现过程可以如图13所示,该流程可以应用于图14所示的系统架构。其中,区别与图12所示的系统架构,图14所示的系统架构中,流量管理装置200中同时具有业务场景的标识与流量管理策略之间的关联关系,以及微服务的标识与流量管理策略之间的关联关系。该流程具体可以包括:In the above-mentioned embodiment shown in FIG. 11 , the association relationship saved in the matching module 202 may only be the association relationship between the service scenario identifier and the traffic feature, while in other possible embodiments, the matching module 202 may save the service scenario at the same time. The relationship between identity and traffic characteristics, and the relationship between microservice identity and traffic characteristics. At this time, the specific implementation process of the traffic management apparatus 200 processing the microservice access request sent by the requesting apparatus 100 may be as shown in FIG. 13 , and the process may be applied to the system architecture shown in FIG. 14 . Wherein, different from the system architecture shown in FIG. 12 , in the system architecture shown in FIG. 14 , the traffic management device 200 also has an association relationship between the identification of the business scenario and the traffic management strategy, as well as the identification of the microservice and the traffic management relationship between strategies. Specifically, the process can include:
S1301:匹配模块202从策略存储模块204中拉取业务场景标识与第一流量特征之间的关联关系以及微服务标识与第二流量特征之间的关联关系,流量管理模块203从策略存储模块204中拉取业务场景标识与第一流量管理策略之间的关联关系以及微服务标识与第二流量管理策略之间的关联关系。S1301: The matching module 202 pulls the association between the business scenario identifier and the first traffic feature and the association between the microservice identifier and the second traffic feature from the policy storage module 204, and the traffic management module 203 retrieves the association from the policy storage module 204. Pull the association between the business scenario identifier and the first traffic management policy and the association between the microservice identifier and the second traffic management policy.
其中,策略存储模块204中存储的关联关系,可以是由策略管理模块205根据技术人员在相应界面上的输入操作完成建立,并将建立的关联关系存储于策略存储模块204中。其中,对于策略管理模块205如何实现建立业务场景标识分别与第一流量特征以及第一流量管理策略之间的关联关系、微服务标识分别与第二流量特征以及第二流量管理策略之间的关联关系的具体实现,可以参见前述实施例中的相关之处描述,在此不做赘述。并且,在其它示例中,策略存储模块204中存储的关联关系,也可以是由技术人员预先导入策略存储模块204中,本实施例对此并不进行限定。The association relationship stored in the policy storage module 204 may be established by the policy management module 205 according to the input operation by the technician on the corresponding interface, and the established association relationship is stored in the policy storage module 204 . Wherein, as to how the policy management module 205 realizes the establishment of the association relationship between the business scenario identifier and the first traffic feature and the first traffic management policy, and the association between the microservice identifier and the second traffic feature and the second traffic management policy, respectively For the specific implementation of the relationship, reference may be made to the description of the relevant parts in the foregoing embodiments, which will not be repeated here. Moreover, in other examples, the association relationship stored in the policy storage module 204 may also be imported into the policy storage module 204 in advance by a technician, which is not limited in this embodiment.
值得注意的是,在其它实施例中,上述步骤S1301也可以不执行,例如匹配模块202以及流量管理模块203可以预先存储有相应的关联关系,无需从策略存储模块204中进行获取;或者,匹配模块202以及流量管理模块203中存储的关联关系也可以是预先由技术人员进行静态配置,无需从策略存储模块204中获取等。It is worth noting that, in other embodiments, the above step S1301 may not be executed, for example, the matching module 202 and the traffic management module 203 may store the corresponding associations in advance, and there is no need to obtain them from the policy storage module 204; The association relationship stored in the module 202 and the traffic management module 203 may also be statically configured by a technician in advance, and does not need to be acquired from the policy storage module 204 or the like.
S1302:请求装置100发送针对微服务的访问请求。S1302: The requesting apparatus 100 sends an access request for the microservice.
S1303:解析模块201对接收到的访问请求进行解析,并将解析得到的目标流量特征等 信息进行存储,其中,存储该信息的地址通过指针指示。S1303: The parsing module 201 parses the received access request, and stores information such as the target traffic characteristics obtained by parsing, wherein the address where the information is stored is indicated by a pointer.
S1304:匹配模块202根据指针指示的信息,查找微服务标识与第二流量特征之间的关联关系,确定是否存在与目标流量特征相匹配的目标微服务标识。S1304: The matching module 202 searches for the association relationship between the microservice identifier and the second traffic feature according to the information indicated by the pointer, and determines whether there is a target microservice identifier matching the target traffic feature.
S1305:当存在目标微服务标识时,流量管理模块203根据微服务的标识与第二流量管理策略之间的关联关系,查找该目标微服务标识关联的目标流量管理策略。S1305: When there is a target microservice identifier, the traffic management module 203 searches for a target traffic management policy associated with the target microservice identifier according to the association relationship between the microservice identifier and the second traffic management policy.
S1306:流量管理模块203根据确定出的目标流量管理策略对请求目标微服务时产生的网络流量进行管理。S1306: The traffic management module 203 manages the network traffic generated when the target microservice is requested according to the determined target traffic management policy.
S1307:当不存在目标微服务标识时,匹配模块202根据指针指示的信息,查找业务场景标识与第一流量特征之间的关联关系,确定与目标流量特征相匹配的目标业务场景标识。S1307: When the target microservice identifier does not exist, the matching module 202 searches for the association relationship between the business scenario identifier and the first traffic feature according to the information indicated by the pointer, and determines the target business scenario identifier matching the target traffic feature.
S1308:流量管理模块203根据业务场景标识与第一流量管理策略之间的关联关系,查找该目标业务场景标识关联的目标流量管理策略。S1308: The traffic management module 203 searches for the target traffic management policy associated with the target service scenario identifier according to the association relationship between the service scenario identifier and the first traffic management policy.
S1309:流量管理模块203根据确定出的目标流量管理策略对请求微服务时产生的网络流量进行管理。S1309: The traffic management module 203 manages the network traffic generated when the microservice is requested according to the determined target traffic management policy.
需要说明的是,本实施例中各个步骤的具体实现方式,可以参见前述实施例中的相关之处描述,在此不做赘述。It should be noted that, for the specific implementation manner of each step in this embodiment, reference may be made to the description of the relevant part in the foregoing embodiment, which will not be repeated here.
以上结合图1至图14对本申请实施例提供的配置流量管理策略的方法进行介绍,接下来结合附图对本申请实施例提供的用于实现上述流量管理装置200功能的计算设备进行介绍。The method for configuring a traffic management policy provided by the embodiments of the present application is described above with reference to FIGS. 1 to 14 . Next, the computing device for implementing the functions of the traffic management apparatus 200 provided by the embodiments of the present application is described with reference to the accompanying drawings.
图15提供了一种计算设备。如图15所示,计算设备1500具体可以用于实现上述图2、11至15所示实施例中流量管理装置200的功能。Figure 15 provides a computing device. As shown in FIG. 15 , the computing device 1500 may be specifically configured to implement the functions of the traffic management apparatus 200 in the embodiments shown in FIGS. 2 , 11 to 15 .
计算设备1500包括总线1501、处理器1502和存储器1503。处理器1502、存储器1503之间通过总线1501通信。Computing device 1500 includes bus 1501 , processor 1502 and memory 1503 . The processor 1502 and the memory 1503 communicate through the bus 1501 .
总线1501可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图15中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 1501 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is shown in FIG. 15, but it does not mean that there is only one bus or one type of bus.
处理器1502可以为中央处理器(central processing unit,CPU)、图形处理器(graphics processing unit,GPU)、微处理器(micro processor,MP)或者数字信号处理器(digital signal processor,DSP)等处理器中的任意一种或多种。The processor 1502 may be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP), etc. any one or more of the devices.
存储器1503可以包括易失性存储器(volatile memory),例如随机存取存储器(random access memory,RAM)。存储器1503还可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器,机械硬盘(hard drive drive,HDD)或固态硬盘(solid state drive,SSD)。The memory 1503 may include volatile memory, such as random access memory (RAM). The memory 1503 may also include non-volatile memory (non-volatile memory), such as read-only memory (ROM), flash memory, hard drive drive (HDD) or solid state drive (solid state drive) , SSD).
存储器1503中存储有可执行的程序代码,处理器1502执行该可执行的程序代码以执行前述流量管理装置200所执行的流量管理方法和/或配置流量管理策略的方法。Executable program code is stored in the memory 1503, and the processor 1502 executes the executable program code to execute the traffic management method and/or the method for configuring the traffic management policy performed by the aforementioned traffic management apparatus 200.
本申请实施例还提供了一种计算机可读存储介质。所述计算机可读存储介质可以是计算设备能够存储的任何可用介质或者是包含一个或多个可用介质的数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、 或者半导体介质(例如固态硬盘)等。该计算机可读存储介质包括指令,所述指令指示计算设备执行上述流量管理装置200所执行的流量管理方法。Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium may be any available medium that a computing device can store, or a data storage device such as a data center that contains one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like. The computer-readable storage medium includes instructions, the instructions instruct the computing device to execute the traffic management method executed by the traffic management apparatus 200 described above.
本申请实施例还提供了另一种计算机可读存储介质。所述计算机可读存储介质可以是计算设备能够存储的任何可用介质或者是包含一个或多个可用介质的数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘)等。该计算机可读存储介质包括指令,所述指令指示计算设备执行上述流量管理装置200所执行的配置流量管理策略的方法。The embodiments of the present application further provide another computer-readable storage medium. The computer-readable storage medium may be any available medium that a computing device can store, or a data storage device such as a data center that contains one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state drives), and the like. The computer-readable storage medium includes instructions, the instructions instruct the computing device to execute the method for configuring a traffic management policy performed by the traffic management apparatus 200 described above.
本申请实施例还提供了一种计算机程序产品。所述计算机程序产品包括一个或多个计算机指令。在计算设备上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。The embodiments of the present application also provide a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the computing device, all or part of the processes or functions described in the embodiments of the present application are generated.
所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机或数据中心进行传输。The computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted over a wire from a website site, computer or data center. (eg coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg infrared, wireless, microwave, etc.) to another website site, computer or data center.
所述计算机程序产品可以为一个软件安装包,在需要使用前述对象识别方法的任一方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。The computer program product can be a software installation package, which can be downloaded and executed on a computing device if any one of the aforementioned object recognition methods needs to be used.
上述各个附图对应的流程或结构的描述各有侧重,某个流程或结构中没有详述的部分,可以参见其他流程或结构的相关描述。The descriptions of the processes or structures corresponding to each of the above-mentioned drawings have their own emphasis, and for the parts that are not described in detail in a certain process or structure, reference may be made to the related descriptions of other processes or structures.

Claims (18)

  1. 一种流量管理方法,其特征在于,所述方法应用于流量管理装置,所述流量管理装置用于对应用中的微服务的流量进行管理,所述方法包括:A traffic management method, characterized in that, the method is applied to a traffic management device, and the traffic management device is used to manage the traffic of microservices in the application, and the method includes:
    接收所述应用的用户对微服务的访问请求;Receive an access request to the microservice from the user of the application;
    根据所述访问请求包括的目标流量特征,确定目标业务场景的标识,其中,所述目标业务场景表示所述应用的用户使用微服务时的一种事件;Determine the identifier of the target business scenario according to the target traffic feature included in the access request, wherein the target business scenario represents an event when the user of the application uses the microservice;
    查找与所述目标业务场景的标识关联的目标流量管理策略;Find the target traffic management policy associated with the identifier of the target business scenario;
    根据所述目标流量管理策略管理属于所述目标业务场景的网络流量。The network traffic belonging to the target service scenario is managed according to the target traffic management policy.
  2. 根据权利要求1所述的方法,其特征在于,在接收所述应用的用户对微服务的访问请求之前,所述方法还包括:The method according to claim 1, wherein, before receiving an access request for a microservice from a user of the application, the method further comprises:
    获取业务场景的标识以及所述业务场景的标识对应的流量特征;Obtain the identifier of the business scenario and the traffic characteristics corresponding to the identifier of the business scenario;
    将所述业务场景的标识与所述流量管理策略建立关联。Associating the identifier of the service scenario with the traffic management policy.
  3. 根据权利要求2所述的方法,其特征在于,所述目标业务场景为请求访问多个微服务时均存在的场景。The method according to claim 2, wherein the target business scenario is a scenario that exists when requesting access to multiple microservices.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述根据所述访问请求包括的目标流量特征,确定目标业务场景的标识,包括:The method according to any one of claims 1 to 3, wherein the determining the identifier of the target service scenario according to the target traffic feature included in the access request comprises:
    查找与所述微服务的访问请求包括的目标流量特征相匹配的目标微服务的标识以及与所述目标微服务的标识关联的流量管理策略;Find the identifier of the target microservice that matches the target traffic feature included in the access request of the microservice and the traffic management policy associated with the identifier of the target microservice;
    当查找失败时,根据所述目标流量特征确定所述目标业务场景的标识。When the search fails, the identifier of the target service scenario is determined according to the target traffic feature.
  5. 根据权利要求2或3所述的方法,其特征在于,所述获取业务场景的标识以及所述业务场景的标识对应的流量特征,包括:The method according to claim 2 or 3, wherein the acquiring an identifier of a business scenario and a traffic feature corresponding to the identifier of the business scenario comprises:
    呈现业务场景输入界面;Present the business scenario input interface;
    响应针对于业务场景的输入操作,获取所述业务场景的标识以及所述业务场景的标识对应的流量特征。In response to an input operation for a business scenario, an identifier of the business scenario and a traffic feature corresponding to the identifier of the business scenario are acquired.
  6. 根据权利要求2至4任一项所述的方法,其特征在于,所述将所述业务场景的标识与所述流量管理策略建立关联,包括:The method according to any one of claims 2 to 4, wherein the associating the identifier of the service scenario with the traffic management policy comprises:
    呈现策略配置界面;Present the policy configuration interface;
    响应针对于流量管理策略的配置操作,将所述业务场景的标识与所述流量管理策略建立关联。In response to the configuration operation for the traffic management policy, the identification of the business scenario is associated with the traffic management policy.
  7. 一种配置流量管理策略的方法,其特征在于,所述方法应用于流量管理装置,在接收应用的用户对微服务的访问请求之前,所述方法包括:A method for configuring a traffic management policy, wherein the method is applied to a traffic management device, and before receiving an access request to a microservice by a user of the application, the method includes:
    获取业务场景的标识以及所述业务场景的标识对应的流量特征;Obtain the identifier of the business scenario and the traffic characteristics corresponding to the identifier of the business scenario;
    将所述业务场景的标识与所述流量管理策略建立关联;associating the identifier of the business scenario with the traffic management policy;
    存储所述业务场景的标识与所述流量管理策略之间的关联,其中,所述流量管理策略用于对属于所述业务场景标识对应的业务场景的网络流量进行管理。The association between the identifier of the service scenario and the traffic management policy is stored, wherein the traffic management policy is used to manage the network traffic belonging to the service scenario corresponding to the service scenario identifier.
  8. 根据权利要求7所述的方法,其特征在于,所述目标业务场景为请求访问多个微服务时均存在的场景。The method according to claim 7, wherein the target business scenario is a scenario that exists when requesting access to multiple microservices.
  9. 一种流量管理装置,其特征在于,所述流量管理装置用于对应用中的微服务的流量 进行管理,所述装置包括:A traffic management device, characterized in that the traffic management device is used to manage the traffic of microservices in an application, and the device comprises:
    解析模块,用于接收所述应用的用户对微服务的访问请求;a parsing module, configured to receive an access request to the microservice from the user of the application;
    匹配模块,用于根据所述访问请求包括的目标流量特征,确定目标业务场景的标识,其中,所述目标业务场景表示所述应用的用户使用微服务时的一种事件;a matching module, configured to determine the identifier of the target business scenario according to the target traffic feature included in the access request, wherein the target business scenario represents an event when the user of the application uses the microservice;
    流量管理模块,用于查找与所述目标业务场景的标识关联的目标流量管理策略,并根据所述目标流量管理策略管理属于所述目标业务场景的网络流量。A traffic management module, configured to search for a target traffic management policy associated with the identifier of the target service scenario, and manage network traffic belonging to the target service scenario according to the target traffic management policy.
  10. 根据权利要求9所述的装置,其特征在于,所述装置还包括:The apparatus according to claim 9, wherein the apparatus further comprises:
    策略管理模块,用于在接收所述应用的用户对微服务的访问请求之前,获取业务场景的标识以及所述业务场景的标识对应的流量特征,并将所述业务场景的标识与所述流量管理策略建立关联。The policy management module is used to obtain the identifier of the business scenario and the traffic characteristics corresponding to the identifier of the business scenario before receiving the access request to the micro-service from the user of the application, and associate the identifier of the business scenario with the traffic Manage policies to establish associations.
  11. 根据权利要求10所述的装置,其特征在于,所述目标业务场景为请求访问多个微服务时均存在的场景。The apparatus according to claim 10, wherein the target business scenario is a scenario that exists when requesting to access multiple microservices.
  12. 根据权利要求9至11任一项所述的装置,其特征在于,所述匹配模块,具体用于:The device according to any one of claims 9 to 11, wherein the matching module is specifically used for:
    查找与所述微服务的访问请求包括的目标流量特征相匹配的目标微服务的标识以及与所述目标微服务的标识关联的流量管理策略;Find the identifier of the target microservice that matches the target traffic feature included in the access request of the microservice and the traffic management policy associated with the identifier of the target microservice;
    当查找失败时,根据所述目标流量特征确定所述目标业务场景的标识。When the search fails, the identifier of the target service scenario is determined according to the target traffic feature.
  13. 根据权利要求10或11所述的装置,其特征在于,所述策略管理模块,具体用于:The device according to claim 10 or 11, wherein the policy management module is specifically configured to:
    呈现业务场景输入界面;Present the business scenario input interface;
    响应针对于业务场景的输入操作,获取所述业务场景的标识以及所述业务场景的标识对应的流量特征。In response to an input operation for a business scenario, an identifier of the business scenario and a traffic feature corresponding to the identifier of the business scenario are acquired.
  14. 根据权利要求10至12任一项所述的装置,其特征在于,所述策略管理模块,具体用于:The device according to any one of claims 10 to 12, wherein the policy management module is specifically configured to:
    呈现策略配置界面;Present the policy configuration interface;
    响应针对于流量管理策略的配置操作,将所述业务场景的标识与所述流量管理策略建立关联。In response to the configuration operation for the traffic management policy, the identification of the business scenario is associated with the traffic management policy.
  15. 一种流量管理装置,其特征在于,所述装置包括策略管理模块和策略存储模块,所述策略管理模块用于在接收应用的用户对微服务的访问请求之前,获取业务场景的标识以及所述业务场景的标识对应的流量特征,将所述业务场景的标识与所述流量管理策略建立关联;所述策略存储模块用于存储所述业务场景的标识与所述流量管理策略之间的关联,其中,所述流量管理策略用于对属于所述业务场景标识对应的业务场景的网络流量进行管理。A traffic management device, characterized in that the device includes a policy management module and a policy storage module, and the policy management module is used to obtain the identifier of the business scenario and the description of the The traffic characteristics corresponding to the identifiers of the business scenarios, and the identifiers of the business scenarios are associated with the traffic management policies; the policy storage module is used to store the association between the identifiers of the business scenarios and the traffic management policies, Wherein, the traffic management policy is used to manage the network traffic belonging to the service scenario corresponding to the service scenario identifier.
  16. 根据权利要求15所述的装置,其特征在于,所述目标业务场景为请求访问多个微服务时均存在的场景。The apparatus according to claim 15, wherein the target business scenario is a scenario that exists when requesting access to multiple microservices.
  17. 一种计算设备,其特征在于,包括处理器、存储器;A computing device, comprising a processor and a memory;
    所述处理器用于执行所述存储器中存储的指令,以使所述计算设备执行如权利要求1至6任一项所述的方法,或执行如权利要求7或8所述的方法。The processor is configured to execute instructions stored in the memory to cause the computing device to perform the method of any one of claims 1 to 6, or to perform the method of claim 7 or 8.
  18. 一种计算机可读存储介质,其特征在于,包括指令,当其在计算设备上运行时,使得所述计算设备执行如权利要求1至6中任一项所述的方法,或执行如权利要求7或8所述的 方法。A computer-readable storage medium comprising instructions that, when run on a computing device, cause the computing device to perform the method of any one of claims 1 to 6, or to perform the method as claimed in claim 1 The method of 7 or 8.
PCT/CN2021/117939 2021-01-05 2021-09-13 Traffic management method and apparatus, traffic management strategy configuration method and apparatus, and device and medium WO2022148050A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110008946.2 2021-01-05
CN202110008946.2A CN114726789A (en) 2021-01-05 2021-01-05 Method, device, equipment and medium for traffic management and traffic management policy configuration

Publications (1)

Publication Number Publication Date
WO2022148050A1 true WO2022148050A1 (en) 2022-07-14

Family

ID=82233642

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/117939 WO2022148050A1 (en) 2021-01-05 2021-09-13 Traffic management method and apparatus, traffic management strategy configuration method and apparatus, and device and medium

Country Status (2)

Country Link
CN (1) CN114726789A (en)
WO (1) WO2022148050A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115664739A (en) * 2022-10-17 2023-01-31 山东大学 Active user identity attribute detection method and system based on flow characteristic matching
CN117294657A (en) * 2023-11-24 2023-12-26 杭银消费金融股份有限公司 Flow control method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713168A (en) * 2016-12-21 2017-05-24 上海艾融软件股份有限公司 Flow control method and system
US20190215239A1 (en) * 2016-09-19 2019-07-11 Huawei Technologies Co., Ltd. Microservice Configuration Apparatus and Method
CN111600930A (en) * 2020-04-09 2020-08-28 网宿科技股份有限公司 Micro-service request traffic management method, device, server and storage medium
CN111726303A (en) * 2019-03-22 2020-09-29 阿里巴巴集团控股有限公司 Flow control method and device and computing equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190215239A1 (en) * 2016-09-19 2019-07-11 Huawei Technologies Co., Ltd. Microservice Configuration Apparatus and Method
CN106713168A (en) * 2016-12-21 2017-05-24 上海艾融软件股份有限公司 Flow control method and system
CN111726303A (en) * 2019-03-22 2020-09-29 阿里巴巴集团控股有限公司 Flow control method and device and computing equipment
CN111600930A (en) * 2020-04-09 2020-08-28 网宿科技股份有限公司 Micro-service request traffic management method, device, server and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115664739A (en) * 2022-10-17 2023-01-31 山东大学 Active user identity attribute detection method and system based on flow characteristic matching
CN115664739B (en) * 2022-10-17 2024-05-07 山东大学 User identity attribute active detection method and system based on flow characteristic matching
CN117294657A (en) * 2023-11-24 2023-12-26 杭银消费金融股份有限公司 Flow control method and device
CN117294657B (en) * 2023-11-24 2024-02-13 杭银消费金融股份有限公司 Flow control method and device

Also Published As

Publication number Publication date
CN114726789A (en) 2022-07-08

Similar Documents

Publication Publication Date Title
US11307967B2 (en) Test orchestration platform
US11909604B2 (en) Automatic provisioning of monitoring for containerized microservices
US11030020B2 (en) Asynchronous handling of service requests
EP3454214A1 (en) Infrastructure instantiation, collaboration, and validation architecture for serverless execution frameworks
CA2817760C (en) Virtual machine morphing for heterogeneous migration environments
US11388261B2 (en) Cross-domain brokering protocol cloud proxy
WO2022148050A1 (en) Traffic management method and apparatus, traffic management strategy configuration method and apparatus, and device and medium
CN111258627B (en) Interface document generation method and device
US20080020737A1 (en) Automatic Application Definition Distribution
JP2019522282A (en) Secure configuration of cloud computing nodes
US11546287B2 (en) Multi-device workspace notifications
US20200026586A1 (en) Discovery and Chaining of Virtual Functions
WO2021022714A1 (en) Message processing method for cross-block chain node, device, apparatus and medium
US20140337471A1 (en) Migration assist system and migration assist method
WO2019062634A1 (en) Communication method and apparatus
US10574701B1 (en) Network security policies using custom attributes
US20200293337A1 (en) Self-service orchestration platform
US11770436B2 (en) Web client with response latency awareness
US20230328147A1 (en) Smart notification system
US11757976B2 (en) Unified application management for heterogeneous application delivery
US11403093B1 (en) Application modification with proxy service process
US20220338292A1 (en) Network architecture for virtual mobile phones
EP4303729A1 (en) Exposing standardized events within an api proxy system
EP4310693A1 (en) Evaluating the quality of integrations for executing searches using application programming interfaces
US20220413689A1 (en) Context-based presentation of available microapp actions

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21917093

Country of ref document: EP

Kind code of ref document: A1