WO2021051623A1 - 基于微服务框架的灰度发布方法、装置和计算机设备 - Google Patents

基于微服务框架的灰度发布方法、装置和计算机设备 Download PDF

Info

Publication number
WO2021051623A1
WO2021051623A1 PCT/CN2019/118806 CN2019118806W WO2021051623A1 WO 2021051623 A1 WO2021051623 A1 WO 2021051623A1 CN 2019118806 W CN2019118806 W CN 2019118806W WO 2021051623 A1 WO2021051623 A1 WO 2021051623A1
Authority
WO
WIPO (PCT)
Prior art keywords
version
gray
users
scale
grayscale
Prior art date
Application number
PCT/CN2019/118806
Other languages
English (en)
French (fr)
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 WO2021051623A1 publication Critical patent/WO2021051623A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Definitions

  • This application relates to the computer field, and in particular to a gray-scale publishing method, device, computer equipment, and storage medium based on a microservice framework.
  • Gray release refers to a release method in which there are different service versions within the same time period, and a smooth transition between the original version and the new version.
  • gray-scale publishing is mainly used for gray-scale publishing of services with a single architecture.
  • the gray-scale publishing scheme of a single-architecture since the number of machine instances in the microservice group needs to be doubled, it will cost a lot of machine costs and Operation and maintenance costs, a huge burden on the cost, often can only do two service versions.
  • the service party when traditional technology is released in grayscale, the service party must not only set the version of the service, but also set the grayscale release strategy. The process of setting the grayscale release is tedious and time-consuming.
  • the traditional technology can only artificially set the gray scale basis, and the accuracy of the gray scale release made is insufficient.
  • the main purpose of this application is to provide a gray-scale publishing method, device, computer equipment, and storage medium based on a microservice framework, aiming to realize multi-version gray-scale publishing and improve the accuracy of gray-scale publishing.
  • this application proposes a gray-scale publishing method based on a microservice framework, which includes the following steps:
  • the multiple user terminals are divided into A0, A1, A2..., An, where A0, A1, A2..., An refers to temporary non-grayscale users, first version grayscale users, second version grayscale users,..., nth version grayscale users, where there are n versions of the specified service;
  • the first version grayscale users, the second version grayscale users,..., the nth version grayscale users are respectively diverted to the first version microservice chain, the second version microservice chain,..., the nth version microservice chain , Wherein the first version of the microservice chain, the second version of the microservice chain, ..., the nth version of the microservice chain have the same microservices, and the number of the same microservices is greater than a preset number;
  • the temporary non-gray-scale user input has been trained in the gray-scale reclassification model based on the machine learning model, so as to obtain the gray-scale users and the final non-gray-scale users classified from the temporary non-gray-scale users, And the microservice chain corresponding to the classified gray-scale users;
  • the classified gray-scale users are diverted to the micro-service chain corresponding to the categorized gray-scale users, and the final non-gray-scale users are diverted to the current version of the micro-service chain.
  • This application provides a gray-scale publishing device based on a microservice framework, including:
  • the designated data acquisition unit is configured to receive requests for accessing designated services sent by multiple user terminals, and parse the requests to obtain designated data, where the designated data includes the ip address, request header, or request parameters of the user terminal;
  • the gray-scale strategy acquisition unit is used to obtain the gray-scale strategy and provide the gray-scale strategy provided by the terminal;
  • the gray-scale user dividing unit is used to divide the multiple user terminals into A0, A1, A2..., An by determining whether the designated data falls within the multiple preset ranges of the gray-scale strategy, A0, A1, A2..., An respectively refer to temporary non-grayscale users, first version grayscale users, second version grayscale users,..., nth version grayscale users, in which there are n versions of the specified service;
  • the distribution unit is used to divert the first version grayscale users, the second version grayscale users,..., the nth version grayscale users to the first version microservice chain, the second version microservice chain,..., the first version grayscale users, respectively.
  • the re-classification unit is used to input the temporary non-gray-scale user input into the machine learning model-based gray-scale re-classification model that has been trained, so as to obtain the gray-scale users classified from the temporary non-gray-scale users and The final non-grayscale user, and the microservice chain corresponding to the classified grayscale user;
  • the re-distribution unit is configured to distribute the classified gray-scale users to the micro-service chain corresponding to the classified gray-scale users, and to divert the final non-gray-scale users to the micro-service chain of the current version.
  • the present application provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the steps of any one of the above methods when the computer program is executed.
  • the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above-mentioned methods are implemented.
  • the gray-scale publishing method, device, computer equipment and storage medium based on the micro-service framework of the present application receive requests for accessing specified services sent by multiple user terminals, and parse the requests to obtain specified data; obtain gray-scale policy providing terminals Provide gray-scale strategy; by judging whether the specified data falls within multiple preset ranges of the gray-scale strategy, the multiple user terminals are divided into A0, A1, A2..., An; Users are diverted to different versions of the microservice chain; the temporary non-gray-scale users are inputted into the trained gray-scale reclassification model based on the machine learning model, so as to obtain the classification from the temporary non-gray-scale users.
  • Gray-scale users and final non-gray-scale users divert the classified gray-scale users to the microservice chain corresponding to the classified gray-scale users, and divert the final non-gray-scale users to the current version Microservice chain. In this way, multi-version gray-scale release is realized and the accuracy of gray-scale release is improved.
  • FIG. 1 is a schematic flowchart of a gray-scale publishing method based on a microservice framework according to an embodiment of the application
  • FIG. 2 is a schematic block diagram of the structure of a gray-scale publishing apparatus based on a microservice framework according to an embodiment of the application;
  • FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
  • an embodiment of the present application provides a gray-scale publishing method based on a microservice framework, including the following steps:
  • the multiple user terminals are divided into A0, A1, A2..., An, where A0, A1, A2 ..., An respectively refer to temporary non-gray users, first version gray users, second version gray users,..., nth version gray users, where there are n versions of the specified service;
  • step S1 receiving requests for accessing a specified service sent by multiple user terminals, and analyzing the requests to obtain specified data, the specified data including the ip address, request header, or request parameters of the user terminal.
  • the multi-version gray-scale publishing method of this application is preferably applied to a server.
  • the request includes information such as the ip address, request header, or request parameters of the user terminal, so the specified data is obtained by parsing the request.
  • the specified data is used as a basis for subsequent grayscale release and diversion, that is, it is used to determine which version of the service the user terminal should divert to. Since this application adopts a microservice architecture and sets up multiple versions of microservice chains, this application can implement the gray-scale release of multiple service versions at the same time.
  • the request parameter refers to the parameter in the request, and the value of the request parameter may be used as a basis for dividing the user terminal, so as to determine which version of the service the user terminal should be diverted to.
  • obtaining the gray-scale strategy provides the gray-scale strategy provided by the terminal.
  • the gray-scale strategy is used to indicate the service version to which the user terminal should be diverted according to the specified data. For example, it is determined whether the ip address of the user terminal falls within the preset address range, and if it falls within the preset address range, the user terminal is identified as the first version gray user.
  • the gray-scale strategy may indicate shunting based on only a single data, or may also indicate shunting based on multiple data.
  • the gray-scale strategy adopted in this application comes from the gray-scale strategy provider terminal, so that the gray-scale strategy setting is separated from the gray-scale version mark. When the service provider performs the gray-scale release, only the version of the microservice is required. Just mark it, which overcomes the cumbersome and time-consuming defects of the traditional scheme setting gray-scale release process.
  • the multiple user terminals are divided into A0, A1, A2..., An, where A0, A1, A2..., An refer to temporary non-grayscale users, first version grayscale users, second version grayscale users,..., nth version grayscale users, in which there are n versions of the specified service.
  • One of the preset ranges represents a version gray user, thereby dividing user terminals.
  • the gray scale strategy comprehensively considers a variety of data
  • the first version grayscale users, second version grayscale users,..., nth version grayscale users are diverted to the first version microservice chain, the second version microservice chain,... , The nth version of the microservice chain, wherein the first version of the microservice chain, the second version of the microservice chain, ..., the nth version of the microservice chain have the same microservices, and the number of the same microservices is greater than the expected number Set the number.
  • the first version of the microservice chain consists of all microservices marked as the first version (the same microservice is marked with all version numbers by default), or all microservices marked as the first version and marked as the current version Number of microservices (that is, the same microservices) composition.
  • the number of the same microservices is greater than the preset number, which can ensure that during grayscale publishing, only instances of the specified microservices need to be adapted to the new version, which greatly reduces the resource consumption of grayscale publishing.
  • step S5 input the temporary non-gray-scale users into the trained gray-scale reclassification model based on the machine learning model, so as to obtain the gray-scale users classified from the temporary non-gray-scale users.
  • the microservice chain corresponding to the final non-gray-scale users and the classified gray-scale users.
  • this application also uses a gray-scale reclassification model to re-classify the temporary non-gray-scale users, so as to obtain information from the temporary non-gray-scale users.
  • this application uses two classifications, and the second classification adopts the gray-scale re-classification model, which can perform gray-scale publishing more accurately, thereby making the data information obtained by gray-scale publishing feedback more effective and improving The success rate of gray release.
  • the classified gray-scale users are diverted to the micro-service chain corresponding to the categorized gray-scale users, and the final non-gray-scale users are diverted to the current version of the micro-service chain.
  • the final non-gray user is an accurate non-gray user and does not need to be diverted to the updated version of the microservice chain, so it is diverted to the current version of the microservice chain.
  • multi-version gray-scale publishing can be completed.
  • the request is encapsulated by a designated communication protocol
  • the step S1 of receiving a request for accessing a designated service sent by a plurality of user terminals and parsing the request to obtain designated data includes:
  • S101 Receive requests for accessing a designated service sent by multiple user terminals, and obtain the format of the designated communication protocol from a plurality of pre-stored communication protocol formats;
  • the request is parsed to obtain the specified data.
  • the designated communication protocol can be any communication protocol, such as HTTP communication protocol, etc., or a custom communication protocol.
  • the request encapsulated by the specified communication protocol has a request header, such as an HTTP request message header.
  • the format of the HTTP request is, for example, a request line, a request header, a blank line, and the request content.
  • the request header includes a lot of content, such as the type of browser that generated the request, the list of response content types that the client can recognize, the natural language that the client can accept, and other content (for example, expressed as the first in the form of usertype:test1) Version grayscale users) and so on.
  • the request is parsed using the format of the designated communication protocol to obtain the request header in the request; the data in the pre-appointed location is extracted from the request header and recorded as the designated data, then it can be passed Specify data to determine whether the client is a gray user.
  • the plurality of user terminals are divided into A0, A1, A2..., An by determining whether the designated data falls within a plurality of preset ranges of the gray-scale strategy, A0, A1, A2..., An refer to temporary non-grayscale users, first version grayscale users, second version grayscale users,..., nth version grayscale users, and there are n versions of the specified service.
  • Step S3 includes:
  • S301 Calculate the similarity value between the designated data and the preset character string according to a preset similarity algorithm
  • the multiple user terminals are divided into A0, A1, A2..., An, where A0, A1, A2..., An refer to temporary non-grayscale users, first version grayscale users, and second grayscale users, respectively.
  • the preset similarity algorithm can be any algorithm, as long as the similarity value between the specified data and the preset character string can be calculated, such as a distance formula based on the law of cosine, a similarity algorithm based on a word frequency vector, and the like. If the similarity value is less than the preset similarity threshold, it means that the corresponding designated data is not similar to the preset character string, and therefore the corresponding user terminal is a temporary non-gray user.
  • the temporary gray-scale users corresponding to the first keyword, the second keyword, ..., and the nth keyword recorded in the specified data are respectively classified as the first version gray-scale users , The second version of the gray user,..., the nth version of the gray user. In this way, the accurate release of multiple versions based on the request header is realized.
  • the plurality of user terminals are divided into A0, A1, A2..., An by determining whether the designated data falls within a plurality of preset ranges of the gray-scale strategy, A0, A1, A2..., An refer to temporary non-grayscale users, first version grayscale users, second version grayscale users,..., nth version grayscale users, and there are n versions of the specified service.
  • Step S3 includes:
  • S302 Acquire a designated parameter matrix [C1, C2, C3] corresponding to the gray strategy provided by the gray strategy providing terminal according to the preset correspondence between the gray strategy and the parameter matrix;
  • the multiple user terminals are divided into A0, A1, A2..., An, where A0, A1, A2..., An Refers to temporary non-grayscale users, first version grayscale users, second version grayscale users, ..., nth version grayscale users, where there are n versions of the designated service.
  • the multiple user terminals are divided into A0, A1, A2..., An, where A0, A1, A2..., An refer to temporary non-grayscale users, first version grayscale users, and second grayscale users, respectively.
  • Version gray user,..., nth version gray user Traditional gray-scale publishing solutions use a single factor for low-dimensional gray-scale publishing, while this application uses high-dimensional mixed grayscale, which is faster and more precise than the single-dimensional gray-scale solution of the traditional technology.
  • the encoding method is a method of sequentially mapping the ip address, request header, and request parameters of the user terminal to specific values, and then combining them to obtain a matrix. Therefore, this application can simultaneously integrate the ip address, request header, and request parameters of the user terminal to perform high-dimensional and accurate gray-scale release, and the division is faster and more accurate.
  • the microservice has a version attribute
  • the first version grayscale user, the second version grayscale user,..., the nth version grayscale user are respectively diverted to the first version microservice chain
  • the second version of the microservice chain,..., the nth version of the microservice chain wherein the first version of the microservice chain, the second version of the microservice chain,..., the nth version of the microservice chain have the same microservices, and all
  • the method includes:
  • S31 Receive a version marking requirement sent by a version marking terminal, where the version marking requirement records the microservices that need to be marked and the marked version number;
  • the setting of the first version of the microservice chain, the second version of the microservice chain,..., the nth version of the microservice chain has been achieved.
  • This application separates the setting of the gray-scale strategy from the mark of the microservice version, avoiding the cumbersome process of gray-scale steps.
  • the service provider that is, the version marking terminal
  • the version marking requirement sent by the version marking terminal is to edit the version attribute of the microservice.
  • the unedited microservice has all the version numbers by default, and accordingly the version attribute is marked as the first version of all microservices.
  • the first version of the microservice chain all the microservices whose version attribute is marked as the second version constitute the second version of the microservice chain,..., and all the microservices whose version attribute is marked as the nth version constitute the nth version of the microservice chain.
  • the microservices marked with multiple version numbers are the same microservices of multiple version microservice chains.
  • the machine learning model is a CHAID decision tree model
  • the temporary non-gray-scale user is inputted into a machine learning model-based gray-scale reclassification model that has been trained to operate, thereby obtaining data from the Before step S5 of the classified gray-scale users and the final non-gray-scale users from the temporarily non-gray-scale users, and the micro-service chain corresponding to the classified gray-scale users, it includes:
  • sample data includes pre-adopted user-side data and a sample composed of gray-scale user categories associated with the user-side data data;
  • the gray-level reclassification model is achieved.
  • the user-side data can be any data, for example, including: IP address, request header, request parameters, user-side traffic conditions, user-side network access records, and/or user-side registration duration, etc. These user-side data can reflect which version of the service is suitable for the user-side, so it can be used for gray-scale user classification again.
  • the gray-scale re-classification model is used for re-classification to make Grayscale release is more accurate.
  • the decision tree is a machine learning model that can be used for data classification.
  • This application uses the CHAID decision tree established by the chi-square automatic interactive detection method as the machine learning model.
  • the CHAID decision tree model refers to a decision tree model that uses the chi-square automatic interactive detection method CHAID.
  • CHAID decision tree refers to a decision tree model that uses the chi-square automatic interactive detection method CHAID.
  • the CHAID decision tree 1. Combine the group values that have no significant difference in the impact of the decision variables in the group; 2. Select the variable with the largest chi-square value as the tree classification variable; 3. Repeat the steps 1 and 2 until it fails Choose that the chi-square value is greater than a certain value or the P value is no longer less than a certain critical value, or the sample is less than a certain number. Then use the samples of the training set to train the CHAID decision tree model, and then use the samples of the test set to verify. If it passes, the gray-scale reclassification model is obtained.
  • the step S42 of inputting the sample data of the training set into a preset CHAID decision tree model for training to obtain a preliminary gray-scale reclassification model includes:
  • S422 Input the sample data of the training set into the CHAID decision tree model established by the chi-square automatic interactive detection method for training, to obtain a preliminary CHAID decision tree.
  • the CHAID decision tree model can be determined only by setting the modeling standard parameters of the CHAID decision tree model.
  • the modeling standard parameters include the maximum number of layers of the decision tree, the subdividable significance level of the parent node, the minimum number of samples contained in the parent node, and the minimum number of samples contained in the child nodes.
  • the maximum number of layers of the decision tree is 3-6
  • the significance level that can be subdivided for the layer and the parent node is 0.05, the minimum number of samples contained in the parent node is 100, and the minimum number of samples contained in the child node is 50. More specifically, the modeling standard parameter is adjusted according to the difference of the collected user-side data.
  • the number of samples of the user-side data is greater than a predetermined value
  • the number of types of the user-side data is greater than the preset value
  • the maximum number of layers of the decision tree, the subdivisionable significance level of the parent node, and the parent node include The parameter values of the minimum number of samples and the minimum number of samples contained in the child node are set larger.
  • the gray-scale publishing method based on the micro-service framework of the present application receives requests for accessing specified services sent by multiple user terminals, and parses the requests to obtain specified data; obtains the gray-scale strategy to provide the gray-scale strategy provided by the terminal; Whether the specified data falls within a plurality of preset ranges of the gray-scale strategy, thereby dividing the plurality of user terminals into A0, A1, A2..., An; separate gray-scale users to different versions Micro-service chain; input the temporary non-gray-scale users into the already-trained gray-scale reclassification model based on the machine learning model to obtain the gray-scale users and the final non-gray-scale users classified from the temporary non-gray-scale users Gray-scale users; divert the classified gray-scale users to the micro-service chain corresponding to the classified gray-scale users, and divert the final non-gray-scale users to the current version of the micro-service chain. In this way, multi-version gray-scale release is realized and the accuracy of gray-scale release is
  • an embodiment of the present application provides a gray-scale publishing device based on a microservice framework, including:
  • the designated data acquisition unit 10 is configured to receive requests for accessing designated services sent by multiple user terminals, and parse the requests to obtain designated data, the designated data including the ip address, request header, or request parameters of the user terminal;
  • the gray-scale strategy acquisition unit 20 is configured to acquire the gray-scale strategy and provide the gray-scale strategy provided by the terminal;
  • the gray-scale user dividing unit 30 is configured to divide the plurality of user terminals into A0, A1, A2..., An by determining whether the designated data falls within the plurality of preset ranges of the gray-scale strategy. , Where A0, A1, A2..., An respectively refer to temporary non-grayscale users, first version grayscale users, second version grayscale users,..., nth version grayscale users, and the specified service has n versions in total ;
  • the shunting unit 40 is configured to shunt the first version grayscale users, the second version grayscale users,..., the nth version grayscale users to the first version microservice chain, the second version microservice chain,..., The nth version of the microservice chain, wherein the first version of the microservice chain, the second version of the microservice chain, ..., the nth version of the microservice chain have the same microservices, and the number of the same microservices is greater than a preset Quantity
  • the reclassification unit 50 is configured to input the temporary non-gray-scale user into the trained gray-scale reclassification model based on the machine learning model, so as to obtain the gray-scale user classified from the temporary non-gray-scale user And the final non-gray-scale user and the microservice chain corresponding to the classified gray-scale user;
  • the re-offloading unit 60 is configured to offload the classified gray-scale users to the micro-service chain corresponding to the classified gray-scale users, and to off-load the final non-gray-scale users to the current version of the micro-service chain.
  • the request is encapsulated using a designated communication protocol
  • the designated data obtaining unit 10 includes:
  • the format obtaining subunit is configured to receive requests for accessing a specified service sent by multiple user terminals, and obtain the format of the specified communication protocol from a plurality of pre-stored communication protocol formats;
  • the request header obtaining subunit is configured to parse the request using the format of the specified communication protocol, so as to obtain the request header in the request;
  • the designated data acquisition subunit is used to extract the data in the pre-appointed position from the request header and record it as the designated data.
  • the gray-scale user dividing unit 30 includes:
  • the similarity value calculation subunit is configured to calculate the similarity value between the designated data and the preset character string according to a preset similarity algorithm
  • the temporary gray-scale user division subunit is used to classify user terminals whose similarity values are less than a preset similarity threshold into temporary non-gray-scale users, and to divide user terminals whose similarity values are not less than the preset similarity threshold Divided into temporary gray users;
  • the keyword acquisition subunit is used to acquire the first keyword and the second keyword corresponding to the first version gray user, the second version gray user,..., the nth version gray user agreed in the gray level strategy ,..., the nth keyword, where there are n versions of the specified service;
  • the gray-scale user division subunit is used to divide the temporary gray-scale users corresponding to the first keyword, the second keyword, ..., and the nth keyword in the specified data into the first version gray-scale users and the first version, respectively.
  • the gray-scale user dividing unit 30 includes:
  • the encoding subunit is used to encode the ip address, request header, and request parameters of the user terminal into a matrix [B1, B2, B3] according to a preset encoding method, where B1 is the mapping value corresponding to the ip address, B2 is the mapping value corresponding to the request header, and B3 is the mapping value corresponding to the request parameter;
  • the designated parameter matrix acquisition subunit is used to acquire the designated parameter matrix [C1, C2, C3] corresponding to the gray strategy provided by the gray strategy providing terminal according to the preset corresponding relationship between the gray strategy and the parameter matrix;
  • the numerical range judgment subunit is used to divide the multiple user terminals into A0, A1, A2..., An by judging whether the reference index M falls within multiple preset numerical ranges, where A0, A1, A2..., An respectively refer to temporary non-grayscale users, first version grayscale users, second version grayscale users,..., nth version grayscale users, in which there are n versions of the specified service.
  • the microservice has a version attribute
  • the device includes:
  • the version marking request receiving unit is configured to receive the version marking request sent by the version marking terminal, where the version marking request records the microservices that need to be marked and the marked version number;
  • the version attribute modification unit is configured to modify the version attribute of the microservice according to the version marking requirement, wherein at least one microservice is marked with multiple version numbers;
  • the microservice chain component unit is used to form all microservices whose version attributes are marked as the first version into the first version microservice chain, and all microservices whose version attributes are marked as the second version into the second version microservice chain, ...And all microservices whose version attribute is marked as the nth version form the nth version microservice chain.
  • the machine learning model is a CHAID decision tree model
  • the device includes:
  • the sample data acquisition unit is used to acquire a specified amount of sample data, and divide the sample data into a training set and a test set; wherein the sample data includes pre-adopted user-side data and grayscale associated with the user-side data Sample data composed of user categories;
  • the training unit is used to input the sample data of the training set into the preset CHAID decision tree model for training to obtain a preliminary gray-scale reclassification model
  • a verification unit configured to verify the preliminary gray-scale reclassification model by using the test set
  • the model marking unit is configured to record the preliminary gray-scale reclassification model as a gray-scale reclassification model if the verification is passed.
  • the training unit includes:
  • the modeling standard parameter setting subunit is used to set the modeling standard parameters of the CHAID decision tree model.
  • the modeling standard parameters include the maximum number of layers of the decision tree, the subdividable significance level of the parent node, and the parent node contains The minimum number of samples and the minimum number of samples contained in the child node;
  • the training subunit is used to input the sample data of the training set into the CHAID decision tree model established by the chi-square automatic interactive detection method for training to obtain a preliminary CHAID decision tree.
  • the gray-scale publishing device based on the micro-service framework of the present application receives requests for accessing specified services sent by multiple user terminals, and parses the requests to obtain specified data; obtains the gray-scale strategy to provide the gray-scale strategy provided by the terminal; Whether the specified data falls within a plurality of preset ranges of the gray-scale strategy, thereby dividing the plurality of user terminals into A0, A1, A2..., An; separate gray-scale users to different versions Micro-service chain; input the temporary non-gray-scale users into the already-trained gray-scale reclassification model based on the machine learning model to obtain the gray-scale users and the final non-gray-scale users classified from the temporary non-gray-scale users Gray-scale users; divert the classified gray-scale users to the micro-service chain corresponding to the classified gray-scale users, and divert the final non-gray-scale users to the current version of the micro-service chain. In this way, multi-version gray-scale release is realized and the accuracy of gray-scale release is
  • an embodiment of the present application also provides a computer device.
  • the computer device may be a server, and its internal structure may be as shown in the figure.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor designed by the computer is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store the data used in the gray-scale publishing method based on the micro-service framework.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to realize a gray-scale publishing method based on the microservice framework.
  • the above-mentioned processor executes the above-mentioned gray-scale publishing method based on the micro-service framework, wherein the steps included in the method respectively correspond to the steps of executing the gray-scale publishing method based on the micro-service framework of the foregoing embodiments one-to-one, and will not be repeated here.
  • the computer device of the present application receives requests for access to designated services sent by multiple user terminals, and parses the requests to obtain designated data; obtains the gray-scale strategy provided by the gray-scale strategy provided by the terminal; determines whether the specified data falls into Within a plurality of preset ranges of the gray-scale strategy, thereby dividing the plurality of user terminals into A0, A1, A2..., An; branching gray-scale users to different versions of the microservice chain; Temporarily non-gray-scale users input the already trained gray-scale reclassification model based on the machine learning model, so as to obtain gray-scale users and final non-gray-scale users classified from the temporary non-gray-scale users; The classified gray-scale users are diverted to the micro-service chain corresponding to the classified gray-scale users, and the final non-gray-scale users are diverted to the current version of the micro-service chain. In this way, multi-version gray-scale release is realized and the accuracy of gray-scale release is improved.
  • An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored.
  • a gray-scale publishing method based on a microservice framework is implemented, wherein the steps included in the method are respectively the same as those in the execution.
  • the steps of the gray-scale publishing method based on the micro-service framework of the foregoing embodiment correspond one-to-one, and will not be repeated here.
  • the computer-readable storage medium is, for example, a non-volatile computer-readable storage medium or a volatile computer-readable storage medium.
  • the computer-readable storage medium of the present application receives requests for accessing specified services sent by multiple user terminals, and parses the requests to obtain specified data; obtains the gray-scale strategy provided by the gray-scale strategy provided by the terminal; and judges the specified data Whether it falls within the multiple preset ranges of the gray-scale strategy, thereby dividing the multiple user terminals into A0, A1, A2..., An; diverts the gray-scale users to different versions of the microservice chain; Inputting the temporary non-gray-scale user into a machine learning model-based gray-scale reclassification model that has been trained to obtain a gray-scale user and a final non-gray-scale user classified from the temporary non-gray-scale user; The classified gray-scale users are diverted to the micro-service chain corresponding to the categorized gray-scale users, and the final non-gray-scale users are diverted to the current version of the micro-service chain. In this way, multi-version gray-scale release is realized and the accuracy of gray-scale release is improved.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种基于微服务框架的灰度发布方法、装置、计算机设备和存储介质,所述方法包括:接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据;获取灰度策略提供终端提供的灰度策略;将所述多个用户终端划分为A0、A1、A2…、An;将灰度用户分别分流至不同版本的微服务链;将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户;将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。从而实现多版本灰度发布,并提高灰度发布的精准度。

