技术领域technical field
本发明涉及软件开发测试SSR灰度发布技术领域,具体涉及一种基于nginx、memcache、lua实现SSR灰度发布的方法。The invention relates to the technical field of software development and testing SSR gray scale release, in particular to a method for realizing SSR gray scale release based on nginx, memcache and lua.
背景技术Background technique
灰度发布是指在黑与白之间,能够平滑过渡的一种发布方式。AB test就是一种灰度发布方式,让一部分用户继续用A,一部分用户开始用B,如果用户对B没有什么反对意见,那么逐步扩大范围,把所有用户都迁移到B上面来。灰度发布可以保证整体系统的稳定,在初始灰度的时候就可以发现、调整问题,以保证其影响度。Grayscale publishing refers to a publishing method that can smoothly transition between black and white. AB test is a grayscale release method that allows some users to continue using A and some users to start using B. If users have no objection to B, then gradually expand the scope and migrate all users to B. Grayscale publishing can ensure the stability of the overall system, and problems can be found and adjusted at the initial grayscale to ensure their impact.
按照wikipedia中对A/B测试的定义,A/B测试又叫:A/B/N Testing、MultivariateTesting,因此本质上灰度测试可以算作A/B测试的一种特例。According to the definition of A/B testing in wikipedia, A/B testing is also called: A/B/N Testing, MultivariateTesting, so in essence grayscale testing can be regarded as a special case of A/B testing.
浪潮操作系统安全增强系统(简称:SSR),是浪潮具有自主知识产权的"操作系统安全增强系统",通过对文件、目录、进程、注册表和服务的强制访问控制,有效的制约和分散了原有系统管理员的权限。Inspur Operating System Security Enhancement System (abbreviation: SSR) is an "operating system security enhancement system" with independent intellectual property rights of Inspur. Through mandatory access control to files, directories, processes, registry and services, it effectively restricts and disperses The authority of the original system administrator.
在开发中灰度发布是一种AB测试的重要技术和手段,目前SSR系统缺少这种能力,如果想要公测SSR2.0,只能重新部署SSR2.0的一套产品,并强制用户使用SSR2.0,或者关闭SSR1.0系统使迫使用户使用SSR2.0系统,这都是一种粗暴的方法并且造成极差的用户体验。在现代软件开发中是不可接受的。Gray release is an important technology and method for AB testing in development. Currently, the SSR system lacks this capability. If you want to test SSR2.0 publicly, you can only redeploy a set of SSR2.0 products and force users to use SSR2. .0, or closing the SSR1.0 system to force users to use the SSR2.0 system, this is a crude method and results in a very poor user experience. Unacceptable in modern software development.
发明内容Contents of the invention
本发明要解决的技术问题是:本发明针对以上问题,提供一种实现SSR灰度发布的方法,在黑白之间,能够平滑过渡的一种发布方式,类似于AB测试,让一部分用户继续使用SSR1.0系统,一部分用户开始使用SSR2.0系统,如果用户对SSR2.0系统没有反对意见,那么扩大范围,把所有用户迁移到SSR2.0系统上来,灰度发布可以保证整个系统的稳定性,在初始灰度的时候就可以发现调整问题。。The technical problem to be solved by the present invention is: aiming at the above problems, the present invention provides a method for realizing SSR gray release, a release method that can smoothly transition between black and white, similar to AB test, allowing some users to continue to use In the SSR1.0 system, some users started to use the SSR2.0 system. If the users have no objection to the SSR2.0 system, then expand the scope and migrate all users to the SSR2.0 system. Gray release can ensure the stability of the entire system , the adjustment problem can be found at the initial grayscale. .
本发明所采用的技术方案为:The technical scheme adopted in the present invention is:
一种实现SSR灰度发布的方法,所述方法基于nginx、memcache、lua,依赖nginx的高并发处理能力和memcache的hash缓存,使用lua脚本进行分流控制,根据用户的IP来进行分流,将不同用户分流到不同的系统上面实现灰度发布,让一部分用户继续使用SSR1.0系统,一部分用户开始使用SSR2.0系统,如果用户对SSR2.0系统没有反对意见,那么扩大范围,把所有用户迁移到SSR2.0系统上来,保证了系统的高响应能力和部署的简单可靠。A method for realizing SSR grayscale publishing, said method is based on nginx, memcache, and lua, relies on the high concurrent processing capability of nginx and the hash cache of memcache, uses lua scripts to perform distribution control, and performs distribution according to the user's IP to separate different Users are distributed to different systems to achieve grayscale release, so that some users continue to use the SSR1.0 system, and some users start to use the SSR2.0 system. If users have no objection to the SSR2.0 system, then expand the scope and migrate all users The introduction of the SSR2.0 system ensures the high responsiveness of the system and the simple and reliable deployment.
所述方法实现步骤如下:The implementation steps of the method are as follows:
1)制定灰度名单,包含能够访问SSR2.0系统的用户IP地址,具体格式如下:100.2.3.3;100.2.3.4;100.2.2.5(IP地址有具体的生产环境决定);1) Make a grayscale list, including the IP addresses of users who can access the SSR2.0 system. The specific format is as follows: 100.2.3.3; 100.2.3.4; 100.2.2.5 (the IP address is determined by the specific production environment);
2)安装搭建memcache,将第一步中的灰度名单刷新到memcache缓存;2) Install and build memcache, and refresh the grayscale list in the first step to the memcache cache;
3)安装搭建nginx服务器,定制lua脚本,lua接收分析用户请求,获取用户IP,查询memcache,如果该IP在灰度名单里,则将该用户路由到SSR2.0系统,如果该IP不在灰度名单之内,则将该用户路由到SSR1.0系统。3) Install and build nginx server, customize lua script, lua receives and analyzes user requests, obtains user IP, queries memcache, if the IP is in the grayscale list, route the user to the SSR2.0 system, if the IP is not in grayscale If it is in the list, the user will be routed to the SSR1.0 system.
所述memcache的客户端为memcache的API。The memcache client is the memcache API.
本发明的有益效果为:The beneficial effects of the present invention are:
本发明方法实现原理简单,依赖memcache和nginx,可以提高系统的高并发处理能,使用lua进行分流控制,可以跟nginx完美的结合发挥lua和nginx的优点;解决了SSR产品AB测试的短板,和灰度发布技术的空白;可以根据用户IP定制灰度名单,可以有效的控制灰度发布。The realization principle of the method of the present invention is simple, relies on memcache and nginx, can improve the high concurrent processing performance of the system, uses lua to carry out shunt control, and can perfectly combine with nginx to play the advantages of lua and nginx; solves the short board of SSR product AB test, There is a gap in the grayscale release technology; the grayscale list can be customized according to the user's IP, which can effectively control the grayscale release.
附图说明Description of drawings
图1为本发明方法流程图。Fig. 1 is a flow chart of the method of the present invention.
具体实施方式detailed description
下面结合说明书附图,根据具体实施方式对本发明进一步说明:Below in conjunction with accompanying drawing of description, the present invention is further described according to specific embodiment:
实施例1:Example 1:
一种实现SSR灰度发布的方法,所述方法基于nginx、memcache、lua,依赖nginx的高并发处理能力和memcache的hash缓存,使用lua脚本进行分流控制,根据用户的IP来进行分流,将不同用户分流到不同的系统上面实现灰度发布,让一部分用户继续使用SSR1.0系统,一部分用户开始使用SSR2.0系统,如果用户对SSR2.0系统没有反对意见,那么扩大范围,把所有用户迁移到SSR2.0系统上来,保证了系统的高响应能力和部署的简单可靠。A method for realizing SSR grayscale publishing, said method is based on nginx, memcache, and lua, relies on the high concurrent processing capability of nginx and the hash cache of memcache, uses lua scripts to perform distribution control, and performs distribution according to the user's IP to separate different Users are distributed to different systems to achieve grayscale release, so that some users continue to use the SSR1.0 system, and some users start to use the SSR2.0 system. If users have no objection to the SSR2.0 system, then expand the scope and migrate all users The introduction of the SSR2.0 system ensures the high responsiveness of the system and the simple and reliable deployment.
实施例2Example 2
如图1所示,在实施例1的基础上,本实施例所述方法实现步骤如下:As shown in Figure 1, on the basis of Embodiment 1, the implementation steps of the method described in this embodiment are as follows:
1)制定灰度名单,包含能够访问SSR2.0系统的用户IP地址,具体格式如下:100.2.3.3;100.2.3.4;100.2.2.5(IP地址有具体的生产环境决定);1) Make a grayscale list, including the IP addresses of users who can access the SSR2.0 system. The specific format is as follows: 100.2.3.3; 100.2.3.4; 100.2.2.5 (the IP address is determined by the specific production environment);
2)安装搭建memcache,将第一步中的灰度名单刷新到memcache缓存;2) Install and build memcache, and refresh the grayscale list in the first step to the memcache cache;
3)安装搭建nginx服务器,定制lua脚本,lua接收分析用户请求,获取用户IP,查询memcache,如果该IP在灰度名单里,则将该用户路由到SSR2.0系统,如果该IP不在灰度名单之内,则将该用户路由到SSR1.0系统。3) Install and build nginx server, customize lua script, lua receives and analyzes user requests, obtains user IP, queries memcache, if the IP is in the grayscale list, route the user to the SSR2.0 system, if the IP is not in grayscale If it is in the list, the user will be routed to the SSR1.0 system.
实施例3Example 3
在实施例2的基础上,本实施例所述memcache的客户端为memcache的API。On the basis of Embodiment 2, the client of memcache described in this embodiment is the API of memcache.
实施方式仅用于说明本发明,而并非对本发明的限制,有关技术领域的普通技术人员,在不脱离本发明的精神和范围的情况下,还可以做出各种变化和变型,因此所有等同的技术方案也属于本发明的范畴,本发明的专利保护范围应由权利要求限定。The embodiments are only used to illustrate the present invention, rather than to limit the present invention. Those of ordinary skill in the relevant technical field can also make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, all equivalent The technical solution also belongs to the category of the present invention, and the scope of patent protection of the present invention should be defined by the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610446655.0ACN106100927A (en) | 2016-06-20 | 2016-06-20 | Method for realizing SSR gray scale release |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610446655.0ACN106100927A (en) | 2016-06-20 | 2016-06-20 | Method for realizing SSR gray scale release |
| Publication Number | Publication Date |
|---|---|
| CN106100927Atrue CN106100927A (en) | 2016-11-09 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610446655.0APendingCN106100927A (en) | 2016-06-20 | 2016-06-20 | Method for realizing SSR gray scale release |
| Country | Link |
|---|---|
| CN (1) | CN106100927A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106775859A (en)* | 2016-12-08 | 2017-05-31 | 上海亿账通互联网科技有限公司 | Gray scale dissemination method and system |
| CN106998369A (en)* | 2017-05-26 | 2017-08-01 | 努比亚技术有限公司 | Gray scale dissemination method, gateway blocker and computer-readable recording medium |
| CN107451020A (en)* | 2017-06-28 | 2017-12-08 | 北京五八信息技术有限公司 | A kind of AB test systems and method of testing |
| CN108763065A (en)* | 2018-05-11 | 2018-11-06 | 国网电子商务有限公司 | A kind of mobile application gray scale delivery system and method |
| CN108768875A (en)* | 2018-05-31 | 2018-11-06 | 康键信息技术(深圳)有限公司 | Gray scale dissemination method, device and the computer readable storage medium of application |
| CN109388627A (en)* | 2017-08-08 | 2019-02-26 | 阿里巴巴集团控股有限公司 | A kind of control method of database access, device and electronic equipment |
| CN110704777A (en)* | 2019-09-20 | 2020-01-17 | 阿里巴巴集团控股有限公司 | Method and system for implementing gray scale publishing |
| CN111488159A (en)* | 2019-12-20 | 2020-08-04 | 杭州当虹科技股份有限公司 | Gray scale publishing method capable of being dynamically configured |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103176790A (en)* | 2011-12-26 | 2013-06-26 | 阿里巴巴集团控股有限公司 | Application releasing method and application releasing system |
| CN104317914A (en)* | 2014-10-28 | 2015-01-28 | 小米科技有限责任公司 | Data acquiring method and device |
| CN104378304A (en)* | 2013-08-14 | 2015-02-25 | 腾讯科技(深圳)有限公司 | Gray scale issuing control method, device and system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103176790A (en)* | 2011-12-26 | 2013-06-26 | 阿里巴巴集团控股有限公司 | Application releasing method and application releasing system |
| CN104378304A (en)* | 2013-08-14 | 2015-02-25 | 腾讯科技(深圳)有限公司 | Gray scale issuing control method, device and system |
| CN104317914A (en)* | 2014-10-28 | 2015-01-28 | 小米科技有限责任公司 | Data acquiring method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106775859A (en)* | 2016-12-08 | 2017-05-31 | 上海亿账通互联网科技有限公司 | Gray scale dissemination method and system |
| CN106775859B (en)* | 2016-12-08 | 2018-02-02 | 上海壹账通金融科技有限公司 | Gray scale dissemination method and system |
| CN106998369A (en)* | 2017-05-26 | 2017-08-01 | 努比亚技术有限公司 | Gray scale dissemination method, gateway blocker and computer-readable recording medium |
| CN107451020A (en)* | 2017-06-28 | 2017-12-08 | 北京五八信息技术有限公司 | A kind of AB test systems and method of testing |
| CN107451020B (en)* | 2017-06-28 | 2020-12-15 | 北京五八信息技术有限公司 | AB test system and test method |
| CN109388627A (en)* | 2017-08-08 | 2019-02-26 | 阿里巴巴集团控股有限公司 | A kind of control method of database access, device and electronic equipment |
| CN108763065A (en)* | 2018-05-11 | 2018-11-06 | 国网电子商务有限公司 | A kind of mobile application gray scale delivery system and method |
| CN108768875A (en)* | 2018-05-31 | 2018-11-06 | 康键信息技术(深圳)有限公司 | Gray scale dissemination method, device and the computer readable storage medium of application |
| CN108768875B (en)* | 2018-05-31 | 2023-04-07 | 康键信息技术(深圳)有限公司 | Application gray level publishing method and device and computer readable storage medium |
| CN110704777A (en)* | 2019-09-20 | 2020-01-17 | 阿里巴巴集团控股有限公司 | Method and system for implementing gray scale publishing |
| CN111488159A (en)* | 2019-12-20 | 2020-08-04 | 杭州当虹科技股份有限公司 | Gray scale publishing method capable of being dynamically configured |
| Publication | Publication Date | Title |
|---|---|---|
| CN106100927A (en) | Method for realizing SSR gray scale release | |
| US20240283674A1 (en) | Device identification | |
| US12413621B2 (en) | Visual detection of phishing websites via headless browser | |
| US20230021885A1 (en) | Phishing Mitigation Service | |
| JP6791134B2 (en) | Analytical systems, analytical methods, analyzers and computer programs | |
| WO2016105927A1 (en) | Trusted binary translation | |
| CN105045605B (en) | A kind of method and system by DLL injection target process | |
| Juyal et al. | Rise of academic plagiarism in India: reasons, solutions and resolution | |
| US11399033B2 (en) | Malicious advertisement protection | |
| WO2018070781A3 (en) | Method for issuing, redeeming, refunding, settling and revoking electronic voucher by using utxo-based protocol, and server employing same | |
| EP3314860A1 (en) | Enterprise reputations for uniform resource locators | |
| US10681063B1 (en) | Securing a network device from a malicious embedded script hosted on a third-party domain | |
| US10838780B2 (en) | Portable hosted content | |
| US9600682B2 (en) | Mapping process changes | |
| BR112022009608A2 (en) | VIDEO GENERATION METHOD AND DEVICE, ELECTRONIC DEVICE AND COMPUTER READable MEDIA | |
| RU2667052C2 (en) | Detection of harmful software with cross-review | |
| EP3201794A1 (en) | Visually differentiating strings for testing | |
| US10664648B2 (en) | Webpage rendering using a remotely generated layout node tree | |
| WO2020263917A1 (en) | Cloud-based shared security cache | |
| CN104158856B (en) | Local API calling method dispense with preset of secure session | |
| US20210200589A1 (en) | Resource Management for Web Browser Based Applications | |
| TW201025351A (en) | Data processing and addressing methods for use in an electronic apparatus and electronic apparatus | |
| US11403397B2 (en) | Cache system for consistent retrieval of related objects | |
| MX2016011543A (en) | Operating system/hypervisor efficiencies for sub-divided privilege levels. | |
| Fah | The development of TVET system in Malaysia and its challenges ahead |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | Application publication date:20161109 | |
| RJ01 | Rejection of invention patent application after publication |