Description

基于微服务框架的灰度发布方法、装置和计算机设备
本申请要求于2019年9月18日提交中国专利局、申请号为201910882710.4,发明名称为“基于微服务框架的灰度发布方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及到计算机领域,特别是涉及到一种基于微服务框架的灰度发布方法、装置、计算机设备和存储介质。
背景技术
灰度发布是指在同一个时间段内,存在不同的服务版本,在原始版本与新的版本间平滑过渡的一种发布方式。目前采用灰度发布主要针对单体式架构的服务进行灰度发布,而单体式架构的灰度发布方案,由于微服务群的机器实例数量需要成倍的,会耗费极大的机器成本以及运维成本,成本上的极大负担,往往只能做两个服务版本。并且传统技术在灰度发布时,服务方不仅必须设置服务的版本,还必须设置灰度发布策略,设置灰度发布的流程繁琐,耗时长。另外,传统技术仅能人为设定灰度依据,做出的灰度发布精准度不足。
技术问题
本申请的主要目的为提供一种基于微服务框架的灰度发布方法、装置、计算机设备和存储介质,旨在实现多版本灰度发布,并提高灰度发布的精准度。
技术解决方案
为了实现上述发明目的,本申请提出一种基于微服务框架的灰度发布方法,包括以下步骤:
接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据,所述指定数据包括用户终端的ip地址、请求头或者请求参数;
获取灰度策略提供终端提供的灰度策略;
通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本;
将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量;
将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链;
将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。
本申请提供一种基于微服务框架的灰度发布装置,包括:
指定数据获取单元,用于接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据,所述指定数据包括用户终端的ip地址、请求头或者请求参数;
灰度策略获取单元,用于获取灰度策略提供终端提供的灰度策略;
灰度用户划分单元,用于通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本;
分流单元,用于将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量;
再分类单元,用于将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链;
再分流单元,用于将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。
本申请提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述任一项所述方法的步骤。
本申请提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法的步骤。
有益效果
本申请的基于微服务框架的灰度发布方法、装置、计算机设备和存储介质,接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据;获取灰度策略提供终端提供的灰度策略;通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An;将灰度用户分别分流至不同版本的微服务链;将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户;将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。从而实现多版本灰度发布,并提高灰度发布的精准度。
附图说明
图1 为本申请一实施例的基于微服务框架的灰度发布方法的流程示意图;
图2 为本申请一实施例的基于微服务框架的灰度发布装置的结构示意框图;
图3 为本申请一实施例的计算机设备的结构示意框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本申请的最佳实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
参照图1,本申请实施例提供一种基于微服务框架的灰度发布方法,包括以下步骤:
S1、接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据,所述指定数据包括用户终端的ip地址、请求头或者请求参数;
S2、获取灰度策略提供终端提供的灰度策略;
S3、通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本;
S4、将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量;
S5、将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链;
S6、将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。
如上述步骤S1所述,接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据,所述指定数据包括用户终端的ip地址、请求头或者请求参数。本申请的多版本灰度发布方法优选应用于服务器。其中所述请求中包括有用户终端的ip地址、请求头或者请求参数等信息,因此通过解析所述请求从而得到指定数据。其中所述指定数据是作为后续灰度发布分流的依据,即用于确定用户终端应分流至哪个版本的服务。由于本申请采用的是微服务架构,并且设置了多个版本的微服务链,因此本申请可以实现同时进行多个服务版本的灰度发布。其中请求参数指所述请求中的参数,可以依据所述请求参数的值作为划分所述用户终端的依据,从而决定所述用户终端应被分流至哪些版本的服务。
如上述步骤S2所述,获取灰度策略提供终端提供的灰度策略。所述灰度策略用于指示依据所述指定数据确定所述用户终端应分流至哪个版本的服务。例如判断用户终端的ip地址是否落入预设的地址范围内,若落入预设的地址范围内,则将所述用户终端认定为第一版本灰度用户。其中所述灰度策略可以为仅依据单个数据而指示分流,或者也可以依据多个数据而指示分流。其中本申请采用的灰度策略来自于灰度策略提供终端,从而使灰度策略的设置与灰度版本的标记分割开来,服务提供方在进行灰度发布时,只需对微服务的版本进行标记即可,从而克服了传统方案设置灰度发布的流程繁琐,耗时长的缺陷。
如上述步骤S3所述,通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本。其中一个预设范围代表了一个版本灰度用户,从而划分用户终端。进一步地,所述灰度策略综合考虑多种数据,所述划分方法具体为:根据预设的编码方法,将所述用户终端的ip地址、请求头和请求参数编码为矩阵[B1,B2,B3],其中B1为所述ip地址对应的映射值、B2为所述请求头对应的映射值、B3为所述请求参数对应的映射值;根据预设的灰度策略与参数矩阵的对应关系,获取与所述灰度策略提供终端提供的灰度策略对应的指定参数矩阵[C1,C2,C3];通过公式:M=||[B1,B2,B3] T[C1,C2,C3] ||,计算得到划分参考指数M;通过判断所述参考指数M是否落入预设的多个数值范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本。从而实现了高维混合灰度,相较于传统技术的单维灰度方案,划分更加快捷、精准。
如上述步骤S4所述,将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量。其中第一版本微服务链由所有被标记为第一版本的微服务构成(相同的微服务默认标记有所有版本号),或者由所有被标记为第一版本的微服务和被标记为当前版本号的微服务(即相同的微服务)构成。并且所述相同的微服务的数量大于预设数量,可以保证在灰度发布时,仅需要对指定微服务做出适应新版本的实例即可,大大减少了灰度发布的资源消耗。
如上述步骤S5所述,将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链。虽然前述的划分方法已经将用户端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,但是为了更精准地进行灰度发布,本申请还采用了灰度再分类模型对所述暂时非灰度用户进行再次分类,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链。相较于传统方案,本申请采用两次分类,并且第二次分类采用灰度再分类模型的方式,能够更精准地进行灰度发布,进而使灰度发布反馈得到的数据信息更有效,提高灰度发布的成功率。
如上述步骤S6所述,将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。所述最终非灰度用户是精确的非灰度用户,不需要引流至更新版本的微服务链中,因此将其分流至当前版本的微服务链。以及将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,即可完成多版本灰度发布。
在一个实施方式中,所述请求采用指定通信协议封装而成,所述接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据的步骤S1,包括:
S101、接收多个用户终端发送的访问指定服务的请求,并从预存的多个通信协议格式中获取所述指定通信协议的格式;
S102、利用所述指定通信协议的格式解析所述请求,从而得到所述请求中的请求头;
S103、从所述请求头中提取预先约定位置中的数据,并记为所述指定数据。
如上所述,实现了解析所述请求从而得到指定数据。指定通信协议可为任意通信协议,例如为HTTP通信协议等,或者为自定义的通信协议。而指定通信协议封装而成的请求具有请求头,例如HTTP请求报文头。其中HTTP请求的格式例如为:请求行、请求头、空行和请求内容所构成。其中请求头中包括了许多内容,例如:生成请求的浏览器类型、客户端可识别的响应内容类型列表、客户端可接受的自然语言以及其他内容(例如以usertype:test1的形式表示为第一版本灰度用户)等。据此利用所述指定通信协议的格式解析所述请求,从而得到所述请求中的请求头;从所述请求头中提取预先约定位置中的数据,并记为所述指定数据,就能够通过指定数据来判断用户端是否为灰度用户。
在一个实施方式中,所述通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本的步骤S3,包括:
S301、根据预设的相似度算法,计算所述指定数据与预设字符串的相似度值;
S302、将所述相似度值小于预设相似度阈值的用户终端划分为暂时非灰度用户,并将所述相似度值不小于预设相似度阈值的用户终端划分为暂时灰度用户;
S303、获取所述灰度策略中约定的第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户对应的第一关键词、第二关键词、…、第n关键词,其中所述指定服务共有n个版本;
S304、将所述指定数据中记载有第一关键词、第二关键词、…、第n关键词对应的暂时灰度用户分别划分为第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户。
如上所述,实现了将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户。其中预设的相似算法可以为任意算法,只要能计算所述指定数据与预设字符串的相似度值即可,例如基于余弦定理的距离公式,基于词频向量的相似度算法等。所述相似度值小于预设相似度阈值,则表示对应的指定数据与预设字符串不相似,因此对应的用户终端为暂时非灰度用户。并且为了进一步确定灰度用户的分类,还将所述指定数据中记载有第一关键词、第二关键词、…、第n关键词对应的暂时灰度用户分别划分为第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户。从而实现了以请求头为依据实现多版本的准确发布。
在一个实施方式中,所述通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本的步骤S3,包括:
S301、根据预设的编码方法,将所述用户终端的ip地址、请求头和请求参数编码为矩阵[B1,B2,B3],其中B1为所述ip地址对应的映射值、B2为所述请求头对应的映射值、B3为所述请求参数对应的映射值;
S302、根据预设的灰度策略与参数矩阵的对应关系,获取与所述灰度策略提供终端提供的灰度策略对应的指定参数矩阵[C1,C2,C3];
S303、通过公式: M=||[B1,B2,B3] T[C1,C2,C3] ||,计算得到划分参考指数M;
S304、通过判断所述参考指数M是否落入预设的多个数值范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本。
如上所述,实现了将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户。传统的灰度发布方案都是采用单个因素进行低维灰度发布,而本申请采用了高维混合灰度,相较于传统技术的单维灰度方案,划分更加快捷、精准。具体地,根据预设的编码方法,将所述用户终端的ip地址、请求头和请求参数编码为矩阵[B1,B2,B3];根据预设的灰度策略与参数矩阵的对应关系,获取与所述灰度策略提供终端提供的灰度策略对应的指定参数矩阵[C1,C2,C3];通过公式: M=||[B1,B2,B3] T[C1,C2,C3] ||,计算得到划分参考指数M;再根据参考指数M进行划分灰度用户。其中编码方法即是将所述用户终端的ip地址、请求头和请求参数依次映射为具体数值,再组合得到矩阵的方法。因此本申请可以同时综合用户终端的ip地址、请求头和请求参数进行高维准确地灰度发布,划分更加快捷、精准。
在一个实施方式中,所述微服务具有版本属性,所述将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量的步骤S4之前,包括:
S31、接收版本标记终端发送的版本标记要求,所述版本标记要求记载了需要标记的微服务以及标记的版本号;
S32、根据所述版本标记要求,修改所述微服务的版本属性,其中至少有一个微服务被标记为多个版本号;
S33、将版本属性被标记为第一版本的所有微服务组成第一版本微服务链、将版本属性被标记为第二版本的所有微服务组成第二版本微服务链、…、以及将版本属性被标记为第n版本的所有微服务组成第n版本微服务链。
如上所述,实现了设置第一版本微服务链、第二版本微服务链、…、第n版本微服务链。本申请通过将灰度策略的设置与微服务版本的标记分割开来的方式,避免了灰度步骤的繁琐流程。其中服务提供方(即版本标记终端)只需进行版本标记即可,减少了进行灰度发布需要的工作量。版本标记终端发送的版本标记要求,即是对微服务的版本属性进行编辑,其中未被编辑的微服务默认为具有所有版本号,据此将版本属性被标记为第一版本的所有微服务组成第一版本微服务链、将版本属性被标记为第二版本的所有微服务组成第二版本微服务链、…、以及将版本属性被标记为第n版本的所有微服务组成第n版本微服务链。其中被标记为多个版本号的微服务即为多个版本微服务链的具有的相同微服务。
在一个实施方式中,所述机器学习模型为CHAID决策树模型,所述将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链的步骤S5之前,包括:
S41、获取指定量的样本数据,并将样本数据分成训练集和测试集;其中,所述样本数据包括预先采用的用户端数据,以及与所述用户端数据关联的灰度用户类别组成的样本数据;
S42、将训练集的样本数据输入到预设的CHAID决策树模型中进行训练,得到初步灰度再分类模型;
S43、利用所述测试集验证所述初步灰度再分类模型;
S44、若验证通过,则将所述初步灰度再分类模型记为灰度再分类模型。
如上所述,实现了获得灰度再分类模型。其中用户端数据可为任意数据,例如包括:IP地址、请求头、请求参数、用户端的流量状况、用户端的网络访问记录和/或用户端的注册时长等等。这些用户端数据可以反应用户端适于采用何种版本的服务,因此可以用于再次灰度用户分类。虽然用户终端已经进行过划分灰度用户的流程,但是被划分为暂时非灰度用户的用户端中其实还是存在可再次进行灰度的用户,因此采用灰度再分类模型进行再次分类,以使灰度发布更加精准。其中,决策树是一种机器学习模型,可用于数据分类,本申请采用卡方自动交互检测法建立的CHAID决策树作为机器学习模型。CHAID决策树模型指采用卡方自动交互检测法CHAID的决策树模型。在此简单介绍CHAID决策树的原理:1、合并组内对决策变量影响差别不显著的组值;2、选取卡方值最大的变量作为树分类变量;3、重复1、2步骤,至不能选取卡方值大于某值或P值不再小于某临界值,或样本小于某数。再采用训练集的样本训练CHAID决策树模型,再用测试集的样本进行验证,若通过,则获得灰度再分类模型。
在一个实施方式中,所述将训练集的样本数据输入到预设的CHAID决策树模型中进行训练,得到初步灰度再分类模型的步骤S42,包括:
S421、设置所述CHAID决策树模型的建模标准参数,所述建模标准参数包括决策树的最大层数、母节点的可再分的显著水平、母节点包含的最小样本数和子节点包含的最小样本数;
S422、将训练集的样本数据输入到采用卡方自动交互检测法建立的所述CHAID决策树模型中进行训练,得到初步CHAID决策树。
如上所述,实现了得到初步CHAID决策树。其中设置所述CHAID决策树模型的建模标准参数,才可确定所述CHAID决策树模型。所述建模标准参数包括决策树的最大层数、母节点的可再分的显著水平、母节点包含的最小样本数和子节点包含的最小样本数,例如决策树的最大层数为3-6层、母节点可再分的显著水平为0.05、母节点包含的最小样本数为100、子节点包含的最小样本数为50。更具体地,根据采集的用户端数据的不同,调节所述建模标准参数。例如所述用户端数据的样本数大于预定数值,且所述用户端数据的类型数量大于预设数值,则可以将决策树的最大层数、母节点的可再分的显著水平、母节点包含的最小样本数和子节点包含的最小样本数的参数值设置更大。
本申请的基于微服务框架的灰度发布方法,接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据;获取灰度策略提供终端提供的灰度策略;通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An;将灰度用户分别分流至不同版本的微服务链;将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户;将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。从而实现多版本灰度发布,并提高灰度发布的精准度。
参照图2,本申请实施例提供一种基于微服务框架的灰度发布装置,包括:
指定数据获取单元10,用于接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据,所述指定数据包括用户终端的ip地址、请求头或者请求参数;
灰度策略获取单元20,用于获取灰度策略提供终端提供的灰度策略;
灰度用户划分单元30,用于通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本;
分流单元40,用于将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量;
再分类单元50,用于将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链;
再分流单元60,用于将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。
其中上述单元分别用于执行的操作与前述实施方式的基于微服务框架的灰度发布方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述请求采用指定通信协议封装而成,所述指定数据获取单元10,包括:
格式获取子单元,用于接收多个用户终端发送的访问指定服务的请求,并从预存的多个通信协议格式中获取所述指定通信协议的格式;
请求头获取子单元,用于利用所述指定通信协议的格式解析所述请求,从而得到所述请求中的请求头;
指定数据获取子单元,用于从所述请求头中提取预先约定位置中的数据,并记为所述指定数据。
其中上述子单元分别用于执行的操作与前述实施方式的基于微服务框架的灰度发布方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述灰度用户划分单元30,包括:
相似度值计算子单元,用于根据预设的相似度算法,计算所述指定数据与预设字符串的相似度值;
暂时灰度用户划分子单元,用于将所述相似度值小于预设相似度阈值的用户终端划分为暂时非灰度用户,并将所述相似度值不小于预设相似度阈值的用户终端划分为暂时灰度用户;
关键词获取子单元,用于获取所述灰度策略中约定的第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户对应的第一关键词、第二关键词、…、第n关键词,其中所述指定服务共有n个版本;
灰度用户划分子单元,用于将所述指定数据中记载有第一关键词、第二关键词、…、第n关键词对应的暂时灰度用户分别划分为第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户。
其中上述子单元分别用于执行的操作与前述实施方式的基于微服务框架的灰度发布方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述灰度用户划分单元30,包括:
编码子单元,用于根据预设的编码方法,将所述用户终端的ip地址、请求头和请求参数编码为矩阵[B1,B2,B3],其中B1为所述ip地址对应的映射值、B2为所述请求头对应的映射值、B3为所述请求参数对应的映射值;
指定参数矩阵获取子单元,用于根据预设的灰度策略与参数矩阵的对应关系,获取与所述灰度策略提供终端提供的灰度策略对应的指定参数矩阵[C1,C2,C3];
参考指数M计算子单元,用于通过公式: M=||[B1,B2,B3] T[C1,C2,C3] ||,计算得到划分参考指数M;
数值范围判断子单元,用于通过判断所述参考指数M是否落入预设的多个数值范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本。
其中上述子单元分别用于执行的操作与前述实施方式的基于微服务框架的灰度发布方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述微服务具有版本属性,所述装置,包括:
版本标记要求接收单元,用于接收版本标记终端发送的版本标记要求,所述版本标记要求记载了需要标记的微服务以及标记的版本号;
版本属性修改单元,用于根据所述版本标记要求,修改所述微服务的版本属性,其中至少有一个微服务被标记为多个版本号;
微服务链组成单元,用于将版本属性被标记为第一版本的所有微服务组成第一版本微服务链、将版本属性被标记为第二版本的所有微服务组成第二版本微服务链、…、以及将版本属性被标记为第n版本的所有微服务组成第n版本微服务链。
其中上述单元分别用于执行的操作与前述实施方式的基于微服务框架的灰度发布方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述机器学习模型为CHAID决策树模型,所述装置,包括:
样本数据获取单元,用于获取指定量的样本数据,并将样本数据分成训练集和测试集;其中,所述样本数据包括预先采用的用户端数据,以及与所述用户端数据关联的灰度用户类别组成的样本数据;
训练单元,用于将训练集的样本数据输入到预设的CHAID决策树模型中进行训练,得到初步灰度再分类模型;
验证单元,用于利用所述测试集验证所述初步灰度再分类模型;
模型标记单元,用于若验证通过,则将所述初步灰度再分类模型记为灰度再分类模型。
其中上述单元分别用于执行的操作与前述实施方式的基于微服务框架的灰度发布方法的步骤一一对应,在此不再赘述。
在一个实施方式中,所述训练单元,包括:
建模标准参数设置子单元,用于设置所述CHAID决策树模型的建模标准参数,所述建模标准参数包括决策树的最大层数、母节点的可再分的显著水平、母节点包含的最小样本数和子节点包含的最小样本数;
训练子单元,用于将训练集的样本数据输入到采用卡方自动交互检测法建立的所述CHAID决策树模型中进行训练,得到初步CHAID决策树。
其中上述子单元分别用于执行的操作与前述实施方式的基于微服务框架的灰度发布方法的步骤一一对应,在此不再赘述。
本申请的基于微服务框架的灰度发布装置,接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据;获取灰度策略提供终端提供的灰度策略;通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An;将灰度用户分别分流至不同版本的微服务链;将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户;将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。从而实现多版本灰度发布,并提高灰度发布的精准度。
参照图3,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储基于微服务框架的灰度发布方法所用数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于微服务框架的灰度发布方法。
上述处理器执行上述基于微服务框架的灰度发布方法,其中所述方法包括的步骤分别与执行前述实施方式的基于微服务框架的灰度发布方法的步骤一一对应,在此不再赘述。
本领域技术人员可以理解,图中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定。
本申请的计算机设备,接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据;获取灰度策略提供终端提供的灰度策略;通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An;将灰度用户分别分流至不同版本的微服务链;将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户;将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。从而实现多版本灰度发布,并提高灰度发布的精准度。
本申请一实施例还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现基于微服务框架的灰度发布方法,其中所述方法包括的步骤分别与执行前述实施方式的基于微服务框架的灰度发布方法的步骤一一对应,在此不再赘述。其中所述计算机可读存储介质,例如为非易失性的计算机可读存储介质,或者为易失性的计算机可读存储介质。
本申请的计算机可读存储介质,接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据;获取灰度策略提供终端提供的灰度策略;通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An;将灰度用户分别分流至不同版本的微服务链;将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户;将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。从而实现多版本灰度发布,并提高灰度发布的精准度。
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种基于微服务框架的灰度发布方法,其特征在于,包括:
    接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据,所述指定数据包括用户终端的ip地址、请求头或者请求参数;
    获取灰度策略提供终端提供的灰度策略;
    通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本;
    将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量;
    将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链;
    将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。
  2. 根据权利要求1所述的基于微服务框架的灰度发布方法,其特征在于,所述请求采用指定通信协议封装而成,所述接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据的步骤,包括:
    接收多个用户终端发送的访问指定服务的请求,并从预存的多个通信协议格式中获取所述指定通信协议的格式;
    利用所述指定通信协议的格式解析所述请求,从而得到所述请求中的请求头;
    从所述请求头中提取预先约定位置中的数据,并记为所述指定数据。
  3. 根据权利要求1所述的基于微服务框架的灰度发布方法,其特征在于,所述通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本的步骤,包括:
    根据预设的相似度算法,计算所述指定数据与预设字符串的相似度值;
    将所述相似度值小于预设相似度阈值的用户终端划分为暂时非灰度用户,并将所述相似度值不小于预设相似度阈值的用户终端划分为暂时灰度用户;
    获取所述灰度策略中约定的第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户对应的第一关键词、第二关键词、…、第n关键词,其中所述指定服务共有n个版本;
    将所述指定数据中记载有第一关键词、第二关键词、…、第n关键词对应的暂时灰度用户分别划分为第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户。
  4. 根据权利要求1所述的基于微服务框架的灰度发布方法,其特征在于,所述通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本的步骤,包括:
    根据预设的编码方法,将所述用户终端的ip地址、请求头和请求参数编码为矩阵[B1,B2,B3],其中B1为所述ip地址对应的映射值、B2为所述请求头对应的映射值、B3为所述请求参数对应的映射值;
    根据预设的灰度策略与参数矩阵的对应关系,获取与所述灰度策略提供终端提供的灰度策略对应的指定参数矩阵[C1,C2,C3];
    通过公式: M=||[B1,B2,B3] T[C1,C2,C3] ||,计算得到划分参考指数M;
    通过判断所述参考指数M是否落入预设的多个数值范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本。
  5. 根据权利要求1所述的基于微服务框架的灰度发布方法,其特征在于,所述微服务具有版本属性,所述将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量的步骤之前,包括:
    接收版本标记终端发送的版本标记要求,所述版本标记要求记载了需要标记的微服务以及标记的版本号;
    根据所述版本标记要求,修改所述微服务的版本属性,其中至少有一个微服务被标记为多个版本号;
    将版本属性被标记为第一版本的所有微服务组成第一版本微服务链、将版本属性被标记为第二版本的所有微服务组成第二版本微服务链、…、以及将版本属性被标记为第n版本的所有微服务组成第n版本微服务链。
  6. 根据权利要求1所述的基于微服务框架的灰度发布方法,其特征在于,所述机器学习模型为CHAID决策树模型,所述将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链的步骤之前,包括:
    获取指定量的样本数据,并将样本数据分成训练集和测试集;其中,所述样本数据包括预先采用的用户端数据,以及与所述用户端数据关联的灰度用户类别组成的样本数据;
    将训练集的样本数据输入到预设的CHAID决策树模型中进行训练,得到初步灰度再分类模型;
    利用所述测试集验证所述初步灰度再分类模型;
    若验证通过,则将所述初步灰度再分类模型记为灰度再分类模型。
  7. 根据权利要求6所述的基于微服务框架的灰度发布方法,其特征在于,所述将训练集的样本数据输入到预设的CHAID决策树模型中进行训练,得到初步灰度再分类模型的步骤,包括:
    设置所述CHAID决策树模型的建模标准参数,所述建模标准参数包括决策树的最大层数、母节点的可再分的显著水平、母节点包含的最小样本数和子节点包含的最小样本数;
    将训练集的样本数据输入到采用卡方自动交互检测法建立的所述CHAID决策树模型中进行训练,得到初步CHAID决策树。
  8. 一种基于微服务框架的灰度发布装置,其特征在于,包括:
    指定数据获取单元,用于接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据,所述指定数据包括用户终端的ip地址、请求头或者请求参数;
    灰度策略获取单元,用于获取灰度策略提供终端提供的灰度策略;
    灰度用户划分单元,用于通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本;
    分流单元,用于将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量;
    再分类单元,用于将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链;
    再分流单元,用于将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。
  9. 根据权利要求8所述的基于微服务框架的灰度发布装置,其特征在于,所述请求采用指定通信协议封装而成,所述指定数据获取单元,包括:
    格式获取子单元,用于接收多个用户终端发送的访问指定服务的请求,并从预存的多个通信协议格式中获取所述指定通信协议的格式;
    请求头获取子单元,用于利用所述指定通信协议的格式解析所述请求,从而得到所述请求中的请求头;
    指定数据获取子单元,用于从所述请求头中提取预先约定位置中的数据,并记为所述指定数据。
  10. 根据权利要求8所述的基于微服务框架的灰度发布装置,其特征在于,所述灰度用户划分单元,包括:
    相似度值计算子单元,用于根据预设的相似度算法,计算所述指定数据与预设字符串的相似度值;
    暂时灰度用户划分子单元,用于将所述相似度值小于预设相似度阈值的用户终端划分为暂时非灰度用户,并将所述相似度值不小于预设相似度阈值的用户终端划分为暂时灰度用户;
    关键词获取子单元,用于获取所述灰度策略中约定的第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户对应的第一关键词、第二关键词、…、第n关键词,其中所述指定服务共有n个版本;
    灰度用户划分子单元,用于将所述指定数据中记载有第一关键词、第二关键词、…、第n关键词对应的暂时灰度用户分别划分为第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户。
  11. 根据权利要求8所述的基于微服务框架的灰度发布装置,其特征在于,所述灰度用户划分单元,包括:
    编码子单元,用于根据预设的编码方法,将所述用户终端的ip地址、请求头和请求参数编码为矩阵[B1,B2,B3],其中B1为所述ip地址对应的映射值、B2为所述请求头对应的映射值、B3为所述请求参数对应的映射值;
    指定参数矩阵获取子单元,用于根据预设的灰度策略与参数矩阵的对应关系,获取与所述灰度策略提供终端提供的灰度策略对应的指定参数矩阵[C1,C2,C3];
    参考指数M计算子单元,用于通过公式: M=||[B1,B2,B3] T[C1,C2,C3] ||,计算得到划分参考指数M;
    数值范围判断子单元,用于通过判断所述参考指数M是否落入预设的多个数值范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本。
  12. 根据权利要求8所述的基于微服务框架的灰度发布装置,其特征在于,所述微服务具有版本属性,所述装置,包括:
    版本标记要求接收单元,用于接收版本标记终端发送的版本标记要求,所述版本标记要求记载了需要标记的微服务以及标记的版本号;
    版本属性修改单元,用于根据所述版本标记要求,修改所述微服务的版本属性,其中至少有一个微服务被标记为多个版本号;
    微服务链组成单元,用于将版本属性被标记为第一版本的所有微服务组成第一版本微服务链、将版本属性被标记为第二版本的所有微服务组成第二版本微服务链、…、以及将版本属性被标记为第n版本的所有微服务组成第n版本微服务链。
  13. 根据权利要求8所述的基于微服务框架的灰度发布装置,其特征在于,所述机器学习模型为CHAID决策树模型,所述装置,包括:
    样本数据获取单元,用于获取指定量的样本数据,并将样本数据分成训练集和测试集;其中,所述样本数据包括预先采用的用户端数据,以及与所述用户端数据关联的灰度用户类别组成的样本数据;
    训练单元,用于将训练集的样本数据输入到预设的CHAID决策树模型中进行训练,得到初步灰度再分类模型;
    验证单元,用于利用所述测试集验证所述初步灰度再分类模型;
    模型标记单元,用于若验证通过,则将所述初步灰度再分类模型记为灰度再分类模型。
  14. 根据权利要求13所述的基于微服务框架的灰度发布装置,其特征在于,所述训练单元,包括:
    建模标准参数设置子单元,用于设置所述CHAID决策树模型的建模标准参数,所述建模标准参数包括决策树的最大层数、母节点的可再分的显著水平、母节点包含的最小样本数和子节点包含的最小样本数;
    训练子单元,用于将训练集的样本数据输入到采用卡方自动交互检测法建立的所述CHAID决策树模型中进行训练,得到初步CHAID决策树。
  15. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现基于微服务框架的灰度发布方法,所述基于微服务框架的灰度发布方法,包括:
    接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据,所述指定数据包括用户终端的ip地址、请求头或者请求参数;
    获取灰度策略提供终端提供的灰度策略;
    通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本;
    将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量;
    将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链;
    将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。
  16. 根据权利要求15所述的计算机设备,其特征在于,所述请求采用指定通信协议封装而成,所述接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据的步骤,包括:
    接收多个用户终端发送的访问指定服务的请求,并从预存的多个通信协议格式中获取所述指定通信协议的格式;
    利用所述指定通信协议的格式解析所述请求,从而得到所述请求中的请求头;
    从所述请求头中提取预先约定位置中的数据,并记为所述指定数据。
  17. 根据权利要求15所述的计算机设备,其特征在于,所述通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本的步骤,包括:
    根据预设的相似度算法,计算所述指定数据与预设字符串的相似度值;
    将所述相似度值小于预设相似度阈值的用户终端划分为暂时非灰度用户,并将所述相似度值不小于预设相似度阈值的用户终端划分为暂时灰度用户;
    获取所述灰度策略中约定的第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户对应的第一关键词、第二关键词、…、第n关键词,其中所述指定服务共有n个版本;
    将所述指定数据中记载有第一关键词、第二关键词、…、第n关键词对应的暂时灰度用户分别划分为第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户。
  18. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现基于微服务框架的灰度发布方法,所述基于微服务框架的灰度发布方法,包括:
    接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据,所述指定数据包括用户终端的ip地址、请求头或者请求参数;
    获取灰度策略提供终端提供的灰度策略;
    通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本;
    将所述第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户分别分流至第一版本微服务链、第二版本微服务链、…、第n版本微服务链,其中所述第一版本微服务链、第二版本微服务链、…、第n版本微服务链具有相同的微服务,并且所述相同的微服务的数量大于预设数量;
    将所述暂时非灰度用户输入已经训练完成的基于机器学习模型的灰度再分类模型中运算,从而获得从所述暂时非灰度用户中分类出的灰度用户和最终非灰度用户,以及所述分类出的灰度用户对应的微服务链;
    将所述分类出的灰度用户分流至所述分类出的灰度用户对应的微服务链,以及将所述最终非灰度用户分流至当前版本的微服务链。
  19. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述请求采用指定通信协议封装而成,所述接收多个用户终端发送的访问指定服务的请求,并解析所述请求从而得到指定数据的步骤,包括:
    接收多个用户终端发送的访问指定服务的请求,并从预存的多个通信协议格式中获取所述指定通信协议的格式;
    利用所述指定通信协议的格式解析所述请求,从而得到所述请求中的请求头;
    从所述请求头中提取预先约定位置中的数据,并记为所述指定数据。
  20. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述通过判断所述指定数据是否落入所述灰度策略的多个预设范围之内,从而将所述多个用户终端划分为A0、A1、A2…、An,其中A0、A1、A2…、An分别指暂时非灰度用户、第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户,其中所述指定服务共有n个版本的步骤,包括:
    根据预设的相似度算法,计算所述指定数据与预设字符串的相似度值;
    将所述相似度值小于预设相似度阈值的用户终端划分为暂时非灰度用户,并将所述相似度值不小于预设相似度阈值的用户终端划分为暂时灰度用户;
    获取所述灰度策略中约定的第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户对应的第一关键词、第二关键词、…、第n关键词,其中所述指定服务共有n个版本;
    将所述指定数据中记载有第一关键词、第二关键词、…、第n关键词对应的暂时灰度用户分别划分为第一版本灰度用户、第二版本灰度用户、…、第n版本灰度用户。
PCT/CN2019/118806 2019-09-18 2019-11-15 基于微服务框架的灰度发布方法、装置和计算机设备 WO2021051623A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910882710.4 2019-09-18
CN201910882710.4A CN110798502B (zh) 2019-09-18 2019-09-18 基于微服务框架的灰度发布方法、装置和计算机设备

Publications (1)

Publication Number Publication Date
WO2021051623A1 true WO2021051623A1 (zh) 2021-03-25

Family

ID=69427285

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118806 WO2021051623A1 (zh) 2019-09-18 2019-11-15 基于微服务框架的灰度发布方法、装置和计算机设备

Country Status (2)

Country Link
CN (1) CN110798502B (zh)
WO (1) WO2021051623A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596157A (zh) * 2021-07-30 2021-11-02 绿漫科技有限公司 一种基于SpringCloud的联盟链无感发布方法
CN117591132A (zh) * 2024-01-12 2024-02-23 杭州谐云科技有限公司 一种服务的发布方法和发布系统
CN118101773A (zh) * 2024-04-29 2024-05-28 华能信息技术有限公司 一种基于api网关的多服务共享方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111464520B (zh) * 2020-03-26 2022-12-09 银联商务股份有限公司 一种数据处理方法、装置、存储介质及电子设备
CN111581036B (zh) * 2020-03-31 2022-04-15 西安电子科技大学 一种物联网故障检测方法、检测系统、存储介质
CN111475226B (zh) * 2020-03-31 2022-04-29 招商局金融科技有限公司 电子装置、微服务调用方法和计算机可读存储介质
CN112087325B (zh) * 2020-08-21 2021-07-20 烽火通信科技股份有限公司 灰度发布方法、装置、设备及可读存储介质
CN114168179B (zh) * 2020-09-11 2024-07-09 腾讯科技(深圳)有限公司 微服务管理方法、装置、计算机设备和存储介质
CN112822272B (zh) * 2021-01-08 2023-10-13 上海理想信息产业(集团)有限公司 微服务灰度发布方法及装置、计算机设备及存储介质
CN113986396B (zh) * 2021-11-10 2023-06-06 重庆紫光华山智安科技有限公司 一种基于分布式服务的集中配置方法、系统、设备及介质
CN115733750A (zh) * 2022-11-25 2023-03-03 中国工商银行股份有限公司 微服务网关中元数据更新方法、装置、设备和存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106257894A (zh) * 2016-08-29 2016-12-28 北京海誉动想科技股份有限公司 基于微服务的灰度发布方法
US20180146067A1 (en) * 2016-11-18 2018-05-24 Sap Se Embedded database as a microservice for distributed container cloud platform
CN109787830A (zh) * 2019-01-21 2019-05-21 北京京东尚科信息技术有限公司 灰度发布控制方法、装置、系统、电子设备及存储介质
CN109992273A (zh) * 2019-01-03 2019-07-09 蔚来汽车有限公司 一种灰度发布方法以及灰度发布系统
CN109995713A (zh) * 2017-12-30 2019-07-09 华为技术有限公司 一种微服务框架中的服务处理方法及相关设备
CN110071960A (zh) * 2019-03-12 2019-07-30 平安科技(深圳)有限公司 管理灰度发布的方法、系统、设备及存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10354201B1 (en) * 2016-01-07 2019-07-16 Amazon Technologies, Inc. Scalable clustering for mixed machine learning data
CN108848092B (zh) * 2018-06-20 2021-02-26 中国联合网络通信集团有限公司 基于调用链的微服务灰度发布的处理方法及装置
CN108847989B (zh) * 2018-06-29 2021-07-06 杭州安恒信息技术股份有限公司 基于微服务架构的日志处理方法、业务服务系统以及电子设备
CN109542624B (zh) * 2018-11-23 2021-09-28 中国农业银行股份有限公司 一种应用变更的资源调配方法及装置
CN109597643A (zh) * 2018-11-27 2019-04-09 平安科技(深圳)有限公司 应用灰度发布方法、装置、电子设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106257894A (zh) * 2016-08-29 2016-12-28 北京海誉动想科技股份有限公司 基于微服务的灰度发布方法
US20180146067A1 (en) * 2016-11-18 2018-05-24 Sap Se Embedded database as a microservice for distributed container cloud platform
CN109995713A (zh) * 2017-12-30 2019-07-09 华为技术有限公司 一种微服务框架中的服务处理方法及相关设备
CN109992273A (zh) * 2019-01-03 2019-07-09 蔚来汽车有限公司 一种灰度发布方法以及灰度发布系统
CN109787830A (zh) * 2019-01-21 2019-05-21 北京京东尚科信息技术有限公司 灰度发布控制方法、装置、系统、电子设备及存储介质
CN110071960A (zh) * 2019-03-12 2019-07-30 平安科技(深圳)有限公司 管理灰度发布的方法、系统、设备及存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596157A (zh) * 2021-07-30 2021-11-02 绿漫科技有限公司 一种基于SpringCloud的联盟链无感发布方法
CN117591132A (zh) * 2024-01-12 2024-02-23 杭州谐云科技有限公司 一种服务的发布方法和发布系统
CN117591132B (zh) * 2024-01-12 2024-04-26 杭州谐云科技有限公司 一种服务的发布方法和发布系统
CN118101773A (zh) * 2024-04-29 2024-05-28 华能信息技术有限公司 一种基于api网关的多服务共享方法

Also Published As

Publication number Publication date
CN110798502B (zh) 2022-06-17
CN110798502A (zh) 2020-02-14

Similar Documents

Publication Publication Date Title
WO2021051623A1 (zh) 基于微服务框架的灰度发布方法、装置和计算机设备
CN111695697A (zh) 多方联合决策树构建方法、设备及可读存储介质
WO2020082579A1 (zh) 一种风险审批方法、装置、存储介质和服务器
CN104317839B (zh) 生成报表模板的方法和装置
CN111191767B (zh) 一种基于向量化的恶意流量攻击类型的判断方法
CN110781930A (zh) 一种基于网络安全设备日志数据的用户画像分组及行为分析方法和系统
CN103886376A (zh) 用于基于规则的内容过滤的系统和方法
CN113194126B (zh) 一种基于区块链的横向联邦学习模型构建方法
CN107087160A (zh) 一种基于BP‑Adaboost神经网络的用户体验质量的预测方法
CN107360032A (zh) 一种网络流识别方法及电子设备
CN106454437A (zh) 一种流媒体业务速率预测方法及装置
WO2022095385A1 (zh) 文档知识抽取方法、装置、计算机设备及可读存储介质
CN113656547B (zh) 文本匹配方法、装置、设备及存储介质
CN114095447B (zh) 一种基于知识蒸馏与自蒸馏的通信网络加密流量分类方法
CN106530198B (zh) 基于参数拟合安全容量的自适应批量隐写方法
CN116028702A (zh) 学习资源推荐方法、系统及电子设备
CN108521435B (zh) 一种用户网络行为画像的方法及系统
CN110427971A (zh) 用户及ip的识别方法、装置、服务器和存储介质
CN111385273A (zh) 一种物联网业务流程识别方法、装置、电子设备及介质
CN112347102B (zh) 多表拼接方法和多表拼接装置
CN111143688B (zh) 一种基于移动新闻客户端的评估方法及其系统
CN104378329A (zh) 安全验证的方法、装置及系统
CN112235397A (zh) 应用于互联网通信的大数据传输处理方法及云计算中心
CN109766727A (zh) 智能区块网络构建方法及系统
CN117829987B (zh) 不动产信息管理方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19946003

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19946003

Country of ref document: EP

Kind code of ref document: A1